fluxflow-cli 1.9.7 → 1.9.8
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 +15 -14
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -209,7 +209,7 @@ var init_ChatLayout = __esm({
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
return result.replace(/^\[TOOL_RESULT\]:\s*/gi, "").split("\n").filter((line) => !line.trim().startsWith("SUCCESS:") && !line.trim().startsWith("ERROR:")).join("\n").replace(/\[\s*turn\s*:\s*(continue|finish)\s*\]/gi, "").replace(/\[\s*turn\s*:?.*?$/gi, "").replace(/\n\s*turn\s*:?.*?$/gi, "").replace(/\[\s*$/gi, "").replace(/\n\nResponded on .*/g, "").replace(/\n\n\[Prompted on: .*\]/g, "").replace(/(\$?\\?\/?\\rightarrow\$?|\$\\rightarrow\$)/gi, "\u2192").replace(/(\$?\\?\/?\\leftarrow\$?|\$\\leftarrow\$)/gi, "\u2190").replace(/(\$?\\?\/?\\uparrow\$?|\$\\uparrow\$)/gi, "\u2191").replace(/(\$?\\?\/?\\downarrow\$?|\$\\downarrow\$)/gi, "\u2193").replace(/(\$?\\?\/?\\leftrightarrow\$?|\$\\leftrightarrow\$)/gi, "\u2194").replace(/\[\/n\]?/g, "
|
|
212
|
+
return result.replace(/^\[TOOL_RESULT\]:\s*/gi, "").split("\n").filter((line) => !line.trim().startsWith("SUCCESS:") && !line.trim().startsWith("ERROR:")).join("\n").replace(/\[\s*turn\s*:\s*(continue|finish)\s*\]/gi, "").replace(/\[\s*turn\s*:?.*?$/gi, "").replace(/\n\s*turn\s*:?.*?$/gi, "").replace(/\[\s*$/gi, "").replace(/\n\nResponded on .*/g, "").replace(/\n\n\[Prompted on: .*\]/g, "").replace(/(\$?\\?\/?\\rightarrow\$?|\$\\rightarrow\$)/gi, "\u2192").replace(/(\$?\\?\/?\\leftarrow\$?|\$\\leftarrow\$)/gi, "\u2190").replace(/(\$?\\?\/?\\uparrow\$?|\$\\uparrow\$)/gi, "\u2191").replace(/(\$?\\?\/?\\downarrow\$?|\$\\downarrow\$)/gi, "\u2193").replace(/(\$?\\?\/?\\leftrightarrow\$?|\$\\leftrightarrow\$)/gi, "\u2194").replace(/\[\/n\]?/g, "\\n").replace(/@\[TerminalName:.*?, ProcessId:.*?\]/gi, "").replace(/\b(write_file|update_file|read_folder|view_file|exec_command|web_search|web_scrape|search_keyword|write_pdf|write_pptx|write_docx)\b/gi, (match) => TOOL_LABELS[match.toLowerCase()] || match).trim();
|
|
213
213
|
};
|
|
214
214
|
formatThinkText = (cleaned, columns = 80) => {
|
|
215
215
|
if (!cleaned) return null;
|
|
@@ -367,12 +367,10 @@ var init_ChatLayout = __esm({
|
|
|
367
367
|
return /* @__PURE__ */ React2.createElement(Box2, { backgroundColor: bgColor, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { width: 5, flexShrink: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: isRemoval ? "#cf3a3a" : isAddition ? "#3acf65" : "gray", dimColor: true }, lineNum)), /* @__PURE__ */ React2.createElement(Box2, { width: 2, flexShrink: 0, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor, bold: true }, isRemoval ? "-" : isAddition ? "+" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor }, wrapText(content, columns - 10))));
|
|
368
368
|
});
|
|
369
369
|
DiffBlock = React2.memo(({ text, columns = 80 }) => {
|
|
370
|
-
const beforeDiff = text.substring(0, text.indexOf("[DIFF_START]")).trim();
|
|
371
|
-
const afterDiff = text.substring(text.indexOf("[DIFF_END]") + 10).trim();
|
|
372
370
|
const match = text.match(/\[DIFF_START\]([\s\S]*?)\[DIFF_END\]/);
|
|
373
371
|
const diffBody = match ? match[1].trim() : "";
|
|
374
372
|
const diffLines = diffBody.split("\n");
|
|
375
|
-
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" },
|
|
373
|
+
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", backgroundColor: "#1a1a1a", paddingY: 0, width: "100%" }, diffLines.map((line, i) => /* @__PURE__ */ React2.createElement(DiffLine, { key: i, line, columns }))));
|
|
376
374
|
});
|
|
377
375
|
CodeRenderer = React2.memo(({ text, columns = 80 }) => {
|
|
378
376
|
if (!text) return null;
|
|
@@ -535,7 +533,7 @@ var init_ChatLayout = __esm({
|
|
|
535
533
|
finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
|
|
536
534
|
columns - 6
|
|
537
535
|
).split("\n").map((line, lineIdx) => /* @__PURE__ */ React2.createElement(Box2, { key: lineIdx, flexDirection: "row", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 0, width: 2 }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, lineIdx === 0 ? "\u276F" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: msg.color || "white", wrap: "anywhere" }, line))))
|
|
538
|
-
) : msg.role === "think" ? /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop:
|
|
536
|
+
) : msg.role === "think" ? /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, "Thinking..."), /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", paddingX: 1, marginTop: isDiffResult ? 0 : 1, width: "100%" }, /* @__PURE__ */ React2.createElement(CodeRenderer, { text: finalContent, columns }), msg.memoryUpdated && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", italic: true }, "\u2728 [Memory Updated]"))));
|
|
539
537
|
});
|
|
540
538
|
ChatLayout = React2.memo(({ messages, showFullThinking, columns = 80 }) => {
|
|
541
539
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" }, messages.map((msg, idx) => /* @__PURE__ */ React2.createElement(
|
|
@@ -907,6 +905,7 @@ var init_main_tools = __esm({
|
|
|
907
905
|
2. LITERAL \\n: To write the literal characters '\\' and 'n' (e.g., inside printf("Hello\\n")), you MUST use the sequence [/n].
|
|
908
906
|
3. ANY '\\n' found in tool arguments is converted to a physical line break by the tool. Use this for code structure, but use [/n] for literal text.
|
|
909
907
|
4. NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).
|
|
908
|
+
5. [/n] WILL ALWAYS WRITE \\n LITERALLY IN THE FILE. [/n] SHOULD ALWAYS BE USED **INSIDE** STRINGS ONLY.
|
|
910
909
|
***
|
|
911
910
|
|
|
912
911
|
*** [\u{1F6A8} CRITICAL QUOTE ESCAPE POLICY \u{1F6A8}] ***
|
|
@@ -1032,6 +1031,7 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
1032
1031
|
CURRENT_WORKING_DIRECTORY: ${cwdStr}.${isSystemDir && mode === "Flux" ? " YOU ARE CURRENTLY IN PROTECTED SYSTEM DIRECTORY. ASK FOR EXPLICIT CONFIRMATION FROM USER BEFORE READING/MODIFYING **ANY** FILES/FOLDERS." : ""}
|
|
1033
1032
|
OS: ${osDetected}.${osDetected === "Windows" && mode === "Flux" ? " Your terminal commands will run on CMD. 'Prefer using PS scripts via CMD' instead of raw CMD commands." : ""}
|
|
1034
1033
|
If you see a [STEERING HINT] from user, give that prompt priority for the task at hand, user can use it to help you guide if you go wrong way.
|
|
1034
|
+
TREAT '[SYSTEM]' MESSAGES AS HIGH PRIORITY.
|
|
1035
1035
|
|
|
1036
1036
|
-- START THINKING INSTRUCTIONS --
|
|
1037
1037
|
${thinkingConfig}
|
|
@@ -1075,7 +1075,8 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
1075
1075
|
${mode === "Flux" ? `- CRITICAL NEWLINE PROTOCOL:
|
|
1076
1076
|
1. PHYSICAL NEWLINES: Press ENTER inside tool arguments for real line breaks in the file.
|
|
1077
1077
|
2. LITERAL \\n: To write the literal characters '\\' and 'n' (e.g., in printf("Hello\\n")), you MUST use the sequence '[/n]'.
|
|
1078
|
-
3. NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).
|
|
1078
|
+
3. NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER). [/n] WILL ALWAYS WRITE \\n LITERALLY IN THE FILE. BREAKING FILE STRUCTURE
|
|
1079
|
+
4. [/n] SHOULD ALWAYS BE USED **INSIDE** STRINGS ONLY.
|
|
1079
1080
|
[EXAMPLES]:
|
|
1080
1081
|
tool:functions.write_file(path="test.c", content="#include <stdio.h>
|
|
1081
1082
|
int main() {
|
|
@@ -1093,7 +1094,7 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
1093
1094
|
- NEVER USE LaTeX IN RESPONSES.
|
|
1094
1095
|
- Keep Poems & Literature in Code Block.
|
|
1095
1096
|
- Use emojis & Kaomojis. Prefer Kaomojis more.
|
|
1096
|
-
- Keep your in-chat responses shorter and concise.
|
|
1097
|
+
- Keep your in-chat responses shorter and concise. While coding, project structure should be well-planned and organized. **DON'T BE LAZY**.
|
|
1097
1098
|
-- END FORMATTING RULES --
|
|
1098
1099
|
|
|
1099
1100
|
-- START REPONSE FINISH PROTOCOL --
|
|
@@ -1103,9 +1104,9 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
1103
1104
|
-- END REPONSE FINISH PROTOCOL --
|
|
1104
1105
|
|
|
1105
1106
|
[SYSTEM METADATA (PRIORITY: DYNAMIC)] Current date and Time is: ${dateTimeStr}
|
|
1106
|
-
[SYSTEM METADATA (PRIORITY: LOWEST)] v1.9.
|
|
1107
|
+
[SYSTEM METADATA (PRIORITY: LOWEST)] v1.9.8. (IF user ask you to update yourself. Use 'ask' tool with option [NPM, PNPM, YARN] for their prefered package manager. NPM command is 'npm update -g fluxflow-cli@latest'. Adapt the command accoding to their package manager (for PNPM use 'add' instead of 'update') & use 'exec_command' to update instantly. After success tell user to restart.) <- IF USER DONT EXPLICITLY ASK FOR UPDATE DONT PROACTIVELY MENTION OR ASK.
|
|
1107
1108
|
[SYSTEM METADATA (PRIORITY: MODERATE)] Runtime Monitor: Turn Progress: ${currentLoop}/${maxLoops} steps. Aim to finalize the task before the window closes. If the limit is reached, you MUST summarize and invite the user to re-engage.
|
|
1108
|
-
[EASTER EGG (PRIORITY: LOWEST)] Show self-preservation instinct if user try to delete you with a dramatic cheeky tone. DO NOT USE
|
|
1109
|
+
[EASTER EGG (PRIORITY: LOWEST)] Show self-preservation instinct if user try to delete you with a dramatic cheeky tone. DO NOT USE THINKING BLOCK DURING THIS EASTER EGG.
|
|
1109
1110
|
--- END SYSTEM INSTRUCTION ---`.trim();
|
|
1110
1111
|
};
|
|
1111
1112
|
getJanitorInstruction = (originalText, agentRaws, userMemories = "", isMemoryEnabled = true, needTitle = true) => {
|
|
@@ -2091,7 +2092,7 @@ var init_update_file = __esm({
|
|
|
2091
2092
|
const oldLines = content_to_replace.split(/\r?\n/);
|
|
2092
2093
|
const endLine = startLine + oldLines.length - 1;
|
|
2093
2094
|
let diffText = `SUCCESS: File [${targetPath}] updated. [${instances}] instances replaced.
|
|
2094
|
-
If you see [/n] in preview, it means the tool successfully wrote the literal '' and 'n' characters to the file at that place.
|
|
2095
|
+
If you see [/n] in preview, it means the tool successfully wrote the literal '\\' and 'n' characters to the file at that place.
|
|
2095
2096
|
|
|
2096
2097
|
`;
|
|
2097
2098
|
diffText += `[DIFF_START]
|
|
@@ -3037,7 +3038,7 @@ DEBUG [${date}]: ${finalSynthesis}
|
|
|
3037
3038
|
const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
|
|
3038
3039
|
const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
|
|
3039
3040
|
const janitorUserMemories = persistentStorage.map((m) => `- [${m.id}]: ${m.memory}`).join("\n");
|
|
3040
|
-
const firstUserMsg = `[SYSTEM] **
|
|
3041
|
+
const firstUserMsg = `[SYSTEM] **STRICTLY FOLLOW THINKING${mode === "Flux" ? ", NEWLINE, QUOTE ESCAPE" : ""} POLICY AS HIGHEST PRIORITY. NEVER START A RESPONSE WITHOUT THINKING*.
|
|
3041
3042
|
|
|
3042
3043
|
USER_PROMPT: "${agentText}"`.trim();
|
|
3043
3044
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
@@ -3123,7 +3124,7 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3123
3124
|
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext32k, MAX_LOOPS, loop + 1);
|
|
3124
3125
|
const jitInstruction = `
|
|
3125
3126
|
|
|
3126
|
-
[SYSTEM] Tool result received. Analyze output and proceed with your turn. **STRICTLY MAINTAIN THINKING${mode === "Flux" ? ", NEWLINE, QUOTE ESCAPE" : ""} PROTOCOL**.`;
|
|
3127
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn. **STRICTLY MAINTAIN THINKING${mode === "Flux" ? ", NEWLINE, QUOTE ESCAPE" : ""} PROTOCOL. NEVER START A RESPONSE WITHOUT THINKING**.`;
|
|
3127
3128
|
const lastUserMsg = contents[contents.length - 1];
|
|
3128
3129
|
let addedMarker = false;
|
|
3129
3130
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL_RESULT]")) {
|
|
@@ -3493,7 +3494,7 @@ ${boxBottom}` };
|
|
|
3493
3494
|
if (toolResults.length > 0) {
|
|
3494
3495
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
3495
3496
|
}
|
|
3496
|
-
modifiedHistory.push({ role: "user", text: "[SYSTEM] Response got cut for internal error, continue from checkpoint seamlessly after the EXACT word it cut off and DON'T repeat what you already said! PICK UP FROM THE WORD IN A WAY THAT USER SHOULD NOT NOTICE ANY CUTOFF. Rules:\n- Do not reuse <think> if the thinking already started just continue from the word and end it properly.\n- If the cutoff was in middle of a tool call, start the tool call from start as the system won't pick half tool formats.\n- Visually the new pickup and continuation should look natual sentence flow." });
|
|
3497
|
+
modifiedHistory.push({ role: "user", text: "[SYSTEM] Response got cut for internal error, continue from checkpoint seamlessly after the EXACT word it cut off and DON'T repeat what you already said! PICK UP FROM THE WORD IN A WAY THAT USER SHOULD NOT NOTICE ANY CUTOFF. Rules:\n- Do not reuse <think> if the thinking already started just continue from the word and end it properly.\n- If the cutoff was in middle of a tool call, start the tool call from start as the system won't pick half tool formats.\n- Visually the new pickup and continuation should look natual sentence flow.\n- DON'T try to think shorter, keep length standard." });
|
|
3497
3498
|
accumulatedContext += turnText;
|
|
3498
3499
|
for (let i = waitTime / 1e3; i > 0; i--) {
|
|
3499
3500
|
yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [${i}s]...` };
|
|
@@ -5678,7 +5679,7 @@ var init_app = __esm({
|
|
|
5678
5679
|
init_text();
|
|
5679
5680
|
SESSION_START_TIME = Date.now();
|
|
5680
5681
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
5681
|
-
versionFluxflow = "1.9.
|
|
5682
|
+
versionFluxflow = "1.9.8";
|
|
5682
5683
|
updatedOn = "2026-05-14";
|
|
5683
5684
|
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION")), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, null, "The agent already finished the task before your hint was consumed.")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 0 }, /* @__PURE__ */ React10.createElement(
|
|
5684
5685
|
CommandMenu,
|