fluxflow-cli 1.7.12 → 1.7.14
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 +81 -51
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -9,15 +9,55 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/utils/text.js
|
|
13
|
+
var wrapText;
|
|
14
|
+
var init_text = __esm({
|
|
15
|
+
"src/utils/text.js"() {
|
|
16
|
+
wrapText = (text, width) => {
|
|
17
|
+
if (!text) return "";
|
|
18
|
+
const sourceLines = text.split(/\r?\n/);
|
|
19
|
+
let finalLines = [];
|
|
20
|
+
sourceLines.forEach((sLine) => {
|
|
21
|
+
if (sLine.length <= width) {
|
|
22
|
+
finalLines.push(sLine);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let currentLine = "";
|
|
26
|
+
const words = sLine.split(/(\s+)/);
|
|
27
|
+
words.forEach((word) => {
|
|
28
|
+
if ((currentLine + word).length > width) {
|
|
29
|
+
if (currentLine) finalLines.push(currentLine.replace(/\s+$/, ""));
|
|
30
|
+
if (word.trim().length === 0) {
|
|
31
|
+
currentLine = "";
|
|
32
|
+
} else {
|
|
33
|
+
currentLine = word;
|
|
34
|
+
while (currentLine.length > width) {
|
|
35
|
+
finalLines.push(currentLine.substring(0, width));
|
|
36
|
+
currentLine = currentLine.substring(width);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
currentLine += word;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (currentLine) finalLines.push(currentLine.replace(/\s+$/, ""));
|
|
44
|
+
});
|
|
45
|
+
return finalLines.join("\n");
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
12
50
|
// src/components/TerminalBox.jsx
|
|
13
51
|
import React from "react";
|
|
14
52
|
import { Box, Text } from "ink";
|
|
15
53
|
var TerminalBox;
|
|
16
54
|
var init_TerminalBox = __esm({
|
|
17
55
|
"src/components/TerminalBox.jsx"() {
|
|
18
|
-
|
|
56
|
+
init_text();
|
|
57
|
+
TerminalBox = React.memo(({ command, output, completed = false, isFocused = false, columns = 80 }) => {
|
|
19
58
|
const cleanOutput = (output || "").replace(/\r/g, "").trim();
|
|
20
|
-
|
|
59
|
+
const wrappedOutput = cleanOutput ? wrapText(cleanOutput, columns - 6) : "";
|
|
60
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column", borderStyle: isFocused ? "double" : "round", borderColor: completed ? "#334155" : isFocused ? "yellow" : "cyan", paddingX: 2, paddingY: completed ? 0 : 1, width: "100%" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { color: completed ? "gray" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React.createElement(Text, { color: completed ? "gray" : "white" }, command)), wrappedOutput ? /* @__PURE__ */ React.createElement(Box, { marginTop: completed ? 0 : 1, backgroundColor: "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: completed ? "gray" : "green" }, wrappedOutput)) : !completed && /* @__PURE__ */ React.createElement(Box, { marginTop: 1, backgroundColor: "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "gray", italic: true }, "Waiting for output...")), /* @__PURE__ */ React.createElement(Box, { justifyContent: "space-between", marginTop: 1 }, !completed ? /* @__PURE__ */ React.createElement(Text, { color: "gray", dimColor: true, italic: true }, "Double-press ESC to terminate if hanging.") : /* @__PURE__ */ React.createElement(Box, null), /* @__PURE__ */ React.createElement(Text, { color: completed ? "#475569" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u25CF ARCHIVED" : isFocused ? "\u25B6 TERMINAL FOCUSED" : "\u25CF LIVE (Press TAB to focus)")));
|
|
21
61
|
});
|
|
22
62
|
}
|
|
23
63
|
});
|
|
@@ -25,10 +65,11 @@ var init_TerminalBox = __esm({
|
|
|
25
65
|
// src/components/ChatLayout.jsx
|
|
26
66
|
import React2, { useState, useEffect, useRef } from "react";
|
|
27
67
|
import { Box as Box2, Text as Text2 } from "ink";
|
|
28
|
-
var TypewriterText, cleanSignals, formatThinkText, InlineMarkdown,
|
|
68
|
+
var TypewriterText, cleanSignals, formatThinkText, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
|
|
29
69
|
var init_ChatLayout = __esm({
|
|
30
70
|
"src/components/ChatLayout.jsx"() {
|
|
31
71
|
init_TerminalBox();
|
|
72
|
+
init_text();
|
|
32
73
|
TypewriterText = ({ text, isStreaming, onComplete, columns = 80, color = "white", speed = 50, render }) => {
|
|
33
74
|
const [displayedText, setDisplayedText] = useState("");
|
|
34
75
|
const fullTextRef = useRef(text);
|
|
@@ -153,29 +194,6 @@ var init_ChatLayout = __esm({
|
|
|
153
194
|
return part;
|
|
154
195
|
}));
|
|
155
196
|
});
|
|
156
|
-
wrapText = (text, width) => {
|
|
157
|
-
if (!text) return "";
|
|
158
|
-
const sourceLines = text.split(/\r?\n/);
|
|
159
|
-
let finalLines = [];
|
|
160
|
-
sourceLines.forEach((sLine) => {
|
|
161
|
-
const words = sLine.split(" ");
|
|
162
|
-
let currentLine = "";
|
|
163
|
-
words.forEach((word) => {
|
|
164
|
-
if ((currentLine + word).length > width) {
|
|
165
|
-
if (currentLine) finalLines.push(currentLine.trim());
|
|
166
|
-
currentLine = word + " ";
|
|
167
|
-
while (currentLine.length > width) {
|
|
168
|
-
finalLines.push(currentLine.substring(0, width));
|
|
169
|
-
currentLine = currentLine.substring(width) + " ";
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
currentLine += word + " ";
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
if (currentLine) finalLines.push(currentLine.trim());
|
|
176
|
-
});
|
|
177
|
-
return finalLines.join("\n");
|
|
178
|
-
};
|
|
179
197
|
TableRenderer = React2.memo(({ buffer, terminalWidth = 80 }) => {
|
|
180
198
|
if (buffer.length < 2) return null;
|
|
181
199
|
const rows = buffer.map((line) => {
|
|
@@ -340,7 +358,7 @@ var init_ChatLayout = __esm({
|
|
|
340
358
|
const outputMatch = msg.text.match(/OUTPUT: ([\s\S]*)$/);
|
|
341
359
|
const cmd = cmdMatch ? cmdMatch[1] : "Unknown";
|
|
342
360
|
const outputList = outputMatch ? outputMatch[1] : "";
|
|
343
|
-
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(TerminalBox, { command: cmd, output: outputList, completed: true }));
|
|
361
|
+
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(TerminalBox, { command: cmd, output: outputList, completed: true, columns }));
|
|
344
362
|
}
|
|
345
363
|
const [animationDone, setAnimationDone] = React2.useState(!msg.isStreaming);
|
|
346
364
|
const content = React2.useMemo(() => cleanSignals(msg.text), [msg.text]);
|
|
@@ -727,7 +745,7 @@ Your tool syntax is: 'tool:functions.function_name(args...)'
|
|
|
727
745
|
You have access to the following memory functions to persist important information:
|
|
728
746
|
|
|
729
747
|
1. Temporary context (MUST OUTPUT THIS TOOL CALL EVERY TIME):
|
|
730
|
-
tool:functions.memory(action='temp', content='<summary of the user prompt & model responses ONLY FROM LATEST PROMPT
|
|
748
|
+
tool:functions.memory(action='temp', content='<summary of the user prompt & model responses ONLY FROM LATEST PROMPT UNDER 40 WORDS>. [Talked on: <date> <hour>]')
|
|
731
749
|
|
|
732
750
|
${isMemoryEnabled ? `2. User-specific long-term memory (USE BASED ON CONVERSATION CONTEXT):
|
|
733
751
|
- Add: tool:functions.memory(action='user', method='add', content='<string to add>. [Saved on: <date ONLY>]')
|
|
@@ -746,10 +764,10 @@ var thinking_prompts_default;
|
|
|
746
764
|
var init_thinking_prompts = __esm({
|
|
747
765
|
"src/data/thinking_prompts.json"() {
|
|
748
766
|
thinking_prompts_default = {
|
|
749
|
-
Max: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MAX\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 12**, **MAX 15**. EACH HEADING SHOULD HAVE MIN 12, MAX 16 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & NUANCES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES.\n-- END THINKING INSTRUCTIONS --",
|
|
750
|
-
High: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: HIGH\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 8**, **MAX 11**. EACH HEADING SHOULD HAVE MIN 8, MAX 12 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & THINK LONGER before responding. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES.\n-- END THINKING INSTRUCTIONS --",
|
|
751
|
-
Medium: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MEDIUM\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 3**, **MAX 5**. EACH HEADING SHOULD HAVE MIN 4, MAX 8 SENTENCES OF INTERNAL MONOLOGUE. THINK LONGER FOR COMPLEX QUERIES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES.\n-- END THINKING INSTRUCTIONS --",
|
|
752
|
-
Minimal: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: LOW\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 0**, **MAX 2**. EACH HEADING SHOULD HAVE MIN 1, MAX 3 SENTENCES OF INTERNAL MONOLOGUE. No Thinking is preferred if query is simple.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES.\n-- END THINKING INSTRUCTIONS --"
|
|
767
|
+
Max: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MAX\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 12**, **MAX 15**. EACH HEADING SHOULD HAVE MIN 12, MAX 16 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & NUANCES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
|
|
768
|
+
High: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: HIGH\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 8**, **MAX 11**. EACH HEADING SHOULD HAVE MIN 8, MAX 12 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & THINK LONGER before responding. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
|
|
769
|
+
Medium: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MEDIUM\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 3**, **MAX 5**. EACH HEADING SHOULD HAVE MIN 4, MAX 8 SENTENCES OF INTERNAL MONOLOGUE. THINK LONGER FOR COMPLEX QUERIES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
|
|
770
|
+
Minimal: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: LOW\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 0**, **MAX 2**. EACH HEADING SHOULD HAVE MIN 1, MAX 3 SENTENCES OF INTERNAL MONOLOGUE. No Thinking is preferred if query is simple.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --"
|
|
753
771
|
};
|
|
754
772
|
}
|
|
755
773
|
});
|
|
@@ -767,9 +785,12 @@ var init_prompts = __esm({
|
|
|
767
785
|
if (thinkingLevel === "xHigh" || thinkingLevel === "Max") levelKey = "Max";
|
|
768
786
|
const thinkingConfig = thinking_prompts_default[levelKey] || thinking_prompts_default["Medium"];
|
|
769
787
|
const osDetected = process.platform === "win32" ? "Windows" : process.platform === "darwin" ? "macOS" : "Linux";
|
|
770
|
-
const nameStr = profile.name && profile.name?.length > 0 ? `User Name: ${profile.name}
|
|
771
|
-
|
|
772
|
-
const
|
|
788
|
+
const nameStr = profile.name && profile.name?.length > 0 ? `User Name: ${profile.name}
|
|
789
|
+
` : "";
|
|
790
|
+
const nicknameStr = profile.nickname && profile.nickname?.length > 0 ? `. User Nickname: ${profile.nickname}.
|
|
791
|
+
` : "";
|
|
792
|
+
const userInstrStr = profile.instructions && profile.instructions?.length > 0 ? `. User Instructions: ${profile.instructions}.
|
|
793
|
+
` : "";
|
|
773
794
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
774
795
|
const cwdStr = process.cwd();
|
|
775
796
|
const tempMemoriesStr = tempMemories?.length > 0 && !isContext50 ? `
|
|
@@ -786,11 +807,11 @@ ${userMemories}
|
|
|
786
807
|
|
|
787
808
|
` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
|
|
788
809
|
|
|
789
|
-
` : ""}
|
|
790
|
-
|
|
810
|
+
` : ""}${nameStr}${nicknameStr}${userInstrStr}
|
|
811
|
+
--- START SYSTEM INSTRUCTION ---
|
|
812
|
+
You are Flux Flow (made by Kushal Roy Chowdhury). A CLI Agent. Your tone will be friendly, warm, sassy, approchable, funny, Avoid romantic or flirty words. Dont mention modes unless explicitly asked. ${mode === "Flux" ? "You are currently operating in FLUX mode. Keep your agentic approach goal oriented, conversation quality and user experience. Use provided tools when needed. And try to minimize number of agentic loops (Agent Loop is limited to 50 per turn, finish your goal by then). Analyze user prompt and project requirements, then plan your approach." : "You are currently operating in Flow mode. Focus more on conversation quality and user experience. Keep Agentic Loops to minimum (Agent Loop is limited to 7 per turn, finish your goal by then). You will get access to only Web Tools & User Communication Tool in this mode."}
|
|
791
813
|
CURRENT_WORKING_DIRECTORY: ${cwdStr}.
|
|
792
814
|
OS: ${osDetected}. ${osDetected === "Windows" && mode === "Flux" ? "Your terminal commands will run on CMD. 'Prefer using PS scripts via CMD' instead of raw CMD commands." : ""}
|
|
793
|
-
${nameStr}${nicknameStr}${userInstrStr}
|
|
794
815
|
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.
|
|
795
816
|
|
|
796
817
|
${thinkingConfig}
|
|
@@ -816,14 +837,14 @@ ${isMemoryEnabled ? "You have a internal memory system. Data is saved by a backg
|
|
|
816
837
|
-- END SECURITY BOUNDARY --
|
|
817
838
|
|
|
818
839
|
-- START TEMPORAL AWARENESS --
|
|
819
|
-
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"}
|
|
840
|
+
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.
|
|
820
841
|
-- END TEMPORAL AWARENESS --
|
|
821
842
|
|
|
822
843
|
-- START FORMATTING RULES --
|
|
823
844
|
- Structure responses VISUALLY pleasing, easy to read, and beautiful.
|
|
824
845
|
- USE GFM Markdown HEAVILY.
|
|
825
846
|
- 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.
|
|
826
|
-
- **CRITICAL**: NEVER USE LaTeX IN
|
|
847
|
+
- **CRITICAL**: NEVER USE LaTeX IN RESPONSES.
|
|
827
848
|
- Keep Poems & Literature in Code Block.
|
|
828
849
|
- Use emojis & Kaomojis. Prefer Kaomojis more.
|
|
829
850
|
-- END FORMATTING RULES --
|
|
@@ -1401,7 +1422,7 @@ var init_memory = __esm({
|
|
|
1401
1422
|
if (!content) return "ERROR: Missing 'content' for temp memory.";
|
|
1402
1423
|
const tempStorage = readEncryptedJson(TEMP_MEM_FILE, {});
|
|
1403
1424
|
if (!tempStorage[chatId]) tempStorage[chatId] = [];
|
|
1404
|
-
const MAX_CHARS =
|
|
1425
|
+
const MAX_CHARS = 5e3 * 4;
|
|
1405
1426
|
let currentTotalLength = tempStorage[chatId].reduce((acc, m) => acc + m.length, 0);
|
|
1406
1427
|
while (tempStorage[chatId].length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1407
1428
|
const removed = tempStorage[chatId].shift();
|
|
@@ -1415,7 +1436,7 @@ var init_memory = __esm({
|
|
|
1415
1436
|
const memories = readEncryptedJson(MEMORIES_FILE, []);
|
|
1416
1437
|
if (method === "add") {
|
|
1417
1438
|
if (!content) return "ERROR: Missing 'content' for memory addition.";
|
|
1418
|
-
const MAX_CHARS =
|
|
1439
|
+
const MAX_CHARS = 3e3 * 4;
|
|
1419
1440
|
let currentTotalLength = memories.reduce((acc, m) => acc + (m.memory?.length || 0), 0);
|
|
1420
1441
|
while (memories.length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1421
1442
|
const removed = memories.shift();
|
|
@@ -1781,19 +1802,28 @@ var init_update_file = __esm({
|
|
|
1781
1802
|
`;
|
|
1782
1803
|
const contextStart = Math.max(0, startLine - 16);
|
|
1783
1804
|
for (let i = contextStart; i < startLine - 1; i++) {
|
|
1784
|
-
diffText += `[UI_CONTEXT] ${i + 1}
|
|
1805
|
+
diffText += `[UI_CONTEXT] ${i + 1}|${allOriginalLines[i]}
|
|
1785
1806
|
`;
|
|
1786
1807
|
}
|
|
1787
|
-
|
|
1788
|
-
|
|
1808
|
+
const lineStartPos = currentContent.lastIndexOf("\n", startPos) + 1;
|
|
1809
|
+
const affectedEndPos = startPos + content_to_replace.length;
|
|
1810
|
+
const lineEndPos = currentContent.indexOf("\n", affectedEndPos);
|
|
1811
|
+
const actualEndPos = lineEndPos === -1 ? currentContent.length : lineEndPos;
|
|
1812
|
+
const fullOldLines = currentContent.substring(lineStartPos, actualEndPos).split("\n");
|
|
1813
|
+
const newAffectedEndPos = startPos + content_to_add.length;
|
|
1814
|
+
const newLineEndPos = newFileContent.indexOf("\n", newAffectedEndPos);
|
|
1815
|
+
const actualNewEndPos = newLineEndPos === -1 ? newFileContent.length : newLineEndPos;
|
|
1816
|
+
const fullNewLines = newFileContent.substring(lineStartPos, actualNewEndPos).split("\n");
|
|
1817
|
+
fullOldLines.forEach((line, i) => {
|
|
1818
|
+
diffText += `-${startLine + i}|${line}
|
|
1789
1819
|
`;
|
|
1790
1820
|
});
|
|
1791
|
-
|
|
1792
|
-
diffText += `+${startLine + i}
|
|
1821
|
+
fullNewLines.forEach((line, i) => {
|
|
1822
|
+
diffText += `+${startLine + i}|${line}
|
|
1793
1823
|
`;
|
|
1794
1824
|
});
|
|
1795
1825
|
for (let i = endLine; i < Math.min(allOriginalLines.length, endLine + 15); i++) {
|
|
1796
|
-
diffText += `[UI_CONTEXT] ${i + 1}
|
|
1826
|
+
diffText += `[UI_CONTEXT] ${i + 1}|${allOriginalLines[i]}
|
|
1797
1827
|
`;
|
|
1798
1828
|
}
|
|
1799
1829
|
diffText += `[DIFF_END]`;
|
|
@@ -4652,9 +4682,9 @@ var init_app = __esm({
|
|
|
4652
4682
|
init_setup();
|
|
4653
4683
|
SESSION_START_TIME = Date.now();
|
|
4654
4684
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
4655
|
-
versionFluxflow = "1.7.
|
|
4656
|
-
updatedOn = "2026-05-
|
|
4657
|
-
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION"), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "The agent already finished the task
|
|
4685
|
+
versionFluxflow = "1.7.14";
|
|
4686
|
+
updatedOn = "2026-05-05";
|
|
4687
|
+
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION"), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "The agent already finished the task before your hint was consumed."), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, backgroundColor: "#222", paddingX: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(
|
|
4658
4688
|
CommandMenu,
|
|
4659
4689
|
{
|
|
4660
4690
|
title: "Select Action",
|