fluxflow-cli 4.20.2 → 4.21.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-7WG52QSH.js → ai-WJELS6YF.js} +1 -1
- package/dist/chunks/{app-NKMIWEAZ.js → app-MTU6DOUS.js} +1 -1
- package/dist/chunks/{chunk-QBGHCHJ2.js → chunk-N5OMQI4N.js} +104 -104
- package/dist/chunks/{invoke-DLOC5IJ6.js → invoke-HB2Q2HKB.js} +2 -2
- package/dist/chunks/{invokeSync-JOA2RK6Y.js → invokeSync-BW4MHOXO.js} +2 -2
- package/dist/cli.js +19 -15
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -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-WJELS6YF.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-WJELS6YF.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-WJELS6YF.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-WJELS6YF.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,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as v}from"./chunks/chunk-RI37VZYB.js";import{spawn as pe}from"child_process";import{fileURLToPath as ee}from"url";import me from"os";import O from"path";import
|
|
3
|
-
[ERROR] Allocation value '${
|
|
4
|
-
`),process.exit(1));var I=Math.floor(te*.75),we=!isNaN(
|
|
5
|
-
[MEMORY] Starting with: '${
|
|
2
|
+
import{a as v}from"./chunks/chunk-RI37VZYB.js";import{spawn as pe}from"child_process";import{fileURLToPath as ee}from"url";import me from"os";import O from"path";import $ from"fs";import F from"dotenv";try{let e=O.join(v,"AGENTS.md"),u=O.join(v,"FLUXFLOW.md");$.existsSync(v)||$.mkdirSync(v,{recursive:!0}),$.existsSync(e)||$.writeFileSync(e,"","utf8"),$.existsSync(u)||$.writeFileSync(u,"","utf8")}catch{}F.config({path:"./.env",override:!0,quiet:!0});F.config({path:`${v}/.env`,override:!0,quiet:!0});F.config({path:`${v}/.env.agents`,override:!0,quiet:!0});F.config({path:`${v}/.env.fluxflow`,override:!0,quiet:!0});F.config({path:"./.env.agents",override:!0,quiet:!0});F.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var de=me.totalmem(),te=de/(1024*1024),ue=.5,ge=Math.floor(te*ue),oe=process.argv.slice(2),Z=oe.indexOf("--allocation"),d=Z!==-1?parseInt(oe[Z+1],10):NaN,fe=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,xe=!isNaN(d)||fe||!1;!isNaN(d)&&d<64&&(console.error(`
|
|
3
|
+
[ERROR] Allocation value '${d} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
|
+
`),process.exit(1));var I=Math.floor(te*.75),we=!isNaN(d)&&d>0?Math.min(d,I):Math.max(1536,Math.min(32768,ge)),he=ee(import.meta.url).endsWith(".js");if(he&&!process.execArgv.some(e=>e.includes("max-old-space-size"))&&xe)Number.isNaN(d)||(console.log(`
|
|
5
|
+
[MEMORY] Starting with: '${d>I?I:d} MB' Allocation${d>I?" (Max allowed: '"+I+" MB')":""}. Please Wait...`),await new Promise(u=>setTimeout(u,5e3))),pe(process.execPath,[`--max-old-space-size=${we}`,"--expose-gc","--max-semi-space-size=1",ee(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",u=>process.exit(u||0));else{let e=process.argv.slice(2),u=e.includes("--help")&&e[e.indexOf("--help")+1]==="commands",X=e.includes("--help")&&!u,V=e.includes("--version")||e.includes("-v"),z=e[0]==="--update",J=e[0]==="--export";if(e[0]==="--usage"||e.includes("--usage")||e[0]==="--budget"||e.includes("--budget")){let{openUsageDashboard:t}=await import("./chunks/usageServer-5WB6ZWFG.js"),{url:p}=await t();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
|
-
\u2800\u2800\u2514\u2500 Serving at: ${
|
|
7
|
+
\u2800\u2800\u2514\u2500 Serving at: ${p}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
9
|
-
`),await new Promise(()=>{})}if(V||X||
|
|
10
|
-
Usage: fluxflow --export error`),process.exit(1)}if(V&&(console.log(`v${
|
|
9
|
+
`),await new Promise(()=>{})}if(V||X||u||z||J){let t=await import("fs"),p=await import("path"),{fileURLToPath:r}=await import("url"),w=p.join(p.dirname(r(import.meta.url)),"../package.json"),g=JSON.parse(t.readFileSync(w,"utf8")).version;if(J){let S=(e[1]||"").toLowerCase();if(S==="error"||S==="logs")try{let{exportErrorLogs:f}=await import("./chunks/export-YTWRQ63I.js"),a=await f();console.log(`[EXPORT LOGS] Exported ${a.entryCount} error log entries (FluxFlow: ${a.fluxflowCount}, Memory: ${a.memoryCount}, Usage: ${a.usageCount}) to "${a.exportFile}"`),process.exit(0)}catch(f){console.error(`[EXPORT ERROR] Failed to export error logs: ${f.message}`),process.exit(1)}else console.error(`[EXPORT ERROR] Invalid export target "${e[1]||""}". --export only supports 'error'.
|
|
10
|
+
Usage: fluxflow --export error`),process.exit(1)}if(V&&(console.log(`v${g}`),process.exit(0)),X&&(console.log(`FluxFlow CLI Arguments:
|
|
11
11
|
--mode <flux|flow|icu|omni> Set startup mode (Agent / Chat / Computer Use / Sentient being)
|
|
12
12
|
--model <model_name> Set startup AI model
|
|
13
13
|
--key <key@provider> Set API key and provider
|
|
@@ -32,7 +32,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(V&&(console.log(`v${u}`),pro
|
|
|
32
32
|
--export error Export system error logs to fluxflow-error-<timestamp>.txt
|
|
33
33
|
--update check Check for new updates
|
|
34
34
|
--update check latest Show the latest version available on npm
|
|
35
|
-
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),
|
|
35
|
+
--update [latest] Update the app to the latest version (latest is default)`),process.exit(0)),u&&(console.log(`FluxFlow Chat /Commands:
|
|
36
36
|
/quit Exit and shutdown Flux
|
|
37
37
|
/help Show help menu
|
|
38
38
|
/clear Clear terminal screen
|
|
@@ -64,16 +64,20 @@ Usage: fluxflow --export error`),process.exit(1)}if(V&&(console.log(`v${u}`),pro
|
|
|
64
64
|
/docs View documentation
|
|
65
65
|
/fluxflow init Create FluxFlow.md template
|
|
66
66
|
/update check Check for new version
|
|
67
|
-
/update latest Install latest release`),process.exit(0)),z){let S=e[1]||"latest";if(S==="check"){let
|
|
67
|
+
/update latest Install latest release`),process.exit(0)),z){let S=e[1]||"latest";if(S==="check"){let f=e[2]==="latest";try{let m=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;m||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(f?`Latest version: v${m}`:m!==g?`A new version of FluxFlow is available: v${m} (current: v${g}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${g}).`)}catch(a){console.error("Error checking for updates:",a.message),process.exit(1)}process.exit(0)}else if(S==="latest"){console.log("Checking latest version and settings...");try{let i=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;i||(console.error("Error: Could not retrieve latest version."),process.exit(1)),i===g&&(console.log(`FluxFlow is already up to date (v${g}).`),process.exit(0));let m=async()=>{let s=(await import("react")).default,{useState:A}=s,{render:_,Box:h,Text:E}=await import("ink"),B=(await import("ink-select-input")).default,D=(await import("ink-text-input")).default;return new Promise(j=>{let G=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],Y=({label:l,isSelected:c})=>s.createElement(h,{width:"100%"},s.createElement(E,{bold:c},"\u2514\u2500 ",c?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",l)),T,M=()=>{let[l,c]=A("select"),[q,H]=A(""),R=N=>{N.value==="custom"?c("custom"):k({manager:N.value})},W=N=>{k({manager:"custom",customCommand:N})};return l==="custom"?s.createElement(h,{flexDirection:"column",marginY:1},s.createElement(h,{marginBottom:1},s.createElement(E,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),s.createElement(h,{flexDirection:"row"},s.createElement(E,{color:"cyan",bold:!0}," \u276F "),s.createElement(D,{value:q,onChange:H,onSubmit:W})),s.createElement(h,{marginTop:1},s.createElement(E,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):s.createElement(h,{flexDirection:"column",marginY:1},s.createElement(h,{marginBottom:1},s.createElement(E,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),s.createElement(B,{items:G,onSelect:R,itemComponent:Y,indicatorComponent:()=>null}))},k=l=>{T&&T(),j(l)},{unmount:o}=_(s.createElement(M,null));T=o})},n,P="",b;try{let{loadSettings:s}=await import("./chunks/settings-JGWWOFEC.js");b=await s(),n=b?.systemSettings?.updateManager||b?.updateManager}catch{}if(!n){let s=await m();n=s.manager,P=s.customCommand}let x="";n==="pnpm"?x=`pnpm add -g fluxflow-cli@${i}`:n==="bun"?x=`bun add -g fluxflow-cli@${i}`:n==="yarn"?x=`yarn global add fluxflow-cli@${i}`:n==="custom"?x=P||b?.customUpdateCommand||`npm install -g fluxflow-cli@${i}`:x=`npm install -g fluxflow-cli@${i}`,console.log(`Updating FluxFlow to v${i} using ${n}...`),console.log(`Running: ${x}`);let{execSync:C}=await import("child_process");C(x,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${i}.\x1B[0m`)}catch(f){console.error("\x1B[31m\u274C Update failed:\x1B[0m",f.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:se}=await import("react"),{render:re}=await import("ink"),{default:ne}=await import("./chunks/app-MTU6DOUS.js");process.env.NODE_NO_WARNINGS="1";let ae=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],ie=console.log,le=console.warn,ce=console.error,L=t=>{let p=t.map(String).join(" ");return ae.some(r=>p.includes(r))};console.log=(...t)=>!L(t)&&ie(...t),console.warn=(...t)=>!L(t)&&le(...t),console.error=(...t)=>!L(t)&&ce(...t);let U=e.findIndex(t=>t==="--cwd"||t==="--path");if(U!==-1&&U+1<e.length){let t=e[U+1],p=await import("path"),r=await import("fs-extra"),w=p.default.resolve(t);try{r.default.existsSync(w)&&r.default.statSync(w).isDirectory()?process.chdir(w):(console.error(`[ERROR] Directory not found: "${t}"`),process.exit(0))}catch(y){console.error(`[ERROR] Failed to change directory to "${t}": ${y.message}`),process.exit(0)}}let K=e.findIndex(t=>t==="-p"||t==="--prompt");if(K!==-1){let t=e.includes("--new")||e.includes("-n"),r=e.slice(K+1).filter(o=>o!=="-n"&&o!=="--new")[0];if(!process.stdin.isTTY){let o=[];for await(let c of process.stdin)o.push(c);let l=Buffer.concat(o).toString("utf8").trim();l&&(r?r=`Stdin Context:
|
|
68
|
+
${l}
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
${r}`:r=l)}r||(console.error("[ERROR] -p/--prompt requires a prompt string (or piped stdin input)."),process.exit(1));let{loadSettings:w}=await import("./chunks/settings-JGWWOFEC.js"),{getProviderAPIKey:y}=await import("./chunks/secrets-RFEEPY3S.js"),{getDefaultModel:g}=await import("./chunks/model_config-UZLNHYP5.js"),{generateSimpleContent:S}=await import("./chunks/ai-WJELS6YF.js"),{checkQuotaDetailed:f}=await import("./chunks/usage-XHKS6GHC.js"),a=await w(),i=e.filter(o=>o!=="-p"&&o!=="--prompt"&&o!==r&&o!=="-n"&&o!=="--new"),m=o=>{for(let l of o){let c=i.indexOf(l);if(c!==-1&&c+1<i.length)return i[c+1]}return null},n=m(["--provider"])||a.aiProvider||"Google",P=m(["--model"])||a.activeModel||g(n,a.apiTier)||g(n,"paid"),b=m(["--key"])||await y(n);b||(console.error(`[ERROR] No API key resolved for provider "${n}".`),process.exit(1));let x=await f("agent",{aiProvider:n});x.allowed||(console.error(`[ERROR] ${x.reason||"Budget Exhausted"} - adjust with /budget set.`),process.exit(1));let C={aiProvider:n,apiKey:b,model:P,mode:"flow",thinkingLevel:m(["--thinking"])||"Fast",systemSettings:a.systemSettings||{}},s=process.platform==="win32"?"Windows":process.platform==="darwin"?"macOS":"Linux",A=new Date,_=A.getFullYear(),h=A.toLocaleString("en-US",{month:"short"}).toUpperCase(),E=String(A.getDate()).padStart(2,"0"),B=A.toLocaleTimeString([],{hour:"2-digit",hour12:!0}),D=`${_}-${h}-${E}, ${B}`,j=`Identity: FluxFlow. Sassy, CLI Assistant
|
|
68
72
|
Use NO markdown, only plain text
|
|
69
73
|
Additional Context:
|
|
70
|
-
- OS: ${
|
|
71
|
-
- Model: ${O.basename(C.model).trim().replace(":free","").replace("-free","").replace("/free","").replace("_free","").replace("free_","").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,
|
|
74
|
+
- OS: ${s}
|
|
75
|
+
- Model: ${O.basename(C.model).trim().replace(":free","").replace("-free","").replace("/free","").replace("_free","").replace("free_","").replaceAll("-"," ").replaceAll("_"," ").replace(/\b\w/g,o=>o.toUpperCase().trim())}
|
|
72
76
|
- Approx time: ${D}
|
|
73
77
|
- Non interactive CLI, no tools
|
|
74
|
-
- \`fluxflow\` TUI for full capability`.trim(),{getPromptSessionHistory:G,savePromptSessionHistory:
|
|
75
|
-
`);let{text:H}=await S(C
|
|
78
|
+
- \`fluxflow\` TUI for full capability`.trim(),{getPromptSessionHistory:G,savePromptSessionHistory:Y,clearPromptSessionHistory:T}=await import("./chunks/sessionDaemon-GHQTAGDG.js"),M=[];t?await T():M=await G();let k=[];if(Array.isArray(M)&&M.length>0)for(let o of M)o.text&&k.push({role:o.role==="model"?"model":"user",parts:[{text:o.text}]});k.push({role:"user",parts:[{text:r}]});try{let o="\x1B[36m",l="\x1B[35m",c="\x1B[0m",q=O.basename(C.model).trim().replace(":free","").replace("-free","").replace("free/","").replaceAll("-"," ").replace(/\b\w/g,W=>W.toUpperCase().trim());process.stdout.write(`Responding with ${o}${q}${c} from ${l}${C.aiProvider}${c}:
|
|
79
|
+
`);let{text:H}=await S(C,P,k,j,C.thinkingLevel),R=(H||"").trim();process.stdout.write(R+`
|
|
76
80
|
|
|
77
|
-
`),
|
|
81
|
+
`),R&&await Y(r,R)}catch(o){console.error(`[ERROR] Prompt request failed: ${o.message.trim()}
|
|
78
82
|
|
|
79
|
-
`),process.exit(1)}process.exit(0)}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let Q=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",Q),["SIGINT","SIGTERM","SIGHUP"].forEach(t=>{process.once(t,()=>{Q(),process.exit(0)})}),e.includes("--playground")){let t=process.cwd();process.argv.push("--original-cwd",t);let{DATA_DIR:
|
|
83
|
+
`),process.exit(1)}process.exit(0)}process.stdout.write("\x1B[2J\x1B[3J\x1B[H"),process.stdout.isTTY&&(process.stdout.write("\x1B]0;FluxFlow\x07"),process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07"),process.stdout.write("\x1B[?2004h"));let Q=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",Q),["SIGINT","SIGTERM","SIGHUP"].forEach(t=>{process.once(t,()=>{Q(),process.exit(0)})}),e.includes("--playground")){let t=process.cwd();process.argv.push("--original-cwd",t);let{DATA_DIR:p}=await import("./chunks/paths-Y7ACZJAE.js"),r=await import("path"),w=await import("fs-extra"),y=r.default.join(p,"playground");try{w.default.ensureDirSync(y),process.chdir(y)}catch{}}re(se.createElement(ne,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED