fluxflow-cli 2.12.2 → 2.12.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/fluxflow.js +84 -2
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -11256,6 +11256,9 @@ function App({ args = [] }) {
|
|
|
11256
11256
|
i++;
|
|
11257
11257
|
} else if (arg === "--playground") {
|
|
11258
11258
|
parsed.playground = true;
|
|
11259
|
+
} else if ((arg === "--original-cwd" || arg === "--orginal-cwd") && args[i + 1]) {
|
|
11260
|
+
parsed.originalCwd = args[i + 1];
|
|
11261
|
+
i++;
|
|
11259
11262
|
}
|
|
11260
11263
|
}
|
|
11261
11264
|
return parsed;
|
|
@@ -12200,6 +12203,7 @@ function App({ args = [] }) {
|
|
|
12200
12203
|
const COMMANDS = [
|
|
12201
12204
|
{ cmd: "/quit", desc: "Exit and shutdown Flux" },
|
|
12202
12205
|
{ cmd: "/help", desc: "Show all available commands" },
|
|
12206
|
+
...parsedArgs.playground ? [{ cmd: "/move", desc: "Move playground directory to original CWD/playground-export" }] : [],
|
|
12203
12207
|
{ cmd: "/compress", desc: "Summarize and compress chat history" },
|
|
12204
12208
|
{ cmd: "/clear", desc: "Clear terminal screen" },
|
|
12205
12209
|
{ cmd: "/resume", desc: "Load previous session" },
|
|
@@ -12588,6 +12592,54 @@ ${cleanText}`, color: "magenta" }];
|
|
|
12588
12592
|
}
|
|
12589
12593
|
break;
|
|
12590
12594
|
}
|
|
12595
|
+
case "/move": {
|
|
12596
|
+
if (!parsedArgs.playground) {
|
|
12597
|
+
setMessages((prev) => {
|
|
12598
|
+
setCompletedIndex(prev.length + 1);
|
|
12599
|
+
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] /move command is only available in playground mode.`, isMeta: true }];
|
|
12600
|
+
});
|
|
12601
|
+
break;
|
|
12602
|
+
}
|
|
12603
|
+
if (!parsedArgs.originalCwd) {
|
|
12604
|
+
setMessages((prev) => {
|
|
12605
|
+
setCompletedIndex(prev.length + 1);
|
|
12606
|
+
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Error: Original CWD not found.`, isMeta: true }];
|
|
12607
|
+
});
|
|
12608
|
+
break;
|
|
12609
|
+
}
|
|
12610
|
+
const src = path20.join(DATA_DIR, "playground");
|
|
12611
|
+
const dest = path20.join(parsedArgs.originalCwd, "playground-export");
|
|
12612
|
+
const moveFiles = async () => {
|
|
12613
|
+
try {
|
|
12614
|
+
setMessages((prev) => {
|
|
12615
|
+
setCompletedIndex(prev.length + 1);
|
|
12616
|
+
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Exporting playground content to ${dest}`, isMeta: true }];
|
|
12617
|
+
});
|
|
12618
|
+
await fs22.ensureDir(dest);
|
|
12619
|
+
const excludeDirs = ["node_modules", ".git", ".venv", "venv", "env", ".next", "dist", "build", ".cache"];
|
|
12620
|
+
await fs22.copy(src, dest, {
|
|
12621
|
+
overwrite: true,
|
|
12622
|
+
filter: (srcPath) => {
|
|
12623
|
+
const relative = path20.relative(src, srcPath);
|
|
12624
|
+
if (!relative) return true;
|
|
12625
|
+
const parts2 = relative.split(path20.sep);
|
|
12626
|
+
return !parts2.some((part) => excludeDirs.includes(part));
|
|
12627
|
+
}
|
|
12628
|
+
});
|
|
12629
|
+
setMessages((prev) => {
|
|
12630
|
+
setCompletedIndex(prev.length + 1);
|
|
12631
|
+
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Successfully copied playground content to ${dest}`, isMeta: true }];
|
|
12632
|
+
});
|
|
12633
|
+
} catch (err) {
|
|
12634
|
+
setMessages((prev) => {
|
|
12635
|
+
setCompletedIndex(prev.length + 1);
|
|
12636
|
+
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Failed to move content: ${err.message}`, isMeta: true }];
|
|
12637
|
+
});
|
|
12638
|
+
}
|
|
12639
|
+
};
|
|
12640
|
+
moveFiles();
|
|
12641
|
+
break;
|
|
12642
|
+
}
|
|
12591
12643
|
case "/clear": {
|
|
12592
12644
|
setMessages([
|
|
12593
12645
|
{ id: "logo-" + Date.now(), role: "system", isLogo: true, isMeta: true }
|
|
@@ -12597,8 +12649,36 @@ ${cleanText}`, color: "magenta" }];
|
|
|
12597
12649
|
parsedArgs.playground = false;
|
|
12598
12650
|
deleteChat(PLAYGROUND_CHAT_ID).catch(() => {
|
|
12599
12651
|
});
|
|
12600
|
-
|
|
12601
|
-
|
|
12652
|
+
if (parsedArgs.originalCwd) {
|
|
12653
|
+
try {
|
|
12654
|
+
process.chdir(parsedArgs.originalCwd);
|
|
12655
|
+
setMessages((prev) => {
|
|
12656
|
+
const newMsgs = [...prev, {
|
|
12657
|
+
id: "playground-" + Date.now(),
|
|
12658
|
+
role: "system",
|
|
12659
|
+
text: `[PLAYGROUND] Session ended. Restored Working Directory to ${parsedArgs.originalCwd}`,
|
|
12660
|
+
isMeta: true
|
|
12661
|
+
}];
|
|
12662
|
+
setCompletedIndex(newMsgs.length);
|
|
12663
|
+
return newMsgs;
|
|
12664
|
+
});
|
|
12665
|
+
} catch (e) {
|
|
12666
|
+
}
|
|
12667
|
+
}
|
|
12668
|
+
setTimeout(() => {
|
|
12669
|
+
fs22.emptyDir(path20.join(DATA_DIR, "playground")).catch((err) => {
|
|
12670
|
+
setMessages((prev) => {
|
|
12671
|
+
const newMsgs = [...prev, {
|
|
12672
|
+
id: "playground-" + Date.now(),
|
|
12673
|
+
role: "system",
|
|
12674
|
+
text: `[PLAYGROUND] Failed to clear session: ${DATA_DIR + "/playground"}`,
|
|
12675
|
+
isMeta: true
|
|
12676
|
+
}];
|
|
12677
|
+
setCompletedIndex(newMsgs.length);
|
|
12678
|
+
return newMsgs;
|
|
12679
|
+
});
|
|
12680
|
+
});
|
|
12681
|
+
}, 500);
|
|
12602
12682
|
setSystemSettings((s2) => ({
|
|
12603
12683
|
...s2,
|
|
12604
12684
|
allowExternalAccess: originalAllowExternalAccessRef.current,
|
|
@@ -15215,6 +15295,8 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
15215
15295
|
process.stdout.write("\x1B]633;P;TerminalTitle=FluxFlow\x07");
|
|
15216
15296
|
}
|
|
15217
15297
|
if (args.includes("--playground")) {
|
|
15298
|
+
const originalCwd = process.cwd();
|
|
15299
|
+
process.argv.push("--original-cwd", originalCwd);
|
|
15218
15300
|
const { DATA_DIR: DATA_DIR2 } = await Promise.resolve().then(() => (init_paths(), paths_exports));
|
|
15219
15301
|
const pathMod = await import("path");
|
|
15220
15302
|
const fsMod = await import("fs-extra");
|