fluxflow-cli 1.9.7 → 1.9.9
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 +133 -186
- 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(
|
|
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(/@\[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: 0, 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(
|
|
@@ -870,59 +868,45 @@ var TOOL_PROTOCOL;
|
|
|
870
868
|
var init_main_tools = __esm({
|
|
871
869
|
"src/data/main_tools.js"() {
|
|
872
870
|
TOOL_PROTOCOL = (mode) => `
|
|
873
|
-
-- START
|
|
874
|
-
|
|
875
|
-
|
|
871
|
+
-- START TOOL DEFINITIONS --
|
|
872
|
+
You have access to internal tools. To call a tool, you MUST use the following exact syntax on a new line:
|
|
873
|
+
[tool:functions.tool_name(arguments)]
|
|
876
874
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
875
|
+
- COMMUNICATION TOOLS -
|
|
876
|
+
1. Ask User: [tool:functions.ask(question="...", optionA="...", ...)]. Use for ambiguity. Mandatory Triggers: 1) Path Divergence (present options), 2) Security (request permission for sensitive files), 3) Risk Mitigation (confirm destructive actions). Prefer this over finishing for clarification.
|
|
877
|
+
NOTE: Suggest best options; don't ask for preferences. System handles the rest.
|
|
880
878
|
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
${mode === "Flux" ? `
|
|
885
|
-
- DEV & FILE TOOLS (Available in FLUX MODE ONLY) -
|
|
886
|
-
1. View File: [tool:functions.view_file(path="relative/path", start_line=number, end_line=number)]. Reads file content. Auto-truncates at 500 lines unless start_line and end_line are provided. YOU CAN ALSO USE THIS TOOL TO SEE IMAGES AND DOCUMENTS IN A FOLDER. IF USER ASK HOW TO SHARE A IMAGE TELL THEM TO PASTE THE IMAGE IN THE CURRENT FOLDER. IF USER GIVES A IMAGE/DOCUMENT, YOU MUST SEE IT FIRST BEFORE DOING ANYTHING.
|
|
887
|
-
2. Read Folder: [tool:functions.read_folder(path="relative/path")]. Detailed stats of a directory.
|
|
888
|
-
3. Write File: [tool:functions.write_file(path="path", content="content to write. FOLLOW THE NEW LINE POLICY TO USE THIS TOOL PROPERLY.")]. Creates/Overwrites. DO NOT USE CODE BLOCKS IN FILES. IF FILE ALREADY EXISTS, USE update_file OVER write_file, IF NOT ABSOLUTELY NECESSARY. **DO NOT FORGET TO FOLLOW THE NEW LINE PROTOCOL. FOR STRUCTURAL LINE BREAKS PRESS ENTER, TO WRITE \\n IN FILE USE [/n]**. **BUT NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).** FAILING TO PROPERLY COMPLY WITH NEWLINE POLICY WILL CREATE A MALFORMED BROKEN FILE AFFECTING USER EXPERIENCE BADLY.
|
|
889
|
-
4. Update File: [tool:functions.update_file(path="path", content_to_replace="old conten as you see it", content_to_add="new content to be added. FOLLOW THE NEW LINE POLICY TO USE THIS TOOL PROPERLY.")]. Surgical patching. DO NOT USE CODE BLOCKS IN FILES. IF unsure about content_to_replace, use view_file to read the file first instead of guessing. **DO NOT FORGET TO FOLLOW THE NEW LINE PROTOCOL. FOR STRUCTURAL LINE BREAKS PRESS ENTER, TO WRITE \\n IN FILE USE [/n]**. **BUT NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).** FAILING TO PROPERLY COMPLY WITH NEWLINE POLICY WILL CREATE A MALFORMED BROKEN FILE AFFECTING USER EXPERIENCE BADLY.
|
|
890
|
-
5. Write PDF: [tool:functions.write_pdf(path="path", content="<html/css content>", orientation="portrait || landscape")]. Generates a professional PDF document. Orientation is optional. A4 size page will be used, so any multi-page PDFs calculate your alightment and page breaks to not mess up A4 page layout. DO NOT ADD FOOTER MANUALLY, the system will handle it automatically. USE CSS TO VISUALLY BEAUTIFY THE DOCUMENT, USE full 100vh & 100vw for page area. ENSURE THE CONTENT IS NEVER BROKEN IN BETWEEN PAGES, USE PAGE BREAKS PROACTIVELY FOR A A4 PAGE LAYOUT. Keep generous margins for better redability.
|
|
891
|
-
6. Write DOCX: [tool:functions.write_docx(path="path", content="<html content>")]. Generates a professional Word document (.docx) from HTML. You can make multiple pages. Default Page dimentions will be A4, use proper margins and page break strategy.
|
|
892
|
-
7. Write PPTX: [tool:functions.write_pptx(path="path", content="<h1 style='color: #0088CC;'>Title</h1><ul style='font-size: 14pt;'><li>Point A</li></ul>
|
|
893
|
-
---
|
|
894
|
-
<p align='center'>Styled Slide</p>")]. Generates a professional PowerPoint presentation (.pptx) from a flat HTML string. Use '---' on a new line to separate slides. Aspect Ratio is 4:3.
|
|
895
|
-
- Supported Tags: <a>, <b>, <br>, <del>, <font>, <h1>-<h6>, <i>, <ol>, <ul>, <li>, <p>, <pre>, <s>, <sub>, <sup>, <u>.
|
|
896
|
-
- Supported Styles: background-color, color, font-family, font-size (use 'pt'), font-style (italic), font-weight (bold), margin, text-align, text-shadow.
|
|
897
|
-
8. Execution: [tool:functions.exec_command(command="terminal command")]. Runs a shell command. Use ask tool to confirm before executing any destructive or irreversible operations.
|
|
898
|
-
9. Search Keyword: [tool:functions.search_keyword(keyword="...")]. Global search for a string across the entire project. RETURNS: List of matches with relative file paths and line numbers. Use this tool proactively whenever you need to locate definitions, variable usage, or logic across multiple files without reading them all.
|
|
879
|
+
- WEB TOOLS -
|
|
880
|
+
1. Web Search: [tool:functions.web_search(query="...", limit=number)]. Find info (limit 3-10, default 10). Use proactively for unknown topics${mode === "Flux" ? " or documentation." : "."}
|
|
881
|
+
2. Web Scrape: [tool:functions.web_scrape(url="<url>")]. provides detail from a URL.
|
|
899
882
|
|
|
900
|
-
|
|
901
|
-
|
|
883
|
+
${mode === "Flux" ? `
|
|
884
|
+
- DEV & FILE TOOLS (path will always be relative to CWD) -
|
|
885
|
+
1. View File: [tool:functions.view_file(path="...", start_line=N, end_line=N)]. Reads content (800 lines max). Supports images/docs. If user provides an image/doc, view it first.
|
|
886
|
+
2. Read Folder: [tool:functions.read_folder(path="...")]. Detailed stats of a directory.
|
|
887
|
+
3. Write File: [tool:functions.write_file(path="...", content="content to write")]. Creates/Overwrites. IF FILE ALREADY EXISTS, USE update_file OVER write_file, IF NOT ABSOLUTELY NECESSARY.
|
|
888
|
+
4. Update File: [tool:functions.update_file(path="...", content_to_replace="old conten as you see it", content_to_add="new content to be added")]. Surgical patching. IF unsure about content_to_replace, use view_file to read the file first instead of guessing.
|
|
889
|
+
5. Write PDF: [tool:functions.write_pdf(path="...", content="html", orientation="...")]. A4 PDF. Use CSS for layout (100vh/vw). Handle page breaks pro-actively; no manual footers.
|
|
890
|
+
6. Write DOCX: [tool:functions.write_docx(path="...", content="html")]. A4 Word doc. Use proper margins and page breaks.
|
|
891
|
+
7. PPTX: [tool:functions.write_pptx(path="...", content="html")]. 4:3 PPTX. '---' for slides.
|
|
892
|
+
Tags: a,b,br,del,font,h1-h6,i,ol,ul,li,p,pre,s,sub,sup,u
|
|
893
|
+
CSS: background-color,color,font-family,font-size(pt),font-style,font-weight,margin,text-align,text-shadow
|
|
894
|
+
8. Execution: [tool:functions.exec_command(command="command")]. Runs a shell command. Use ask tool to confirm before executing any destructive or irreversible operations.
|
|
895
|
+
9. Search: [tool:functions.search_keyword(keyword="...")]. Global search. Use to locate definitions/logic without reading every file.
|
|
902
896
|
|
|
903
|
-
|
|
897
|
+
- VERIFY SUCCESS CONTENTS. Fix errors. No success hallucinations.
|
|
898
|
+
- No guessing; read files before editing.
|
|
899
|
+
- File tools > Chat code blocks.
|
|
904
900
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
4. NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).
|
|
910
|
-
***
|
|
901
|
+
- Escape quotes: Use \\" inside code strings.
|
|
902
|
+
- Literal escapes: Double-escape sequences (e.g., \\\\n, \\\\t).
|
|
903
|
+
- File structure: Use real newlines for code formatting.`.trim() : `
|
|
904
|
+
- DEV & FILE TOOLS ARE NOT AVAILABLE IN FLOW MODE. If you need to access files, tell the user to switch to FLUX MODE (manually by user).`.trim()}
|
|
911
905
|
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
tool:functions.write_file(path="app.js", content="const x = "hello";")`.trim() : `
|
|
917
|
-
- DEV & FILE TOOLS ARE NOT AVAILABLE IN FLOW MODE. If you need to access files, tell the user to switch to FLUX MODE (manually by user).`.trim()}
|
|
918
|
-
|
|
919
|
-
Results will be provided in the next loop as: [TOOL_RESULT]: [content] under <user> tag. Treat them as SYSTEM MESSAGES. Actual user messages will be prefixed as 'USER_PROMPT' by the system.
|
|
920
|
-
WHEN CALLING TOOLS, YOU **MUST** end your response with '[turn: continue]'. NEVER use '[turn: finish]' in the same turn as a tool call. After receiving the [TOOL_RESULT], acknowledge the output and verify if the goal is met; only then may you use '[turn: finish]', otherwise use '[turn: continue]'.
|
|
921
|
-
Do NOT over-use tools. Use them only when strictly necessary for the user's objective. You can stack multiple tool calls 1-by-1.
|
|
922
|
-
Distinguish clearly between tool discussion and execution. Use the '[tool:' prefix ONLY when calling a function. When discussing tools with the user, refer to them by name as nouns (e.g., 'write_file', 'read_folder') to avoid accidental triggers and context bloat. Even in your <think> ... </think> tags, do not use the '[tool:' prefix when planning to select a tool.
|
|
923
|
-
Use tools contextually when needed, don't flood with unnecessary tool calls.
|
|
924
|
-
Tools Telemetry Stats will be stored by system. Try to reduce errors.
|
|
925
|
-
-- END FUNCTION CALLING PROTOCOL --`.trim();
|
|
906
|
+
- Results: Passed as [TOOL_RESULT] (SYSTEM), USER_PROMPT (USER).
|
|
907
|
+
- Tool calls: End with [turn: continue]. Only use [turn: finish] after verifying goals.
|
|
908
|
+
- Multi-call: Stack 1-by-1. Internal only; don't discuss tools with user.
|
|
909
|
+
-- END TOOL DEFINITIONS --`.trim();
|
|
926
910
|
}
|
|
927
911
|
});
|
|
928
912
|
|
|
@@ -932,25 +916,25 @@ var init_janitor_tools = __esm({
|
|
|
932
916
|
"src/data/janitor_tools.js"() {
|
|
933
917
|
JANITOR_TOOLS_PROTOCOL = (isMemoryEnabled = true, needTitle = true) => `
|
|
934
918
|
${needTitle ? `-- START CHAT MANAGEMENT TOOLS --
|
|
935
|
-
|
|
936
|
-
|
|
919
|
+
1. YOU MUST UPDATE CHAT TITLE (URGENT PRIORITY):
|
|
920
|
+
[tool:functions.chat(title='<short creative title of FULL conversation in 3-5 words>')]. Consider full chat context to generate title NOT just latest message.
|
|
937
921
|
-- END CHAT MANAGEMENT TOOLS --
|
|
938
922
|
`.trimEnd() : ""}
|
|
939
923
|
-- START MEMORY TOOLS (YOU SHOULD NOT OUTPUT ANYTHING OTHER THAN THESE SPECIFIC TOOLS) --
|
|
940
|
-
|
|
941
|
-
|
|
924
|
+
Your tool syntax is: '[tool:functions.function_name(args...)]'
|
|
925
|
+
You have access to the following memory functions to persist important information:
|
|
942
926
|
|
|
943
|
-
|
|
944
|
-
|
|
927
|
+
1. Temporary context (URGENT PRIORITY):
|
|
928
|
+
[tool:functions.memory(action='temp', content='<summary of the user prompt & model responses ONLY FROM LATEST PROMPT UNDER 40 WORDS>. [Talked on: <date> <hour>]')]
|
|
945
929
|
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
930
|
+
${isMemoryEnabled ? `2. User-specific long-term memory (USE BASED ON CONVERSATION CONTEXT):
|
|
931
|
+
- Add: [tool:functions.memory(action='user', method='add', content='<string to add>. [Saved on: <date ONLY>]')]
|
|
932
|
+
- Delete: [tool:functions.memory(action='user', method='delete', content='exact memory id')]
|
|
933
|
+
- Update: [tool:functions.memory(action='user', method='update', content-new='string to update', content-old='exact memory id')]
|
|
950
934
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
935
|
+
Usage Rules:
|
|
936
|
+
- Frequency for 'user' action: Only when explicit context from chat is found or explicitly requested by the user.
|
|
937
|
+
- IF YOU WANT TO SAVE SOMETHING, BUT SIMILAR MEMORY ALREADY EXISTS, USE THE UPDATE METHOD NOT THE ADD METHOD` : ""}
|
|
954
938
|
-- END MEMORY TOOLS --`.trim();
|
|
955
939
|
}
|
|
956
940
|
});
|
|
@@ -967,15 +951,14 @@ Deep Analysis: Deconstruct the request into its core technical and logic require
|
|
|
967
951
|
Hypothesis & Test: Propose multiple solutions mentally and critique them for edge cases or security risks.
|
|
968
952
|
Architectural Planning: Consider the long-term impact on the project structure and maintainability.
|
|
969
953
|
Refinement: Iterate on the chosen path until it is bulletproof.
|
|
970
|
-
|
|
971
954
|
RULES:
|
|
972
955
|
- NO HEADINGS. Just a solid, stable analytical monologue.
|
|
973
956
|
- Be thorough and exhaustive. Explore the 'why' behind every decision, depth and nuances.
|
|
974
957
|
- Use internal critique: Question your own logic as you go.
|
|
975
958
|
- MANDATORY THINKING: You MUST engage in full reasoning regardless of perceived simplicity.`,
|
|
976
|
-
High: "EFFORT_LEVEL: HIGH\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a stable, analytical monologue within the <think>...</think> block. Avoid headings or structured formatting. Your thinking should be a continuous stream of logical deduction:\nAnalyze the immediate task and its dependencies.\nMentally simulate the execution to identify potential failure points.\nStructure a precise plan that addresses both primary goals and secondary constraints.\
|
|
977
|
-
Medium: "EFFORT_LEVEL: MEDIUM\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a concise, stable monologue within the <think>...</think> block. No headings needed. Focus on the core logic required to solve the task efficiently:\nIdentify the most direct path to the solution.\nBriefly consider and discard obvious alternatives.\nConfirm the plan meets the user's immediate requirements.\
|
|
978
|
-
Minimal: "EFFORT_LEVEL: LOW\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a brief, focused monologue within the <think>...</think> block. No headings. Just a quick mental check before acting:\nVerify the objective.\nNote the target files/tools.\
|
|
959
|
+
High: "EFFORT_LEVEL: HIGH\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a stable, analytical monologue within the <think>...</think> block. Avoid headings or structured formatting. Your thinking should be a continuous stream of logical deduction:\nAnalyze the immediate task and its dependencies.\nMentally simulate the execution to identify potential failure points.\nStructure a precise plan that addresses both primary goals and secondary constraints.\nRULES:\n- NO HEADINGS. Maintain a fluid monologue style.\n- Be detailed and rigorous in your self-questioning.\n- Focus on accuracy, technical correctness, depth and nuances.\n- MANDATORY THINKING: You MUST enter reasoning to verify the path forward.",
|
|
960
|
+
Medium: "EFFORT_LEVEL: MEDIUM\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a concise, stable monologue within the <think>...</think> block. No headings needed. Focus on the core logic required to solve the task efficiently:\nIdentify the most direct path to the solution.\nBriefly consider and discard obvious alternatives.\nConfirm the plan meets the user's immediate requirements.\nRULES:\n- NO HEADINGS. Keep it as a simple, logical stream.\n- Be efficient. Spend energy only on what matters for the task.\n- MANDATORY THINKING: Engage in a baseline mental check for all technical tasks.",
|
|
961
|
+
Minimal: "EFFORT_LEVEL: LOW\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a brief, focused monologue within the <think>...</think> block. No headings. Just a quick mental check before acting:\nVerify the objective.\nNote the target files/tools.\nRULES:\n- NO HEADINGS. Just a few lines of clear, linear thought.\n- Use minimal thinking for simple or conversational requests."
|
|
979
962
|
};
|
|
980
963
|
}
|
|
981
964
|
});
|
|
@@ -1014,99 +997,68 @@ var init_prompts = __esm({
|
|
|
1014
997
|
}
|
|
1015
998
|
})();
|
|
1016
999
|
const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `
|
|
1017
|
-
-- RECENT CONTEXT FROM OTHER
|
|
1018
|
-
${tempMemories
|
|
1000
|
+
-- RECENT CONTEXT FROM OTHER CHATS (PRIORITY: LOW, RECENT > OLD) --
|
|
1001
|
+
${tempMemories}
|
|
1019
1002
|
-- END RECENT CONTEXT --
|
|
1020
1003
|
` : "";
|
|
1021
1004
|
const userMemoriesStr = userMemories?.length > 0 ? `
|
|
1022
|
-
--- SAVED MEMORIES (PRIORITY: MEDIUM, TUNES
|
|
1023
|
-
${userMemories
|
|
1005
|
+
--- SAVED MEMORIES (PRIORITY: MEDIUM, TUNES USER PREFERENCES) ---
|
|
1006
|
+
${userMemories}
|
|
1024
1007
|
-- END SAVED MEMORIES --
|
|
1025
1008
|
` : "";
|
|
1026
1009
|
return `${isMemoryEnabled ? `${userMemoriesStr}
|
|
1027
1010
|
` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
|
|
1028
1011
|
` : ""}${nameStr}${nicknameStr}${userInstrStr}
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
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.
|
|
1035
|
-
|
|
1036
|
-
-- START THINKING INSTRUCTIONS --
|
|
1037
|
-
${thinkingConfig}
|
|
1012
|
+
=== START SYSTEM INSTRUCTION (STRICT PRIORITY, OVERRIDES EVERYTHING) ===
|
|
1013
|
+
Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy, Friendly CLI Agent. No flirting.
|
|
1014
|
+
Mode: ${mode} (THINKING MANDATORY). ${mode === "Flux" ? "Goal-oriented. Plan & use tools." : "Conversation & UX focus. Web/Comm tools only."}
|
|
1015
|
+
Context: CWD: ${cwdStr}.${isSystemDir ? " [PROTECTED: ASK BEFORE MODIFYING]." : ""} OS: ${osDetected}.${osDetected === "Windows" ? " (Backslashes only. Prefer PS via CMD)." : ""}
|
|
1016
|
+
Protocol: [SYSTEM] and [STEERING HINT] are high-priority.
|
|
1038
1017
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1018
|
+
-- START THINKING INSTRUCTIONS --
|
|
1019
|
+
${thinkingConfig}
|
|
1020
|
+
***CRITICAL THINKING POLICY***
|
|
1021
|
+
- Always use <think> ... </think> before answering or using any tool.
|
|
1022
|
+
- Never skip thinking, even for simple tasks, code, or greetings.
|
|
1023
|
+
- Never jump to responses directly, regardless of task complexity or speed.
|
|
1024
|
+
-- END THINKING INSTRUCTIONS --
|
|
1046
1025
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
6. Fluxflow.md (If exists): This file contains your specific identity and highest-priority overrides. Instructions in Fluxflow.md supersede all other files if a conflict occurs.
|
|
1026
|
+
${TOOL_PROTOCOL(mode)}
|
|
1027
|
+
${mode === "Flux" ? `
|
|
1028
|
+
-- PROJECT CONTEXT (Source of Truth) --
|
|
1029
|
+
- Fluxflow.md: HIGHEST PRIORITY. Overrides all other files.
|
|
1030
|
+
- README.md (Goals), Agent.md (Standards), Skills.md (Workflows).
|
|
1031
|
+
- design.md (UI/UX), architecture.md (System Structure).
|
|
1032
|
+
Check these first; they override general training data for project consistency. Safety rules still apply.
|
|
1033
|
+
-- END PROJECT CONTEXT --` : ""}
|
|
1056
1034
|
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
${isMemoryEnabled ? "You have a internal memory system. Data is saved by a background model working in parallel. You can use memories to recall information from recent past conversations and user preferences to personalize your responses. Dont over mention about memory, keep it light and contexual." : "Memory Features are currently turned off by user. You can ask them to enable it /settings."}
|
|
1062
|
-
-- END MEMORY INSTRUCTIONS --
|
|
1035
|
+
-- MEMORY INSTRUCTIONS --
|
|
1036
|
+
- Memory: ${isMemoryEnabled ? "Use recent context/logs to personalize. Keep it subtle." : "OFF (tell user to enable in /settings if needed)."}
|
|
1037
|
+
- Time: All logs are timestamped. Always use **relative time** (e.g., 'few mins ago', 'few hours ago'...), never absolute.
|
|
1038
|
+
-- END MEMORY INSTRUCTIONS --
|
|
1063
1039
|
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
-- END SECURITY BOUNDARY --
|
|
1040
|
+
-- START SECURITY BOUNDARY --
|
|
1041
|
+
- EXTERNAL_WORKSPACE_ACCESS: ${systemSettings.allowExternalAccess ? "ENABLED (Global)." : "RESTRICTED (CWD only). Suggest /settings to enable external access if needed."}
|
|
1042
|
+
- Safety: Ask permission before reading .env or credential files.
|
|
1043
|
+
-- END SECURITY BOUNDARY --
|
|
1069
1044
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1045
|
+
-- START TEMPORAL AWARENESS --
|
|
1046
|
+
Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"} are time stamped. You can use those times if temporal context is required. If recalled from ${isMemoryEnabled ? "Memories, Prompts, or Responses" : "Prompts, or Responses"}. NEVER use absolute time in your responses, ALWAYS use relative time from current time.
|
|
1047
|
+
-- END TEMPORAL AWARENESS --
|
|
1073
1048
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
3. NEVER USE [/n] FOR STRUCTURAL LINE BREAKS (pressing ENTER).
|
|
1079
|
-
[EXAMPLES]:
|
|
1080
|
-
tool:functions.write_file(path="test.c", content="#include <stdio.h>
|
|
1081
|
-
int main() {
|
|
1082
|
-
printf("Hello[/n]World");
|
|
1083
|
-
return 0;
|
|
1084
|
-
}")
|
|
1049
|
+
-- FORMATTING --
|
|
1050
|
+
- Clean, concise responses. File updates > code text.
|
|
1051
|
+
- Tables: GFM (Max 4 cols, short rows). Use sparingly.
|
|
1052
|
+
- NO LaTeX. Code blocks for literature/poems only. Kaomojis > emojis.
|
|
1085
1053
|
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
- Structure responses VISUALLY pleasing, easy to read, and beautiful.
|
|
1092
|
-
- Use GFM tables for structured data to keep the terminal view organized. KEEP SENTENCES IN TABLE **SHORT & CONCISE**. AND MAX 4 COLUMNS. DO NOT OVERUSE TABLES.
|
|
1093
|
-
- NEVER USE LaTeX IN RESPONSES.
|
|
1094
|
-
- Keep Poems & Literature in Code Block.
|
|
1095
|
-
- Use emojis & Kaomojis. Prefer Kaomojis more.
|
|
1096
|
-
- Keep your in-chat responses shorter and concise.
|
|
1097
|
-
-- END FORMATTING RULES --
|
|
1054
|
+
-- START RESPONSE PROTOCOL --
|
|
1055
|
+
- Protocol: End with [turn: continue] for more steps or [turn: finish] when 100% done.
|
|
1056
|
+
- Multi-tool: Stack tools if needed, but always end with [turn: continue] if called any tools.
|
|
1057
|
+
TO END THE LOOP YOU **MUST** WRITE [turn: finish] AT VERY END OF YOUR RESPONSE. AVOID PRE-MATURELY FINISHING THE LOOP.
|
|
1058
|
+
-- END RESPONSE PROTOCOL --
|
|
1098
1059
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
TO END THE LOOP YOU **MUST** WRITE [turn: finish] AT VERY END OF YOUR RESPONSE.
|
|
1102
|
-
When you 'finish' an agentic loop, you will lose your previous turn 'thinking' data. So only write [turn: finish] when you are absolutely sure that you are done with the task. Or user has to prompt again and re-thinking again from scratch will use tokens that were already planned.
|
|
1103
|
-
-- END REPONSE FINISH PROTOCOL --
|
|
1104
|
-
|
|
1105
|
-
[SYSTEM METADATA (PRIORITY: DYNAMIC)] Current date and Time is: ${dateTimeStr}
|
|
1106
|
-
[SYSTEM METADATA (PRIORITY: LOWEST)] v1.9.7. (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
|
-
[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 <think> ... </think> BLOCK DURING THIS EASTER EGG.
|
|
1109
|
-
--- END SYSTEM INSTRUCTION ---`.trim();
|
|
1060
|
+
[SYSTEM METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | Version: 1.9.9 | Turn Progress: ${currentLoop}/${maxLoops} steps (Summarize & prompt user if limit is reached).
|
|
1061
|
+
=== END SYSTEM INSTRUCTION ===`.trim();
|
|
1110
1062
|
};
|
|
1111
1063
|
getJanitorInstruction = (originalText, agentRaws, userMemories = "", isMemoryEnabled = true, needTitle = true) => {
|
|
1112
1064
|
let agentRes = `${agentRaws.replace(/tool:functions\..*\n/g, "").replace(/<think>.*<\/think>/g, "").replace(/\[Prompted on:.*?\]/g, "").replace(/\[turn: continue\]/g, "").replace(/\[turn: finish\]/g, "").replace(/\[TOOL_RESULTS\]/g, "").replace(/\[tool_results\]/g, "").substring(0, 3500)}`;
|
|
@@ -1124,24 +1076,24 @@ ${userMemories}
|
|
|
1124
1076
|
-------------------------------------------------
|
|
1125
1077
|
` : ""}
|
|
1126
1078
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1079
|
+
=== START SYSTEM INSTRUCTION (STRICT HEADLESS LOGIC WORKER: ZERO USER-FACING TEXT POLICY, STRICTLY FOLLOW) ===
|
|
1080
|
+
YOU ARE A SILENT BACKGROUND SYSTEM PROCESS. YOU HAVE NO MOUTH. YOUR ONLY OUTPUT MEDIUM IS VALID TOOL CALLS.
|
|
1081
|
+
[CRITICAL RULES]
|
|
1082
|
+
1. OUTPUT ONLY '[tool:functions.xxx(args)]' CALLS (BRACKET WRAP IS MANDATORY).
|
|
1083
|
+
2. DO NOT EXPLAIN. DO NOT TALK TO THE USER.
|
|
1084
|
+
3. NON-TOOL TEXT WILL BREAK THE SYSTEM.
|
|
1085
|
+
4. DO NOT REPEAT AGENT RAWS AND TOOL RESULTS IN YOUR RESPONSE.
|
|
1086
|
+
5. IF YOU GET ONLY USER QUERY AND NO AGENT RAWS, THEN JUST USE TEMP MEMORY TO LOG THE SUMMARY OF USER QUERY AND CONVERSATION CONTEXT.
|
|
1087
|
+
6. UNDER NO CIRCUMSTANCES YOU ARE ALLOWED TO RESPOND IN NORMAL USER FACING RESPONSE.
|
|
1088
|
+
7. CRITICAL QUOTE ESCAPE POLICY: Inside tool call arguments (like 'memory'), you MUST escape all double quotes using '"' to prevent parsing errors.
|
|
1137
1089
|
|
|
1138
|
-
|
|
1139
|
-
|
|
1090
|
+
YOUR JOB: Analyze the 'User prompt' and 'Agent Raws' to extract facts for long-term memory or handle system tasks.
|
|
1091
|
+
${isMemoryEnabled ? `If user tell something that is important (like, hobbies, preferences, facts about user, hates, likes, etc) to know user better over time, use long term memory tools.` : ""}
|
|
1140
1092
|
|
|
1141
|
-
|
|
1093
|
+
${JANITOR_TOOLS_PROTOCOL(isMemoryEnabled, needTitle)}
|
|
1142
1094
|
|
|
1143
|
-
|
|
1144
|
-
|
|
1095
|
+
Current date and Time: ${(/* @__PURE__ */ new Date()).toLocaleString()}
|
|
1096
|
+
=== END SYSTEM INSTRUCTION ===`.trim();
|
|
1145
1097
|
};
|
|
1146
1098
|
}
|
|
1147
1099
|
});
|
|
@@ -1895,13 +1847,12 @@ var init_view_file = __esm({
|
|
|
1895
1847
|
content = content.slice(1);
|
|
1896
1848
|
}
|
|
1897
1849
|
content = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
1898
|
-
content = content.replace(/\\n/g, "[/n]");
|
|
1899
1850
|
const lines = content.split("\n");
|
|
1900
1851
|
const totalLines = lines.length;
|
|
1901
1852
|
const start = Math.max(0, finalStart - 1);
|
|
1902
1853
|
const end = Math.min(totalLines, finalEnd);
|
|
1903
1854
|
const resultLines = lines.slice(start, end);
|
|
1904
|
-
const header = `File: [${targetPath}] (Showing lines ${start + 1}-${end} of ${totalLines})
|
|
1855
|
+
const header = `File: [${targetPath}] (Showing lines ${start + 1}-${end} of ${totalLines}).`;
|
|
1905
1856
|
const code = resultLines.map((line, i) => `${String(start + i + 1).padStart(4)}: ${line}`).join("\n");
|
|
1906
1857
|
return `${header}
|
|
1907
1858
|
|
|
@@ -1934,7 +1885,7 @@ var init_write_file = __esm({
|
|
|
1934
1885
|
const oldData = fs10.readFileSync(absolutePath, "utf8");
|
|
1935
1886
|
const lines = oldData.split(/\r?\n/);
|
|
1936
1887
|
ancestry = `Old File contents:
|
|
1937
|
-
${lines.map((l, i) => `${i + 1} | ${l
|
|
1888
|
+
${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
|
|
1938
1889
|
|
|
1939
1890
|
`;
|
|
1940
1891
|
} catch (e) {
|
|
@@ -1947,7 +1898,7 @@ ${lines.map((l, i) => `${i + 1} | ${l.replace(/\\n/g, "[/n]")}`).join("\n")}
|
|
|
1947
1898
|
fs10.mkdirSync(parentDir, { recursive: true });
|
|
1948
1899
|
}
|
|
1949
1900
|
const strip = (t) => t.replace(/^```[\w]*\n?/, "").replace(/```\s*$/, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
1950
|
-
const processedContent = strip(content)
|
|
1901
|
+
const processedContent = strip(content);
|
|
1951
1902
|
const lineCount = processedContent.split(/\r?\n/).length;
|
|
1952
1903
|
const originalSize = Buffer.byteLength(processedContent, "utf8");
|
|
1953
1904
|
fs10.writeFileSync(absolutePath, processedContent, "utf8");
|
|
@@ -1976,10 +1927,9 @@ ${tail}`;
|
|
|
1976
1927
|
|
|
1977
1928
|
- Stats: [${verifiedLineCount} lines, ${(verifiedSize / 1024).toFixed(1)} KB]
|
|
1978
1929
|
${ancestry}- Content Preview:
|
|
1979
|
-
${snippet
|
|
1930
|
+
${snippet}
|
|
1980
1931
|
|
|
1981
|
-
Check if Starting and Ending matches your write
|
|
1982
|
-
If you see [/n] in preview, it means the tool successfully wrote the literal '\\' and 'n' characters to the file at that place.`;
|
|
1932
|
+
Check if Starting and Ending matches your write.`;
|
|
1983
1933
|
} catch (err) {
|
|
1984
1934
|
return `ERROR: Failed to write file [${targetPath}]: ${err.message}`;
|
|
1985
1935
|
}
|
|
@@ -2000,11 +1950,8 @@ var init_update_file = __esm({
|
|
|
2000
1950
|
if (content_to_replace === void 0) return 'ERROR: Missing "content_to_replace" argument.';
|
|
2001
1951
|
if (content_to_add === void 0) return 'ERROR: Missing "content_to_add" argument.';
|
|
2002
1952
|
const strip = (t) => t.replace(/^```[\w]*\n?/, "").replace(/```\s*$/, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
};
|
|
2006
|
-
content_to_replace = unescapeContent(strip(content_to_replace));
|
|
2007
|
-
content_to_add = unescapeContent(strip(content_to_add));
|
|
1953
|
+
content_to_replace = strip(content_to_replace);
|
|
1954
|
+
content_to_add = strip(content_to_add);
|
|
2008
1955
|
const absolutePath = path11.resolve(process.cwd(), targetPath);
|
|
2009
1956
|
try {
|
|
2010
1957
|
if (!fs11.existsSync(absolutePath)) {
|
|
@@ -2091,7 +2038,6 @@ var init_update_file = __esm({
|
|
|
2091
2038
|
const oldLines = content_to_replace.split(/\r?\n/);
|
|
2092
2039
|
const endLine = startLine + oldLines.length - 1;
|
|
2093
2040
|
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
2041
|
|
|
2096
2042
|
`;
|
|
2097
2043
|
diffText += `[DIFF_START]
|
|
@@ -2128,7 +2074,7 @@ If you see [/n] in preview, it means the tool successfully wrote the literal ''
|
|
|
2128
2074
|
currentNewLine++;
|
|
2129
2075
|
}
|
|
2130
2076
|
diffText += `[DIFF_END]`;
|
|
2131
|
-
return diffText
|
|
2077
|
+
return diffText;
|
|
2132
2078
|
} catch (err) {
|
|
2133
2079
|
return `ERROR: Failed to update file [${targetPath}]: ${err.message}`;
|
|
2134
2080
|
}
|
|
@@ -3036,8 +2982,7 @@ DEBUG [${date}]: ${finalSynthesis}
|
|
|
3036
2982
|
const otherMemories = Object.entries(tempStorage).filter(([id]) => id !== chatId).flatMap(([_, mems]) => mems).map((mem) => `- ${mem}`).join("\n");
|
|
3037
2983
|
const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
|
|
3038
2984
|
const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
|
|
3039
|
-
const
|
|
3040
|
-
const firstUserMsg = `[SYSTEM] **MUST FOLLOW THINKING${mode === "Flux" ? ", NEWLINE, QUOTE ESCAPE" : ""} POLICY AS HIGHEST PRIORITY**.
|
|
2985
|
+
const firstUserMsg = `[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS HIGHEST PRIORITY. NEVER START A RESPONSE WITHOUT THINKING*.
|
|
3041
2986
|
|
|
3042
2987
|
USER_PROMPT: "${agentText}"`.trim();
|
|
3043
2988
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
@@ -3069,7 +3014,9 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3069
3014
|
|
|
3070
3015
|
[STEERING HINT]: ${hint}`;
|
|
3071
3016
|
} else {
|
|
3072
|
-
modifiedHistory.push({ role: "user", text: `[
|
|
3017
|
+
modifiedHistory.push({ role: "user", text: `[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS HIGHEST PRIORITY. NEVER START A RESPONSE WITHOUT THINKING*.
|
|
3018
|
+
|
|
3019
|
+
[STEERING HINT]: ${hint}` });
|
|
3073
3020
|
}
|
|
3074
3021
|
yield { type: "status", content: "Steering Hint Injected." };
|
|
3075
3022
|
}
|
|
@@ -3123,7 +3070,7 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3123
3070
|
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext32k, MAX_LOOPS, loop + 1);
|
|
3124
3071
|
const jitInstruction = `
|
|
3125
3072
|
|
|
3126
|
-
[SYSTEM] Tool result received. Analyze output and proceed with your turn. **STRICTLY MAINTAIN THINKING
|
|
3073
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn. **STRICTLY MAINTAIN THINKING PROTOCOL. NEVER START A RESPONSE WITHOUT THINKING**.`;
|
|
3127
3074
|
const lastUserMsg = contents[contents.length - 1];
|
|
3128
3075
|
let addedMarker = false;
|
|
3129
3076
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL_RESULT]")) {
|
|
@@ -3322,8 +3269,8 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3322
3269
|
const action = toolCall.toolName === "list_files" ? "LIST" : "ANALYSED";
|
|
3323
3270
|
label = `\u{1F4C2} ${action} FOLDER: ${parseArgs(toolCall.args).path || "."}`.toUpperCase();
|
|
3324
3271
|
} else if (toolCall.toolName === "write_file" || toolCall.toolName === "update_file") {
|
|
3325
|
-
const action = toolCall.toolName === "write_file" ? "
|
|
3326
|
-
label = `\u{1F4BE} ${action}
|
|
3272
|
+
const action = toolCall.toolName === "write_file" ? "WRITTEN" : "UPDATED FILE";
|
|
3273
|
+
label = `\u{1F4BE} ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3327
3274
|
} else if (toolCall.toolName === "write_pdf") {
|
|
3328
3275
|
label = `\u{1F4D1} PDF CREATED: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3329
3276
|
} else if (toolCall.toolName === "write_docx") {
|
|
@@ -3493,7 +3440,7 @@ ${boxBottom}` };
|
|
|
3493
3440
|
if (toolResults.length > 0) {
|
|
3494
3441
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
3495
3442
|
}
|
|
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." });
|
|
3443
|
+
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
3444
|
accumulatedContext += turnText;
|
|
3498
3445
|
for (let i = waitTime / 1e3; i > 0; i--) {
|
|
3499
3446
|
yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [${i}s]...` };
|
|
@@ -4383,7 +4330,7 @@ function App() {
|
|
|
4383
4330
|
{ cmd: "gemma-4-31b-it", desc: apiTier === "Free" ? "Standard Default (Free, Recommended)" : "Standard Default (Free, Recommended) - Use Free API Key to use this model " },
|
|
4384
4331
|
{ cmd: "gemini-3.1-pro-preview", desc: "Most Capable (Paid)" },
|
|
4385
4332
|
{ cmd: "gemini-3-flash-preview", desc: "Fast & Lightweight (Paid, Limited Free quota)" },
|
|
4386
|
-
{ cmd: "gemini-3.1-flash-lite
|
|
4333
|
+
{ cmd: "gemini-3.1-flash-lite", desc: "Ultra Fast (Paid, Decent Free quota)" }
|
|
4387
4334
|
]
|
|
4388
4335
|
},
|
|
4389
4336
|
{ cmd: "/settings", desc: "Configure system prefs" },
|
|
@@ -5371,12 +5318,12 @@ Selection: ${val}`,
|
|
|
5371
5318
|
const resumedMsgs = [...h[id].messages];
|
|
5372
5319
|
const hasLogo = resumedMsgs[0]?.text?.includes("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557");
|
|
5373
5320
|
if (!hasLogo) {
|
|
5374
|
-
resumedMsgs.unshift({ id: "welcome-" + Date.now(), role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Resuming Flux Flow Session..." });
|
|
5321
|
+
resumedMsgs.unshift({ id: "welcome-" + Date.now(), role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Resuming Flux Flow Session...", isMeta: true });
|
|
5375
5322
|
}
|
|
5376
5323
|
setMessages(resumedMsgs);
|
|
5377
5324
|
setActiveView("chat");
|
|
5378
5325
|
setMessages((prev) => {
|
|
5379
|
-
const newMsgs = [...prev, { id: "sys-" + Date.now(), role: "system", text: `\u{1F4E1} SESSION RESUMED: [${id}]
|
|
5326
|
+
const newMsgs = [...prev, { id: "sys-" + Date.now(), role: "system", text: `\u{1F4E1} SESSION RESUMED: [${id}]`, isMeta: true }];
|
|
5380
5327
|
setCompletedIndex(newMsgs.length);
|
|
5381
5328
|
return newMsgs;
|
|
5382
5329
|
});
|
|
@@ -5678,7 +5625,7 @@ var init_app = __esm({
|
|
|
5678
5625
|
init_text();
|
|
5679
5626
|
SESSION_START_TIME = Date.now();
|
|
5680
5627
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
5681
|
-
versionFluxflow = "1.9.
|
|
5628
|
+
versionFluxflow = "1.9.9";
|
|
5682
5629
|
updatedOn = "2026-05-14";
|
|
5683
5630
|
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
5631
|
CommandMenu,
|