fluxflow-cli 1.18.1 → 1.18.2
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 +21 -5
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -440,11 +440,15 @@ var init_TerminalBox = __esm({
|
|
|
440
440
|
"src/components/TerminalBox.jsx"() {
|
|
441
441
|
init_text();
|
|
442
442
|
TerminalBox = React2.memo(({ command, output, completed = false, isFocused = false, columns = 80, isPty = false }) => {
|
|
443
|
-
const
|
|
443
|
+
const processPTY = (text) => {
|
|
444
444
|
if (!text) return "";
|
|
445
|
-
|
|
445
|
+
const noTrailingCr = text.replace(/\r+\n/g, "\n");
|
|
446
|
+
return noTrailingCr.split("\n").map((line) => {
|
|
447
|
+
const parts = line.split("\r");
|
|
448
|
+
return parts[parts.length - 1];
|
|
449
|
+
}).join("\n");
|
|
446
450
|
};
|
|
447
|
-
const cleanOutput =
|
|
451
|
+
const cleanOutput = isPty ? processPTY(output) : (output || "").replace(/\r\n/g, "\n");
|
|
448
452
|
const displayOutput = isPty ? cleanOutput : cleanOutput ? wrapText(cleanOutput, columns - 6) : "";
|
|
449
453
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: isFocused ? "double" : "round", borderColor: completed ? "#334155" : isFocused ? "yellow" : "cyan", paddingX: 2, paddingY: completed ? 0 : 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 1, paddingRight: 2 }, /* @__PURE__ */ React2.createElement(Text2, null, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "white" }, command))), isPty && /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 0, paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "magenta", bold: true }, "ADVANCE"))), displayOutput ? /* @__PURE__ */ React2.createElement(Box2, { marginTop: completed ? 0 : 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : void 0 }, displayOutput)) : !completed && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "gray", italic: true }, "Waiting for output...")), /* @__PURE__ */ React2.createElement(Box2, { justifyContent: "space-between", marginTop: 1 }, !completed ? /* @__PURE__ */ React2.createElement(Text2, { color: "gray", dimColor: true, italic: true }, "Double-press ESC to terminate if hanging.") : /* @__PURE__ */ React2.createElement(Box2, null), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "#475569" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u25CF ARCHIVED" : isFocused ? "\u25B6 TERMINAL FOCUSED" : "\u25CF LIVE (Press TAB to focus)")));
|
|
450
454
|
});
|
|
@@ -3626,7 +3630,8 @@ var init_exec_command = __esm({
|
|
|
3626
3630
|
});
|
|
3627
3631
|
ptyProcess.onExit(({ exitCode }) => {
|
|
3628
3632
|
activeChildProcess = null;
|
|
3629
|
-
const
|
|
3633
|
+
const normalizedOutput = (output || "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
3634
|
+
const finalOutput = normalizedOutput || "Command executed with no output.";
|
|
3630
3635
|
if (exitCode !== 0) {
|
|
3631
3636
|
resolve(`ERROR: Command [${rawCommand}] failed with exit code [${exitCode}].
|
|
3632
3637
|
|
|
@@ -7785,10 +7790,21 @@ ${timestamp}` };
|
|
|
7785
7790
|
onExecEnd: () => {
|
|
7786
7791
|
setMessages((prev) => {
|
|
7787
7792
|
if (!activeCommandRef.current) return prev;
|
|
7793
|
+
const rawOutput = execOutputRef.current || "";
|
|
7794
|
+
let normalizedOutput = "";
|
|
7795
|
+
if (isActiveCommandPty) {
|
|
7796
|
+
const noTrailingCr = rawOutput.replace(/\r+\n/g, "\n");
|
|
7797
|
+
normalizedOutput = noTrailingCr.split("\n").map((line) => {
|
|
7798
|
+
const parts = line.split("\r");
|
|
7799
|
+
return parts[parts.length - 1];
|
|
7800
|
+
}).join("\n");
|
|
7801
|
+
} else {
|
|
7802
|
+
normalizedOutput = rawOutput.replace(/\r\n/g, "\n");
|
|
7803
|
+
}
|
|
7788
7804
|
const finalStatus = `[TERMINAL_RECORD]
|
|
7789
7805
|
COMMAND: ${activeCommandRef.current}
|
|
7790
7806
|
PTY: ${isActiveCommandPty}
|
|
7791
|
-
OUTPUT: ${
|
|
7807
|
+
OUTPUT: ${normalizedOutput}`;
|
|
7792
7808
|
return [...prev, { id: "term-" + Date.now(), role: "system", text: finalStatus, isTerminalRecord: true }];
|
|
7793
7809
|
});
|
|
7794
7810
|
setActiveCommand(null);
|