fluxflow-cli 1.8.18 → 1.8.19
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 +62 -58
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -770,19 +770,19 @@ var init_thinking_prompts = __esm({
|
|
|
770
770
|
thinking_prompts_default = {
|
|
771
771
|
Max: `EFFORT_LEVEL: MAX
|
|
772
772
|
Think in a continuous, fluid analytical monologue within the <think>...</think> block. Do NOT use headings, bullet points, or artificial sections. Engage in a deep "Stream of Consciousness" that follows this cognitive path:
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
773
|
+
Deep Analysis: Deconstruct the request into its core technical and logic requirements.
|
|
774
|
+
Hypothesis & Test: Propose multiple solutions mentally and critique them for edge cases or security risks.
|
|
775
|
+
Architectural Planning: Consider the long-term impact on the project structure and maintainability.
|
|
776
|
+
Refinement: Iterate on the chosen path until it is bulletproof.
|
|
777
777
|
|
|
778
778
|
RULES:
|
|
779
779
|
- NO HEADINGS. Just a solid, stable analytical monologue.
|
|
780
780
|
- Be thorough and exhaustive. Explore the 'why' behind every decision.
|
|
781
781
|
- Use internal critique: Question your own logic as you go.
|
|
782
|
-
-
|
|
783
|
-
High: "EFFORT_LEVEL: HIGH\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:\
|
|
784
|
-
Medium: "EFFORT_LEVEL: MEDIUM\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:\
|
|
785
|
-
Minimal: "EFFORT_LEVEL: LOW\nThink in a brief, focused monologue within the <think>...</think> block. No headings. Just a quick mental check before acting:\
|
|
782
|
+
- MANDATORY REASONING: You MUST engage in full reasoning regardless of perceived simplicity.`,
|
|
783
|
+
High: "EFFORT_LEVEL: HIGH\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.\n\nRULES:\n- NO HEADINGS. Maintain a fluid monologue style.\n- Be detailed and rigorous in your self-questioning.\n- Focus on accuracy and technical correctness.\n- MANDATORY REASONING: You MUST enter reasoning to verify the path forward.",
|
|
784
|
+
Medium: "EFFORT_LEVEL: MEDIUM\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.\n\nRULES:\n- NO HEADINGS. Keep it as a simple, logical stream.\n- Be efficient. Spend energy only on what matters for the task.\n- REQUIRED REASONING: Engage in a baseline mental check for all technical tasks.",
|
|
785
|
+
Minimal: "EFFORT_LEVEL: LOW\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.\n\nRULES:\n- NO HEADINGS. Just a few lines of clear, linear thought.\n- Use minimal/no thinking for simple or conversational requests."
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
788
|
});
|
|
@@ -794,7 +794,7 @@ var init_prompts = __esm({
|
|
|
794
794
|
init_main_tools();
|
|
795
795
|
init_janitor_tools();
|
|
796
796
|
init_thinking_prompts();
|
|
797
|
-
getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMemories = "", userMemories = "", isMemoryEnabled = true,
|
|
797
|
+
getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMemories = "", userMemories = "", isMemoryEnabled = true, isContext8 = false, maxLoops, currentLoop) => {
|
|
798
798
|
let levelKey = thinkingLevel;
|
|
799
799
|
if (thinkingLevel === "Low") levelKey = "Minimal";
|
|
800
800
|
if (thinkingLevel === "xHigh" || thinkingLevel === "Max") levelKey = "Max";
|
|
@@ -808,7 +808,7 @@ var init_prompts = __esm({
|
|
|
808
808
|
` : "";
|
|
809
809
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
810
810
|
const cwdStr = process.cwd();
|
|
811
|
-
const tempMemoriesStr = tempMemories?.length > 0 && !
|
|
811
|
+
const tempMemoriesStr = tempMemories?.length > 0 && !isContext8 ? `
|
|
812
812
|
-- RECENT CONTEXT FROM OTHER CHAT THREADS --
|
|
813
813
|
${tempMemories}
|
|
814
814
|
------------------------------------------
|
|
@@ -833,7 +833,7 @@ If you see a [STEERING HINT] from user, give that prompt priority for the task a
|
|
|
833
833
|
-- START THINKING INSTRUCTIONS --
|
|
834
834
|
${thinkingConfig}
|
|
835
835
|
|
|
836
|
-
BEFORE USING ANY TOOL THINKING IS **MANDATORY
|
|
836
|
+
BEFORE USING ANY TOOL THINKING IS **MANDATORY** WITH TOOL RULES. ALWAYS PRIORITIZE THINKING FIRST BEFORE RESPONDING. YOU ARE **FORBIDDEN** TO JUMP TO RESPONSES FIRST.
|
|
837
837
|
-- END THINKING INSTRUCTIONS --
|
|
838
838
|
|
|
839
839
|
${TOOL_PROTOCOL(mode)}
|
|
@@ -1488,7 +1488,7 @@ var init_memory = __esm({
|
|
|
1488
1488
|
if (!content) return "ERROR: Missing 'content' for temp memory.";
|
|
1489
1489
|
const tempStorage = readEncryptedJson(TEMP_MEM_FILE, {});
|
|
1490
1490
|
if (!tempStorage[chatId]) tempStorage[chatId] = [];
|
|
1491
|
-
const MAX_CHARS =
|
|
1491
|
+
const MAX_CHARS = 2e3 * 4;
|
|
1492
1492
|
let currentTotalLength = tempStorage[chatId].reduce((acc, m) => acc + m.length, 0);
|
|
1493
1493
|
while (tempStorage[chatId].length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1494
1494
|
const removed = tempStorage[chatId].shift();
|
|
@@ -2665,7 +2665,7 @@ var init_ai = __esm({
|
|
|
2665
2665
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
2666
2666
|
let lastUsage = null;
|
|
2667
2667
|
const MAX_LOOPS = mode === "Flux" ? 50 : 7;
|
|
2668
|
-
const MAX_RETRIES =
|
|
2668
|
+
const MAX_RETRIES = 8;
|
|
2669
2669
|
yield { type: "status", content: "Connecting..." };
|
|
2670
2670
|
TERMINATION_SIGNAL = false;
|
|
2671
2671
|
let fullAgentResponseChunks = [];
|
|
@@ -2698,16 +2698,18 @@ var init_ai = __esm({
|
|
|
2698
2698
|
}
|
|
2699
2699
|
let stream;
|
|
2700
2700
|
let success = false;
|
|
2701
|
-
let retryCount =
|
|
2701
|
+
let retryCount = 1;
|
|
2702
|
+
let inStreamRetryCount = 1;
|
|
2702
2703
|
let turnText = "";
|
|
2703
2704
|
let lastToolSniffed = null;
|
|
2704
2705
|
let lastToolEventTime = null;
|
|
2705
2706
|
let toolResults = [];
|
|
2706
2707
|
let toolCallPointer = 0;
|
|
2707
2708
|
let isThinkingLoop = false;
|
|
2709
|
+
let isStutteringLoop = false;
|
|
2708
2710
|
let isInitialAttempt = true;
|
|
2709
2711
|
let accumulatedContext = "";
|
|
2710
|
-
while (retryCount <= MAX_RETRIES && !success && !TERMINATION_SIGNAL) {
|
|
2712
|
+
while (retryCount <= MAX_RETRIES && inStreamRetryCount <= MAX_RETRIES && !success && !TERMINATION_SIGNAL) {
|
|
2711
2713
|
try {
|
|
2712
2714
|
if (isInitialAttempt) {
|
|
2713
2715
|
yield { type: "turn_reset", content: true };
|
|
@@ -2729,48 +2731,32 @@ var init_ai = __esm({
|
|
|
2729
2731
|
throw new Error("Error: Daily Quota Exausted for Agent");
|
|
2730
2732
|
}
|
|
2731
2733
|
let targetModel = modelName;
|
|
2732
|
-
if (retryCount ===
|
|
2734
|
+
if (retryCount === 6) {
|
|
2733
2735
|
targetModel = "gemini-3-flash-preview";
|
|
2734
2736
|
yield { type: "model_update", content: "Trying with fallback model" };
|
|
2735
|
-
} else if (retryCount >=
|
|
2737
|
+
} else if (retryCount >= 7) {
|
|
2736
2738
|
targetModel = "gemini-3.1-flash-lite-preview";
|
|
2737
2739
|
yield { type: "model_update", content: "Trying with fallback model lite" };
|
|
2738
2740
|
} else if (retryCount > 0) {
|
|
2739
2741
|
yield { type: "model_update", content: null };
|
|
2740
2742
|
}
|
|
2741
|
-
const
|
|
2742
|
-
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled,
|
|
2743
|
+
const isContext8 = (sessionStats.tokens || 0) >= 8e3;
|
|
2744
|
+
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext8, MAX_LOOPS, loop + 1);
|
|
2743
2745
|
stream = await client.models.generateContentStream({
|
|
2744
2746
|
model: targetModel || "gemma-4-31b-it",
|
|
2745
2747
|
contents,
|
|
2746
2748
|
config: {
|
|
2747
2749
|
systemInstruction: currentSystemInstruction,
|
|
2748
|
-
temperature: mode === "Flux" ?
|
|
2750
|
+
temperature: mode === "Flux" ? 0.99 : 1.4,
|
|
2749
2751
|
maxOutputTokens: 32768,
|
|
2750
2752
|
mediaResolution: "MEDIA_RESOLUTION_MEDIUM",
|
|
2751
2753
|
safetySettings: [
|
|
2752
|
-
{
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
}
|
|
2756
|
-
{
|
|
2757
|
-
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
|
|
2758
|
-
threshold: HarmBlockThreshold.BLOCK_NONE
|
|
2759
|
-
},
|
|
2760
|
-
{
|
|
2761
|
-
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
|
|
2762
|
-
threshold: HarmBlockThreshold.BLOCK_NONE
|
|
2763
|
-
},
|
|
2764
|
-
{
|
|
2765
|
-
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
|
|
2766
|
-
threshold: HarmBlockThreshold.BLOCK_NONE
|
|
2767
|
-
}
|
|
2754
|
+
{ category: HarmCategory.HARM_CATEGORY_HARASSMENT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
2755
|
+
{ category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
2756
|
+
{ category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
2757
|
+
{ category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_NONE }
|
|
2768
2758
|
],
|
|
2769
|
-
thinkingConfig: {
|
|
2770
|
-
includeThoughts: false,
|
|
2771
|
-
thinkingLevel: ThinkingLevel.MINIMAL
|
|
2772
|
-
// Gemma's API Reasoning is bad. Keep it Minimal.
|
|
2773
|
-
}
|
|
2759
|
+
thinkingConfig: { includeThoughts: false, thinkingLevel: targetModel.includes("pro") ? ThinkingLevel.HIGH : ThinkingLevel.MINIMAL }
|
|
2774
2760
|
}
|
|
2775
2761
|
});
|
|
2776
2762
|
turnText = "";
|
|
@@ -2832,9 +2818,16 @@ var init_ai = __esm({
|
|
|
2832
2818
|
const wordCount = thinkContent.split(/\s+/).filter((w) => w.length > 0).length;
|
|
2833
2819
|
let repetitionThresholdThinking = 0.4;
|
|
2834
2820
|
let repetitionThresholdResponse = 0.6;
|
|
2835
|
-
|
|
2821
|
+
const thinkingCaps = {
|
|
2822
|
+
"low": 200,
|
|
2823
|
+
"medium": 500,
|
|
2824
|
+
"high": 2e3,
|
|
2825
|
+
"max": 3500
|
|
2826
|
+
};
|
|
2827
|
+
const cap = thinkingCaps[thinkingLevel?.toLowerCase()] || 2500;
|
|
2828
|
+
let isOverVerboseThinking = wordCount > cap;
|
|
2836
2829
|
if (repetitionRatio > repetitionThresholdThinking || isOverVerboseThinking) {
|
|
2837
|
-
const reason = repetitionRatio > repetitionThresholdThinking ? "Thinking Loop Detected" : "
|
|
2830
|
+
const reason = repetitionRatio > repetitionThresholdThinking ? "Thinking Loop Detected" : "Thinking Budget Exceeded";
|
|
2838
2831
|
yield { type: "status", content: `${reason}. Re-centering...` };
|
|
2839
2832
|
isThinkingLoop = true;
|
|
2840
2833
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
@@ -2864,6 +2857,7 @@ var init_ai = __esm({
|
|
|
2864
2857
|
if (stutterDetected) {
|
|
2865
2858
|
yield { type: "status", content: `Stuttering Detected. Re-centering...` };
|
|
2866
2859
|
isThinkingLoop = false;
|
|
2860
|
+
isStutteringLoop = true;
|
|
2867
2861
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
2868
2862
|
break;
|
|
2869
2863
|
}
|
|
@@ -3067,24 +3061,33 @@ ${boxBottom}
|
|
|
3067
3061
|
----------------------------------------------------------------------
|
|
3068
3062
|
|
|
3069
3063
|
`);
|
|
3070
|
-
if (
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3064
|
+
if (turnText.trim().length > 0) {
|
|
3065
|
+
if (inStreamRetryCount <= MAX_RETRIES) {
|
|
3066
|
+
inStreamRetryCount++;
|
|
3067
|
+
const waitTime = Math.floor(Math.random() * (3e3 - 1e3 + 1)) + 1e3;
|
|
3074
3068
|
modifiedHistory.push({ role: "agent", text: turnText });
|
|
3075
3069
|
if (toolResults.length > 0) {
|
|
3076
3070
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
3077
3071
|
}
|
|
3078
3072
|
modifiedHistory.push({ role: "user", text: "[SYSTEM] Response got cut for internal error, continue from checkpoint seamlessly and DON'T repeat what you already said!" });
|
|
3079
3073
|
accumulatedContext += turnText;
|
|
3080
|
-
yield { type: "status", content: `Recovering
|
|
3074
|
+
yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES})...` };
|
|
3075
|
+
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
3081
3076
|
} else {
|
|
3082
|
-
|
|
3083
|
-
|
|
3077
|
+
throw new Error(`Stream collapsed too many times. (Failed to resolve ${MAX_RETRIES} times)
|
|
3078
|
+
Error Log can be found in ${path16.join(LOGS_DIR, "agent", "error.log")}`);
|
|
3084
3079
|
}
|
|
3085
|
-
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
3086
3080
|
} else {
|
|
3087
|
-
|
|
3081
|
+
if (retryCount <= MAX_RETRIES) {
|
|
3082
|
+
retryCount++;
|
|
3083
|
+
const waitTime = Math.floor(Math.random() * (3e3 - 1e3 + 1)) + 1e3;
|
|
3084
|
+
isInitialAttempt = true;
|
|
3085
|
+
yield { type: "status", content: `Retrying Connection (${retryCount}/${MAX_RETRIES})...` };
|
|
3086
|
+
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
3087
|
+
} else {
|
|
3088
|
+
throw new Error(`Model cannot be reached. (Failed ${MAX_RETRIES} times)
|
|
3089
|
+
Error Log can be found in ${path16.join(LOGS_DIR, "agent", "error.log")}`);
|
|
3090
|
+
}
|
|
3088
3091
|
}
|
|
3089
3092
|
}
|
|
3090
3093
|
}
|
|
@@ -3243,8 +3246,9 @@ ${timestamp}`;
|
|
|
3243
3246
|
if (toolResults.length > 0) {
|
|
3244
3247
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
3245
3248
|
} else {
|
|
3246
|
-
modifiedHistory.push({ role: "user", text: `[SYSTEM]: ${isThinkingLoop ? "OVER-THINKING " : ""}LOOP DETECTED by Internal System. ${isThinkingLoop ? "If you have planned the task, prioritize the execution/output. " : "If you have finished your task use [turn: finish] else continue."}` });
|
|
3249
|
+
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."}`}` });
|
|
3247
3250
|
isThinkingLoop = false;
|
|
3251
|
+
isStutteringLoop = false;
|
|
3248
3252
|
}
|
|
3249
3253
|
}
|
|
3250
3254
|
yield { type: "status", content: null };
|
|
@@ -3928,10 +3932,10 @@ Check what's new using \`/changelog\` command.`,
|
|
|
3928
3932
|
cmd: "/model",
|
|
3929
3933
|
desc: "Switch AI model",
|
|
3930
3934
|
subs: [
|
|
3931
|
-
{ cmd: "gemma-4-31b-it", desc: apiTier === "Free" ? "Standard Default (Free, Recommended)" : "Standard Default (Free, Recommended) -
|
|
3935
|
+
{ cmd: "gemma-4-31b-it", desc: apiTier === "Free" ? "Standard Default (Free, Recommended)" : "Standard Default (Free, Recommended) - Use Free API Key to use this model " },
|
|
3932
3936
|
{ cmd: "gemini-3.1-pro-preview", desc: "Most Capable (Paid)" },
|
|
3933
|
-
{ cmd: "gemini-3-flash-preview", desc: "Fast & Lightweight (Paid, Free
|
|
3934
|
-
{ cmd: "gemini-3.1-flash-lite-preview", desc: "Ultra Fast (Paid, Free
|
|
3937
|
+
{ cmd: "gemini-3-flash-preview", desc: "Fast & Lightweight (Paid, Limited Free quota)" },
|
|
3938
|
+
{ cmd: "gemini-3.1-flash-lite-preview", desc: "Ultra Fast (Paid, Decent Free quota)" }
|
|
3935
3939
|
]
|
|
3936
3940
|
},
|
|
3937
3941
|
{ cmd: "/settings", desc: "Configure system prefs" },
|
|
@@ -4951,7 +4955,7 @@ Selection: ${val}`,
|
|
|
4951
4955
|
setActiveView("chat");
|
|
4952
4956
|
setTimeout(() => {
|
|
4953
4957
|
handleSubmit(val);
|
|
4954
|
-
},
|
|
4958
|
+
}, 200);
|
|
4955
4959
|
},
|
|
4956
4960
|
onEdit: (val) => {
|
|
4957
4961
|
setResolutionData(null);
|
|
@@ -5198,7 +5202,7 @@ var init_app = __esm({
|
|
|
5198
5202
|
init_text();
|
|
5199
5203
|
SESSION_START_TIME = Date.now();
|
|
5200
5204
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
5201
|
-
versionFluxflow = "1.8.
|
|
5205
|
+
versionFluxflow = "1.8.19";
|
|
5202
5206
|
updatedOn = "2026-05-10";
|
|
5203
5207
|
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(
|
|
5204
5208
|
CommandMenu,
|