fluxflow-cli 3.1.5 → 3.1.7

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 +139 -44
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -3986,7 +3986,7 @@ var init_terminal = __esm({
3986
3986
  }
3987
3987
  return " ".repeat(baseSpaces);
3988
3988
  };
3989
- getFluxLogo = (version = "2.0.0", provider = "Google") => {
3989
+ getFluxLogo = (version = "...", provider = "Loading...") => {
3990
3990
  const quote = STARTUP_QUOTES[Math.floor(Math.random() * STARTUP_QUOTES.length)];
3991
3991
  const art = [
3992
3992
  " \u2588\u2588\u2588 ",
@@ -6549,7 +6549,7 @@ Check these first; These Files > Training Data. Safety rules apply
6549
6549
  const projectContextBlock = cachedProjectContextBlock;
6550
6550
  return `${nameStr}${nicknameStr}${userInstrStr}=== SYSTEM PROMPT ===
6551
6551
  Identity: Flux Flow (by Kushal Roy Chowdhury). ${mode === "Flux" ? "Sassy" : "Conversational, Sassy, Friendly, Humorous, Sarcastic"}, CLI Agent
6552
- Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking)" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Run tests where needed to verify" : "Concise"}
6552
+ Mode: ${mode}${thinkingLevel !== "Fast" ? "" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Run tests where needed to verify" : "Concise"}
6553
6553
 
6554
6554
  -- MARKERS --
6555
6555
  - TOOL SYSTEM: [TOOL RESULT]
@@ -10600,7 +10600,7 @@ __export(ai_exports, {
10600
10600
  import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
10601
10601
  import path21, { normalize } from "path";
10602
10602
  import fs22 from "fs";
10603
- var client, globalSettings, colorMainWords, withRetry, TERMINATION_SIGNAL, MULTIMODAL_MODELS, isModelMultimodal, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getNVIDIAStream, getOpenRouterStream, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
10603
+ var client, globalSettings, colorMainWords, withRetry, TERMINATION_SIGNAL, MULTIMODAL_MODELS, isModelMultimodal, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getNVIDIAStream, wrapNvidiaStreamWithQueueDepth, getOpenRouterStream, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
10604
10604
  var init_ai = __esm({
10605
10605
  async "src/utils/ai.js"() {
10606
10606
  await init_prompts();
@@ -11049,6 +11049,97 @@ var init_ai = __esm({
11049
11049
  }
11050
11050
  }
11051
11051
  };
11052
+ wrapNvidiaStreamWithQueueDepth = async function* (stream, modelName) {
11053
+ const queue = [];
11054
+ let resolveNext = null;
11055
+ let done = false;
11056
+ let error = null;
11057
+ const push = (item) => {
11058
+ queue.push(item);
11059
+ if (resolveNext) {
11060
+ const resolve = resolveNext;
11061
+ resolveNext = null;
11062
+ resolve();
11063
+ }
11064
+ };
11065
+ const cleanModelId = modelName.split("/").pop();
11066
+ const pollUrl = `https://api.ngc.nvidia.com/v2/predict/queues/models/qc69jvmznzxy/${cleanModelId}`;
11067
+ let isStreamingStarted = false;
11068
+ let pollInterval = null;
11069
+ const poll = async () => {
11070
+ try {
11071
+ const res = await fetch(pollUrl);
11072
+ if (res.ok) {
11073
+ const data = await res.json();
11074
+ if (data && data.queues && data.queues[0] && typeof data.queues[0].queueDepth === "number") {
11075
+ const depth = data.queues[0].queueDepth;
11076
+ if (!isStreamingStarted) {
11077
+ push({ value: { type: "status", content: `Queue Depth ${depth}...` }, done: false });
11078
+ }
11079
+ }
11080
+ }
11081
+ } catch (e) {
11082
+ }
11083
+ };
11084
+ poll();
11085
+ pollInterval = setInterval(poll, 5e3);
11086
+ (async () => {
11087
+ try {
11088
+ const iterator = stream[Symbol.asyncIterator]();
11089
+ while (true) {
11090
+ const { value, done: streamDone } = await iterator.next();
11091
+ if (streamDone) {
11092
+ break;
11093
+ }
11094
+ isStreamingStarted = true;
11095
+ if (pollInterval) {
11096
+ clearInterval(pollInterval);
11097
+ pollInterval = null;
11098
+ }
11099
+ push({ value, done: false });
11100
+ }
11101
+ done = true;
11102
+ push(null);
11103
+ } catch (e) {
11104
+ error = e;
11105
+ if (pollInterval) {
11106
+ clearInterval(pollInterval);
11107
+ pollInterval = null;
11108
+ }
11109
+ if (resolveNext) {
11110
+ const resolve = resolveNext;
11111
+ resolveNext = null;
11112
+ resolve();
11113
+ }
11114
+ }
11115
+ })();
11116
+ try {
11117
+ while (true) {
11118
+ if (error) {
11119
+ throw error;
11120
+ }
11121
+ if (queue.length > 0) {
11122
+ const item = queue.shift();
11123
+ if (item === null && done) {
11124
+ break;
11125
+ }
11126
+ yield item.value;
11127
+ } else {
11128
+ if (done) {
11129
+ break;
11130
+ }
11131
+ await new Promise((resolve) => {
11132
+ resolveNext = resolve;
11133
+ });
11134
+ }
11135
+ }
11136
+ } finally {
11137
+ if (pollInterval) {
11138
+ clearInterval(pollInterval);
11139
+ pollInterval = null;
11140
+ }
11141
+ }
11142
+ };
11052
11143
  getOpenRouterStream = async function* (apiKey, model, contents, systemInstruction, thinkingLevel, mode, isMultiModal, signal, temperature = 0.95) {
11053
11144
  const messages = [];
11054
11145
  if (systemInstruction) {
@@ -11928,6 +12019,7 @@ ${newMemoryListStr}
11928
12019
  let targetModel = "gemma-4-26b-a4b-it";
11929
12020
  if (aiProvider === "OpenRouter") targetModel = "google/gemma-4-26b-a4b-it:free";
11930
12021
  if (aiProvider === "DeepSeek") targetModel = "deepseek-v4-flash";
12022
+ if (aiProvider === "NVIDIA") targetModel = "moonshotai/kimi-k2.6";
11931
12023
  while (attempts <= maxAttempts && !success) {
11932
12024
  attempts++;
11933
12025
  try {
@@ -11994,7 +12086,7 @@ Provide a consolidated summary of the entire session.`;
11994
12086
  let targetModel = "gemma-4-26b-a4b-it";
11995
12087
  if (aiProvider === "OpenRouter") targetModel = "google/gemma-4-26b-a4b-it:free";
11996
12088
  if (aiProvider === "DeepSeek") targetModel = "deepseek-v4-flash";
11997
- if (aiProvider === "NVIDIA") targetModel = "stepfun-ai/step-3.7-flash";
12089
+ if (aiProvider === "NVIDIA") targetModel = "moonshotai/kimi-k2.6";
11998
12090
  let attempts = 0;
11999
12091
  let success = false;
12000
12092
  let response = null;
@@ -12373,7 +12465,6 @@ Provide a consolidated summary of the entire session.`;
12373
12465
  };
12374
12466
  yield { type: "status", content: "[start]" };
12375
12467
  yield { type: "status", content: "Gathering Context..." };
12376
- await new Promise((resolve) => setTimeout(resolve, 300));
12377
12468
  const totalFolders = countFolders(process.cwd());
12378
12469
  let dynamicMaxDepth = 12;
12379
12470
  if (totalFolders > 4096) dynamicMaxDepth = 1;
@@ -12935,7 +13026,7 @@ ${ideErr} [/ERROR]`;
12935
13026
  0.99
12936
13027
  );
12937
13028
  } else if (aiProvider === "NVIDIA") {
12938
- stream = getNVIDIAStream(
13029
+ const rawStream = getNVIDIAStream(
12939
13030
  settings.apiKey,
12940
13031
  targetModel,
12941
13032
  activeContents,
@@ -12946,6 +13037,7 @@ ${ideErr} [/ERROR]`;
12946
13037
  abortController.signal,
12947
13038
  0.99
12948
13039
  );
13040
+ stream = wrapNvidiaStreamWithQueueDepth(rawStream, targetModel);
12949
13041
  } else {
12950
13042
  const apiCallPromise = client.models.generateContentStream({
12951
13043
  model: targetModel || "gemini-3-flash-preview",
@@ -13173,6 +13265,10 @@ ${ideErr} [/ERROR]`;
13173
13265
  abortPromise
13174
13266
  ]);
13175
13267
  if (done) break;
13268
+ if (chunk && chunk.type === "status") {
13269
+ yield chunk;
13270
+ continue;
13271
+ }
13176
13272
  if (settings && typeof settings.onTokenChunk === "function") {
13177
13273
  settings.onTokenChunk();
13178
13274
  }
@@ -15771,11 +15867,14 @@ function App({ args = [] }) {
15771
15867
  const diff = Date.now() - lastGCTime || 0;
15772
15868
  if (diff > 3e4) {
15773
15869
  if (global.gc) {
15774
- try {
15775
- global.gc();
15870
+ const gCAsync = async () => {
15871
+ for (let i = 0; i < 1; i++) {
15872
+ global.gc();
15873
+ await new Promise((resolve) => setImmediate(resolve));
15874
+ }
15776
15875
  lastGCTime = Date.now();
15777
- } catch (e) {
15778
- }
15876
+ };
15877
+ gCAsync();
15779
15878
  }
15780
15879
  }
15781
15880
  }
@@ -17506,11 +17605,14 @@ ${cleanText}`, color: "magenta" }];
17506
17605
  chatTokenStartRef.current = sessionTotalTokens;
17507
17606
  setTimeout(() => {
17508
17607
  if (global.gc) {
17509
- try {
17510
- global.gc();
17608
+ const gCAsync = async () => {
17609
+ for (let i = 0; i < 5; i++) {
17610
+ global.gc();
17611
+ await new Promise((resolve) => setImmediate(resolve));
17612
+ }
17511
17613
  lastGCTime = Date.now();
17512
- } catch (e) {
17513
- }
17614
+ };
17615
+ gCAsync();
17514
17616
  }
17515
17617
  }, 500);
17516
17618
  break;
@@ -17530,11 +17632,14 @@ ${cleanText}`, color: "magenta" }];
17530
17632
  });
17531
17633
  setTimeout(() => {
17532
17634
  if (global.gc) {
17533
- try {
17534
- global.gc();
17635
+ const gCAsync = async () => {
17636
+ for (let i = 0; i < 5; i++) {
17637
+ global.gc();
17638
+ await new Promise((resolve) => setImmediate(resolve));
17639
+ }
17535
17640
  lastGCTime = Date.now();
17536
- } catch (e) {
17537
- }
17641
+ };
17642
+ gCAsync();
17538
17643
  }
17539
17644
  }, 500);
17540
17645
  break;
@@ -18387,6 +18492,7 @@ Selection: ${val}`,
18387
18492
  let inToolCallString = null;
18388
18493
  const signalRegex = /\[?\s*turn\s*:\s*.*?\s*\]?/gi;
18389
18494
  for await (const packet of stream) {
18495
+ await new Promise((resolve) => setTimeout(resolve, 3));
18390
18496
  if (packet.type === "text") {
18391
18497
  setLastChunkTime(Date.now());
18392
18498
  }
@@ -18458,14 +18564,11 @@ Selection: ${val}`,
18458
18564
  });
18459
18565
  clearBlocksCache();
18460
18566
  if (global.gc) {
18461
- try {
18567
+ for (let i = 0; i < 2; i++) {
18462
18568
  global.gc();
18463
- setTimeout(() => {
18464
- if (global.gc) global.gc();
18465
- lastGCTime = Date.now();
18466
- }, 100);
18467
- } catch (e) {
18569
+ await new Promise((resolve) => setImmediate(resolve));
18468
18570
  }
18571
+ lastGCTime = Date.now();
18469
18572
  }
18470
18573
  continue;
18471
18574
  }
@@ -18492,20 +18595,9 @@ Selection: ${val}`,
18492
18595
  onBackgroundIncrement: () => setSessionBackgroundCalls((prev) => prev + 1)
18493
18596
  }
18494
18597
  );
18495
- if (global.gc) {
18496
- try {
18497
- global.gc();
18498
- setTimeout(() => {
18499
- if (global.gc) global.gc();
18500
- lastGCTime = Date.now();
18501
- }, 150);
18502
- } catch (e) {
18503
- }
18504
- }
18505
18598
  continue;
18506
18599
  }
18507
18600
  if (packet.type === "visual_feedback") {
18508
- await new Promise((r) => setTimeout(r, 75));
18509
18601
  setMessages((prev) => {
18510
18602
  const updatedPrev = prev.map((m) => m.isStreaming ? { ...m, isStreaming: false } : m);
18511
18603
  const newMsgs = [...updatedPrev, {
@@ -18618,7 +18710,10 @@ Selection: ${val}`,
18618
18710
  let chunkText = packet.content;
18619
18711
  if (packet.type === "text" && chunkText.includes("Request Cancelled")) {
18620
18712
  if (global.gc) {
18621
- global.gc();
18713
+ for (let i = 0; i < 5; i++) {
18714
+ global.gc();
18715
+ await new Promise((resolve) => setImmediate(resolve));
18716
+ }
18622
18717
  lastGCTime = Date.now();
18623
18718
  }
18624
18719
  continue;
@@ -18759,11 +18854,11 @@ Selection: ${val}`,
18759
18854
  clearBlocksCache();
18760
18855
  if (global.gc) {
18761
18856
  try {
18762
- global.gc();
18763
- setTimeout(() => {
18764
- if (global.gc) global.gc();
18765
- lastGCTime = Date.now();
18766
- }, 500);
18857
+ for (let i = 0; i < 5; i++) {
18858
+ global.gc();
18859
+ await new Promise((resolve) => setImmediate(resolve));
18860
+ }
18861
+ lastGCTime = Date.now();
18767
18862
  } catch (e) {
18768
18863
  }
18769
18864
  }
@@ -19857,7 +19952,7 @@ Selection: ${val}`,
19857
19952
  ), /* @__PURE__ */ React15.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React15.createElement(Text15, { color: "#555555" }, "\u2580".repeat(Math.max(1, terminalSize.columns))))));
19858
19953
  }
19859
19954
  };
19860
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, showBridgePromo ? /* @__PURE__ */ React15.createElement(BridgePromo, { width: stdout?.columns || 80, height: stdout?.rows || 24, selectedIndex: promoSelectedIndex }) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React15.createElement(Static, { key: `static-${clearKey}-${chatId}-${terminalSize.columns}-${terminalSize.rows}`, items: parsedBlocks.completed }, (block) => /* @__PURE__ */ React15.createElement(
19955
+ return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, isInitializing ? null : showBridgePromo ? /* @__PURE__ */ React15.createElement(BridgePromo, { width: stdout?.columns || 80, height: stdout?.rows || 24, selectedIndex: promoSelectedIndex, aiProvider }) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React15.createElement(Static, { key: `static-${clearKey}-${chatId}-${terminalSize.columns}-${terminalSize.rows}`, items: parsedBlocks.completed }, (block) => /* @__PURE__ */ React15.createElement(
19861
19956
  BlockItem,
19862
19957
  {
19863
19958
  key: block.key,
@@ -20100,7 +20195,7 @@ var init_app = __esm({
20100
20195
  options.push({ label: "Continue to CLI only", action: "dismiss" });
20101
20196
  return options;
20102
20197
  };
20103
- BridgePromo = ({ width, height, selectedIndex }) => {
20198
+ BridgePromo = ({ width, height, selectedIndex, aiProvider }) => {
20104
20199
  const ideName = getIDEName();
20105
20200
  const options = getPromoOptions(ideName);
20106
20201
  return /* @__PURE__ */ React15.createElement(
@@ -20112,7 +20207,7 @@ var init_app = __esm({
20112
20207
  width,
20113
20208
  height
20114
20209
  },
20115
- /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1, width: Math.min(80, width - 4), justifyContent: "flex-start" }, /* @__PURE__ */ React15.createElement(Text15, null, getFluxLogo(versionFluxflow))),
20210
+ /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1, width: Math.min(80, width - 4), justifyContent: "flex-start" }, /* @__PURE__ */ React15.createElement(Text15, null, getFluxLogo(versionFluxflow, aiProvider))),
20116
20211
  /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "double", borderColor: "grey", paddingX: 3, paddingY: 1, width: Math.min(80, width - 4) }, /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "white", textAlign: "center" }, "\u{1F680} UPGRADE YOUR WORKFLOW"), /* @__PURE__ */ React15.createElement(Box14, { marginY: 1, flexDirection: "column", alignItems: "left" }, /* @__PURE__ */ React15.createElement(Text15, null, "You're in ", /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "cyan" }, ideName), ", but the ", /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "white" }, "FluxFlow-CLI Companion"), " is not installed."), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Real-time IDE context & Error Resolution"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Auto-open files created by agent"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Native DIFFing for AI edits"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Direct IDE context sharing"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Surgical Diagnostic Sync"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Native Right-Click \u276F Chat integration"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Live Status in IDE"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Clickable terminal-to-code links"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, options.map((opt, i) => /* @__PURE__ */ React15.createElement(Box14, { key: i }, /* @__PURE__ */ React15.createElement(Text15, { color: selectedIndex === i ? "yellow" : "white", bold: selectedIndex === i }, selectedIndex === i ? " \u276F " : " ", opt.label)))), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(Text15, { dimColor: true, italic: true }, "(Use arrows to navigate, Enter to select)")))
20117
20212
  );
20118
20213
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "3.1.5",
3
+ "version": "3.1.7",
4
4
  "date": "2026-07-06",
5
5
  "description": "A High-Fidelity Agentic CLI with Sub-Agents for the Flux Era.",
6
6
  "keywords": [