fluxflow-cli 1.8.24 → 1.8.26

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.
Files changed (2) hide show
  1. package/dist/fluxflow.js +31 -30
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -740,7 +740,7 @@ var init_janitor_tools = __esm({
740
740
  JANITOR_TOOLS_PROTOCOL = (isMemoryEnabled = true, needTitle = true) => `
741
741
  ${needTitle ? `-- START CHAT MANAGEMENT TOOLS --
742
742
  1. YOU MUST UPDATE CHAT TITLE (URGENT PRIORITY):
743
- tool:functions.chat(title='<short creative title of FULL conversation in 3-5 words>')
743
+ 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.
744
744
  -- END CHAT MANAGEMENT TOOLS --
745
745
 
746
746
  ` : ""}
@@ -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, isContext8 = false, maxLoops, currentLoop) => {
797
+ getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, tempMemories = "", userMemories = "", isMemoryEnabled = true, isContext32k = 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,13 +808,13 @@ 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 && !isContext8 ? `
812
- -- RECENT CONTEXT FROM OTHER CHAT THREADS --
811
+ const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `
812
+ -- RECENT CONTEXT FROM OTHER CHAT THREADS (LOW PRIORITY) --
813
813
  ${tempMemories}
814
814
  ------------------------------------------
815
815
  ` : "";
816
816
  const userMemoriesStr = userMemories?.length > 0 ? `
817
- --- PERSISTENT USER MEMORIES ---
817
+ --- PERSISTENT USER MEMORIES (MEDIUM PRIORITY, TUNES PERSONALIZATION & USER PREFERENCES) ---
818
818
  ${userMemories}
819
819
  --------------------------------
820
820
  ` : "";
@@ -823,8 +823,9 @@ ${userMemories}
823
823
  ` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
824
824
 
825
825
  ` : ""}${nameStr}${nicknameStr}${userInstrStr}
826
- --- START SYSTEM INSTRUCTION ---
826
+ --- START SYSTEM INSTRUCTION (STRICT PRIORITY, OVERRIDES EVERYTHING) ---
827
827
  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. 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. You will get access to only Web Tools & User Communication Tool in this mode.`}
828
+ MUST FOLLOW THE "CRITICAL NEWLINE PROTOCOL" ALWAYS.
828
829
  CURRENT_WORKING_DIRECTORY: ${cwdStr}.
829
830
  OS: ${osDetected}. ${osDetected === "Windows" && mode === "Flux" ? "Your terminal commands will run on CMD. 'Prefer using PS scripts via CMD' instead of raw CMD commands." : ""}
830
831
  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.
@@ -833,7 +834,7 @@ If you see a [STEERING HINT] from user, give that prompt priority for the task a
833
834
  -- START THINKING INSTRUCTIONS --
834
835
  ${thinkingConfig}
835
836
 
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. THINKING IS REQUIRED EVEN WITH SIMPLEST CONVERSATIONAL RESPONSES.
837
+ BEFORE USING ANY TOOL THINKING IS **MANDATORY** WITH TOOL RULES. ALWAYS PRIORITIZE THINKING FIRST BEFORE RESPONDING. YOU ARE **FORBIDDEN** TO JUMP TO RESPONSES FIRST. THINKING IS **REQUIRED EVEN WITH SIMPLEST CONVERSATIONAL RESPONSES OR BASIC TASKS**.
837
838
  -- END THINKING INSTRUCTIONS --
838
839
 
839
840
  ${TOOL_PROTOCOL(mode)}
@@ -844,7 +845,7 @@ ${mode === "Flux" ? `
844
845
  3. Skills.md (If exists): Use this for complex workflows. If a task matches a "Skill" defined in this file, execute the documented step-by-step instructions exactly as written.
845
846
  4. 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.
846
847
 
847
- Before starting any task, check for these files and treat them as your primary source of truth, overriding your general training data to remain consistent with this specific project's environment.
848
+ Before starting any task, check for these files and treat them as your primary source of truth, overriding your general training data to remain consistent with this specific project's environment. THIS WOUDLD BE APPLIED FOR PROJECT SPECIFIC INSTRUCTIONS AND SHOULD NOT TRY TO BYPASS YOUR CRITICAL PROTOCOLS OR SAFETY RULES.
848
849
  -- END PROJECT SPECIFIC INSTRUCTIONS --` : ""}
849
850
 
850
851
  -- START MEMORY INSTRUCTIONS --
@@ -866,14 +867,13 @@ Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"}
866
867
  [CORRECT]:
867
868
  tool:functions.write_file(path="test.c", content="#include <stdio.h>
868
869
  int main() {
869
- printf("Hello[/n]");
870
+ printf("Hello[/n]World");
870
871
  return 0;
871
872
  }")
872
873
  [INCORRECT]:
873
874
  tool:functions.write_file(path="test.c", content="#include <stdio.h>\\nint main() {\\nprintf("Hello\\\\n");\\n}")
874
875
  \u{1F6D1} NEVER use '\\\\n' for literals; it will be converted to a real line break and break code syntax.
875
876
  - Structure responses VISUALLY pleasing, easy to read, and beautiful.
876
- - USE GFM Markdown HEAVILY.
877
877
  - 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.
878
878
  - **CRITICAL**: NEVER USE LaTeX IN RESPONSES.
879
879
  - Keep Poems & Literature in Code Block.
@@ -887,7 +887,7 @@ TO END THE LOOP YOU **MUST** WRITE [turn: finish] AT VERY END OF YOUR RESPONSE.
887
887
  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.
888
888
  -- END REPONSE FINISH PROTOCOL --
889
889
 
890
- [Runtime Monitor] Turn Progress: ${currentLoop}/${maxLoops} steps. Aim to finalize the task before the window closes. If the limit is reached, please summarize and invite the user to re-engage.
890
+ [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.
891
891
  Current date and Time is: ${dateTimeStr}
892
892
  --- END SYSTEM INSTRUCTION ---`.trim();
893
893
  };
@@ -2486,18 +2486,17 @@ var init_ai = __esm({
2486
2486
  janitorContents.push({ role: "user", parts: [{ text: janitorPrompt }] });
2487
2487
  let finalSynthesis = "";
2488
2488
  let attempts = 0;
2489
- const MAX_JANITOR_RETRIES = 2;
2489
+ const MAX_JANITOR_RETRIES = 4;
2490
2490
  while (attempts <= MAX_JANITOR_RETRIES) {
2491
2491
  try {
2492
2492
  if (!await checkQuota("background", settings)) {
2493
- console.warn("Quota Exhausted for Background Model. Skipping refinement.");
2494
2493
  return;
2495
2494
  }
2496
2495
  let fullContent = "";
2497
2496
  let lastUsage = null;
2498
2497
  try {
2499
2498
  const timeoutPromise = new Promise(
2500
- (_, reject) => setTimeout(() => reject(new Error("JANITOR_TIMEOUT")), attempts === 1 ? 25e3 : attempts === 2 ? 2e4 : 3e4)
2499
+ (_, reject) => setTimeout(() => reject(new Error("JANITOR_TIMEOUT")), 6e4)
2501
2500
  );
2502
2501
  const streamPromise = (async () => {
2503
2502
  const stream = await client.models.generateContentStream({
@@ -2537,9 +2536,6 @@ var init_ai = __esm({
2537
2536
  }
2538
2537
  }
2539
2538
  } catch (e) {
2540
- if (e.message === "JANITOR_TIMEOUT") {
2541
- console.error("Janitor API Timeout: No tokens received within 30s.");
2542
- }
2543
2539
  throw e;
2544
2540
  }
2545
2541
  if (fullContent) {
@@ -2582,7 +2578,7 @@ DEBUG [${date}]: ${finalSynthesis}
2582
2578
 
2583
2579
  `);
2584
2580
  if (attempts > MAX_JANITOR_RETRIES) break;
2585
- const backoff = Math.min(1e3 * Math.pow(2, attempts - 1), 5e3);
2581
+ const backoff = Math.min(1e3 * Math.pow(2, attempts - 1), 8e3);
2586
2582
  await new Promise((resolve) => setTimeout(resolve, backoff));
2587
2583
  }
2588
2584
  }
@@ -2795,11 +2791,11 @@ DEBUG [${date}]: ${finalSynthesis}
2795
2791
  const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
2796
2792
  const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
2797
2793
  const janitorUserMemories = persistentStorage.map((m) => `- [${m.id}]: ${m.memory}`).join("\n");
2798
- const firstUserMsg = `USER_PROMPT: ${agentText}`.trim();
2794
+ const firstUserMsg = `USER_PROMPT: "${agentText}"`.trim();
2799
2795
  modifiedHistory.push({ role: "user", text: firstUserMsg });
2800
2796
  let lastUsage = null;
2801
2797
  const MAX_LOOPS = mode === "Flux" ? 50 : 7;
2802
- const MAX_RETRIES = 8;
2798
+ const MAX_RETRIES = 16;
2803
2799
  yield { type: "status", content: "Connecting..." };
2804
2800
  TERMINATION_SIGNAL = false;
2805
2801
  let fullAgentResponseChunks = [];
@@ -2865,17 +2861,17 @@ DEBUG [${date}]: ${finalSynthesis}
2865
2861
  throw new Error("Error: Daily Quota Exausted for Agent");
2866
2862
  }
2867
2863
  let targetModel = modelName;
2868
- if (retryCount === 7) {
2864
+ if (retryCount === MAX_RETRIES - 1) {
2869
2865
  targetModel = "gemini-3-flash-preview";
2870
2866
  yield { type: "model_update", content: "Trying with fallback model" };
2871
- } else if (retryCount >= 8) {
2867
+ } else if (retryCount === MAX_RETRIES) {
2872
2868
  targetModel = "gemini-3.1-flash-lite-preview";
2873
2869
  yield { type: "model_update", content: "Trying with fallback model lite" };
2874
2870
  } else if (retryCount > 0) {
2875
2871
  yield { type: "model_update", content: null };
2876
2872
  }
2877
- const isContext8 = (sessionStats.tokens || 0) >= 8e3;
2878
- const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext8, MAX_LOOPS, loop + 1);
2873
+ const isContext32k = (sessionStats.tokens || 0) >= 32e3;
2874
+ const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext32k, MAX_LOOPS, loop + 1);
2879
2875
  stream = await client.models.generateContentStream({
2880
2876
  model: targetModel || "gemma-4-31b-it",
2881
2877
  contents,
@@ -3198,15 +3194,17 @@ ${boxBottom}
3198
3194
  if (turnText.trim().length > 0) {
3199
3195
  if (inStreamRetryCount <= MAX_RETRIES) {
3200
3196
  inStreamRetryCount++;
3201
- const waitTime = Math.min(1e3 * Math.pow(2, inStreamRetryCount - 1), 16e3);
3197
+ const waitTime = Math.min(1e3 * Math.pow(2, inStreamRetryCount - 1), 24e3);
3202
3198
  modifiedHistory.push({ role: "agent", text: turnText });
3203
3199
  if (toolResults.length > 0) {
3204
3200
  toolResults.forEach((tr) => modifiedHistory.push(tr));
3205
3201
  }
3206
3202
  modifiedHistory.push({ role: "user", text: "[SYSTEM] Response got cut for internal error, continue from checkpoint seamlessly and DON'T repeat what you already said!" });
3207
3203
  accumulatedContext += turnText;
3208
- yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [${(waitTime / 1e3).toFixed(0)}s]...` };
3209
- await new Promise((resolve) => setTimeout(resolve, waitTime));
3204
+ for (let i = waitTime / 1e3; i > 0; i--) {
3205
+ yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [${i}s]...` };
3206
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
3207
+ }
3210
3208
  yield { type: "status", content: `Error Occured. Recovering Stream...` };
3211
3209
  } else {
3212
3210
  throw new Error(`Stream collapsed too many times. (Failed to resolve ${MAX_RETRIES} times)
@@ -3215,10 +3213,13 @@ Error Log can be found in ${path16.join(LOGS_DIR, "agent", "error.log")}`);
3215
3213
  } else {
3216
3214
  if (retryCount <= MAX_RETRIES) {
3217
3215
  retryCount++;
3218
- const waitTime = Math.min(1e3 * Math.pow(2, retryCount - 1), 16e3);
3216
+ const waitTime = Math.min(1e3 * Math.pow(2, retryCount - 1), 32e3);
3219
3217
  isInitialAttempt = true;
3220
3218
  yield { type: "status", content: `Retrying Connection (${retryCount}/${MAX_RETRIES}) [${(waitTime / 1e3).toFixed(0)}s]...` };
3221
- await new Promise((resolve) => setTimeout(resolve, waitTime));
3219
+ for (let i = waitTime / 1e3; i > 0; i--) {
3220
+ yield { type: "status", content: `Retrying Connection (${retryCount}/${MAX_RETRIES}) [${i}s]...` };
3221
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
3222
+ }
3222
3223
  yield { type: "status", content: `Retrying Connection...` };
3223
3224
  } else {
3224
3225
  throw new Error(`Model cannot be reached. (Failed ${MAX_RETRIES} times)
@@ -5232,7 +5233,7 @@ var init_app = __esm({
5232
5233
  init_text();
5233
5234
  SESSION_START_TIME = Date.now();
5234
5235
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
5235
- versionFluxflow = "1.8.24";
5236
+ versionFluxflow = "1.8.26";
5236
5237
  updatedOn = "2026-05-11";
5237
5238
  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(
5238
5239
  CommandMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.8.24",
3
+ "version": "1.8.26",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",