fluxflow-cli 3.1.6 → 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.
- package/dist/fluxflow.js +105 -9
- 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 = "
|
|
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" ? "
|
|
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 = "
|
|
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
|
-
|
|
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
|
}
|
|
@@ -19856,7 +19952,7 @@ Selection: ${val}`,
|
|
|
19856
19952
|
), /* @__PURE__ */ React15.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React15.createElement(Text15, { color: "#555555" }, "\u2580".repeat(Math.max(1, terminalSize.columns))))));
|
|
19857
19953
|
}
|
|
19858
19954
|
};
|
|
19859
|
-
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(
|
|
19860
19956
|
BlockItem,
|
|
19861
19957
|
{
|
|
19862
19958
|
key: block.key,
|
|
@@ -20099,7 +20195,7 @@ var init_app = __esm({
|
|
|
20099
20195
|
options.push({ label: "Continue to CLI only", action: "dismiss" });
|
|
20100
20196
|
return options;
|
|
20101
20197
|
};
|
|
20102
|
-
BridgePromo = ({ width, height, selectedIndex }) => {
|
|
20198
|
+
BridgePromo = ({ width, height, selectedIndex, aiProvider }) => {
|
|
20103
20199
|
const ideName = getIDEName();
|
|
20104
20200
|
const options = getPromoOptions(ideName);
|
|
20105
20201
|
return /* @__PURE__ */ React15.createElement(
|
|
@@ -20111,7 +20207,7 @@ var init_app = __esm({
|
|
|
20111
20207
|
width,
|
|
20112
20208
|
height
|
|
20113
20209
|
},
|
|
20114
|
-
/* @__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))),
|
|
20115
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)")))
|
|
20116
20212
|
);
|
|
20117
20213
|
};
|