fluxflow-cli 1.10.7 → 1.10.10
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 +13 -4
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -902,7 +902,7 @@ ${mode === "Flux" ? `- FILE TOOLS (path = relative to CWD) -
|
|
|
902
902
|
6. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word doc. Proper margins and page breaks
|
|
903
903
|
7. [tool:functions.Run(command="...")]. Runs a shell command. Destructive/Irreversible ops -> ask user
|
|
904
904
|
8. [tool:functions.SearchKeyword(keyword="...")]. Global search. Finds definitions/logic without reading every file
|
|
905
|
-
9. [tool:functions.GenerateImage(
|
|
905
|
+
9. [tool:functions.GenerateImage(path="... png", prompt="...", ratio="16:9, 9:16, 1:1, 4:3, 3:4")]. AI images. Usage: Mockups, PDF thumbnails, any visual content
|
|
906
906
|
|
|
907
907
|
- VERIFY RESULT CONTENTS. Fix errors. No hallucinations
|
|
908
908
|
- File tools > code chat
|
|
@@ -3507,6 +3507,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3507
3507
|
let isDedupeActive = false;
|
|
3508
3508
|
while (retryCount <= MAX_RETRIES && inStreamRetryCount <= MAX_RETRIES && !success && !TERMINATION_SIGNAL) {
|
|
3509
3509
|
try {
|
|
3510
|
+
turnText = "";
|
|
3510
3511
|
if (isInitialAttempt) {
|
|
3511
3512
|
if (process.stdout.isTTY) {
|
|
3512
3513
|
process.stdout.write(`\x1B]0;Working...\x07`);
|
|
@@ -3598,7 +3599,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3598
3599
|
if (chunk.text) {
|
|
3599
3600
|
if (isDedupeActive) {
|
|
3600
3601
|
dedupeBuffer += chunk.text;
|
|
3601
|
-
if (dedupeBuffer.length >=
|
|
3602
|
+
if (dedupeBuffer.length >= 30) {
|
|
3602
3603
|
let overlapLen = 0;
|
|
3603
3604
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
3604
3605
|
for (let len = maxPossibleOverlap; len > 0; len--) {
|
|
@@ -3623,7 +3624,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3623
3624
|
turnText += chunk.text;
|
|
3624
3625
|
yield { type: "text", content: chunk.text };
|
|
3625
3626
|
}
|
|
3626
|
-
const
|
|
3627
|
+
const signalSafeText3 = getSanitizedText(turnText);
|
|
3627
3628
|
const toolContext = getActiveToolContext(turnText);
|
|
3628
3629
|
if (toolContext.inside) {
|
|
3629
3630
|
if (!lastToolEventTime) lastToolEventTime = Date.now();
|
|
@@ -3717,7 +3718,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRIC
|
|
|
3717
3718
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
3718
3719
|
break;
|
|
3719
3720
|
}
|
|
3720
|
-
const responseContent =
|
|
3721
|
+
const responseContent = signalSafeText3.trim();
|
|
3721
3722
|
const respSentences = responseContent.split(/[.!?]\s+/);
|
|
3722
3723
|
const uniqueRespSentences = new Set(respSentences);
|
|
3723
3724
|
const respRepetitionRatio = respSentences.length > 10 ? (respSentences.length - uniqueRespSentences.size) / respSentences.length : 0;
|
|
@@ -3993,6 +3994,13 @@ ${boxBottom}` };
|
|
|
3993
3994
|
dedupeBuffer = "";
|
|
3994
3995
|
}
|
|
3995
3996
|
if (TERMINATION_SIGNAL) break;
|
|
3997
|
+
const signalSafeText2 = (turnText || "").trim();
|
|
3998
|
+
const hasFinish2 = /\[\s*(turn\s*:)?\s*finish\s*\]/i.test(signalSafeText2.toLowerCase());
|
|
3999
|
+
const hasContinue = /\[\s*(turn\s*:)?\s*continue\s*\]/i.test(signalSafeText2.toLowerCase());
|
|
4000
|
+
const didCallTool = toolResults.length > 0 || lastToolSniffed !== null;
|
|
4001
|
+
if (!hasFinish2 && !hasContinue && !didCallTool && signalSafeText2.length > 0) {
|
|
4002
|
+
throw new Error("Silent stream cutoff (500): Model stream closed cleanly but missing turn finish/continue signals.");
|
|
4003
|
+
}
|
|
3996
4004
|
success = true;
|
|
3997
4005
|
await incrementUsage("agent");
|
|
3998
4006
|
} catch (err) {
|
|
@@ -4021,6 +4029,7 @@ ${boxBottom}` };
|
|
|
4021
4029
|
const agentErrDir = path15.join(LOGS_DIR, "agent");
|
|
4022
4030
|
if (!fs16.existsSync(agentErrDir)) fs16.mkdirSync(agentErrDir, { recursive: true });
|
|
4023
4031
|
fs16.appendFileSync(path15.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
4032
|
+
DEBUG STATE: turnText='${turnText}', length=${turnText.trim().length}, inStreamRetryCount=${inStreamRetryCount}, retryCount=${retryCount}, isDedupeActive=${isDedupeActive}, dedupeBuffer='${dedupeBuffer}'
|
|
4024
4033
|
|
|
4025
4034
|
----------------------------------------------------------------------
|
|
4026
4035
|
|