fluxflow-cli 1.12.3 → 1.12.4
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/ARCHITECTURE.md +1 -1
- package/dist/fluxflow.js +12 -4
- package/package.json +2 -2
package/ARCHITECTURE.md
CHANGED
|
@@ -15,7 +15,7 @@ The core intelligence of Flux Flow resides in `src/utils/ai.js`. It does not rel
|
|
|
15
15
|
|
|
16
16
|
The execution flow of a single user prompt follows this loop:
|
|
17
17
|
|
|
18
|
-
1. **Context Assembly**: The user's prompt is combined with the system instructions, temporary session context, persistent user memories, and the current chat history. If the history gets too large (e.g., >
|
|
18
|
+
1. **Context Assembly**: The user's prompt is combined with the system instructions, temporary session context, persistent user memories, and the current chat history. If the history gets too large (e.g., >254k tokens) and compression is disabled, it is gracefully truncated.
|
|
19
19
|
2. **Stream Processing**: The main loop initiates a streaming request to the Gemini API (`client.models.generateContentStream`). It yields chunks of text and status updates directly back to the React UI as they arrive.
|
|
20
20
|
3. **Detection & Tool Execution**: Once the stream completes for a given turn, the entire response is scanned for tool calls using a custom regex and bracket-balancing parser (looking for `tool:functions.tool_name(args...)`).
|
|
21
21
|
- If tools are found, the loop pauses.
|
package/dist/fluxflow.js
CHANGED
|
@@ -961,7 +961,7 @@ ${mode === "Flux" ? `- FILE TOOLS (path = relative to CWD) -
|
|
|
961
961
|
2. [tool:functions.ReadFolder(path="...")]. Detailed DIR stats
|
|
962
962
|
3. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? -> update_file > write_file
|
|
963
963
|
4. [tool:functions.PatchFile(path="...", content_to_replace="exact old content", content_to_add="new content")]. Surgical patching. Unsure content_to_replace? -> view_file >> guessing.
|
|
964
|
-
5. [tool:functions.WritePDF(path="...", content="...", orientation="...")].
|
|
964
|
+
5. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. **USE PROPER PROACTIVE A4 PAGE BREAKS**. HTML/CSS for PREMIUM layout (100vh/vw). No manual footers
|
|
965
965
|
6. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word doc. Proper margins and page breaks
|
|
966
966
|
7. [tool:functions.Run(command="...")]. Runs a shell command. Destructive/Irreversible ops -> ask user
|
|
967
967
|
8. [tool:functions.SearchKeyword(keyword="...")]. Global search. Finds definitions/logic without reading every file
|
|
@@ -3894,6 +3894,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3894
3894
|
yield { type: "status", content: "Connecting..." };
|
|
3895
3895
|
TERMINATION_SIGNAL = false;
|
|
3896
3896
|
let fullAgentResponseChunks = [];
|
|
3897
|
+
let wasToolCalledInLastLoop = false;
|
|
3897
3898
|
modifiedHistory.forEach((msg) => {
|
|
3898
3899
|
if (msg.text && msg.role === "agent") {
|
|
3899
3900
|
msg.text = msg.text.replace(/<(think|thought)>[\s\S]*?<\/(think|thought)>/gi, "").trim();
|
|
@@ -3932,6 +3933,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3932
3933
|
let lastToolFinishedAt = 0;
|
|
3933
3934
|
let toolResults = [];
|
|
3934
3935
|
let toolCallPointer = 0;
|
|
3936
|
+
let anyToolExecutedInThisTurn = false;
|
|
3935
3937
|
let isThinkingLoop = false;
|
|
3936
3938
|
let isStutteringLoop = false;
|
|
3937
3939
|
let isGeneralLoop = false;
|
|
@@ -4402,6 +4404,7 @@ ${boxBottom}` };
|
|
|
4402
4404
|
}
|
|
4403
4405
|
const aiContent = `[TOOL RESULT]: ${(result || "").toString().split(/\r?\n/).filter((line) => !line.includes("[UI_CONTEXT]")).join("\n")}`;
|
|
4404
4406
|
toolResults.push({ role: "user", text: aiContent, binaryPart });
|
|
4407
|
+
anyToolExecutedInThisTurn = true;
|
|
4405
4408
|
let uiContent = `[TOOL RESULT]: ${result || ""}`;
|
|
4406
4409
|
if (normToolName === "view_file" || normToolName === "web_scrape") {
|
|
4407
4410
|
uiContent = `[TOOL RESULT]: ${label} (Context Locked for UI Clarity)`;
|
|
@@ -4587,14 +4590,19 @@ ${timestamp}`;
|
|
|
4587
4590
|
if (isActuallyFinished) break;
|
|
4588
4591
|
const nextAgentMsg = cleanedTurnText.trim() || "*Working...*";
|
|
4589
4592
|
modifiedHistory.push({ role: "agent", text: nextAgentMsg });
|
|
4590
|
-
if (toolResults.length > 0) {
|
|
4593
|
+
if (toolResults.length > 0 || anyToolExecutedInThisTurn) {
|
|
4591
4594
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
4592
4595
|
} else {
|
|
4593
|
-
|
|
4596
|
+
if (wasToolCalledInLastLoop) {
|
|
4597
|
+
modifiedHistory.push({ role: "user", text: `[SYSTEM] System executed the tool with no explicit result, continue with your task or use [turn: finish] if completed.` });
|
|
4598
|
+
} else {
|
|
4599
|
+
modifiedHistory.push({ role: "user", text: `[SYSTEM] ${isStutteringLoop && !isThinkingLoop ? `STUTTERING DETECTED by Internal System. Re-calibrate your response & proceed.` : `${isThinkingLoop ? " OVER-THINKING" : " LOOP"} DETECTED by Internal System${isThinkingLoop ? " for current EFFORT_LEVEL" : ""}. ${isThinkingLoop ? "If you have planned the task, prioritize the execution/output. " : "If you have finished your task use [turn: finish] else continue."}`}` });
|
|
4600
|
+
}
|
|
4594
4601
|
isThinkingLoop = false;
|
|
4595
4602
|
isStutteringLoop = false;
|
|
4596
4603
|
isGeneralLoop = false;
|
|
4597
4604
|
}
|
|
4605
|
+
wasToolCalledInLastLoop = toolCallPointer > 0 || anyToolExecutedInThisTurn;
|
|
4598
4606
|
}
|
|
4599
4607
|
yield { type: "status", content: null };
|
|
4600
4608
|
};
|
|
@@ -5616,7 +5624,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
5616
5624
|
if (newMode === "Flow") {
|
|
5617
5625
|
setThinkingLevel("Fast");
|
|
5618
5626
|
} else if (newMode === "Flux") {
|
|
5619
|
-
setThinkingLevel("
|
|
5627
|
+
setThinkingLevel("High");
|
|
5620
5628
|
}
|
|
5621
5629
|
const s2 = emojiSpace(2);
|
|
5622
5630
|
setMessages((prev) => {
|