fluxflow-cli 3.0.12 → 3.0.13
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 +230 -146
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -4267,9 +4267,8 @@ var init_ChatLayout = __esm({
|
|
|
4267
4267
|
} else {
|
|
4268
4268
|
content = wrapText(trimmed, columns - 4);
|
|
4269
4269
|
}
|
|
4270
|
-
const linesOfContent = content.split("\n");
|
|
4271
4270
|
result.push(
|
|
4272
|
-
/* @__PURE__ */ React4.createElement(Box3, { key: i, flexDirection: "column", width: "100%" },
|
|
4271
|
+
/* @__PURE__ */ React4.createElement(Box3, { key: i, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: content, color, italic }))
|
|
4273
4272
|
);
|
|
4274
4273
|
}
|
|
4275
4274
|
});
|
|
@@ -4987,8 +4986,8 @@ function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
|
4987
4986
|
var CustomItem;
|
|
4988
4987
|
var init_CommandMenu = __esm({
|
|
4989
4988
|
"src/components/CommandMenu.jsx"() {
|
|
4990
|
-
CustomItem = ({ label
|
|
4991
|
-
const isCancel =
|
|
4989
|
+
CustomItem = ({ label, isSelected }) => {
|
|
4990
|
+
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
4992
4991
|
return /* @__PURE__ */ React6.createElement(
|
|
4993
4992
|
Box5,
|
|
4994
4993
|
{
|
|
@@ -4997,7 +4996,7 @@ var init_CommandMenu = __esm({
|
|
|
4997
4996
|
paddingX: 1,
|
|
4998
4997
|
width: "100%"
|
|
4999
4998
|
},
|
|
5000
|
-
/* @__PURE__ */ React6.createElement(Text6, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ",
|
|
4999
|
+
/* @__PURE__ */ React6.createElement(Text6, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ", label)
|
|
5001
5000
|
);
|
|
5002
5001
|
};
|
|
5003
5002
|
}
|
|
@@ -5189,7 +5188,9 @@ ${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative to CWD & WILL BE FIRST A
|
|
|
5189
5188
|
9. [tool:functions.await(time="seconds")]. For waiting without exiting agent loop, 15s - 180s
|
|
5190
5189
|
|
|
5191
5190
|
-- SUB AGENTS DEFINITIONS --
|
|
5192
|
-
|
|
5191
|
+
**USING SUB AGENTS HIGHLY PREFERRED FOR MOST TASK**
|
|
5192
|
+
USE PROACTIVELY WITHOUT EXPLICIT USER COMMAND ALLOWED
|
|
5193
|
+
|
|
5193
5194
|
Invocation Types:
|
|
5194
5195
|
- invoke (async, background worker for parallel tasks, upto 7 parallel agents together). Can take long time, If invoked DO NOT REPEAT SAME TASK AGAIN UNLESS subagent returns ERROR. Usage: Benefits parallelism & speed
|
|
5195
5196
|
- invokeSync (sync, blocking main agent loop). Usage: Repeatetive work, Sequential tasks, Task delegation. Huge tokens/costs savings
|
|
@@ -8412,10 +8413,10 @@ var init_ask_user = __esm({
|
|
|
8412
8413
|
if (key.startsWith("option")) {
|
|
8413
8414
|
const val = parsed[key];
|
|
8414
8415
|
if (typeof val === "string" && val.includes("::")) {
|
|
8415
|
-
const [
|
|
8416
|
+
const [label, desc] = val.split("::");
|
|
8416
8417
|
options.push({
|
|
8417
8418
|
id: key,
|
|
8418
|
-
label:
|
|
8419
|
+
label: label.trim(),
|
|
8419
8420
|
description: desc.trim()
|
|
8420
8421
|
});
|
|
8421
8422
|
} else {
|
|
@@ -9282,13 +9283,13 @@ function traverse(node, depth = 0, isLast = true, prefix = "", parentName = null
|
|
|
9282
9283
|
const startLine = node.startPosition.row + 1;
|
|
9283
9284
|
const endLine = node.endPosition.row + 1;
|
|
9284
9285
|
const camelType = toCamelCase(type);
|
|
9285
|
-
const
|
|
9286
|
+
const label = name ? `${camelType} [${name}]` : camelType;
|
|
9286
9287
|
if (depth === 0) {
|
|
9287
9288
|
result += `\u{1F4C1} ROOT (Lines: ${startLine}-${endLine})
|
|
9288
9289
|
`;
|
|
9289
9290
|
nextPrefix = prefix;
|
|
9290
9291
|
} else {
|
|
9291
|
-
result += `${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}${
|
|
9292
|
+
result += `${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}${label} (Lines: ${startLine}-${endLine})
|
|
9292
9293
|
`;
|
|
9293
9294
|
nextPrefix += isLast ? " " : "\u2502 ";
|
|
9294
9295
|
}
|
|
@@ -9671,9 +9672,22 @@ var init_invoke = __esm({
|
|
|
9671
9672
|
let currentTurnLogs = [];
|
|
9672
9673
|
const subagentContext = {
|
|
9673
9674
|
...context,
|
|
9674
|
-
onVisualFeedback:
|
|
9675
|
+
onVisualFeedback: (feedbackLabel) => {
|
|
9676
|
+
taskEntry.lastChunkTime = Date.now();
|
|
9677
|
+
const clean = feedbackLabel.replace(/\x1b\[[0-9;]*m/g, "");
|
|
9678
|
+
const match = clean.match(/[✔✘✗✖🔍📖→➕↻•]\s*([A-Za-z0-9\s-]+)/);
|
|
9679
|
+
if (match) {
|
|
9680
|
+
taskEntry.currentTool = match[1].trim();
|
|
9681
|
+
} else {
|
|
9682
|
+
taskEntry.currentTool = clean;
|
|
9683
|
+
}
|
|
9684
|
+
if (context.onSubagentUpdate) {
|
|
9685
|
+
context.onSubagentUpdate();
|
|
9686
|
+
}
|
|
9687
|
+
},
|
|
9675
9688
|
onTokenChunk: () => {
|
|
9676
9689
|
taskEntry.lastChunkTime = Date.now();
|
|
9690
|
+
taskEntry.currentTool = "Thinking";
|
|
9677
9691
|
if (context.onSubagentUpdate) {
|
|
9678
9692
|
context.onSubagentUpdate();
|
|
9679
9693
|
}
|
|
@@ -9689,7 +9703,9 @@ var init_invoke = __esm({
|
|
|
9689
9703
|
if (logMessage.includes("[Executing Tool]")) {
|
|
9690
9704
|
const m = logMessage.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);
|
|
9691
9705
|
if (m) {
|
|
9692
|
-
taskEntry.currentTool
|
|
9706
|
+
if (!taskEntry.currentTool || taskEntry.currentTool === "Thinking") {
|
|
9707
|
+
taskEntry.currentTool = m[1];
|
|
9708
|
+
}
|
|
9693
9709
|
}
|
|
9694
9710
|
}
|
|
9695
9711
|
let displayLog = logMessage;
|
|
@@ -9727,6 +9743,7 @@ ${finalAnswer}`);
|
|
|
9727
9743
|
});
|
|
9728
9744
|
|
|
9729
9745
|
// src/tools/getProgress.js
|
|
9746
|
+
import fs20 from "fs";
|
|
9730
9747
|
var getProgress;
|
|
9731
9748
|
var init_getProgress = __esm({
|
|
9732
9749
|
"src/tools/getProgress.js"() {
|
|
@@ -9754,7 +9771,72 @@ var init_getProgress = __esm({
|
|
|
9754
9771
|
task.progress.forEach((turnLogs, index) => {
|
|
9755
9772
|
output += `--- Turn ${index + 1} ---
|
|
9756
9773
|
`;
|
|
9757
|
-
|
|
9774
|
+
const processedLogs = turnLogs.map((log) => {
|
|
9775
|
+
if (log.startsWith("[Subagent Response]")) {
|
|
9776
|
+
const header = "[Subagent Response]";
|
|
9777
|
+
const body = log.substring(header.length);
|
|
9778
|
+
let result = body;
|
|
9779
|
+
const trigger = "tool:functions.";
|
|
9780
|
+
while (true) {
|
|
9781
|
+
const lowerResult = result.toLowerCase();
|
|
9782
|
+
const triggerIdx = lowerResult.indexOf(trigger);
|
|
9783
|
+
if (triggerIdx === -1) break;
|
|
9784
|
+
let startIdx = triggerIdx;
|
|
9785
|
+
let hasOuterBracket = false;
|
|
9786
|
+
let k = triggerIdx - 1;
|
|
9787
|
+
while (k >= 0 && /\s/.test(result[k])) k--;
|
|
9788
|
+
if (k >= 0 && result[k] === "[") {
|
|
9789
|
+
startIdx = k;
|
|
9790
|
+
hasOuterBracket = true;
|
|
9791
|
+
}
|
|
9792
|
+
let balance = 0;
|
|
9793
|
+
let foundStart = false;
|
|
9794
|
+
let inString = null;
|
|
9795
|
+
let j = triggerIdx;
|
|
9796
|
+
while (j < result.length) {
|
|
9797
|
+
const char = result[j];
|
|
9798
|
+
if (!inString && (char === "'" || char === '"' || char === "`")) {
|
|
9799
|
+
inString = char;
|
|
9800
|
+
} else if (inString && char === inString && result[j - 1] !== "\\") {
|
|
9801
|
+
inString = null;
|
|
9802
|
+
}
|
|
9803
|
+
if (!inString) {
|
|
9804
|
+
if (char === "(") {
|
|
9805
|
+
balance++;
|
|
9806
|
+
foundStart = true;
|
|
9807
|
+
} else if (char === ")") {
|
|
9808
|
+
balance--;
|
|
9809
|
+
}
|
|
9810
|
+
}
|
|
9811
|
+
if (foundStart && balance === 0 && !inString) {
|
|
9812
|
+
let endIdx = j;
|
|
9813
|
+
if (hasOuterBracket) {
|
|
9814
|
+
let m = j + 1;
|
|
9815
|
+
while (m < result.length && /\s/.test(result[m])) m++;
|
|
9816
|
+
if (m < result.length && result[m] === "]") {
|
|
9817
|
+
endIdx = m;
|
|
9818
|
+
}
|
|
9819
|
+
}
|
|
9820
|
+
result = result.substring(0, startIdx) + result.substring(endIdx + 1);
|
|
9821
|
+
break;
|
|
9822
|
+
}
|
|
9823
|
+
j++;
|
|
9824
|
+
if (j === result.length) {
|
|
9825
|
+
result = result.substring(0, startIdx);
|
|
9826
|
+
break;
|
|
9827
|
+
}
|
|
9828
|
+
}
|
|
9829
|
+
}
|
|
9830
|
+
return header + "\n" + result.trim();
|
|
9831
|
+
}
|
|
9832
|
+
if (log.startsWith("[Executing Tool]")) {
|
|
9833
|
+
if (log.length > 256) {
|
|
9834
|
+
return log.substring(0, 256) + "...[truncated from logs]";
|
|
9835
|
+
}
|
|
9836
|
+
}
|
|
9837
|
+
return log;
|
|
9838
|
+
});
|
|
9839
|
+
output += processedLogs.join("\n") + "\n\n";
|
|
9758
9840
|
});
|
|
9759
9841
|
if (task.status === "completed" && task.finalAnswer) {
|
|
9760
9842
|
output += `Final Answer:
|
|
@@ -9764,6 +9846,7 @@ ${task.finalAnswer}
|
|
|
9764
9846
|
output += `Failure Error: ${task.error}
|
|
9765
9847
|
`;
|
|
9766
9848
|
}
|
|
9849
|
+
fs20.writeFileSync("progress.txt", output.trim());
|
|
9767
9850
|
return output.trim();
|
|
9768
9851
|
};
|
|
9769
9852
|
}
|
|
@@ -10034,7 +10117,7 @@ __export(ai_exports, {
|
|
|
10034
10117
|
});
|
|
10035
10118
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
10036
10119
|
import path19 from "path";
|
|
10037
|
-
import
|
|
10120
|
+
import fs21 from "fs";
|
|
10038
10121
|
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;
|
|
10039
10122
|
var init_ai = __esm({
|
|
10040
10123
|
async "src/utils/ai.js"() {
|
|
@@ -10053,9 +10136,9 @@ var init_ai = __esm({
|
|
|
10053
10136
|
init_editor();
|
|
10054
10137
|
client = null;
|
|
10055
10138
|
globalSettings = {};
|
|
10056
|
-
colorMainWords = (
|
|
10057
|
-
if (!
|
|
10058
|
-
return
|
|
10139
|
+
colorMainWords = (label) => {
|
|
10140
|
+
if (!label) return label;
|
|
10141
|
+
return label.replace(/(?:(\x1b\[\d+m))?([✔✘✖🔍📖→➕↻•])(?:(\x1b\[\d+m))?\s*\b(Created|Read|Edited|Viewed|Auto-Read|List|Generated|Written|Searched|Get Map|Write Canceled|Edit Canceled|Write Cancelled|Edit Denied|Visited|Updated|Reviewed|Delegated|Background|Checked|Indexed|Analyzed|Browsed|Elevating SubAgent|Checking SubAgent Work|Unsupported Modality|Awaiting)\b/ig, (match, ansiBefore, icon, ansiAfter, word) => {
|
|
10059
10142
|
return `${ansiBefore || ""}${icon}${ansiAfter || ""} \x1B[95m${word}\x1B[0m`;
|
|
10060
10143
|
});
|
|
10061
10144
|
};
|
|
@@ -10899,8 +10982,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10899
10982
|
})() : String(err);
|
|
10900
10983
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
10901
10984
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10902
|
-
if (!
|
|
10903
|
-
|
|
10985
|
+
if (!fs21.existsSync(janitorErrDir)) fs21.mkdirSync(janitorErrDir, { recursive: true });
|
|
10986
|
+
fs21.appendFileSync(path19.join(janitorErrDir, "error.log"), `ERROR [Attempt ${attempts}/${MAX_JANITOR_RETRIES + 1}] [${date}]: ${errLog}
|
|
10904
10987
|
|
|
10905
10988
|
`);
|
|
10906
10989
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -10910,7 +10993,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10910
10993
|
}
|
|
10911
10994
|
if (attempts) {
|
|
10912
10995
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10913
|
-
|
|
10996
|
+
fs21.appendFileSync(path19.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
10914
10997
|
|
|
10915
10998
|
`);
|
|
10916
10999
|
if (attempts >= MAX_JANITOR_RETRIES) {
|
|
@@ -11385,8 +11468,8 @@ ${newMemoryListStr}
|
|
|
11385
11468
|
})() : String(err);
|
|
11386
11469
|
;
|
|
11387
11470
|
const janitorLogDir = path19.join(LOGS_DIR, "janitor");
|
|
11388
|
-
if (!
|
|
11389
|
-
|
|
11471
|
+
if (!fs21.existsSync(janitorLogDir)) fs21.mkdirSync(janitorLogDir, { recursive: true });
|
|
11472
|
+
fs21.appendFileSync(
|
|
11390
11473
|
path19.join(janitorLogDir, "error.log"),
|
|
11391
11474
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${errLog}
|
|
11392
11475
|
`
|
|
@@ -11470,7 +11553,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11470
11553
|
deleteChatSummary = (chatId) => {
|
|
11471
11554
|
try {
|
|
11472
11555
|
const summariesFile = path19.join(SECRET_DIR, "chat-summaries.json");
|
|
11473
|
-
if (
|
|
11556
|
+
if (fs21.existsSync(summariesFile)) {
|
|
11474
11557
|
const summaries = readEncryptedJson(summariesFile, {});
|
|
11475
11558
|
if (summaries[chatId]) {
|
|
11476
11559
|
delete summaries[chatId];
|
|
@@ -11713,7 +11796,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11713
11796
|
];
|
|
11714
11797
|
const safeReaddirWithTypes = (dir) => {
|
|
11715
11798
|
try {
|
|
11716
|
-
return
|
|
11799
|
+
return fs21.readdirSync(dir, { withFileTypes: true });
|
|
11717
11800
|
} catch (e) {
|
|
11718
11801
|
return [];
|
|
11719
11802
|
}
|
|
@@ -12003,8 +12086,8 @@ ${ideCtx.warnings}
|
|
|
12003
12086
|
filePath = tagClean.slice(0, matchRange.index);
|
|
12004
12087
|
}
|
|
12005
12088
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
12006
|
-
if (
|
|
12007
|
-
const stats =
|
|
12089
|
+
if (fs21.existsSync(absPath)) {
|
|
12090
|
+
const stats = fs21.statSync(absPath);
|
|
12008
12091
|
if (stats.isFile()) {
|
|
12009
12092
|
const pathLower = filePath.toLowerCase();
|
|
12010
12093
|
const isPdf = pathLower.endsWith(".pdf");
|
|
@@ -12013,6 +12096,7 @@ ${ideCtx.warnings}
|
|
|
12013
12096
|
const isMultimodalFile = isImage || isPdf || isOfficeFile;
|
|
12014
12097
|
const isSupported = aiProvider === "Google" || MULTIMODAL_MODELS.includes(modelName);
|
|
12015
12098
|
if (isMultimodalFile && !isSupported) {
|
|
12099
|
+
const label = `\u2718 Unsupported Modality: ${path19.basename(filePath)}`;
|
|
12016
12100
|
let terminalWidth = 115;
|
|
12017
12101
|
if (process.stdout.isTTY) {
|
|
12018
12102
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -12024,7 +12108,8 @@ ${ideCtx.warnings}
|
|
|
12024
12108
|
const boxMid = boxLines.map((line) => `${line.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`).join("\n");
|
|
12025
12109
|
const boxBottom = `${" ".repeat(boxWidth)}`;
|
|
12026
12110
|
yield { type: "visual_feedback", content: colorMainWords(`${boxBottom}
|
|
12027
|
-
${boxMid}
|
|
12111
|
+
${boxMid}
|
|
12112
|
+
`) };
|
|
12028
12113
|
continue;
|
|
12029
12114
|
}
|
|
12030
12115
|
const finalStart = startLine !== null ? startLine : 1;
|
|
@@ -12054,29 +12139,29 @@ ${boxMid}`) };
|
|
|
12054
12139
|
isError = true;
|
|
12055
12140
|
}
|
|
12056
12141
|
if (!isError) {
|
|
12057
|
-
let
|
|
12142
|
+
let label = "";
|
|
12058
12143
|
if (isImage) {
|
|
12059
|
-
|
|
12144
|
+
label = `\u2714 Viewed: ${filePath}`;
|
|
12060
12145
|
attachedBinaryPart = binPart;
|
|
12061
12146
|
} else if (isPdf || isOfficeFile) {
|
|
12062
|
-
|
|
12147
|
+
label = `\u2714 Viewed: ${filePath}`;
|
|
12063
12148
|
attachedBinaryPart = binPart;
|
|
12064
12149
|
} else {
|
|
12065
12150
|
let totalLines = "...";
|
|
12066
12151
|
try {
|
|
12067
|
-
const content =
|
|
12152
|
+
const content = fs21.readFileSync(absPath, "utf8");
|
|
12068
12153
|
totalLines = content.split("\n").length;
|
|
12069
12154
|
} catch (e) {
|
|
12070
12155
|
}
|
|
12071
|
-
|
|
12156
|
+
label = `\u2714 Auto-Read: ${filePath} \u2192 Lines ${finalStart} - ${Math.min(finalEnd, totalLines)} of ${totalLines}`;
|
|
12072
12157
|
taggedContextBlocks.push(textResult);
|
|
12073
12158
|
}
|
|
12074
|
-
if (
|
|
12159
|
+
if (label) {
|
|
12075
12160
|
let terminalWidth = 115;
|
|
12076
12161
|
if (process.stdout.isTTY) {
|
|
12077
12162
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
12078
12163
|
}
|
|
12079
|
-
const boxLines = [
|
|
12164
|
+
const boxLines = [label];
|
|
12080
12165
|
const maxLen = Math.max(...boxLines.map((l) => l.length));
|
|
12081
12166
|
const boxWidth = Math.min(maxLen + 4, terminalWidth);
|
|
12082
12167
|
const boxMid = boxLines.map((line) => `${line.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`).join("\n");
|
|
@@ -12712,7 +12797,7 @@ ${ideErr} [/ERROR]`;
|
|
|
12712
12797
|
} else if (id && potentialTool === "get_progress") {
|
|
12713
12798
|
detail = id.replace(/["']/g, "");
|
|
12714
12799
|
} else if (timeVal && potentialTool === "await") {
|
|
12715
|
-
let sec = parseFloat(timeVal.replace(/["']/g, ""));
|
|
12800
|
+
let sec = parseFloat(String(timeVal).replace(/["']/g, ""));
|
|
12716
12801
|
if (!isNaN(sec)) {
|
|
12717
12802
|
if (sec < 5) sec = 5;
|
|
12718
12803
|
if (sec > 120) sec = 120;
|
|
@@ -12726,7 +12811,7 @@ ${ideErr} [/ERROR]`;
|
|
|
12726
12811
|
};
|
|
12727
12812
|
detail = formatTime(sec);
|
|
12728
12813
|
} else {
|
|
12729
|
-
detail = timeVal.replace(/["']/g, "");
|
|
12814
|
+
detail = String(timeVal).replace(/["']/g, "");
|
|
12730
12815
|
}
|
|
12731
12816
|
} else {
|
|
12732
12817
|
const m = partialArgs.match(/(?:path|targetFile|TargetFile|directory|keyword|id|taskId|title|task)\s*=\s*\\?["']?([^\\"' \),]+)/);
|
|
@@ -12898,13 +12983,13 @@ ${ideErr} [/ERROR]`;
|
|
|
12898
12983
|
const displayLabel = TOOL_LABELS2[normToolName] || toolCall.toolName;
|
|
12899
12984
|
const detail = getToolDetail(normToolName, toolCall.args);
|
|
12900
12985
|
yield { type: "status", content: `${displayLabel}${detail ? ` (${detail})` : ""}...` };
|
|
12901
|
-
let
|
|
12986
|
+
let label = "";
|
|
12902
12987
|
if (normToolName === "web_search") {
|
|
12903
12988
|
const { query, limit = 10 } = parseArgs(toolCall.args);
|
|
12904
|
-
|
|
12989
|
+
label = `\u2714 Searched: ${query} \u2192 ${limit}`;
|
|
12905
12990
|
} else if (normToolName === "web_scrape") {
|
|
12906
12991
|
const url = parseArgs(toolCall.args).url || "...";
|
|
12907
|
-
|
|
12992
|
+
label = `\u2714 Visited: ${url}`;
|
|
12908
12993
|
} else if (normToolName === "view_file") {
|
|
12909
12994
|
const { path: targetPath2, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(toolCall.args);
|
|
12910
12995
|
const rawStart = StartLine || start_line || startLine;
|
|
@@ -12915,8 +13000,8 @@ ${ideErr} [/ERROR]`;
|
|
|
12915
13000
|
let actualEndLine = eLine;
|
|
12916
13001
|
try {
|
|
12917
13002
|
const absPath = path19.resolve(process.cwd(), targetPath2);
|
|
12918
|
-
if (
|
|
12919
|
-
const content =
|
|
13003
|
+
if (fs21.existsSync(absPath)) {
|
|
13004
|
+
const content = fs21.readFileSync(absPath, "utf8");
|
|
12920
13005
|
const lines = content.split("\n").length;
|
|
12921
13006
|
totalLines = lines;
|
|
12922
13007
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -12928,38 +13013,38 @@ ${ideErr} [/ERROR]`;
|
|
|
12928
13013
|
const isOfficeFile = pathLower.endsWith(".docx") || pathLower.endsWith(".doc") || pathLower.endsWith(".ppt") || pathLower.endsWith(".pptx") || pathLower.endsWith(".xls") || pathLower.endsWith(".xlsx");
|
|
12929
13014
|
const isImage = /\.(png|jpg|jpeg|webp|gif|bmp)$/.test(pathLower);
|
|
12930
13015
|
if (isPdf || isOfficeFile) {
|
|
12931
|
-
|
|
13016
|
+
label = `\u2714 Analyzed: ${targetPath2}`;
|
|
12932
13017
|
} else if (isImage) {
|
|
12933
|
-
|
|
13018
|
+
label = `\u2714 Analyzed: ${targetPath2}`;
|
|
12934
13019
|
} else {
|
|
12935
|
-
|
|
13020
|
+
label = `${totalLines !== "..." ? "\u2714" : "\u2718"} Read: ${targetPath2} \u2192 ${totalLines !== "..." ? `Lines ${sLine} - ${actualEndLine} of ${totalLines}` : "File Not Found"}`;
|
|
12936
13021
|
}
|
|
12937
13022
|
} else if (normToolName === "list_files" || normToolName === "read_folder") {
|
|
12938
|
-
const action = normToolName === "list_files" ? "List" : "
|
|
13023
|
+
const action = normToolName === "list_files" ? "List" : "Browsed";
|
|
12939
13024
|
const path21 = parseArgs(toolCall.args).path;
|
|
12940
|
-
|
|
13025
|
+
label = `\u2714 ${action}: ${path21 === "." ? "./" : path21}`;
|
|
12941
13026
|
} else if (normToolName === "write_file" || normToolName === "update_file") {
|
|
12942
13027
|
const action = normToolName === "write_file" ? "Created" : "Edited";
|
|
12943
|
-
|
|
13028
|
+
label = `\u2714 ${action}: ${parseArgs(toolCall.args).path || "..."}`;
|
|
12944
13029
|
} else if (normToolName === "write_pdf") {
|
|
12945
|
-
|
|
13030
|
+
label = `\u2714 Created: ${parseArgs(toolCall.args).path || "..."}
|
|
12946
13031
|
`;
|
|
12947
13032
|
} else if (normToolName === "write_docx") {
|
|
12948
|
-
|
|
13033
|
+
label = `\u2714 Created: ${parseArgs(toolCall.args).path || "..."}
|
|
12949
13034
|
`;
|
|
12950
13035
|
} else if (normToolName === "file_map") {
|
|
12951
|
-
|
|
13036
|
+
label = `\u2714 Indexed: ${parseArgs(toolCall.args).path || "..."}`;
|
|
12952
13037
|
} else if (normToolName.toLowerCase() === "search_keyword" || normToolName.toLowerCase() === "todo") {
|
|
12953
|
-
|
|
13038
|
+
label = "";
|
|
12954
13039
|
} else if (normToolName.toLowerCase() === "generate_image") {
|
|
12955
13040
|
const { path: argPath, outputPath, output } = parseArgs(toolCall.args);
|
|
12956
|
-
|
|
13041
|
+
label = `\u2714 Generated: ${argPath || outputPath || output || "generated_image.png"}`;
|
|
12957
13042
|
} else if (normToolName === "invoke_sync" || normToolName === "invoke") {
|
|
12958
13043
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
12959
|
-
|
|
13044
|
+
label = `\u2714 Elevating SubAgent${detail2 ? `: ${detail2}` : ""}`;
|
|
12960
13045
|
} else if (normToolName === "get_progress") {
|
|
12961
13046
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
12962
|
-
|
|
13047
|
+
label = `\u2714 Checked${detail2 ? `: ${detail2}` : ""}`;
|
|
12963
13048
|
} else if (normToolName === "await") {
|
|
12964
13049
|
const { time } = parseArgs(toolCall.args);
|
|
12965
13050
|
let sec = parseFloat(time) || 0;
|
|
@@ -12973,11 +13058,11 @@ ${ideErr} [/ERROR]`;
|
|
|
12973
13058
|
}
|
|
12974
13059
|
return `${s}s`;
|
|
12975
13060
|
};
|
|
12976
|
-
|
|
13061
|
+
label = `\u2714 Awaiting \u2192 ${formatTime(sec)}`;
|
|
12977
13062
|
} else if (normToolName === "exec_command" || normToolName === "ask") {
|
|
12978
|
-
|
|
13063
|
+
label = "";
|
|
12979
13064
|
} else {
|
|
12980
|
-
|
|
13065
|
+
label = `Executed: ${toolCall.toolName}`;
|
|
12981
13066
|
}
|
|
12982
13067
|
yield* flushGoogleBuffer2();
|
|
12983
13068
|
if (normToolName === "exec_command") {
|
|
@@ -13119,7 +13204,7 @@ ${ideErr} [/ERROR]`;
|
|
|
13119
13204
|
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace.`;
|
|
13120
13205
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
13121
13206
|
const action = normToolName === "write_file" ? "Write Canceled" : "Edit Canceled";
|
|
13122
|
-
const deniedLabel = `\
|
|
13207
|
+
const deniedLabel = `\u2718 ${action}: ${parsedArgs.path || "..."}`;
|
|
13123
13208
|
let terminalWidth = 115;
|
|
13124
13209
|
if (process.stdout.isTTY) {
|
|
13125
13210
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -13313,8 +13398,8 @@ ${boxMid}`) };
|
|
|
13313
13398
|
if (currentIDE && normFocused === normAbsPath && currentIDE.full_content) {
|
|
13314
13399
|
originalContent = currentIDE.full_content;
|
|
13315
13400
|
hasOriginal = true;
|
|
13316
|
-
} else if (
|
|
13317
|
-
originalContent =
|
|
13401
|
+
} else if (fs21.existsSync(absPath)) {
|
|
13402
|
+
originalContent = fs21.readFileSync(absPath, "utf8");
|
|
13318
13403
|
hasOriginal = true;
|
|
13319
13404
|
}
|
|
13320
13405
|
originalContentForReporting = originalContent;
|
|
@@ -13368,10 +13453,10 @@ ${boxMid}}`) };
|
|
|
13368
13453
|
} else if (normToolName === "write_file") {
|
|
13369
13454
|
const rawContent = toolArgs.content || toolArgs.newContent || "";
|
|
13370
13455
|
const modifiedContent = rawContent.endsWith("\n") ? rawContent : rawContent + "\n";
|
|
13371
|
-
if (!
|
|
13456
|
+
if (!fs21.existsSync(absPath)) {
|
|
13372
13457
|
isNewFileCreated = true;
|
|
13373
|
-
|
|
13374
|
-
|
|
13458
|
+
fs21.mkdirSync(path19.dirname(absPath), { recursive: true });
|
|
13459
|
+
fs21.writeFileSync(absPath, "", "utf8");
|
|
13375
13460
|
}
|
|
13376
13461
|
yield { type: "status", content: `Opening New File Diff in IDE: ${path19.basename(absPath)}...` };
|
|
13377
13462
|
showDiffInIDE(absPath, "", modifiedContent);
|
|
@@ -13411,9 +13496,9 @@ ${boxMid}}`) };
|
|
|
13411
13496
|
if (filePath) {
|
|
13412
13497
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
13413
13498
|
closeDiffInIDE(absPath, approval);
|
|
13414
|
-
if (approval === "deny" && isNewFileCreated &&
|
|
13499
|
+
if (approval === "deny" && isNewFileCreated && fs21.existsSync(absPath)) {
|
|
13415
13500
|
try {
|
|
13416
|
-
|
|
13501
|
+
fs21.unlinkSync(absPath);
|
|
13417
13502
|
} catch (e) {
|
|
13418
13503
|
}
|
|
13419
13504
|
}
|
|
@@ -13430,8 +13515,8 @@ ${boxMid}}`) };
|
|
|
13430
13515
|
let finalContent = "";
|
|
13431
13516
|
if (finalIDE && finalIDE.file_focused === absPath && finalIDE.full_content) {
|
|
13432
13517
|
finalContent = finalIDE.full_content;
|
|
13433
|
-
} else if (
|
|
13434
|
-
finalContent =
|
|
13518
|
+
} else if (fs21.existsSync(absPath)) {
|
|
13519
|
+
finalContent = fs21.readFileSync(absPath, "utf8");
|
|
13435
13520
|
}
|
|
13436
13521
|
const verifiedLines = finalContent.split(/\r?\n/);
|
|
13437
13522
|
const verifiedLineCount = verifiedLines.length;
|
|
@@ -13529,7 +13614,7 @@ ${boxMid}`) };
|
|
|
13529
13614
|
}
|
|
13530
13615
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
13531
13616
|
const action = normToolName === "write_file" ? "Write Cancelled" : "Edit Denied";
|
|
13532
|
-
const deniedLabel = `\
|
|
13617
|
+
const deniedLabel = `\u2718 ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
13533
13618
|
let terminalWidth = 115;
|
|
13534
13619
|
if (process.stdout.isTTY) {
|
|
13535
13620
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -13555,13 +13640,13 @@ ${boxMid}`) };
|
|
|
13555
13640
|
}
|
|
13556
13641
|
}
|
|
13557
13642
|
}
|
|
13558
|
-
if (
|
|
13643
|
+
if (label) {
|
|
13559
13644
|
let terminalWidth = 115;
|
|
13560
13645
|
if (process.stdout.isTTY) {
|
|
13561
13646
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
13562
13647
|
}
|
|
13563
|
-
const boxWidth = Math.min(
|
|
13564
|
-
const boxMid = `${
|
|
13648
|
+
const boxWidth = Math.min(label.length + 4, terminalWidth);
|
|
13649
|
+
const boxMid = `${label.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`;
|
|
13565
13650
|
const boxBottom = ` ${" ".repeat(boxWidth)} `;
|
|
13566
13651
|
yield { type: "visual_feedback", content: colorMainWords(`
|
|
13567
13652
|
${boxMid}${boxMid.includes("Created") || boxMid.includes("Edited") || boxMid.includes("Written") ? "" : `
|
|
@@ -13719,7 +13804,7 @@ ${colorMainWords(output)}` };
|
|
|
13719
13804
|
anyToolExecutedInThisTurn = true;
|
|
13720
13805
|
let uiContent = `[TOOL RESULT]: ${result || ""}`;
|
|
13721
13806
|
if (normToolName === "view_file" || normToolName === "web_scrape" || normToolName === "file_map") {
|
|
13722
|
-
uiContent = `[TOOL RESULT]: ${
|
|
13807
|
+
uiContent = `[TOOL RESULT]: ${label} (Context Locked for UI Clarity)`;
|
|
13723
13808
|
}
|
|
13724
13809
|
yield { type: "tool_result", content: uiContent, aiContent, binaryPart, toolName: normToolName };
|
|
13725
13810
|
if (normToolName === "memory" && result.includes("SUCCESS")) yield { type: "memory_updated" };
|
|
@@ -13853,8 +13938,8 @@ ${colorMainWords(output)}` };
|
|
|
13853
13938
|
;
|
|
13854
13939
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
13855
13940
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
13856
|
-
if (!
|
|
13857
|
-
|
|
13941
|
+
if (!fs21.existsSync(agentErrDir)) fs21.mkdirSync(agentErrDir, { recursive: true });
|
|
13942
|
+
fs21.appendFileSync(path19.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
13858
13943
|
|
|
13859
13944
|
----------------------------------------------------------------------
|
|
13860
13945
|
|
|
@@ -14024,8 +14109,8 @@ Error Log can be found in ${path19.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
14024
14109
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
14025
14110
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
14026
14111
|
yield { type: "text", content: `\u274C CRITICAL ERROR: ${errLog}` };
|
|
14027
|
-
if (!
|
|
14028
|
-
|
|
14112
|
+
if (!fs21.existsSync(agentErrDir)) fs21.mkdirSync(agentErrDir, { recursive: true });
|
|
14113
|
+
fs21.appendFileSync(path19.join(agentErrDir, "error.log"), `CRITICAL ERROR [${date}]: ${errLog}
|
|
14029
14114
|
|
|
14030
14115
|
----------------------------------------------------------------------
|
|
14031
14116
|
|
|
@@ -14119,33 +14204,28 @@ ${cleanResponse}
|
|
|
14119
14204
|
`;
|
|
14120
14205
|
continue;
|
|
14121
14206
|
}
|
|
14122
|
-
let
|
|
14123
|
-
if (normalizedToolName === "web_search") {
|
|
14124
|
-
|
|
14125
|
-
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
} else if (normalizedToolName === "
|
|
14130
|
-
|
|
14131
|
-
label2 = `\u2714 \x1B[95mRead\x1B[0m: ${targetPath}`;
|
|
14132
|
-
} else if (normalizedToolName === "list_files" || normalizedToolName === "read_folder") {
|
|
14133
|
-
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14134
|
-
label2 = `\u2714 \x1B[95mViewed\x1B[0m: ${path21}`;
|
|
14207
|
+
let label = "";
|
|
14208
|
+
if (normalizedToolName === "web_search" || normalizedToolName === "websearch") {
|
|
14209
|
+
label = `\u2714 \x1B[95mSearched\x1B[0m`;
|
|
14210
|
+
} else if (normalizedToolName === "web_scrape" || normalizedToolName === "webscrape") {
|
|
14211
|
+
label = `\u2714 \x1B[95mScraped\x1B[0m`;
|
|
14212
|
+
} else if (normalizedToolName === "view_file" || normalizedToolName === "viewfile" || normalizedToolName === "readfile") {
|
|
14213
|
+
label = `\u2714 \x1B[95mRead File\x1B[0m`;
|
|
14214
|
+
} else if (normalizedToolName === "list_files" || normalizedToolName === "read_folder" || normalizedToolName === "readfolder") {
|
|
14215
|
+
label = `\u2714 \x1B[95mBrowsed Folder\x1B[0m`;
|
|
14135
14216
|
} else if (normalizedToolName === "write_file" || normalizedToolName === "writefile") {
|
|
14136
14217
|
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14137
|
-
|
|
14138
|
-
} else if (normalizedToolName === "update_file" || normalizedToolName === "updatefile" || normalizedToolName === "patchfile" || normalizedToolName === "patch_file") {
|
|
14139
|
-
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14140
|
-
label2 = `\u2714 \x1B[95mEdited\x1B[0m: ${path21}`;
|
|
14141
|
-
} else if (normalizedToolName === "file_map") {
|
|
14218
|
+
label = `\u2714 \x1B[95mFile Created\x1B[0m: ${path21}`;
|
|
14219
|
+
} else if (normalizedToolName === "update_file" || normalizedToolName === "updatefile" || normalizedToolName === "patchfile" || normalizedToolName === "patch_file" || normalizedToolName === "patchfile" || normalizedToolName === "updatefile") {
|
|
14142
14220
|
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14143
|
-
|
|
14221
|
+
label = `\u2714 \x1B[95mFile Edited\x1B[0m: ${path21}`;
|
|
14222
|
+
} else if (normalizedToolName === "file_map" || normalizedToolName === "filemap") {
|
|
14223
|
+
label = `\u2714 \x1B[95mIndexed\x1B[0m`;
|
|
14144
14224
|
} else if (normalizedToolName === "await") {
|
|
14145
14225
|
const { time } = parseArgs(toolCall.args);
|
|
14146
14226
|
let sec = parseFloat(time) || 0;
|
|
14147
|
-
if (sec <
|
|
14148
|
-
if (sec >
|
|
14227
|
+
if (sec < 10) sec = 10;
|
|
14228
|
+
if (sec > 180) sec = 180;
|
|
14149
14229
|
const formatTime = (s) => {
|
|
14150
14230
|
if (s >= 60) {
|
|
14151
14231
|
const m = Math.floor(s / 60);
|
|
@@ -14154,14 +14234,14 @@ ${cleanResponse}
|
|
|
14154
14234
|
}
|
|
14155
14235
|
return `${s}s`;
|
|
14156
14236
|
};
|
|
14157
|
-
|
|
14237
|
+
label = `\u2714 \x1B[95mAwaiting\x1B[0m \u2192 ${formatTime(sec)}`;
|
|
14158
14238
|
} else {
|
|
14159
14239
|
const displayLabel = TOOL_LABELS2[normalizedToolName] || toolCall.toolName;
|
|
14160
14240
|
const detail = getToolDetail(normalizedToolName, toolCall.args);
|
|
14161
|
-
|
|
14241
|
+
label = `\u2714 \x1B[95m${displayLabel}\x1B[0m${detail ? `: ${detail}` : ""}`;
|
|
14162
14242
|
}
|
|
14163
|
-
if (settings.onVisualFeedback &&
|
|
14164
|
-
settings.onVisualFeedback(
|
|
14243
|
+
if (settings.onVisualFeedback && label) {
|
|
14244
|
+
settings.onVisualFeedback(label);
|
|
14165
14245
|
}
|
|
14166
14246
|
if (logCallback) logCallback(`[Executing Tool] ${toolCall.toolName}(${toolCall.args})...`);
|
|
14167
14247
|
try {
|
|
@@ -15004,7 +15084,7 @@ var init_RevertModal = __esm({
|
|
|
15004
15084
|
import puppeteer4 from "puppeteer";
|
|
15005
15085
|
import { exec } from "child_process";
|
|
15006
15086
|
import { promisify } from "util";
|
|
15007
|
-
import
|
|
15087
|
+
import fs22 from "fs";
|
|
15008
15088
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
15009
15089
|
var init_setup = __esm({
|
|
15010
15090
|
"src/utils/setup.js"() {
|
|
@@ -15012,7 +15092,7 @@ var init_setup = __esm({
|
|
|
15012
15092
|
checkPuppeteerReady = () => {
|
|
15013
15093
|
try {
|
|
15014
15094
|
const exePath = puppeteer4.executablePath();
|
|
15015
|
-
const exists = exePath &&
|
|
15095
|
+
const exists = exePath && fs22.existsSync(exePath);
|
|
15016
15096
|
if (exists) return true;
|
|
15017
15097
|
} catch (e) {
|
|
15018
15098
|
return false;
|
|
@@ -15045,7 +15125,7 @@ __export(app_exports, {
|
|
|
15045
15125
|
import os4 from "os";
|
|
15046
15126
|
import React15, { useState as useState14, useEffect as useEffect11, useRef as useRef4, useMemo as useMemo2 } from "react";
|
|
15047
15127
|
import { Box as Box14, Text as Text15, useInput as useInput9, useStdout as useStdout2, Static } from "ink";
|
|
15048
|
-
import
|
|
15128
|
+
import fs23 from "fs-extra";
|
|
15049
15129
|
import path20 from "path";
|
|
15050
15130
|
import { exec as exec2 } from "child_process";
|
|
15051
15131
|
import { fileURLToPath } from "url";
|
|
@@ -15291,10 +15371,10 @@ function App({ args = [] }) {
|
|
|
15291
15371
|
const kbPath = getKeybindingsPath(ideName);
|
|
15292
15372
|
if (!kbPath) return;
|
|
15293
15373
|
try {
|
|
15294
|
-
await
|
|
15374
|
+
await fs23.ensureDir(path20.dirname(kbPath));
|
|
15295
15375
|
let bindings = [];
|
|
15296
|
-
if (
|
|
15297
|
-
const content =
|
|
15376
|
+
if (fs23.existsSync(kbPath)) {
|
|
15377
|
+
const content = fs23.readFileSync(kbPath, "utf8").trim();
|
|
15298
15378
|
if (content) {
|
|
15299
15379
|
try {
|
|
15300
15380
|
bindings = parseJsonc(content);
|
|
@@ -15314,7 +15394,7 @@ function App({ args = [] }) {
|
|
|
15314
15394
|
},
|
|
15315
15395
|
"when": "terminalFocus"
|
|
15316
15396
|
});
|
|
15317
|
-
|
|
15397
|
+
fs23.writeFileSync(kbPath, JSON.stringify(bindings, null, 4), "utf8");
|
|
15318
15398
|
cachedShortcut = "Shift + Enter";
|
|
15319
15399
|
setMessages((prev) => {
|
|
15320
15400
|
setCompletedIndex(prev.length + 1);
|
|
@@ -15990,7 +16070,7 @@ function App({ args = [] }) {
|
|
|
15990
16070
|
useEffect11(() => {
|
|
15991
16071
|
async function init() {
|
|
15992
16072
|
try {
|
|
15993
|
-
const pkg = JSON.parse(
|
|
16073
|
+
const pkg = JSON.parse(fs23.readFileSync(path20.join(process.cwd(), "package.json"), "utf8"));
|
|
15994
16074
|
initBridge(versionFluxflow || pkg.version || "2.0.0");
|
|
15995
16075
|
} catch (e) {
|
|
15996
16076
|
initBridge("2.0.0");
|
|
@@ -16113,7 +16193,7 @@ function App({ args = [] }) {
|
|
|
16113
16193
|
if (!parsedArgs.playground) {
|
|
16114
16194
|
deleteChat(PLAYGROUND_CHAT_ID).catch(() => {
|
|
16115
16195
|
});
|
|
16116
|
-
|
|
16196
|
+
fs23.remove(path20.join(DATA_DIR, "playground")).catch(() => {
|
|
16117
16197
|
});
|
|
16118
16198
|
}
|
|
16119
16199
|
performVersionCheck(false, freshSettings);
|
|
@@ -16149,7 +16229,7 @@ function App({ args = [] }) {
|
|
|
16149
16229
|
if (parsedArgs.playground) {
|
|
16150
16230
|
const playgroundDir = path20.join(DATA_DIR, "playground");
|
|
16151
16231
|
try {
|
|
16152
|
-
|
|
16232
|
+
fs23.ensureDirSync(playgroundDir);
|
|
16153
16233
|
process.chdir(playgroundDir);
|
|
16154
16234
|
} catch (e) {
|
|
16155
16235
|
}
|
|
@@ -16190,8 +16270,8 @@ function App({ args = [] }) {
|
|
|
16190
16270
|
if (kbPath) {
|
|
16191
16271
|
try {
|
|
16192
16272
|
let bindings = [];
|
|
16193
|
-
if (
|
|
16194
|
-
const content =
|
|
16273
|
+
if (fs23.existsSync(kbPath)) {
|
|
16274
|
+
const content = fs23.readFileSync(kbPath, "utf8").trim();
|
|
16195
16275
|
if (content) {
|
|
16196
16276
|
bindings = parseJsonc(content);
|
|
16197
16277
|
}
|
|
@@ -16486,6 +16566,10 @@ function App({ args = [] }) {
|
|
|
16486
16566
|
cmd: "z-ai/glm-5.1",
|
|
16487
16567
|
desc: "Text Only [DEPRICATED]"
|
|
16488
16568
|
},
|
|
16569
|
+
{
|
|
16570
|
+
cmd: "z-ai/glm-5.2",
|
|
16571
|
+
desc: "Text Only"
|
|
16572
|
+
},
|
|
16489
16573
|
// --- MiniMax Family ---
|
|
16490
16574
|
{
|
|
16491
16575
|
cmd: "minimaxai/minimax-m2.7",
|
|
@@ -16728,9 +16812,9 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16728
16812
|
setCompletedIndex(prev.length + 1);
|
|
16729
16813
|
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Exporting playground content to ${dest}`, isMeta: true }];
|
|
16730
16814
|
});
|
|
16731
|
-
await
|
|
16815
|
+
await fs23.ensureDir(dest);
|
|
16732
16816
|
const excludeDirs = ["node_modules", ".git", ".venv", "venv", "env", ".next", "dist", "build", ".cache"];
|
|
16733
|
-
await
|
|
16817
|
+
await fs23.copy(src, dest, {
|
|
16734
16818
|
overwrite: true,
|
|
16735
16819
|
filter: (srcPath) => {
|
|
16736
16820
|
const relative = path20.relative(src, srcPath);
|
|
@@ -16795,7 +16879,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16795
16879
|
}
|
|
16796
16880
|
}
|
|
16797
16881
|
setTimeout(() => {
|
|
16798
|
-
|
|
16882
|
+
fs23.emptyDir(path20.join(DATA_DIR, "playground")).catch((err) => {
|
|
16799
16883
|
setMessages((prev) => {
|
|
16800
16884
|
const newMsgs = [...prev, {
|
|
16801
16885
|
id: "playground-" + Date.now(),
|
|
@@ -17144,7 +17228,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
17144
17228
|
}
|
|
17145
17229
|
const fileContent = exportLines.join("\n");
|
|
17146
17230
|
try {
|
|
17147
|
-
|
|
17231
|
+
fs23.writeFileSync(exportPath, fileContent, "utf8");
|
|
17148
17232
|
setMessages((prev) => {
|
|
17149
17233
|
setCompletedIndex(prev.length + 1);
|
|
17150
17234
|
return [...prev, {
|
|
@@ -17191,12 +17275,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17191
17275
|
setCompletedIndex(prev.length + 1);
|
|
17192
17276
|
return [...prev, { id: Date.now(), role: "system", text: "[NUCLEAR] Initiating reset...", isMeta: true }];
|
|
17193
17277
|
});
|
|
17194
|
-
if (
|
|
17195
|
-
if (
|
|
17196
|
-
if (
|
|
17278
|
+
if (fs23.existsSync(LOGS_DIR)) fs23.removeSync(LOGS_DIR);
|
|
17279
|
+
if (fs23.existsSync(SECRET_DIR)) fs23.removeSync(SECRET_DIR);
|
|
17280
|
+
if (fs23.existsSync(SETTINGS_FILE)) fs23.removeSync(SETTINGS_FILE);
|
|
17197
17281
|
try {
|
|
17198
|
-
const items =
|
|
17199
|
-
if (items.length === 0)
|
|
17282
|
+
const items = fs23.readdirSync(FLUXFLOW_DIR);
|
|
17283
|
+
if (items.length === 0) fs23.removeSync(FLUXFLOW_DIR);
|
|
17200
17284
|
} catch (e) {
|
|
17201
17285
|
}
|
|
17202
17286
|
setTimeout(() => {
|
|
@@ -17319,14 +17403,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17319
17403
|
- [Define custom step-by-step recipes for this project here]
|
|
17320
17404
|
`;
|
|
17321
17405
|
const filePath = path20.join(process.cwd(), "FluxFlow.md");
|
|
17322
|
-
if (
|
|
17406
|
+
if (fs23.pathExistsSync(filePath)) {
|
|
17323
17407
|
setMessages((prev) => {
|
|
17324
17408
|
setCompletedIndex(prev.length + 1);
|
|
17325
17409
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
17326
17410
|
});
|
|
17327
17411
|
} else {
|
|
17328
17412
|
try {
|
|
17329
|
-
|
|
17413
|
+
fs23.writeFileSync(filePath, template);
|
|
17330
17414
|
setMessages((prev) => {
|
|
17331
17415
|
setCompletedIndex(prev.length + 1);
|
|
17332
17416
|
return [...prev, { id: "init-ok-" + Date.now(), role: "system", text: "[SUCCESS] FluxFlow.md has been initialized. You can now customize it for this project.", isMeta: true }];
|
|
@@ -17547,7 +17631,7 @@ ${timestamp}` };
|
|
|
17547
17631
|
});
|
|
17548
17632
|
},
|
|
17549
17633
|
onSubagentUpdate: () => {
|
|
17550
|
-
setActiveSubagents(
|
|
17634
|
+
setActiveSubagents(subagentProgress.map((sa) => ({ ...sa })));
|
|
17551
17635
|
},
|
|
17552
17636
|
onExecStart: (cmd) => {
|
|
17553
17637
|
setActiveCommand(cmd);
|
|
@@ -18259,8 +18343,8 @@ Selection: ${val}`,
|
|
|
18259
18343
|
});
|
|
18260
18344
|
setActiveView("input");
|
|
18261
18345
|
}, [activeView, providerBudgetCursor]);
|
|
18262
|
-
const CustomMenuItem = ({ label
|
|
18263
|
-
const isCancel =
|
|
18346
|
+
const CustomMenuItem = ({ label, isSelected }) => {
|
|
18347
|
+
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
18264
18348
|
return /* @__PURE__ */ React15.createElement(
|
|
18265
18349
|
Box14,
|
|
18266
18350
|
{
|
|
@@ -18269,10 +18353,10 @@ Selection: ${val}`,
|
|
|
18269
18353
|
paddingX: 1,
|
|
18270
18354
|
width: "100%"
|
|
18271
18355
|
},
|
|
18272
|
-
/* @__PURE__ */ React15.createElement(Text15, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ",
|
|
18356
|
+
/* @__PURE__ */ React15.createElement(Text15, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ", label)
|
|
18273
18357
|
);
|
|
18274
18358
|
};
|
|
18275
|
-
const renderProgressBar = (
|
|
18359
|
+
const renderProgressBar = (label, current, limit) => {
|
|
18276
18360
|
const percent = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 0;
|
|
18277
18361
|
const barWidth = 15;
|
|
18278
18362
|
const filledCount = Math.round(percent / 100 * barWidth);
|
|
@@ -18283,10 +18367,10 @@ Selection: ${val}`,
|
|
|
18283
18367
|
} else if (percent > 80) {
|
|
18284
18368
|
barColor = "red";
|
|
18285
18369
|
}
|
|
18286
|
-
const isTokens =
|
|
18370
|
+
const isTokens = label.toLowerCase().includes("token");
|
|
18287
18371
|
const displayLimit = shouldClearValue(limit) ? "\u221E" : isTokens ? formatTokens(limit) : limit;
|
|
18288
18372
|
const displayCurrent = isTokens ? formatTokens(current) : current;
|
|
18289
|
-
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "row", paddingLeft: 4, key:
|
|
18373
|
+
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "row", paddingLeft: 4, key: label }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, label, ": ")), /* @__PURE__ */ React15.createElement(Text15, { color: barColor }, barStr), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " ", percent, "% (", displayCurrent, "/", displayLimit, ")"));
|
|
18290
18374
|
};
|
|
18291
18375
|
const renderActiveView = () => {
|
|
18292
18376
|
switch (activeView) {
|
|
@@ -18702,7 +18786,7 @@ Selection: ${val}`,
|
|
|
18702
18786
|
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 3, paddingY: 1, paddingBottom: 0, width: Math.min(125, (stdout?.columns || 100) - 2) }, statsMode === "modelBreakdown" ? /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "30-DAY MODEL TOKEN BREAKDOWN"), !monthlyUsage?.models || Object.keys(monthlyUsage.models).length === 0 ? /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey", italic: true }, "No model token usage recorded in the last 30 days.")) : Object.entries(monthlyUsage.models).map(([provider, models]) => {
|
|
18703
18787
|
const providerTotalTokens = Object.values(models).reduce((sum, m) => sum + (m.tokens || 0), 0);
|
|
18704
18788
|
return /* @__PURE__ */ React15.createElement(Box14, { key: provider, flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 40 }, /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", bold: true }, provider, ":")), /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, formatTokens(providerTotalTokens))), Object.entries(models).map(([modelName, stats]) => /* @__PURE__ */ React15.createElement(Box14, { key: modelName, flexDirection: "column", marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 36 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "\xBB ", modelName, ":")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.tokens || 0))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 32 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens((stats.tokens || 0) - (stats.candidateTokens || 0)))), (stats.cachedTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 5 }, /* @__PURE__ */ React15.createElement(Box14, { width: 31 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.cachedTokens))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 32 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.candidateTokens || 0))))));
|
|
18705
|
-
})) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Active Context:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2713 ", sessionToolSuccess), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2715 ", sessionToolFailure), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, timeLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.agent || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.background || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, tokensLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imagesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u.imageCalls.length)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imageCreditsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, codeChangesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, toolCallsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2713 ", u?.toolSuccess || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u2298 ", u?.toolDenied || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2715 ", u?.toolFailure || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )")))), /* @__PURE__ */ React15.createElement(Text15, { dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
|
|
18789
|
+
})) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Active Context:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", sessionToolSuccess), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", sessionToolFailure), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, timeLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.agent || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.background || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, tokensLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imagesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u.imageCalls.length)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imageCreditsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, codeChangesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, toolCallsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", u?.toolSuccess || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u2298 ", u?.toolDenied || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", u?.toolFailure || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )")))), /* @__PURE__ */ React15.createElement(Text15, { dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
|
|
18706
18790
|
}
|
|
18707
18791
|
case "autoExecDanger":
|
|
18708
18792
|
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SECURITY WARNING: YOLO MODE"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1, color: "white" }, "RISKS INVOLVED:"), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake unless specified in sandbox rules."), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
|
|
@@ -19217,18 +19301,18 @@ Selection: ${val}`,
|
|
|
19217
19301
|
},
|
|
19218
19302
|
/* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, suggestions[0]?.cmd?.startsWith("@") ? "FILE SUGGESTIONS" : "COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@") ? /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, "(Use '#Lstart-Lend' to specify line numbers)") : input.startsWith("/model") && apiTier === "Free" ? (() => {
|
|
19219
19303
|
let url = "https://aistudio.google.com/billing";
|
|
19220
|
-
let
|
|
19304
|
+
let label = "billing";
|
|
19221
19305
|
if (aiProvider === "DeepSeek") {
|
|
19222
19306
|
url = "https://platform.deepseek.com/usage";
|
|
19223
|
-
|
|
19307
|
+
label = "billing";
|
|
19224
19308
|
} else if (aiProvider === "OpenRouter") {
|
|
19225
19309
|
url = "https://openrouter.ai/settings/profile";
|
|
19226
|
-
|
|
19310
|
+
label = "profile";
|
|
19227
19311
|
} else if (aiProvider === "NVIDIA") {
|
|
19228
19312
|
url = "https://build.nvidia.com/settings/api-keys";
|
|
19229
|
-
|
|
19313
|
+
label = "billing";
|
|
19230
19314
|
}
|
|
19231
|
-
return /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, "Paid API Strategy has more models. Configure ", /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", underline: true }, `\x1B]8;;${url}\x07${
|
|
19315
|
+
return /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, "Paid API Strategy has more models. Configure ", /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", underline: true }, `\x1B]8;;${url}\x07${label}\x1B]8;;\x07`), " & /settings");
|
|
19232
19316
|
})() : null),
|
|
19233
19317
|
visible.map((s, i) => {
|
|
19234
19318
|
const actualIdx = startIdx + i;
|
|
@@ -19282,7 +19366,7 @@ Selection: ${val}`,
|
|
|
19282
19366
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
19283
19367
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
19284
19368
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
19285
|
-
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "grey", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 0 }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { bold: true }, gradient2(["blue", "purple"])("Agent powering down. Goodbye!"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, chatId)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\
|
|
19369
|
+
return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "grey", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 0 }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { bold: true }, gradient2(["blue", "purple"])("Agent powering down. Goodbye!"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, chatId)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", sessionToolSuccess), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u2298 ", sessionToolDenied), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", sessionToolFailure), " )")), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, successRate, "%")), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 16 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
|
|
19286
19370
|
})())));
|
|
19287
19371
|
}
|
|
19288
19372
|
var shouldClearValue, getPrefilledValue, getIDEName, getIDEDirName, getKeybindingsPath, parseJsonc, hasShiftEnterBinding, getPromoOptions, BridgePromo, SESSION_START_TIME, CHANGELOG_URL, DOCS_URL, linesAdded, linesRemoved, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, parseAgentText, getProjectFiles, cachedShortcut, getLatencyColor2, SubagentRow;
|
|
@@ -19419,7 +19503,7 @@ var init_app = __esm({
|
|
|
19419
19503
|
linesAdded = 0;
|
|
19420
19504
|
linesRemoved = 0;
|
|
19421
19505
|
packageJsonPath = path20.join(path20.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
19422
|
-
packageJson = JSON.parse(
|
|
19506
|
+
packageJson = JSON.parse(fs23.readFileSync(packageJsonPath, "utf8"));
|
|
19423
19507
|
versionFluxflow = packageJson.version;
|
|
19424
19508
|
updatedOn = packageJson.date || "2026-05-20";
|
|
19425
19509
|
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, data.startsWith("/btw") ? "QUESTION" : "STEERING HINT", " RESOLUTION")), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, null, "The agent already finished the task before your ", data.startsWith("/btw") ? "question" : "hint", " was consumed.")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { italic: true, color: "gray" }, '"', data.replace("/btw", "").trim(), '"')), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "How would you like to proceed?")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 0 }, /* @__PURE__ */ React15.createElement(
|
|
@@ -19515,13 +19599,13 @@ var init_app = __esm({
|
|
|
19515
19599
|
const fileList = [];
|
|
19516
19600
|
const scan = (currentDir) => {
|
|
19517
19601
|
try {
|
|
19518
|
-
const files =
|
|
19602
|
+
const files = fs23.readdirSync(currentDir);
|
|
19519
19603
|
for (const file of files) {
|
|
19520
19604
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
19521
19605
|
continue;
|
|
19522
19606
|
}
|
|
19523
19607
|
const filePath = path20.join(currentDir, file);
|
|
19524
|
-
const stat =
|
|
19608
|
+
const stat = fs23.statSync(filePath);
|
|
19525
19609
|
if (stat.isDirectory()) {
|
|
19526
19610
|
scan(filePath);
|
|
19527
19611
|
} else {
|
|
@@ -19604,7 +19688,7 @@ var init_app = __esm({
|
|
|
19604
19688
|
const timer = setInterval(checkLatency, 100);
|
|
19605
19689
|
return () => clearInterval(timer);
|
|
19606
19690
|
}, [sa.status, sa.lastChunkTime]);
|
|
19607
|
-
return /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " \u2022 ", sa.title, " ", /* @__PURE__ */ React15.createElement(Text15, { color: "white", dimColor: true }, "(", sa.id, ")")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" },
|
|
19691
|
+
return /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " \u2022 ", sa.title, " ", /* @__PURE__ */ React15.createElement(Text15, { color: "white", dimColor: true }, "(", sa.id, ")")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", dimColor: true, bold: true }, sa.currentTool || "Active"), /* @__PURE__ */ React15.createElement(Text15, { color: dotColor }, " \u25CF")));
|
|
19608
19692
|
});
|
|
19609
19693
|
}
|
|
19610
19694
|
});
|
|
@@ -19650,11 +19734,11 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
19650
19734
|
const isVersion = args.includes("--version") || args.includes("-v");
|
|
19651
19735
|
const isUpdate = args[0] === "--update";
|
|
19652
19736
|
if (isVersion || isHelp || isHelpCommands || isUpdate) {
|
|
19653
|
-
const
|
|
19737
|
+
const fs24 = await import("fs");
|
|
19654
19738
|
const path21 = await import("path");
|
|
19655
19739
|
const { fileURLToPath: fileURLToPath3 } = await import("url");
|
|
19656
19740
|
const packageJsonPath2 = path21.join(path21.dirname(fileURLToPath3(import.meta.url)), "../package.json");
|
|
19657
|
-
const packageJson2 = JSON.parse(
|
|
19741
|
+
const packageJson2 = JSON.parse(fs24.readFileSync(packageJsonPath2, "utf8"));
|
|
19658
19742
|
const versionFluxflow2 = packageJson2.version;
|
|
19659
19743
|
if (isVersion) {
|
|
19660
19744
|
console.log(`v${versionFluxflow2}`);
|
|
@@ -19771,8 +19855,8 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
19771
19855
|
{ label: "Bun", value: "bun" },
|
|
19772
19856
|
{ label: "Custom Command", value: "custom" }
|
|
19773
19857
|
];
|
|
19774
|
-
const CustomItem2 = ({ label
|
|
19775
|
-
return /* @__PURE__ */ React17.createElement(Box15, { width: "100%" }, /* @__PURE__ */ React17.createElement(Text16, { bold: isSelected }, "\u2514\u2500 ", isSelected ? "\x1B[32m\u25CF\x1B[0m" : "\u25CB", " ",
|
|
19858
|
+
const CustomItem2 = ({ label, isSelected }) => {
|
|
19859
|
+
return /* @__PURE__ */ React17.createElement(Box15, { width: "100%" }, /* @__PURE__ */ React17.createElement(Text16, { bold: isSelected }, "\u2514\u2500 ", isSelected ? "\x1B[32m\u25CF\x1B[0m" : "\u25CB", " ", label));
|
|
19776
19860
|
};
|
|
19777
19861
|
let unmountFn;
|
|
19778
19862
|
const PromptComponent = () => {
|