fluxflow-cli 1.18.16 → 1.18.18
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 +61 -31
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -455,7 +455,7 @@ var init_TerminalBox = __esm({
|
|
|
455
455
|
return parts[parts.length - 1];
|
|
456
456
|
}).join("\n");
|
|
457
457
|
};
|
|
458
|
-
const cleanOutput = isPty ? output
|
|
458
|
+
const cleanOutput = (isPty ? processPTY(output) : (output || "").replace(/\r\n/g, "\n")).replace(/\n{3,}/g, "\n\n");
|
|
459
459
|
const displayOutput = isPty ? cleanOutput : cleanOutput ? wrapText(cleanOutput, columns - 6) : "";
|
|
460
460
|
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 }, isFocused ? "Press TAB to unfocus, then double-press ESC to terminate." : "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)")));
|
|
461
461
|
});
|
|
@@ -1044,8 +1044,7 @@ var init_arg_parser = __esm({
|
|
|
1044
1044
|
const afterRaw = argsString.substring(qIdx + 1);
|
|
1045
1045
|
const after = afterRaw.trim();
|
|
1046
1046
|
const isLogicalEnd = after === "" || // End of entire string
|
|
1047
|
-
after
|
|
1048
|
-
/^(\w+)\s*=/.test(after) || // Next argument key=
|
|
1047
|
+
/^,\s*\w+\s*=/.test(after) || // Next argument separator (comma followed by key=)
|
|
1049
1048
|
after.startsWith(")") && (after.length === 1 || /^\)\s*([,\]\s]|tool:)/i.test(after));
|
|
1050
1049
|
if (isLogicalEnd && afterRaw.startsWith("\n")) {
|
|
1051
1050
|
const nextLine = after.split("\n")[0];
|
|
@@ -4674,7 +4673,23 @@ var init_generate_image = __esm({
|
|
|
4674
4673
|
await RevertManager.recordFileChange(absolutePath);
|
|
4675
4674
|
await fs15.writeFile(absolutePath, finalBuffer);
|
|
4676
4675
|
await recordImageGeneration(settings);
|
|
4677
|
-
|
|
4676
|
+
const ext = path14.extname(outputPath).toLowerCase();
|
|
4677
|
+
const mimeMap = {
|
|
4678
|
+
".jpg": "image/jpeg",
|
|
4679
|
+
".jpeg": "image/jpeg",
|
|
4680
|
+
".png": "image/png",
|
|
4681
|
+
".webp": "image/webp"
|
|
4682
|
+
};
|
|
4683
|
+
const mimeType = mimeMap[ext] || "image/png";
|
|
4684
|
+
return {
|
|
4685
|
+
text: `SUCCESS: Image successfully generated from prompt [${prompt}] and saved to [${outputPath}]. Output attached to multimodal part`,
|
|
4686
|
+
binaryPart: {
|
|
4687
|
+
inlineData: {
|
|
4688
|
+
data: finalBuffer.toString("base64"),
|
|
4689
|
+
mimeType
|
|
4690
|
+
}
|
|
4691
|
+
}
|
|
4692
|
+
};
|
|
4678
4693
|
} catch (err) {
|
|
4679
4694
|
return `ERROR: Failed during image generation: ${err.message}`;
|
|
4680
4695
|
}
|
|
@@ -5730,10 +5745,13 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5730
5745
|
accumulatedContext = "";
|
|
5731
5746
|
}
|
|
5732
5747
|
}
|
|
5733
|
-
const contents = modifiedHistory.filter((msg) => (msg.role === "user" || msg.role === "agent" || msg.role === "system") && !String(msg.id).startsWith("welcome") && !msg.isMeta && !msg.isTerminalRecord && !(msg.text && msg.text.startsWith("[TERMINAL_RECORD]"))).map((msg) => {
|
|
5748
|
+
const contents = modifiedHistory.filter((msg) => (msg.role === "user" || msg.role === "agent" || msg.role === "system") && !String(msg.id).startsWith("welcome") && !msg.isMeta && !msg.isTerminalRecord && !(msg.text && msg.text.startsWith("[TERMINAL_RECORD]"))).map((msg, idx, arr) => {
|
|
5734
5749
|
const parts = [{ text: msg.text }];
|
|
5735
5750
|
if (msg.binaryPart) {
|
|
5736
|
-
|
|
5751
|
+
const physicalUserTurnsAfter = arr.slice(idx + 1).filter((m) => m.role === "user" && !m.text?.startsWith("[TOOL RESULT]")).length;
|
|
5752
|
+
if (physicalUserTurnsAfter <= 4) {
|
|
5753
|
+
parts.push(msg.binaryPart);
|
|
5754
|
+
}
|
|
5737
5755
|
}
|
|
5738
5756
|
return {
|
|
5739
5757
|
role: msg.role === "user" || msg.role === "system" ? "user" : "model",
|
|
@@ -5741,7 +5759,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5741
5759
|
};
|
|
5742
5760
|
});
|
|
5743
5761
|
if (!await checkQuota("agent", settings)) {
|
|
5744
|
-
throw new Error("Error:
|
|
5762
|
+
throw new Error("Error: Quota Exausted for Agent");
|
|
5745
5763
|
}
|
|
5746
5764
|
let targetModel = modelName;
|
|
5747
5765
|
if (retryCount === MAX_RETRIES - 1) {
|
|
@@ -5785,7 +5803,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5785
5803
|
{ category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
5786
5804
|
{ category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_NONE }
|
|
5787
5805
|
],
|
|
5788
|
-
thinkingConfig: { includeThoughts: false, thinkingLevel:
|
|
5806
|
+
thinkingConfig: { includeThoughts: false, thinkingLevel: ThinkingLevel.MINIMAL }
|
|
5807
|
+
// Optimized for Gemma 4.
|
|
5789
5808
|
}
|
|
5790
5809
|
});
|
|
5791
5810
|
if (addedMarker && contents[contents.length - 1]?.parts?.[0]) {
|
|
@@ -7135,19 +7154,31 @@ function App({ args = [] }) {
|
|
|
7135
7154
|
const [isTerminalFocused, setIsTerminalFocused] = useState10(false);
|
|
7136
7155
|
const [tick, setTick] = useState10(0);
|
|
7137
7156
|
useEffect7(() => {
|
|
7138
|
-
|
|
7157
|
+
const s = emojiSpace(2);
|
|
7158
|
+
if (apiTier === "Free") {
|
|
7159
|
+
setActiveModel("gemma-4-31b-it");
|
|
7160
|
+
setMessages((prev) => {
|
|
7161
|
+
setCompletedIndex(prev.length + 1);
|
|
7162
|
+
return [...prev, {
|
|
7163
|
+
id: "tier-switch-" + Date.now(),
|
|
7164
|
+
role: "system",
|
|
7165
|
+
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemma (Free default).`,
|
|
7166
|
+
isMeta: true
|
|
7167
|
+
}];
|
|
7168
|
+
});
|
|
7169
|
+
} else {
|
|
7139
7170
|
setActiveModel("gemini-3-flash-preview");
|
|
7140
7171
|
setMessages((prev) => {
|
|
7141
7172
|
setCompletedIndex(prev.length + 1);
|
|
7142
7173
|
return [...prev, {
|
|
7143
7174
|
id: "tier-switch-" + Date.now(),
|
|
7144
7175
|
role: "system",
|
|
7145
|
-
text: `\u26A0\uFE0F
|
|
7176
|
+
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemini 3 Flash Preview.`,
|
|
7146
7177
|
isMeta: true
|
|
7147
7178
|
}];
|
|
7148
7179
|
});
|
|
7149
7180
|
}
|
|
7150
|
-
}, [apiTier
|
|
7181
|
+
}, [apiTier]);
|
|
7151
7182
|
const terminalEnv = useMemo2(() => {
|
|
7152
7183
|
const isIDE = process.env.TERM_PROGRAM === "vscode" || !!process.env.VSC_TERMINAL_URL || !!process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS;
|
|
7153
7184
|
return {
|
|
@@ -7647,11 +7678,20 @@ function App({ args = [] }) {
|
|
|
7647
7678
|
{
|
|
7648
7679
|
cmd: "/model",
|
|
7649
7680
|
desc: "Switch AI model",
|
|
7650
|
-
subs: [
|
|
7651
|
-
{
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7681
|
+
subs: apiTier === "Free" ? [
|
|
7682
|
+
{
|
|
7683
|
+
cmd: "gemma-4-31b-it",
|
|
7684
|
+
desc: "Standard Default"
|
|
7685
|
+
}
|
|
7686
|
+
] : [
|
|
7687
|
+
{
|
|
7688
|
+
cmd: "gemini-3-flash-preview",
|
|
7689
|
+
desc: "Fast & Lightweight"
|
|
7690
|
+
},
|
|
7691
|
+
{
|
|
7692
|
+
cmd: "gemini-3.5-flash",
|
|
7693
|
+
desc: "Latest"
|
|
7694
|
+
}
|
|
7655
7695
|
]
|
|
7656
7696
|
},
|
|
7657
7697
|
{ cmd: "/settings", desc: "Configure system prefs" },
|
|
@@ -8297,21 +8337,11 @@ ${timestamp}` };
|
|
|
8297
8337
|
} else {
|
|
8298
8338
|
normalizedOutput = rawOutput.replace(/\r\n/g, "\n");
|
|
8299
8339
|
}
|
|
8300
|
-
const
|
|
8301
|
-
COMMAND: ${activeCommandRef.current}
|
|
8302
|
-
PTY: ${isActiveCommandPty}
|
|
8303
|
-
OUTPUT: ${
|
|
8304
|
-
|
|
8305
|
-
COMMAND: ${activeCommandRef.current}
|
|
8306
|
-
PTY: ${isActiveCommandPty}
|
|
8307
|
-
OUTPUT: ${normalizedOutput.replace(/\n{3,}/g, "\n\n")}`;
|
|
8308
|
-
return [...prev, {
|
|
8309
|
-
id: "term-" + Date.now(),
|
|
8310
|
-
role: "system",
|
|
8311
|
-
text: finalStatusRaw,
|
|
8312
|
-
fullText: finalStatusNormalized,
|
|
8313
|
-
isTerminalRecord: true
|
|
8314
|
-
}];
|
|
8340
|
+
const finalStatus = `[TERMINAL_RECORD]
|
|
8341
|
+
COMMAND: ${activeCommandRef.current}
|
|
8342
|
+
PTY: ${isActiveCommandPty}
|
|
8343
|
+
OUTPUT: ${normalizedOutput.replace(/\n{3,}/g, "\n\n")}`;
|
|
8344
|
+
return [...prev, { id: "term-" + Date.now(), role: "system", text: finalStatus, isTerminalRecord: true }];
|
|
8315
8345
|
});
|
|
8316
8346
|
setActiveCommand(null);
|
|
8317
8347
|
setIsTerminalFocused(false);
|