fluxflow-cli 4.11.0 → 4.12.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/README.md +2 -2
- package/dist/chunks/{ai-WB4PWDHV.js → ai-OCOM32HV.js} +1 -1
- package/dist/chunks/app-LKK2QTJ7.js +238 -0
- package/dist/chunks/chunk-LRJGBXD6.js +880 -0
- package/dist/chunks/{chunk-W43IBIRT.js → chunk-MZGMZ4T6.js} +1 -1
- package/dist/chunks/{chunk-2CJOOYOT.js → chunk-R67K3FEP.js} +1 -1
- package/dist/chunks/{chunk-TA42E3DA.js → chunk-RNEHIJXX.js} +1 -1
- package/dist/chunks/chunk-VNPYQFKQ.js +3 -0
- package/dist/chunks/{chunk-Q7SNDU5P.js → chunk-WZW77OYB.js} +1 -1
- package/dist/chunks/{click-WCT2TJ2G.js → click-V2WBK6PX.js} +2 -2
- package/dist/chunks/{computer_action-EKG5CRRA.js → computer_action-QGLK3SY6.js} +1 -1
- package/dist/chunks/{drag-HYJQ5RE7.js → drag-6P367RA2.js} +1 -1
- package/dist/chunks/{generate_image-Q6RIYYMI.js → generate_image-6K34FOJJ.js} +1 -1
- package/dist/chunks/{invoke-RTBTXXOI.js → invoke-D2QN5M3S.js} +2 -2
- package/dist/chunks/{invokeSync-RNOOUMPZ.js → invokeSync-U5GA5PGM.js} +2 -2
- package/dist/chunks/{key_press-RKJOUTTG.js → key_press-BRS2DIB5.js} +1 -1
- package/dist/chunks/{keyboard_typing-GJBWCAZ2.js → keyboard_typing-3YF72D7X.js} +1 -1
- package/dist/chunks/{screen_grid-Y5PT4VFL.js → screen_grid-IUKQWDZG.js} +1 -1
- package/dist/chunks/{scroll-DVM5ACY2.js → scroll-VJJ2SHXR.js} +1 -1
- package/dist/chunks/{settings-2QSWNLAX.js → settings-ZHS26QZ5.js} +1 -1
- package/dist/chunks/{update_file-CF2DSC6F.js → update_file-KPFDUPKK.js} +1 -1
- package/dist/chunks/usageServer-DMWM5ECL.js +1 -0
- package/dist/chunks/{write_file-N2EG2T6U.js → write_file-LYTIK6LS.js} +1 -1
- package/dist/cli.js +6 -6
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/chunks/app-DLM4TCBT.js +0 -225
- package/dist/chunks/chunk-GFDJETGV.js +0 -868
- package/dist/chunks/chunk-K26OGD74.js +0 -3
- package/dist/chunks/usageServer-HYLLNJRZ.js +0 -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-OCOM32HV.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:functions.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*10)/10}}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-OCOM32HV.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-OCOM32HV.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-OCOM32HV.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{b as e}from"./chunk-R67K3FEP.js";import"./chunk-MZGMZ4T6.js";import{a as i}from"./chunk-Y5JU726N.js";var k=async(s,c={})=>{let t=i(s),a=t.key||t.keys||t.input||t.shortcut;if(!a)return'ERROR: Missing required "key" parameter for KeyPress tool.';let r=String(a).trim().toLowerCase();if(r==="clearinput"||r==="clear_input"||r==="clear")return await e("clear_input");if(r==="back"||r==="browser_back"||r==="browserBack")return await e("browser_back");if(r.includes(";")||r.includes("+")){let o=r.split(/[;+]/).map(n=>n.trim()).filter(Boolean);return await e("key_combination",o)}return await e("key_press",r)};export{k as key_press};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-R67K3FEP.js";import"./chunk-MZGMZ4T6.js";import{a as r}from"./chunk-Y5JU726N.js";var p=async(o,u={})=>{let t=r(o),e=t.text||t.input||t.value||"",s=t.autoPressEnter===!0||t.autoPressEnter==="true"||t.enter===!0||t.enter==="true";return e==null?'ERROR: Missing required "text" parameter for KeyboardTyping tool.':await n("type",String(e),{autoPressEnter:s})};export{p as keyboard_typing};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-MZGMZ4T6.js";export{a as GRID_CONFIG,c as captureGriddedScreenshot,b as getActiveDisplay,e as gridToNativeCoordinates,d as parseGridCodeTo720p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-R67K3FEP.js";import"./chunk-MZGMZ4T6.js";import{a as t}from"./chunk-Y5JU726N.js";var m=async(n,i={})=>{let o=t(n),e=(o.direction||"down").toLowerCase(),c=o.amount?parseInt(o.amount,10):6,s=o.gridId||o.grid||o.coordinate||o.target||o.id||null;return await r("scroll",s,{direction:e,amount:c})};export{m as scroll};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as a,i as b}from"./chunk-
|
|
1
|
+
import{h as a,i as b}from"./chunk-VNPYQFKQ.js";import"./chunk-SIINYZWE.js";import"./chunk-4TZKD2XR.js";export{a as loadSettings,b as saveSettings};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as h,f as m,g as R}from"./chunk-6GTIZENY.js";import{a as F}from"./chunk-TGINXVDR.js";import{h as g}from"./chunk-
|
|
1
|
+
import{e as h,f as m,g as R}from"./chunk-6GTIZENY.js";import{a as F}from"./chunk-TGINXVDR.js";import{h as g}from"./chunk-VNPYQFKQ.js";import"./chunk-SIINYZWE.js";import"./chunk-4TZKD2XR.js";import{a as $}from"./chunk-Y5JU726N.js";import c from"fs";import M from"path";var v=async(w,S={})=>{let n=$(w),t=n.path;if(!t)return'ERROR: Missing "path" argument for PatchFile.';let{patchPairs:o,allowMultiple:C,error:p}=h(n);if(p)return`ERROR: ${p}`;if(o.length===0)return"ERROR: No valid replacement pairs found. Use searchContent1, newContent1, etc.";let E=n.allowMultiple!==void 0?n.allowMultiple===!0||String(n.allowMultiple).toLowerCase()==="true":C,i=M.resolve(process.cwd(),t);try{if(!c.existsSync(i))return`ERROR: File [${t}] does not exist. Use WriteFile instead.`;let e=S.forcedContent||c.readFileSync(i,"utf8");e.startsWith("\uFEFF")&&(e=e.slice(1));let s=e.replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`),{content:u,results:l}=m(s,o,{allowMultiple:E}),a=l.filter(r=>!r.success),f=l.filter(r=>r.success);if(f.length===0)return`ERROR: Patch Failed to apply to [${t}].
|
|
4
4
|
${a.map(r=>` \u2022 ${r.error}`).join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-RNEHIJXX.js";import"./chunk-WZW77OYB.js";import"./chunk-VNPYQFKQ.js";import"./chunk-SIINYZWE.js";import"./chunk-4TZKD2XR.js";export{b as openUsageDashboard,a as startUsageServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-TGINXVDR.js";import{h as $}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-TGINXVDR.js";import{h as $}from"./chunk-VNPYQFKQ.js";import"./chunk-SIINYZWE.js";import"./chunk-4TZKD2XR.js";import{a as R}from"./chunk-Y5JU726N.js";import r from"fs";import C from"path";var B=async(w,E={})=>{let{path:s,content:o}=R(w);if(!s)return'ERROR: Missing "path" argument for write_file.';if(o===void 0)return'ERROR: Missing "content" argument for write_file.';o=o.replace(/^```[\w]*\n?/,"").replace(/```\s*$/,"").replace(/\r\n/g,`
|
|
2
2
|
`).replace(/\r/g,`
|
|
3
3
|
`);let t=C.resolve(process.cwd(),s),m=C.dirname(t);try{await y.recordFileChange(t);let n="";if(r.existsSync(t))try{n=`Old File contents:
|
|
4
4
|
${r.readFileSync(t,"utf8").split(/\r?\n/).map((g,j)=>`${j+1} | ${g}`).join(`
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as
|
|
2
|
+
import{a as m}from"./chunks/chunk-4TZKD2XR.js";import{spawn as ce}from"child_process";import{fileURLToPath as D}from"url";import ue from"os";import B from"path";import S from"fs";import h from"dotenv";try{let e=B.join(m,"AGENTS.md"),n=B.join(m,"FLUXFLOW.md");!S.existsSync(e)&&!S.existsSync(n)&&(S.existsSync(m)||S.mkdirSync(m,{recursive:!0}),S.writeFileSync(e,"","utf8"))}catch{}h.config({path:"./.env",override:!0,quiet:!0});h.config({path:`${m}/.env`,override:!0,quiet:!0});h.config({path:`${m}/.env.agents`,override:!0,quiet:!0});h.config({path:`${m}/.env.fluxflow`,override:!0,quiet:!0});h.config({path:"./.env.agents",override:!0,quiet:!0});h.config({path:"./.env.fluxflow",override:!0,quiet:!0});process.env.NO_INS=!1;var me=ue.totalmem(),j=me/(1024*1024),pe=.5,de=Math.floor(j*pe),G=process.argv.slice(2),U=G.indexOf("--allocation"),s=U!==-1?parseInt(G[U+1],10):NaN,ge=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,fe=!isNaN(s)||ge||!1;!isNaN(s)&&s<64&&(console.error(`
|
|
3
3
|
[ERROR] Allocation value '${s} MB' is too low. Minimum: 64 MB, Recommended: 4096 MB.
|
|
4
4
|
`),process.exit(1));var M=Math.floor(j*.75),xe=!isNaN(s)&&s>0?Math.min(s,M):Math.max(1536,Math.min(32768,de)),he=D(import.meta.url).endsWith(".js");if(he&&!process.execArgv.some(e=>e.includes("max-old-space-size"))&&fe)Number.isNaN(s)||(console.log(`
|
|
5
|
-
[MEMORY] Starting with: '${s>M?M:s} MB' Allocation${s>M?" (Max allowed: '"+M+" MB')":""}. Please Wait...`),await new Promise(n=>setTimeout(n,5e3))),ce(process.execPath,[`--max-old-space-size=${xe}`,"--expose-gc","--max-semi-space-size=1",D(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",n=>process.exit(n||0));else{let e=process.argv.slice(2),n=e.includes("--help")&&e[e.indexOf("--help")+1]==="commands",P=e.includes("--help")&&!n,
|
|
5
|
+
[MEMORY] Starting with: '${s>M?M:s} MB' Allocation${s>M?" (Max allowed: '"+M+" MB')":""}. Please Wait...`),await new Promise(n=>setTimeout(n,5e3))),ce(process.execPath,[`--max-old-space-size=${xe}`,"--expose-gc","--max-semi-space-size=1",D(import.meta.url),...process.argv.slice(2)],{stdio:"inherit"}).on("exit",n=>process.exit(n||0));else{let e=process.argv.slice(2),n=e.includes("--help")&&e[e.indexOf("--help")+1]==="commands",P=e.includes("--help")&&!n,N=e.includes("--version")||e.includes("-v"),R=e[0]==="--update",I=e[0]==="--export";if(e[0]==="--usage"||e.includes("--usage")||e[0]==="--budget"||e.includes("--budget")){let{openUsageDashboard:o}=await import("./chunks/usageServer-DMWM5ECL.js"),{url:r}=await o();console.log(`
|
|
6
6
|
\u2726 FluxFlow Token Usage & Analytics Dashboard
|
|
7
7
|
\u2800\u2800\u2514\u2500 Serving at: ${r}
|
|
8
8
|
\u2800\u2800\u2514\u2500 Opened in default browser. Press Ctrl+C to stop.
|
|
9
|
-
`),await new Promise(()=>{})}if(
|
|
10
|
-
Usage: fluxflow --export error`),process.exit(1)}if(
|
|
9
|
+
`),await new Promise(()=>{})}if(N||P||n||R||I){let o=await import("fs"),r=await import("path"),{fileURLToPath:i}=await import("url"),p=r.join(r.dirname(i(import.meta.url)),"../package.json"),d=JSON.parse(o.readFileSync(p,"utf8")).version;if(I){let v=(e[1]||"").toLowerCase();if(v==="error"||v==="logs")try{let{exportErrorLogs:l}=await import("./chunks/export-PSA6YZMJ.js"),c=await l();console.log(`[EXPORT LOGS] Exported ${c.entryCount} error log entries (FluxFlow: ${c.fluxflowCount}, Memory: ${c.memoryCount}) to "${c.exportFile}"`),process.exit(0)}catch(l){console.error(`[EXPORT ERROR] Failed to export error logs: ${l.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(N&&(console.log(`v${d}`),process.exit(0)),P&&(console.log(`FluxFlow CLI Arguments:
|
|
11
11
|
--mode <flux|flow> Set startup mode (flux: Agent / flow: Chat)
|
|
12
12
|
--model <model_name> Set startup AI model
|
|
13
13
|
--key <key@provider> Set API key and provider
|
|
@@ -54,7 +54,7 @@ Usage: fluxflow --export error`),process.exit(1)}if(R&&(console.log(`v${d}`),pro
|
|
|
54
54
|
/theme Customize UI color theme
|
|
55
55
|
/key Manage API keys
|
|
56
56
|
/profile Edit developer persona
|
|
57
|
-
/memory
|
|
57
|
+
/memory <view|migrate> Manage agent memory or migrate to AGENTS.md
|
|
58
58
|
/stats Show session usage
|
|
59
59
|
/usage Open graphical token analytics dashboard in browser
|
|
60
60
|
/reset Wipe all project data
|
|
@@ -63,4 +63,4 @@ Usage: fluxflow --export error`),process.exit(1)}if(R&&(console.log(`v${d}`),pro
|
|
|
63
63
|
/docs View documentation
|
|
64
64
|
/fluxflow init Create FluxFlow.md template
|
|
65
65
|
/update check Check for new version
|
|
66
|
-
/update latest Install latest release`),process.exit(0)),
|
|
66
|
+
/update latest Install latest release`),process.exit(0)),R){let v=e[1]||"latest";if(v==="check"){let l=e[2]==="latest";try{let x=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;x||(console.error("Error: Could not retrieve latest version."),process.exit(1)),console.log(l?`Latest version: v${x}`:x!==d?`A new version of FluxFlow is available: v${x} (current: v${d}). Run "fluxflow --update latest" to upgrade.`:`FluxFlow is up to date (v${d}).`)}catch(c){console.error("Error checking for updates:",c.message),process.exit(1)}process.exit(0)}else if(v==="latest"){console.log("Checking latest version and settings...");try{let a=(await(await fetch("https://registry.npmjs.org/fluxflow-cli",{cache:"no-store"})).json())["dist-tags"]?.latest;a||(console.error("Error: Could not retrieve latest version."),process.exit(1)),a===d&&(console.log(`FluxFlow is already up to date (v${d}).`),process.exit(0));let x=async()=>{let t=(await import("react")).default,{useState:L}=t,{render:K,Box:f,Text:y}=await import("ink"),Q=(await import("ink-select-input")).default,Z=(await import("ink-text-input")).default;return new Promise(ee=>{let oe=[{label:"NPM",value:"npm"},{label:"PNPM",value:"pnpm"},{label:"Yarn",value:"yarn"},{label:"Bun",value:"bun"},{label:"Custom Command",value:"custom"}],te=({label:b,isSelected:C})=>t.createElement(f,{width:"100%"},t.createElement(y,{bold:C},"\u2514\u2500 ",C?"\x1B[32m\u25CF\x1B[0m":"\u25CB"," ",b)),T,se=()=>{let[b,C]=L("select"),[ae,ne]=L(""),ie=F=>{F.value==="custom"?C("custom"):_({manager:F.value})},le=F=>{_({manager:"custom",customCommand:F})};return b==="custom"?t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F527} Enter custom update command:")),t.createElement(f,{flexDirection:"row"},t.createElement(y,{color:"cyan",bold:!0}," \u276F "),t.createElement(Z,{value:ae,onChange:ne,onSubmit:le})),t.createElement(f,{marginTop:1},t.createElement(y,{color:"gray",dimColor:!0,italic:!0}," (Press Enter to confirm)"))):t.createElement(f,{flexDirection:"column",marginY:1},t.createElement(f,{marginBottom:1},t.createElement(y,{color:"magenta",bold:!0},"\u{1F4E6} Select a package manager for the update:")),t.createElement(Q,{items:oe,onSelect:ie,itemComponent:te,indicatorComponent:()=>null}))},_=b=>{T&&T(),ee(b)},{unmount:re}=K(t.createElement(se,null));T=re})},u,O="",E;try{let{loadSettings:t}=await import("./chunks/settings-ZHS26QZ5.js");E=await t(),u=E?.systemSettings?.updateManager||E?.updateManager}catch{}if(!u){let t=await x();u=t.manager,O=t.customCommand}let g="";u==="pnpm"?g=`pnpm add -g fluxflow-cli@${a}`:u==="bun"?g=`bun add -g fluxflow-cli@${a}`:u==="yarn"?g=`yarn global add fluxflow-cli@${a}`:u==="custom"?g=O||E?.customUpdateCommand||`npm install -g fluxflow-cli@${a}`:g=`npm install -g fluxflow-cli@${a}`,console.log(`Updating FluxFlow to v${a} using ${u}...`),console.log(`Running: ${g}`);let{execSync:J}=await import("child_process");J(g,{stdio:"inherit"}),console.log(`\x1B[32m\u2705 Update successful! FluxFlow updated to v${a}.\x1B[0m`)}catch(l){console.error("\x1B[31m\u274C Update failed:\x1B[0m",l.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:Y}=await import("react"),{render:W}=await import("ink"),{default:q}=await import("./chunks/app-LKK2QTJ7.js");process.env.NODE_NO_WARNINGS="1";let H=["cuimp","Found existing binary","Binary verified","curl.exe not found","Falling back to .bat file","DeprecationWarning"],X=console.log,V=console.warn,z=console.error,A=o=>{let r=o.map(String).join(" ");return H.some(i=>r.includes(i))};console.log=(...o)=>!A(o)&&X(...o),console.warn=(...o)=>!A(o)&&V(...o),console.error=(...o)=>!A(o)&&z(...o);let k=e.findIndex(o=>o==="--cwd"||o==="--path");if(k!==-1&&k+1<e.length){let o=e[k+1],r=await import("path"),i=await import("fs-extra"),p=r.default.resolve(o);try{i.default.existsSync(p)&&i.default.statSync(p).isDirectory()?process.chdir(p):(console.error(`[ERROR] Directory not found: "${o}"`),process.exit(0))}catch(w){console.error(`[ERROR] Failed to change directory to "${o}": ${w.message}`),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 $=()=>{process.stdout.isTTY&&process.stdout.write("\x1B[?2004l")};if(process.on("exit",$),["SIGINT","SIGTERM","SIGHUP"].forEach(o=>{process.once(o,()=>{$(),process.exit(0)})}),e.includes("--playground")){let o=process.cwd();process.argv.push("--original-cwd",o);let{DATA_DIR:r}=await import("./chunks/paths-CHZDSDRF.js"),i=await import("path"),p=await import("fs-extra"),w=i.default.join(r,"playground");try{p.default.ensureDirSync(w),process.chdir(w)}catch{}}W(Y.createElement(q,{args:process.argv.slice(2)}),{exitOnCtrlC:!1})}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED