fluxflow-cli 3.0.11 → 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 +360 -191
- 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
|
});
|
|
@@ -4829,36 +4828,78 @@ var init_ChatLayout = __esm({
|
|
|
4829
4828
|
// src/components/StatusBar.jsx
|
|
4830
4829
|
import React5 from "react";
|
|
4831
4830
|
import { Box as Box4, Text as Text5 } from "ink";
|
|
4832
|
-
import { useState as useState5, useEffect as useEffect4 } from "react";
|
|
4831
|
+
import { useState as useState5, useEffect as useEffect4, useRef as useRef3 } from "react";
|
|
4833
4832
|
function getMemoryInfo() {
|
|
4834
4833
|
if (activeGetMemoryInfo) {
|
|
4835
4834
|
activeGetMemoryInfo();
|
|
4836
4835
|
}
|
|
4837
4836
|
}
|
|
4838
|
-
var activeGetMemoryInfo, StatusBar, StatusBar_default;
|
|
4837
|
+
var activeGetMemoryInfo, getLatencyColor, StatusBar, StatusBar_default;
|
|
4839
4838
|
var init_StatusBar = __esm({
|
|
4840
4839
|
"src/components/StatusBar.jsx"() {
|
|
4841
4840
|
init_text();
|
|
4842
4841
|
activeGetMemoryInfo = null;
|
|
4842
|
+
getLatencyColor = (delay) => {
|
|
4843
|
+
if (delay <= 400) return "#00a564";
|
|
4844
|
+
if (delay >= 5e3) return "#ff0000";
|
|
4845
|
+
const points = [
|
|
4846
|
+
{ t: 400, r: 0, g: 165, b: 100 },
|
|
4847
|
+
{ t: 800, r: 120, g: 220, b: 80 },
|
|
4848
|
+
{ t: 1500, r: 250, g: 210, b: 40 },
|
|
4849
|
+
{ t: 3e3, r: 255, g: 120, b: 0 },
|
|
4850
|
+
{ t: 5e3, r: 255, g: 0, b: 0 }
|
|
4851
|
+
];
|
|
4852
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
4853
|
+
const p1 = points[i];
|
|
4854
|
+
const p2 = points[i + 1];
|
|
4855
|
+
if (delay >= p1.t && delay <= p2.t) {
|
|
4856
|
+
const ratio = (delay - p1.t) / (p2.t - p1.t);
|
|
4857
|
+
const r = Math.round(p1.r + (p2.r - p1.r) * ratio);
|
|
4858
|
+
const g = Math.round(p1.g + (p2.g - p1.g) * ratio);
|
|
4859
|
+
const b = Math.round(p1.b + (p2.b - p1.b) * ratio);
|
|
4860
|
+
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
|
|
4861
|
+
}
|
|
4862
|
+
}
|
|
4863
|
+
return "#ff0000";
|
|
4864
|
+
};
|
|
4843
4865
|
StatusBar = React5.memo(({ mode, thinkingLevel, tokens = "0.0k", tokensTotal = "0.0k", chatId = "NEW-SESSION", isMemoryEnabled = true, apiTier = "Free", aiProvider = "Google", activeModel = "", isProcessing = false, lastChunkTime = 0 }) => {
|
|
4844
4866
|
const modeIcon = mode === "Flux" ? "" : "";
|
|
4845
4867
|
const [memoryUsage, setMemoryUsage] = useState5(0);
|
|
4846
4868
|
const [memoryLimit, setMemoryLimit] = useState5(0);
|
|
4847
4869
|
const [memoryUnit, setMemoryUnit] = useState5("MB");
|
|
4848
4870
|
const [dotColor, setDotColor] = useState5("green");
|
|
4871
|
+
const chunkTimesRef = useRef3([]);
|
|
4849
4872
|
useEffect4(() => {
|
|
4850
|
-
if (!isProcessing)
|
|
4873
|
+
if (!isProcessing) {
|
|
4874
|
+
chunkTimesRef.current = [];
|
|
4875
|
+
return;
|
|
4876
|
+
}
|
|
4877
|
+
if (lastChunkTime > 0) {
|
|
4878
|
+
const times = chunkTimesRef.current;
|
|
4879
|
+
if (times.length === 0 || times[times.length - 1] !== lastChunkTime) {
|
|
4880
|
+
times.push(lastChunkTime);
|
|
4881
|
+
if (times.length > 5) {
|
|
4882
|
+
times.shift();
|
|
4883
|
+
}
|
|
4884
|
+
}
|
|
4885
|
+
}
|
|
4851
4886
|
const checkLatency = () => {
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
}
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4887
|
+
if (!lastChunkTime) {
|
|
4888
|
+
setDotColor("#00a564");
|
|
4889
|
+
return;
|
|
4890
|
+
}
|
|
4891
|
+
const times = chunkTimesRef.current;
|
|
4892
|
+
let averageInterval = 0;
|
|
4893
|
+
if (times.length > 1) {
|
|
4894
|
+
let sum = 0;
|
|
4895
|
+
for (let i = 1; i < times.length; i++) {
|
|
4896
|
+
sum += times[i] - times[i - 1];
|
|
4897
|
+
}
|
|
4898
|
+
averageInterval = sum / (times.length - 1);
|
|
4861
4899
|
}
|
|
4900
|
+
const timeSinceLast = Date.now() - lastChunkTime;
|
|
4901
|
+
const delay = Math.max(averageInterval, timeSinceLast);
|
|
4902
|
+
setDotColor(getLatencyColor(delay));
|
|
4862
4903
|
};
|
|
4863
4904
|
checkLatency();
|
|
4864
4905
|
const timer = setInterval(checkLatency, 100);
|
|
@@ -4945,8 +4986,8 @@ function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
|
4945
4986
|
var CustomItem;
|
|
4946
4987
|
var init_CommandMenu = __esm({
|
|
4947
4988
|
"src/components/CommandMenu.jsx"() {
|
|
4948
|
-
CustomItem = ({ label
|
|
4949
|
-
const isCancel =
|
|
4989
|
+
CustomItem = ({ label, isSelected }) => {
|
|
4990
|
+
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
4950
4991
|
return /* @__PURE__ */ React6.createElement(
|
|
4951
4992
|
Box5,
|
|
4952
4993
|
{
|
|
@@ -4955,7 +4996,7 @@ var init_CommandMenu = __esm({
|
|
|
4955
4996
|
paddingX: 1,
|
|
4956
4997
|
width: "100%"
|
|
4957
4998
|
},
|
|
4958
|
-
/* @__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)
|
|
4959
5000
|
);
|
|
4960
5001
|
};
|
|
4961
5002
|
}
|
|
@@ -5147,7 +5188,9 @@ ${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative to CWD & WILL BE FIRST A
|
|
|
5147
5188
|
9. [tool:functions.await(time="seconds")]. For waiting without exiting agent loop, 15s - 180s
|
|
5148
5189
|
|
|
5149
5190
|
-- SUB AGENTS DEFINITIONS --
|
|
5150
|
-
|
|
5191
|
+
**USING SUB AGENTS HIGHLY PREFERRED FOR MOST TASK**
|
|
5192
|
+
USE PROACTIVELY WITHOUT EXPLICIT USER COMMAND ALLOWED
|
|
5193
|
+
|
|
5151
5194
|
Invocation Types:
|
|
5152
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
|
|
5153
5196
|
- invokeSync (sync, blocking main agent loop). Usage: Repeatetive work, Sequential tasks, Task delegation. Huge tokens/costs savings
|
|
@@ -8370,10 +8413,10 @@ var init_ask_user = __esm({
|
|
|
8370
8413
|
if (key.startsWith("option")) {
|
|
8371
8414
|
const val = parsed[key];
|
|
8372
8415
|
if (typeof val === "string" && val.includes("::")) {
|
|
8373
|
-
const [
|
|
8416
|
+
const [label, desc] = val.split("::");
|
|
8374
8417
|
options.push({
|
|
8375
8418
|
id: key,
|
|
8376
|
-
label:
|
|
8419
|
+
label: label.trim(),
|
|
8377
8420
|
description: desc.trim()
|
|
8378
8421
|
});
|
|
8379
8422
|
} else {
|
|
@@ -9240,13 +9283,13 @@ function traverse(node, depth = 0, isLast = true, prefix = "", parentName = null
|
|
|
9240
9283
|
const startLine = node.startPosition.row + 1;
|
|
9241
9284
|
const endLine = node.endPosition.row + 1;
|
|
9242
9285
|
const camelType = toCamelCase(type);
|
|
9243
|
-
const
|
|
9286
|
+
const label = name ? `${camelType} [${name}]` : camelType;
|
|
9244
9287
|
if (depth === 0) {
|
|
9245
9288
|
result += `\u{1F4C1} ROOT (Lines: ${startLine}-${endLine})
|
|
9246
9289
|
`;
|
|
9247
9290
|
nextPrefix = prefix;
|
|
9248
9291
|
} else {
|
|
9249
|
-
result += `${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}${
|
|
9292
|
+
result += `${prefix}${isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 "}${label} (Lines: ${startLine}-${endLine})
|
|
9250
9293
|
`;
|
|
9251
9294
|
nextPrefix += isLast ? " " : "\u2502 ";
|
|
9252
9295
|
}
|
|
@@ -9629,9 +9672,22 @@ var init_invoke = __esm({
|
|
|
9629
9672
|
let currentTurnLogs = [];
|
|
9630
9673
|
const subagentContext = {
|
|
9631
9674
|
...context,
|
|
9632
|
-
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
|
+
},
|
|
9633
9688
|
onTokenChunk: () => {
|
|
9634
9689
|
taskEntry.lastChunkTime = Date.now();
|
|
9690
|
+
taskEntry.currentTool = "Thinking";
|
|
9635
9691
|
if (context.onSubagentUpdate) {
|
|
9636
9692
|
context.onSubagentUpdate();
|
|
9637
9693
|
}
|
|
@@ -9647,7 +9703,9 @@ var init_invoke = __esm({
|
|
|
9647
9703
|
if (logMessage.includes("[Executing Tool]")) {
|
|
9648
9704
|
const m = logMessage.match(/\[Executing Tool\]\s*([a-zA-Z0-9_]+)/);
|
|
9649
9705
|
if (m) {
|
|
9650
|
-
taskEntry.currentTool
|
|
9706
|
+
if (!taskEntry.currentTool || taskEntry.currentTool === "Thinking") {
|
|
9707
|
+
taskEntry.currentTool = m[1];
|
|
9708
|
+
}
|
|
9651
9709
|
}
|
|
9652
9710
|
}
|
|
9653
9711
|
let displayLog = logMessage;
|
|
@@ -9685,6 +9743,7 @@ ${finalAnswer}`);
|
|
|
9685
9743
|
});
|
|
9686
9744
|
|
|
9687
9745
|
// src/tools/getProgress.js
|
|
9746
|
+
import fs20 from "fs";
|
|
9688
9747
|
var getProgress;
|
|
9689
9748
|
var init_getProgress = __esm({
|
|
9690
9749
|
"src/tools/getProgress.js"() {
|
|
@@ -9712,7 +9771,72 @@ var init_getProgress = __esm({
|
|
|
9712
9771
|
task.progress.forEach((turnLogs, index) => {
|
|
9713
9772
|
output += `--- Turn ${index + 1} ---
|
|
9714
9773
|
`;
|
|
9715
|
-
|
|
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";
|
|
9716
9840
|
});
|
|
9717
9841
|
if (task.status === "completed" && task.finalAnswer) {
|
|
9718
9842
|
output += `Final Answer:
|
|
@@ -9722,6 +9846,7 @@ ${task.finalAnswer}
|
|
|
9722
9846
|
output += `Failure Error: ${task.error}
|
|
9723
9847
|
`;
|
|
9724
9848
|
}
|
|
9849
|
+
fs20.writeFileSync("progress.txt", output.trim());
|
|
9725
9850
|
return output.trim();
|
|
9726
9851
|
};
|
|
9727
9852
|
}
|
|
@@ -9992,7 +10117,7 @@ __export(ai_exports, {
|
|
|
9992
10117
|
});
|
|
9993
10118
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
9994
10119
|
import path19 from "path";
|
|
9995
|
-
import
|
|
10120
|
+
import fs21 from "fs";
|
|
9996
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;
|
|
9997
10122
|
var init_ai = __esm({
|
|
9998
10123
|
async "src/utils/ai.js"() {
|
|
@@ -10011,9 +10136,9 @@ var init_ai = __esm({
|
|
|
10011
10136
|
init_editor();
|
|
10012
10137
|
client = null;
|
|
10013
10138
|
globalSettings = {};
|
|
10014
|
-
colorMainWords = (
|
|
10015
|
-
if (!
|
|
10016
|
-
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) => {
|
|
10017
10142
|
return `${ansiBefore || ""}${icon}${ansiAfter || ""} \x1B[95m${word}\x1B[0m`;
|
|
10018
10143
|
});
|
|
10019
10144
|
};
|
|
@@ -10857,8 +10982,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10857
10982
|
})() : String(err);
|
|
10858
10983
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
10859
10984
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10860
|
-
if (!
|
|
10861
|
-
|
|
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}
|
|
10862
10987
|
|
|
10863
10988
|
`);
|
|
10864
10989
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -10868,7 +10993,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10868
10993
|
}
|
|
10869
10994
|
if (attempts) {
|
|
10870
10995
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10871
|
-
|
|
10996
|
+
fs21.appendFileSync(path19.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
10872
10997
|
|
|
10873
10998
|
`);
|
|
10874
10999
|
if (attempts >= MAX_JANITOR_RETRIES) {
|
|
@@ -11343,8 +11468,8 @@ ${newMemoryListStr}
|
|
|
11343
11468
|
})() : String(err);
|
|
11344
11469
|
;
|
|
11345
11470
|
const janitorLogDir = path19.join(LOGS_DIR, "janitor");
|
|
11346
|
-
if (!
|
|
11347
|
-
|
|
11471
|
+
if (!fs21.existsSync(janitorLogDir)) fs21.mkdirSync(janitorLogDir, { recursive: true });
|
|
11472
|
+
fs21.appendFileSync(
|
|
11348
11473
|
path19.join(janitorLogDir, "error.log"),
|
|
11349
11474
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${errLog}
|
|
11350
11475
|
`
|
|
@@ -11428,7 +11553,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11428
11553
|
deleteChatSummary = (chatId) => {
|
|
11429
11554
|
try {
|
|
11430
11555
|
const summariesFile = path19.join(SECRET_DIR, "chat-summaries.json");
|
|
11431
|
-
if (
|
|
11556
|
+
if (fs21.existsSync(summariesFile)) {
|
|
11432
11557
|
const summaries = readEncryptedJson(summariesFile, {});
|
|
11433
11558
|
if (summaries[chatId]) {
|
|
11434
11559
|
delete summaries[chatId];
|
|
@@ -11671,7 +11796,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11671
11796
|
];
|
|
11672
11797
|
const safeReaddirWithTypes = (dir) => {
|
|
11673
11798
|
try {
|
|
11674
|
-
return
|
|
11799
|
+
return fs21.readdirSync(dir, { withFileTypes: true });
|
|
11675
11800
|
} catch (e) {
|
|
11676
11801
|
return [];
|
|
11677
11802
|
}
|
|
@@ -11961,8 +12086,8 @@ ${ideCtx.warnings}
|
|
|
11961
12086
|
filePath = tagClean.slice(0, matchRange.index);
|
|
11962
12087
|
}
|
|
11963
12088
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
11964
|
-
if (
|
|
11965
|
-
const stats =
|
|
12089
|
+
if (fs21.existsSync(absPath)) {
|
|
12090
|
+
const stats = fs21.statSync(absPath);
|
|
11966
12091
|
if (stats.isFile()) {
|
|
11967
12092
|
const pathLower = filePath.toLowerCase();
|
|
11968
12093
|
const isPdf = pathLower.endsWith(".pdf");
|
|
@@ -11971,6 +12096,7 @@ ${ideCtx.warnings}
|
|
|
11971
12096
|
const isMultimodalFile = isImage || isPdf || isOfficeFile;
|
|
11972
12097
|
const isSupported = aiProvider === "Google" || MULTIMODAL_MODELS.includes(modelName);
|
|
11973
12098
|
if (isMultimodalFile && !isSupported) {
|
|
12099
|
+
const label = `\u2718 Unsupported Modality: ${path19.basename(filePath)}`;
|
|
11974
12100
|
let terminalWidth = 115;
|
|
11975
12101
|
if (process.stdout.isTTY) {
|
|
11976
12102
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -11982,7 +12108,8 @@ ${ideCtx.warnings}
|
|
|
11982
12108
|
const boxMid = boxLines.map((line) => `${line.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`).join("\n");
|
|
11983
12109
|
const boxBottom = `${" ".repeat(boxWidth)}`;
|
|
11984
12110
|
yield { type: "visual_feedback", content: colorMainWords(`${boxBottom}
|
|
11985
|
-
${boxMid}
|
|
12111
|
+
${boxMid}
|
|
12112
|
+
`) };
|
|
11986
12113
|
continue;
|
|
11987
12114
|
}
|
|
11988
12115
|
const finalStart = startLine !== null ? startLine : 1;
|
|
@@ -12012,29 +12139,29 @@ ${boxMid}`) };
|
|
|
12012
12139
|
isError = true;
|
|
12013
12140
|
}
|
|
12014
12141
|
if (!isError) {
|
|
12015
|
-
let
|
|
12142
|
+
let label = "";
|
|
12016
12143
|
if (isImage) {
|
|
12017
|
-
|
|
12144
|
+
label = `\u2714 Viewed: ${filePath}`;
|
|
12018
12145
|
attachedBinaryPart = binPart;
|
|
12019
12146
|
} else if (isPdf || isOfficeFile) {
|
|
12020
|
-
|
|
12147
|
+
label = `\u2714 Viewed: ${filePath}`;
|
|
12021
12148
|
attachedBinaryPart = binPart;
|
|
12022
12149
|
} else {
|
|
12023
12150
|
let totalLines = "...";
|
|
12024
12151
|
try {
|
|
12025
|
-
const content =
|
|
12152
|
+
const content = fs21.readFileSync(absPath, "utf8");
|
|
12026
12153
|
totalLines = content.split("\n").length;
|
|
12027
12154
|
} catch (e) {
|
|
12028
12155
|
}
|
|
12029
|
-
|
|
12156
|
+
label = `\u2714 Auto-Read: ${filePath} \u2192 Lines ${finalStart} - ${Math.min(finalEnd, totalLines)} of ${totalLines}`;
|
|
12030
12157
|
taggedContextBlocks.push(textResult);
|
|
12031
12158
|
}
|
|
12032
|
-
if (
|
|
12159
|
+
if (label) {
|
|
12033
12160
|
let terminalWidth = 115;
|
|
12034
12161
|
if (process.stdout.isTTY) {
|
|
12035
12162
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
12036
12163
|
}
|
|
12037
|
-
const boxLines = [
|
|
12164
|
+
const boxLines = [label];
|
|
12038
12165
|
const maxLen = Math.max(...boxLines.map((l) => l.length));
|
|
12039
12166
|
const boxWidth = Math.min(maxLen + 4, terminalWidth);
|
|
12040
12167
|
const boxMid = boxLines.map((line) => `${line.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`).join("\n");
|
|
@@ -12670,7 +12797,7 @@ ${ideErr} [/ERROR]`;
|
|
|
12670
12797
|
} else if (id && potentialTool === "get_progress") {
|
|
12671
12798
|
detail = id.replace(/["']/g, "");
|
|
12672
12799
|
} else if (timeVal && potentialTool === "await") {
|
|
12673
|
-
let sec = parseFloat(timeVal.replace(/["']/g, ""));
|
|
12800
|
+
let sec = parseFloat(String(timeVal).replace(/["']/g, ""));
|
|
12674
12801
|
if (!isNaN(sec)) {
|
|
12675
12802
|
if (sec < 5) sec = 5;
|
|
12676
12803
|
if (sec > 120) sec = 120;
|
|
@@ -12684,7 +12811,7 @@ ${ideErr} [/ERROR]`;
|
|
|
12684
12811
|
};
|
|
12685
12812
|
detail = formatTime(sec);
|
|
12686
12813
|
} else {
|
|
12687
|
-
detail = timeVal.replace(/["']/g, "");
|
|
12814
|
+
detail = String(timeVal).replace(/["']/g, "");
|
|
12688
12815
|
}
|
|
12689
12816
|
} else {
|
|
12690
12817
|
const m = partialArgs.match(/(?:path|targetFile|TargetFile|directory|keyword|id|taskId|title|task)\s*=\s*\\?["']?([^\\"' \),]+)/);
|
|
@@ -12856,13 +12983,13 @@ ${ideErr} [/ERROR]`;
|
|
|
12856
12983
|
const displayLabel = TOOL_LABELS2[normToolName] || toolCall.toolName;
|
|
12857
12984
|
const detail = getToolDetail(normToolName, toolCall.args);
|
|
12858
12985
|
yield { type: "status", content: `${displayLabel}${detail ? ` (${detail})` : ""}...` };
|
|
12859
|
-
let
|
|
12986
|
+
let label = "";
|
|
12860
12987
|
if (normToolName === "web_search") {
|
|
12861
12988
|
const { query, limit = 10 } = parseArgs(toolCall.args);
|
|
12862
|
-
|
|
12989
|
+
label = `\u2714 Searched: ${query} \u2192 ${limit}`;
|
|
12863
12990
|
} else if (normToolName === "web_scrape") {
|
|
12864
12991
|
const url = parseArgs(toolCall.args).url || "...";
|
|
12865
|
-
|
|
12992
|
+
label = `\u2714 Visited: ${url}`;
|
|
12866
12993
|
} else if (normToolName === "view_file") {
|
|
12867
12994
|
const { path: targetPath2, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(toolCall.args);
|
|
12868
12995
|
const rawStart = StartLine || start_line || startLine;
|
|
@@ -12873,8 +13000,8 @@ ${ideErr} [/ERROR]`;
|
|
|
12873
13000
|
let actualEndLine = eLine;
|
|
12874
13001
|
try {
|
|
12875
13002
|
const absPath = path19.resolve(process.cwd(), targetPath2);
|
|
12876
|
-
if (
|
|
12877
|
-
const content =
|
|
13003
|
+
if (fs21.existsSync(absPath)) {
|
|
13004
|
+
const content = fs21.readFileSync(absPath, "utf8");
|
|
12878
13005
|
const lines = content.split("\n").length;
|
|
12879
13006
|
totalLines = lines;
|
|
12880
13007
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -12886,38 +13013,38 @@ ${ideErr} [/ERROR]`;
|
|
|
12886
13013
|
const isOfficeFile = pathLower.endsWith(".docx") || pathLower.endsWith(".doc") || pathLower.endsWith(".ppt") || pathLower.endsWith(".pptx") || pathLower.endsWith(".xls") || pathLower.endsWith(".xlsx");
|
|
12887
13014
|
const isImage = /\.(png|jpg|jpeg|webp|gif|bmp)$/.test(pathLower);
|
|
12888
13015
|
if (isPdf || isOfficeFile) {
|
|
12889
|
-
|
|
13016
|
+
label = `\u2714 Analyzed: ${targetPath2}`;
|
|
12890
13017
|
} else if (isImage) {
|
|
12891
|
-
|
|
13018
|
+
label = `\u2714 Analyzed: ${targetPath2}`;
|
|
12892
13019
|
} else {
|
|
12893
|
-
|
|
13020
|
+
label = `${totalLines !== "..." ? "\u2714" : "\u2718"} Read: ${targetPath2} \u2192 ${totalLines !== "..." ? `Lines ${sLine} - ${actualEndLine} of ${totalLines}` : "File Not Found"}`;
|
|
12894
13021
|
}
|
|
12895
13022
|
} else if (normToolName === "list_files" || normToolName === "read_folder") {
|
|
12896
|
-
const action = normToolName === "list_files" ? "List" : "
|
|
13023
|
+
const action = normToolName === "list_files" ? "List" : "Browsed";
|
|
12897
13024
|
const path21 = parseArgs(toolCall.args).path;
|
|
12898
|
-
|
|
13025
|
+
label = `\u2714 ${action}: ${path21 === "." ? "./" : path21}`;
|
|
12899
13026
|
} else if (normToolName === "write_file" || normToolName === "update_file") {
|
|
12900
13027
|
const action = normToolName === "write_file" ? "Created" : "Edited";
|
|
12901
|
-
|
|
13028
|
+
label = `\u2714 ${action}: ${parseArgs(toolCall.args).path || "..."}`;
|
|
12902
13029
|
} else if (normToolName === "write_pdf") {
|
|
12903
|
-
|
|
13030
|
+
label = `\u2714 Created: ${parseArgs(toolCall.args).path || "..."}
|
|
12904
13031
|
`;
|
|
12905
13032
|
} else if (normToolName === "write_docx") {
|
|
12906
|
-
|
|
13033
|
+
label = `\u2714 Created: ${parseArgs(toolCall.args).path || "..."}
|
|
12907
13034
|
`;
|
|
12908
13035
|
} else if (normToolName === "file_map") {
|
|
12909
|
-
|
|
13036
|
+
label = `\u2714 Indexed: ${parseArgs(toolCall.args).path || "..."}`;
|
|
12910
13037
|
} else if (normToolName.toLowerCase() === "search_keyword" || normToolName.toLowerCase() === "todo") {
|
|
12911
|
-
|
|
13038
|
+
label = "";
|
|
12912
13039
|
} else if (normToolName.toLowerCase() === "generate_image") {
|
|
12913
13040
|
const { path: argPath, outputPath, output } = parseArgs(toolCall.args);
|
|
12914
|
-
|
|
13041
|
+
label = `\u2714 Generated: ${argPath || outputPath || output || "generated_image.png"}`;
|
|
12915
13042
|
} else if (normToolName === "invoke_sync" || normToolName === "invoke") {
|
|
12916
13043
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
12917
|
-
|
|
13044
|
+
label = `\u2714 Elevating SubAgent${detail2 ? `: ${detail2}` : ""}`;
|
|
12918
13045
|
} else if (normToolName === "get_progress") {
|
|
12919
13046
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
12920
|
-
|
|
13047
|
+
label = `\u2714 Checked${detail2 ? `: ${detail2}` : ""}`;
|
|
12921
13048
|
} else if (normToolName === "await") {
|
|
12922
13049
|
const { time } = parseArgs(toolCall.args);
|
|
12923
13050
|
let sec = parseFloat(time) || 0;
|
|
@@ -12931,11 +13058,11 @@ ${ideErr} [/ERROR]`;
|
|
|
12931
13058
|
}
|
|
12932
13059
|
return `${s}s`;
|
|
12933
13060
|
};
|
|
12934
|
-
|
|
13061
|
+
label = `\u2714 Awaiting \u2192 ${formatTime(sec)}`;
|
|
12935
13062
|
} else if (normToolName === "exec_command" || normToolName === "ask") {
|
|
12936
|
-
|
|
13063
|
+
label = "";
|
|
12937
13064
|
} else {
|
|
12938
|
-
|
|
13065
|
+
label = `Executed: ${toolCall.toolName}`;
|
|
12939
13066
|
}
|
|
12940
13067
|
yield* flushGoogleBuffer2();
|
|
12941
13068
|
if (normToolName === "exec_command") {
|
|
@@ -13077,7 +13204,7 @@ ${ideErr} [/ERROR]`;
|
|
|
13077
13204
|
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace.`;
|
|
13078
13205
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
13079
13206
|
const action = normToolName === "write_file" ? "Write Canceled" : "Edit Canceled";
|
|
13080
|
-
const deniedLabel = `\
|
|
13207
|
+
const deniedLabel = `\u2718 ${action}: ${parsedArgs.path || "..."}`;
|
|
13081
13208
|
let terminalWidth = 115;
|
|
13082
13209
|
if (process.stdout.isTTY) {
|
|
13083
13210
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -13271,8 +13398,8 @@ ${boxMid}`) };
|
|
|
13271
13398
|
if (currentIDE && normFocused === normAbsPath && currentIDE.full_content) {
|
|
13272
13399
|
originalContent = currentIDE.full_content;
|
|
13273
13400
|
hasOriginal = true;
|
|
13274
|
-
} else if (
|
|
13275
|
-
originalContent =
|
|
13401
|
+
} else if (fs21.existsSync(absPath)) {
|
|
13402
|
+
originalContent = fs21.readFileSync(absPath, "utf8");
|
|
13276
13403
|
hasOriginal = true;
|
|
13277
13404
|
}
|
|
13278
13405
|
originalContentForReporting = originalContent;
|
|
@@ -13326,10 +13453,10 @@ ${boxMid}}`) };
|
|
|
13326
13453
|
} else if (normToolName === "write_file") {
|
|
13327
13454
|
const rawContent = toolArgs.content || toolArgs.newContent || "";
|
|
13328
13455
|
const modifiedContent = rawContent.endsWith("\n") ? rawContent : rawContent + "\n";
|
|
13329
|
-
if (!
|
|
13456
|
+
if (!fs21.existsSync(absPath)) {
|
|
13330
13457
|
isNewFileCreated = true;
|
|
13331
|
-
|
|
13332
|
-
|
|
13458
|
+
fs21.mkdirSync(path19.dirname(absPath), { recursive: true });
|
|
13459
|
+
fs21.writeFileSync(absPath, "", "utf8");
|
|
13333
13460
|
}
|
|
13334
13461
|
yield { type: "status", content: `Opening New File Diff in IDE: ${path19.basename(absPath)}...` };
|
|
13335
13462
|
showDiffInIDE(absPath, "", modifiedContent);
|
|
@@ -13369,9 +13496,9 @@ ${boxMid}}`) };
|
|
|
13369
13496
|
if (filePath) {
|
|
13370
13497
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
13371
13498
|
closeDiffInIDE(absPath, approval);
|
|
13372
|
-
if (approval === "deny" && isNewFileCreated &&
|
|
13499
|
+
if (approval === "deny" && isNewFileCreated && fs21.existsSync(absPath)) {
|
|
13373
13500
|
try {
|
|
13374
|
-
|
|
13501
|
+
fs21.unlinkSync(absPath);
|
|
13375
13502
|
} catch (e) {
|
|
13376
13503
|
}
|
|
13377
13504
|
}
|
|
@@ -13388,8 +13515,8 @@ ${boxMid}}`) };
|
|
|
13388
13515
|
let finalContent = "";
|
|
13389
13516
|
if (finalIDE && finalIDE.file_focused === absPath && finalIDE.full_content) {
|
|
13390
13517
|
finalContent = finalIDE.full_content;
|
|
13391
|
-
} else if (
|
|
13392
|
-
finalContent =
|
|
13518
|
+
} else if (fs21.existsSync(absPath)) {
|
|
13519
|
+
finalContent = fs21.readFileSync(absPath, "utf8");
|
|
13393
13520
|
}
|
|
13394
13521
|
const verifiedLines = finalContent.split(/\r?\n/);
|
|
13395
13522
|
const verifiedLineCount = verifiedLines.length;
|
|
@@ -13487,7 +13614,7 @@ ${boxMid}`) };
|
|
|
13487
13614
|
}
|
|
13488
13615
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
13489
13616
|
const action = normToolName === "write_file" ? "Write Cancelled" : "Edit Denied";
|
|
13490
|
-
const deniedLabel = `\
|
|
13617
|
+
const deniedLabel = `\u2718 ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
13491
13618
|
let terminalWidth = 115;
|
|
13492
13619
|
if (process.stdout.isTTY) {
|
|
13493
13620
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -13513,13 +13640,13 @@ ${boxMid}`) };
|
|
|
13513
13640
|
}
|
|
13514
13641
|
}
|
|
13515
13642
|
}
|
|
13516
|
-
if (
|
|
13643
|
+
if (label) {
|
|
13517
13644
|
let terminalWidth = 115;
|
|
13518
13645
|
if (process.stdout.isTTY) {
|
|
13519
13646
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
13520
13647
|
}
|
|
13521
|
-
const boxWidth = Math.min(
|
|
13522
|
-
const boxMid = `${
|
|
13648
|
+
const boxWidth = Math.min(label.length + 4, terminalWidth);
|
|
13649
|
+
const boxMid = `${label.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`;
|
|
13523
13650
|
const boxBottom = ` ${" ".repeat(boxWidth)} `;
|
|
13524
13651
|
yield { type: "visual_feedback", content: colorMainWords(`
|
|
13525
13652
|
${boxMid}${boxMid.includes("Created") || boxMid.includes("Edited") || boxMid.includes("Written") ? "" : `
|
|
@@ -13677,7 +13804,7 @@ ${colorMainWords(output)}` };
|
|
|
13677
13804
|
anyToolExecutedInThisTurn = true;
|
|
13678
13805
|
let uiContent = `[TOOL RESULT]: ${result || ""}`;
|
|
13679
13806
|
if (normToolName === "view_file" || normToolName === "web_scrape" || normToolName === "file_map") {
|
|
13680
|
-
uiContent = `[TOOL RESULT]: ${
|
|
13807
|
+
uiContent = `[TOOL RESULT]: ${label} (Context Locked for UI Clarity)`;
|
|
13681
13808
|
}
|
|
13682
13809
|
yield { type: "tool_result", content: uiContent, aiContent, binaryPart, toolName: normToolName };
|
|
13683
13810
|
if (normToolName === "memory" && result.includes("SUCCESS")) yield { type: "memory_updated" };
|
|
@@ -13811,8 +13938,8 @@ ${colorMainWords(output)}` };
|
|
|
13811
13938
|
;
|
|
13812
13939
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
13813
13940
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
13814
|
-
if (!
|
|
13815
|
-
|
|
13941
|
+
if (!fs21.existsSync(agentErrDir)) fs21.mkdirSync(agentErrDir, { recursive: true });
|
|
13942
|
+
fs21.appendFileSync(path19.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
13816
13943
|
|
|
13817
13944
|
----------------------------------------------------------------------
|
|
13818
13945
|
|
|
@@ -13982,8 +14109,8 @@ Error Log can be found in ${path19.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
13982
14109
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
13983
14110
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
13984
14111
|
yield { type: "text", content: `\u274C CRITICAL ERROR: ${errLog}` };
|
|
13985
|
-
if (!
|
|
13986
|
-
|
|
14112
|
+
if (!fs21.existsSync(agentErrDir)) fs21.mkdirSync(agentErrDir, { recursive: true });
|
|
14113
|
+
fs21.appendFileSync(path19.join(agentErrDir, "error.log"), `CRITICAL ERROR [${date}]: ${errLog}
|
|
13987
14114
|
|
|
13988
14115
|
----------------------------------------------------------------------
|
|
13989
14116
|
|
|
@@ -14077,33 +14204,28 @@ ${cleanResponse}
|
|
|
14077
14204
|
`;
|
|
14078
14205
|
continue;
|
|
14079
14206
|
}
|
|
14080
|
-
let
|
|
14081
|
-
if (normalizedToolName === "web_search") {
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
} else if (normalizedToolName === "
|
|
14088
|
-
|
|
14089
|
-
label2 = `\u2714 \x1B[95mRead\x1B[0m: ${targetPath}`;
|
|
14090
|
-
} else if (normalizedToolName === "list_files" || normalizedToolName === "read_folder") {
|
|
14091
|
-
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14092
|
-
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`;
|
|
14093
14216
|
} else if (normalizedToolName === "write_file" || normalizedToolName === "writefile") {
|
|
14094
14217
|
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14095
|
-
|
|
14096
|
-
} else if (normalizedToolName === "update_file" || normalizedToolName === "updatefile" || normalizedToolName === "patchfile" || normalizedToolName === "patch_file") {
|
|
14097
|
-
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14098
|
-
label2 = `\u2714 \x1B[95mEdited\x1B[0m: ${path21}`;
|
|
14099
|
-
} 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") {
|
|
14100
14220
|
const path21 = parseArgs(toolCall.args).path || "...";
|
|
14101
|
-
|
|
14221
|
+
label = `\u2714 \x1B[95mFile Edited\x1B[0m: ${path21}`;
|
|
14222
|
+
} else if (normalizedToolName === "file_map" || normalizedToolName === "filemap") {
|
|
14223
|
+
label = `\u2714 \x1B[95mIndexed\x1B[0m`;
|
|
14102
14224
|
} else if (normalizedToolName === "await") {
|
|
14103
14225
|
const { time } = parseArgs(toolCall.args);
|
|
14104
14226
|
let sec = parseFloat(time) || 0;
|
|
14105
|
-
if (sec <
|
|
14106
|
-
if (sec >
|
|
14227
|
+
if (sec < 10) sec = 10;
|
|
14228
|
+
if (sec > 180) sec = 180;
|
|
14107
14229
|
const formatTime = (s) => {
|
|
14108
14230
|
if (s >= 60) {
|
|
14109
14231
|
const m = Math.floor(s / 60);
|
|
@@ -14112,14 +14234,14 @@ ${cleanResponse}
|
|
|
14112
14234
|
}
|
|
14113
14235
|
return `${s}s`;
|
|
14114
14236
|
};
|
|
14115
|
-
|
|
14237
|
+
label = `\u2714 \x1B[95mAwaiting\x1B[0m \u2192 ${formatTime(sec)}`;
|
|
14116
14238
|
} else {
|
|
14117
14239
|
const displayLabel = TOOL_LABELS2[normalizedToolName] || toolCall.toolName;
|
|
14118
14240
|
const detail = getToolDetail(normalizedToolName, toolCall.args);
|
|
14119
|
-
|
|
14241
|
+
label = `\u2714 \x1B[95m${displayLabel}\x1B[0m${detail ? `: ${detail}` : ""}`;
|
|
14120
14242
|
}
|
|
14121
|
-
if (settings.onVisualFeedback &&
|
|
14122
|
-
settings.onVisualFeedback(
|
|
14243
|
+
if (settings.onVisualFeedback && label) {
|
|
14244
|
+
settings.onVisualFeedback(label);
|
|
14123
14245
|
}
|
|
14124
14246
|
if (logCallback) logCallback(`[Executing Tool] ${toolCall.toolName}(${toolCall.args})...`);
|
|
14125
14247
|
try {
|
|
@@ -14962,7 +15084,7 @@ var init_RevertModal = __esm({
|
|
|
14962
15084
|
import puppeteer4 from "puppeteer";
|
|
14963
15085
|
import { exec } from "child_process";
|
|
14964
15086
|
import { promisify } from "util";
|
|
14965
|
-
import
|
|
15087
|
+
import fs22 from "fs";
|
|
14966
15088
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
14967
15089
|
var init_setup = __esm({
|
|
14968
15090
|
"src/utils/setup.js"() {
|
|
@@ -14970,7 +15092,7 @@ var init_setup = __esm({
|
|
|
14970
15092
|
checkPuppeteerReady = () => {
|
|
14971
15093
|
try {
|
|
14972
15094
|
const exePath = puppeteer4.executablePath();
|
|
14973
|
-
const exists = exePath &&
|
|
15095
|
+
const exists = exePath && fs22.existsSync(exePath);
|
|
14974
15096
|
if (exists) return true;
|
|
14975
15097
|
} catch (e) {
|
|
14976
15098
|
return false;
|
|
@@ -15001,9 +15123,9 @@ __export(app_exports, {
|
|
|
15001
15123
|
default: () => App
|
|
15002
15124
|
});
|
|
15003
15125
|
import os4 from "os";
|
|
15004
|
-
import React15, { useState as useState14, useEffect as useEffect11, useRef as
|
|
15126
|
+
import React15, { useState as useState14, useEffect as useEffect11, useRef as useRef4, useMemo as useMemo2 } from "react";
|
|
15005
15127
|
import { Box as Box14, Text as Text15, useInput as useInput9, useStdout as useStdout2, Static } from "ink";
|
|
15006
|
-
import
|
|
15128
|
+
import fs23 from "fs-extra";
|
|
15007
15129
|
import path20 from "path";
|
|
15008
15130
|
import { exec as exec2 } from "child_process";
|
|
15009
15131
|
import { fileURLToPath } from "url";
|
|
@@ -15027,8 +15149,8 @@ function App({ args = [] }) {
|
|
|
15027
15149
|
const [isFilePickerDismissed, setIsFilePickerDismissed] = useState14(false);
|
|
15028
15150
|
const [showBridgePromo, setShowBridgePromo] = useState14(false);
|
|
15029
15151
|
const [promoSelectedIndex, setPromoSelectedIndex] = useState14(0);
|
|
15030
|
-
const suggestionOffsetRef =
|
|
15031
|
-
const persistedModelRef =
|
|
15152
|
+
const suggestionOffsetRef = useRef4(0);
|
|
15153
|
+
const persistedModelRef = useRef4(null);
|
|
15032
15154
|
useEffect11(() => {
|
|
15033
15155
|
const ideName = getIDEName();
|
|
15034
15156
|
const isIDE = !["Terminal", "Windows Terminal"].includes(ideName) || !!process.env.VSC_TERMINAL_URL;
|
|
@@ -15242,17 +15364,17 @@ function App({ args = [] }) {
|
|
|
15242
15364
|
const [janitorModel, setJanitorModel] = useState14("gemma-4-26b-a4b-it");
|
|
15243
15365
|
const [isInitializing, setIsInitializing] = useState14(true);
|
|
15244
15366
|
const [isAppFocused, setIsAppFocused] = useState14(true);
|
|
15245
|
-
const lastFocusEventTime =
|
|
15367
|
+
const lastFocusEventTime = useRef4(0);
|
|
15246
15368
|
const [apiKey, setApiKey] = useState14(null);
|
|
15247
15369
|
const [tempKey, setTempKey] = useState14("");
|
|
15248
15370
|
const addShiftEnterBinding = async (ideName) => {
|
|
15249
15371
|
const kbPath = getKeybindingsPath(ideName);
|
|
15250
15372
|
if (!kbPath) return;
|
|
15251
15373
|
try {
|
|
15252
|
-
await
|
|
15374
|
+
await fs23.ensureDir(path20.dirname(kbPath));
|
|
15253
15375
|
let bindings = [];
|
|
15254
|
-
if (
|
|
15255
|
-
const content =
|
|
15376
|
+
if (fs23.existsSync(kbPath)) {
|
|
15377
|
+
const content = fs23.readFileSync(kbPath, "utf8").trim();
|
|
15256
15378
|
if (content) {
|
|
15257
15379
|
try {
|
|
15258
15380
|
bindings = parseJsonc(content);
|
|
@@ -15272,7 +15394,7 @@ function App({ args = [] }) {
|
|
|
15272
15394
|
},
|
|
15273
15395
|
"when": "terminalFocus"
|
|
15274
15396
|
});
|
|
15275
|
-
|
|
15397
|
+
fs23.writeFileSync(kbPath, JSON.stringify(bindings, null, 4), "utf8");
|
|
15276
15398
|
cachedShortcut = "Shift + Enter";
|
|
15277
15399
|
setMessages((prev) => {
|
|
15278
15400
|
setCompletedIndex(prev.length + 1);
|
|
@@ -15313,7 +15435,7 @@ function App({ args = [] }) {
|
|
|
15313
15435
|
const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState14(0);
|
|
15314
15436
|
const [sessionTotalTokens, setSessionTotalTokens] = useState14(0);
|
|
15315
15437
|
const [chatTokens, setChatTokens] = useState14(0);
|
|
15316
|
-
const chatTokenStartRef =
|
|
15438
|
+
const chatTokenStartRef = useRef4(0);
|
|
15317
15439
|
const [sessionTotalCachedTokens, setSessionTotalCachedTokens] = useState14(0);
|
|
15318
15440
|
const [sessionTotalCandidateTokens, setSessionTotalCandidateTokens] = useState14(0);
|
|
15319
15441
|
const [sessionToolSuccess, setSessionToolSuccess] = useState14(0);
|
|
@@ -15356,12 +15478,12 @@ function App({ args = [] }) {
|
|
|
15356
15478
|
const [isTerminalFocused, setIsTerminalFocused] = useState14(false);
|
|
15357
15479
|
const [activeSubagents, setActiveSubagents] = useState14([]);
|
|
15358
15480
|
const [tick, setTick] = useState14(0);
|
|
15359
|
-
const isFirstRender =
|
|
15360
|
-
const isSecondRender =
|
|
15361
|
-
const isThirdRender =
|
|
15362
|
-
const prevProviderRef =
|
|
15363
|
-
const originalAllowExternalAccessRef =
|
|
15364
|
-
const originalMemoryRef =
|
|
15481
|
+
const isFirstRender = useRef4(true);
|
|
15482
|
+
const isSecondRender = useRef4(true);
|
|
15483
|
+
const isThirdRender = useRef4(true);
|
|
15484
|
+
const prevProviderRef = useRef4(aiProvider);
|
|
15485
|
+
const originalAllowExternalAccessRef = useRef4(false);
|
|
15486
|
+
const originalMemoryRef = useRef4(true);
|
|
15365
15487
|
useEffect11(() => {
|
|
15366
15488
|
if (prevProviderRef.current !== aiProvider) {
|
|
15367
15489
|
prevProviderRef.current = aiProvider;
|
|
@@ -15447,8 +15569,8 @@ function App({ args = [] }) {
|
|
|
15447
15569
|
}
|
|
15448
15570
|
};
|
|
15449
15571
|
}, []);
|
|
15450
|
-
const activeCommandRef =
|
|
15451
|
-
const execOutputRef =
|
|
15572
|
+
const activeCommandRef = useRef4(null);
|
|
15573
|
+
const execOutputRef = useRef4("");
|
|
15452
15574
|
useEffect11(() => {
|
|
15453
15575
|
activeCommandRef.current = activeCommand;
|
|
15454
15576
|
}, [activeCommand]);
|
|
@@ -15504,8 +15626,8 @@ function App({ args = [] }) {
|
|
|
15504
15626
|
const [escTimer, setEscTimer] = useState14(null);
|
|
15505
15627
|
const [escPressCount, setEscPressCount] = useState14(0);
|
|
15506
15628
|
const [recentPrompts, setRecentPrompts] = useState14([]);
|
|
15507
|
-
const escDoubleTimerRef =
|
|
15508
|
-
const chatLoadingRef =
|
|
15629
|
+
const escDoubleTimerRef = useRef4(null);
|
|
15630
|
+
const chatLoadingRef = useRef4(false);
|
|
15509
15631
|
useEffect11(() => {
|
|
15510
15632
|
return () => {
|
|
15511
15633
|
if (escDoubleTimerRef.current) {
|
|
@@ -15513,7 +15635,7 @@ function App({ args = [] }) {
|
|
|
15513
15635
|
}
|
|
15514
15636
|
};
|
|
15515
15637
|
}, []);
|
|
15516
|
-
const didSignalTerminationRef =
|
|
15638
|
+
const didSignalTerminationRef = useRef4(false);
|
|
15517
15639
|
const [queuedPrompt, setQueuedPrompt] = useState14(null);
|
|
15518
15640
|
const [resolutionData, setResolutionData] = useState14(null);
|
|
15519
15641
|
const [tempModelOverride, setTempModelOverride] = useState14(null);
|
|
@@ -15566,11 +15688,11 @@ function App({ args = [] }) {
|
|
|
15566
15688
|
return next;
|
|
15567
15689
|
});
|
|
15568
15690
|
};
|
|
15569
|
-
const queuedPromptRef =
|
|
15691
|
+
const queuedPromptRef = useRef4(null);
|
|
15570
15692
|
const [btwResponse, setBtwResponse] = useState14("");
|
|
15571
15693
|
const [showBtwBox, setShowBtwBox] = useState14(false);
|
|
15572
|
-
const btwResponseRef =
|
|
15573
|
-
const btwClosedRef =
|
|
15694
|
+
const btwResponseRef = useRef4("");
|
|
15695
|
+
const btwClosedRef = useRef4(null);
|
|
15574
15696
|
useEffect11(() => {
|
|
15575
15697
|
if (messages.length === 0) return;
|
|
15576
15698
|
const lastMsg = messages[messages.length - 1];
|
|
@@ -15591,8 +15713,8 @@ function App({ args = [] }) {
|
|
|
15591
15713
|
}, [messages]);
|
|
15592
15714
|
const [completedIndex, setCompletedIndex] = useState14(messages.length);
|
|
15593
15715
|
const [clearKey, setClearKey] = useState14(0);
|
|
15594
|
-
const lastCompletedBlocksRef =
|
|
15595
|
-
const cachedHistoryRef =
|
|
15716
|
+
const lastCompletedBlocksRef = useRef4([]);
|
|
15717
|
+
const cachedHistoryRef = useRef4({
|
|
15596
15718
|
completedIndex: 0,
|
|
15597
15719
|
columns: 0,
|
|
15598
15720
|
historicalBlocks: [],
|
|
@@ -15948,7 +16070,7 @@ function App({ args = [] }) {
|
|
|
15948
16070
|
useEffect11(() => {
|
|
15949
16071
|
async function init() {
|
|
15950
16072
|
try {
|
|
15951
|
-
const pkg = JSON.parse(
|
|
16073
|
+
const pkg = JSON.parse(fs23.readFileSync(path20.join(process.cwd(), "package.json"), "utf8"));
|
|
15952
16074
|
initBridge(versionFluxflow || pkg.version || "2.0.0");
|
|
15953
16075
|
} catch (e) {
|
|
15954
16076
|
initBridge("2.0.0");
|
|
@@ -16071,7 +16193,7 @@ function App({ args = [] }) {
|
|
|
16071
16193
|
if (!parsedArgs.playground) {
|
|
16072
16194
|
deleteChat(PLAYGROUND_CHAT_ID).catch(() => {
|
|
16073
16195
|
});
|
|
16074
|
-
|
|
16196
|
+
fs23.remove(path20.join(DATA_DIR, "playground")).catch(() => {
|
|
16075
16197
|
});
|
|
16076
16198
|
}
|
|
16077
16199
|
performVersionCheck(false, freshSettings);
|
|
@@ -16107,7 +16229,7 @@ function App({ args = [] }) {
|
|
|
16107
16229
|
if (parsedArgs.playground) {
|
|
16108
16230
|
const playgroundDir = path20.join(DATA_DIR, "playground");
|
|
16109
16231
|
try {
|
|
16110
|
-
|
|
16232
|
+
fs23.ensureDirSync(playgroundDir);
|
|
16111
16233
|
process.chdir(playgroundDir);
|
|
16112
16234
|
} catch (e) {
|
|
16113
16235
|
}
|
|
@@ -16148,8 +16270,8 @@ function App({ args = [] }) {
|
|
|
16148
16270
|
if (kbPath) {
|
|
16149
16271
|
try {
|
|
16150
16272
|
let bindings = [];
|
|
16151
|
-
if (
|
|
16152
|
-
const content =
|
|
16273
|
+
if (fs23.existsSync(kbPath)) {
|
|
16274
|
+
const content = fs23.readFileSync(kbPath, "utf8").trim();
|
|
16153
16275
|
if (content) {
|
|
16154
16276
|
bindings = parseJsonc(content);
|
|
16155
16277
|
}
|
|
@@ -16234,7 +16356,7 @@ function App({ args = [] }) {
|
|
|
16234
16356
|
setTempKey("");
|
|
16235
16357
|
}
|
|
16236
16358
|
};
|
|
16237
|
-
const lastSavedTimeRef =
|
|
16359
|
+
const lastSavedTimeRef = useRef4(SESSION_START_TIME);
|
|
16238
16360
|
useEffect11(() => {
|
|
16239
16361
|
if (activeView === "exit") {
|
|
16240
16362
|
const flush = async () => {
|
|
@@ -16444,6 +16566,10 @@ function App({ args = [] }) {
|
|
|
16444
16566
|
cmd: "z-ai/glm-5.1",
|
|
16445
16567
|
desc: "Text Only [DEPRICATED]"
|
|
16446
16568
|
},
|
|
16569
|
+
{
|
|
16570
|
+
cmd: "z-ai/glm-5.2",
|
|
16571
|
+
desc: "Text Only"
|
|
16572
|
+
},
|
|
16447
16573
|
// --- MiniMax Family ---
|
|
16448
16574
|
{
|
|
16449
16575
|
cmd: "minimaxai/minimax-m2.7",
|
|
@@ -16686,9 +16812,9 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16686
16812
|
setCompletedIndex(prev.length + 1);
|
|
16687
16813
|
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Exporting playground content to ${dest}`, isMeta: true }];
|
|
16688
16814
|
});
|
|
16689
|
-
await
|
|
16815
|
+
await fs23.ensureDir(dest);
|
|
16690
16816
|
const excludeDirs = ["node_modules", ".git", ".venv", "venv", "env", ".next", "dist", "build", ".cache"];
|
|
16691
|
-
await
|
|
16817
|
+
await fs23.copy(src, dest, {
|
|
16692
16818
|
overwrite: true,
|
|
16693
16819
|
filter: (srcPath) => {
|
|
16694
16820
|
const relative = path20.relative(src, srcPath);
|
|
@@ -16753,7 +16879,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16753
16879
|
}
|
|
16754
16880
|
}
|
|
16755
16881
|
setTimeout(() => {
|
|
16756
|
-
|
|
16882
|
+
fs23.emptyDir(path20.join(DATA_DIR, "playground")).catch((err) => {
|
|
16757
16883
|
setMessages((prev) => {
|
|
16758
16884
|
const newMsgs = [...prev, {
|
|
16759
16885
|
id: "playground-" + Date.now(),
|
|
@@ -17102,7 +17228,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
17102
17228
|
}
|
|
17103
17229
|
const fileContent = exportLines.join("\n");
|
|
17104
17230
|
try {
|
|
17105
|
-
|
|
17231
|
+
fs23.writeFileSync(exportPath, fileContent, "utf8");
|
|
17106
17232
|
setMessages((prev) => {
|
|
17107
17233
|
setCompletedIndex(prev.length + 1);
|
|
17108
17234
|
return [...prev, {
|
|
@@ -17149,12 +17275,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17149
17275
|
setCompletedIndex(prev.length + 1);
|
|
17150
17276
|
return [...prev, { id: Date.now(), role: "system", text: "[NUCLEAR] Initiating reset...", isMeta: true }];
|
|
17151
17277
|
});
|
|
17152
|
-
if (
|
|
17153
|
-
if (
|
|
17154
|
-
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);
|
|
17155
17281
|
try {
|
|
17156
|
-
const items =
|
|
17157
|
-
if (items.length === 0)
|
|
17282
|
+
const items = fs23.readdirSync(FLUXFLOW_DIR);
|
|
17283
|
+
if (items.length === 0) fs23.removeSync(FLUXFLOW_DIR);
|
|
17158
17284
|
} catch (e) {
|
|
17159
17285
|
}
|
|
17160
17286
|
setTimeout(() => {
|
|
@@ -17277,14 +17403,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17277
17403
|
- [Define custom step-by-step recipes for this project here]
|
|
17278
17404
|
`;
|
|
17279
17405
|
const filePath = path20.join(process.cwd(), "FluxFlow.md");
|
|
17280
|
-
if (
|
|
17406
|
+
if (fs23.pathExistsSync(filePath)) {
|
|
17281
17407
|
setMessages((prev) => {
|
|
17282
17408
|
setCompletedIndex(prev.length + 1);
|
|
17283
17409
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
17284
17410
|
});
|
|
17285
17411
|
} else {
|
|
17286
17412
|
try {
|
|
17287
|
-
|
|
17413
|
+
fs23.writeFileSync(filePath, template);
|
|
17288
17414
|
setMessages((prev) => {
|
|
17289
17415
|
setCompletedIndex(prev.length + 1);
|
|
17290
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 }];
|
|
@@ -17505,7 +17631,7 @@ ${timestamp}` };
|
|
|
17505
17631
|
});
|
|
17506
17632
|
},
|
|
17507
17633
|
onSubagentUpdate: () => {
|
|
17508
|
-
setActiveSubagents(
|
|
17634
|
+
setActiveSubagents(subagentProgress.map((sa) => ({ ...sa })));
|
|
17509
17635
|
},
|
|
17510
17636
|
onExecStart: (cmd) => {
|
|
17511
17637
|
setActiveCommand(cmd);
|
|
@@ -18217,8 +18343,8 @@ Selection: ${val}`,
|
|
|
18217
18343
|
});
|
|
18218
18344
|
setActiveView("input");
|
|
18219
18345
|
}, [activeView, providerBudgetCursor]);
|
|
18220
|
-
const CustomMenuItem = ({ label
|
|
18221
|
-
const isCancel =
|
|
18346
|
+
const CustomMenuItem = ({ label, isSelected }) => {
|
|
18347
|
+
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
18222
18348
|
return /* @__PURE__ */ React15.createElement(
|
|
18223
18349
|
Box14,
|
|
18224
18350
|
{
|
|
@@ -18227,10 +18353,10 @@ Selection: ${val}`,
|
|
|
18227
18353
|
paddingX: 1,
|
|
18228
18354
|
width: "100%"
|
|
18229
18355
|
},
|
|
18230
|
-
/* @__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)
|
|
18231
18357
|
);
|
|
18232
18358
|
};
|
|
18233
|
-
const renderProgressBar = (
|
|
18359
|
+
const renderProgressBar = (label, current, limit) => {
|
|
18234
18360
|
const percent = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 0;
|
|
18235
18361
|
const barWidth = 15;
|
|
18236
18362
|
const filledCount = Math.round(percent / 100 * barWidth);
|
|
@@ -18241,10 +18367,10 @@ Selection: ${val}`,
|
|
|
18241
18367
|
} else if (percent > 80) {
|
|
18242
18368
|
barColor = "red";
|
|
18243
18369
|
}
|
|
18244
|
-
const isTokens =
|
|
18370
|
+
const isTokens = label.toLowerCase().includes("token");
|
|
18245
18371
|
const displayLimit = shouldClearValue(limit) ? "\u221E" : isTokens ? formatTokens(limit) : limit;
|
|
18246
18372
|
const displayCurrent = isTokens ? formatTokens(current) : current;
|
|
18247
|
-
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, ")"));
|
|
18248
18374
|
};
|
|
18249
18375
|
const renderActiveView = () => {
|
|
18250
18376
|
switch (activeView) {
|
|
@@ -18660,7 +18786,7 @@ Selection: ${val}`,
|
|
|
18660
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]) => {
|
|
18661
18787
|
const providerTotalTokens = Object.values(models).reduce((sum, m) => sum + (m.tokens || 0), 0);
|
|
18662
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))))));
|
|
18663
|
-
})) : /* @__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)"));
|
|
18664
18790
|
}
|
|
18665
18791
|
case "autoExecDanger":
|
|
18666
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(
|
|
@@ -19175,18 +19301,18 @@ Selection: ${val}`,
|
|
|
19175
19301
|
},
|
|
19176
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" ? (() => {
|
|
19177
19303
|
let url = "https://aistudio.google.com/billing";
|
|
19178
|
-
let
|
|
19304
|
+
let label = "billing";
|
|
19179
19305
|
if (aiProvider === "DeepSeek") {
|
|
19180
19306
|
url = "https://platform.deepseek.com/usage";
|
|
19181
|
-
|
|
19307
|
+
label = "billing";
|
|
19182
19308
|
} else if (aiProvider === "OpenRouter") {
|
|
19183
19309
|
url = "https://openrouter.ai/settings/profile";
|
|
19184
|
-
|
|
19310
|
+
label = "profile";
|
|
19185
19311
|
} else if (aiProvider === "NVIDIA") {
|
|
19186
19312
|
url = "https://build.nvidia.com/settings/api-keys";
|
|
19187
|
-
|
|
19313
|
+
label = "billing";
|
|
19188
19314
|
}
|
|
19189
|
-
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");
|
|
19190
19316
|
})() : null),
|
|
19191
19317
|
visible.map((s, i) => {
|
|
19192
19318
|
const actualIdx = startIdx + i;
|
|
@@ -19240,10 +19366,10 @@ Selection: ${val}`,
|
|
|
19240
19366
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
19241
19367
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
19242
19368
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
19243
|
-
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, "%)"))));
|
|
19244
19370
|
})())));
|
|
19245
19371
|
}
|
|
19246
|
-
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, SubagentRow;
|
|
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;
|
|
19247
19373
|
var init_app = __esm({
|
|
19248
19374
|
async "src/app.jsx"() {
|
|
19249
19375
|
init_build();
|
|
@@ -19377,7 +19503,7 @@ var init_app = __esm({
|
|
|
19377
19503
|
linesAdded = 0;
|
|
19378
19504
|
linesRemoved = 0;
|
|
19379
19505
|
packageJsonPath = path20.join(path20.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
19380
|
-
packageJson = JSON.parse(
|
|
19506
|
+
packageJson = JSON.parse(fs23.readFileSync(packageJsonPath, "utf8"));
|
|
19381
19507
|
versionFluxflow = packageJson.version;
|
|
19382
19508
|
updatedOn = packageJson.date || "2026-05-20";
|
|
19383
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(
|
|
@@ -19473,13 +19599,13 @@ var init_app = __esm({
|
|
|
19473
19599
|
const fileList = [];
|
|
19474
19600
|
const scan = (currentDir) => {
|
|
19475
19601
|
try {
|
|
19476
|
-
const files =
|
|
19602
|
+
const files = fs23.readdirSync(currentDir);
|
|
19477
19603
|
for (const file of files) {
|
|
19478
19604
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
19479
19605
|
continue;
|
|
19480
19606
|
}
|
|
19481
19607
|
const filePath = path20.join(currentDir, file);
|
|
19482
|
-
const stat =
|
|
19608
|
+
const stat = fs23.statSync(filePath);
|
|
19483
19609
|
if (stat.isDirectory()) {
|
|
19484
19610
|
scan(filePath);
|
|
19485
19611
|
} else {
|
|
@@ -19499,27 +19625,70 @@ var init_app = __esm({
|
|
|
19499
19625
|
};
|
|
19500
19626
|
})();
|
|
19501
19627
|
cachedShortcut = "\\ + Enter";
|
|
19628
|
+
getLatencyColor2 = (delay) => {
|
|
19629
|
+
if (delay <= 400) return "#00a564";
|
|
19630
|
+
if (delay >= 5e3) return "#ff0000";
|
|
19631
|
+
const points = [
|
|
19632
|
+
{ t: 400, r: 0, g: 165, b: 100 },
|
|
19633
|
+
{ t: 800, r: 120, g: 220, b: 80 },
|
|
19634
|
+
{ t: 1500, r: 250, g: 210, b: 40 },
|
|
19635
|
+
{ t: 3e3, r: 255, g: 120, b: 0 },
|
|
19636
|
+
{ t: 5e3, r: 255, g: 0, b: 0 }
|
|
19637
|
+
];
|
|
19638
|
+
for (let i = 0; i < points.length - 1; i++) {
|
|
19639
|
+
const p1 = points[i];
|
|
19640
|
+
const p2 = points[i + 1];
|
|
19641
|
+
if (delay >= p1.t && delay <= p2.t) {
|
|
19642
|
+
const ratio = (delay - p1.t) / (p2.t - p1.t);
|
|
19643
|
+
const r = Math.round(p1.r + (p2.r - p1.r) * ratio);
|
|
19644
|
+
const g = Math.round(p1.g + (p2.g - p1.g) * ratio);
|
|
19645
|
+
const b = Math.round(p1.b + (p2.b - p1.b) * ratio);
|
|
19646
|
+
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
|
|
19647
|
+
}
|
|
19648
|
+
}
|
|
19649
|
+
return "#ff0000";
|
|
19650
|
+
};
|
|
19502
19651
|
SubagentRow = React15.memo(({ sa }) => {
|
|
19503
19652
|
const [dotColor, setDotColor] = useState14("green");
|
|
19653
|
+
const chunkTimesRef = useRef4([]);
|
|
19504
19654
|
useEffect11(() => {
|
|
19505
|
-
if (sa.status !== "running")
|
|
19655
|
+
if (sa.status !== "running") {
|
|
19656
|
+
chunkTimesRef.current = [];
|
|
19657
|
+
return;
|
|
19658
|
+
}
|
|
19659
|
+
const lastChunkTime = sa.lastChunkTime;
|
|
19660
|
+
if (lastChunkTime > 0) {
|
|
19661
|
+
const times = chunkTimesRef.current;
|
|
19662
|
+
if (times.length === 0 || times[times.length - 1] !== lastChunkTime) {
|
|
19663
|
+
times.push(lastChunkTime);
|
|
19664
|
+
if (times.length > 5) {
|
|
19665
|
+
times.shift();
|
|
19666
|
+
}
|
|
19667
|
+
}
|
|
19668
|
+
}
|
|
19506
19669
|
const checkLatency = () => {
|
|
19507
|
-
|
|
19508
|
-
|
|
19509
|
-
|
|
19510
|
-
}
|
|
19511
|
-
|
|
19512
|
-
|
|
19513
|
-
|
|
19514
|
-
|
|
19515
|
-
|
|
19670
|
+
if (!lastChunkTime) {
|
|
19671
|
+
setDotColor("#00a564");
|
|
19672
|
+
return;
|
|
19673
|
+
}
|
|
19674
|
+
const times = chunkTimesRef.current;
|
|
19675
|
+
let averageInterval = 0;
|
|
19676
|
+
if (times.length > 1) {
|
|
19677
|
+
let sum = 0;
|
|
19678
|
+
for (let i = 1; i < times.length; i++) {
|
|
19679
|
+
sum += times[i] - times[i - 1];
|
|
19680
|
+
}
|
|
19681
|
+
averageInterval = sum / (times.length - 1);
|
|
19516
19682
|
}
|
|
19683
|
+
const timeSinceLast = Date.now() - lastChunkTime;
|
|
19684
|
+
const delay = Math.max(averageInterval, timeSinceLast);
|
|
19685
|
+
setDotColor(getLatencyColor2(delay));
|
|
19517
19686
|
};
|
|
19518
19687
|
checkLatency();
|
|
19519
19688
|
const timer = setInterval(checkLatency, 100);
|
|
19520
19689
|
return () => clearInterval(timer);
|
|
19521
19690
|
}, [sa.status, sa.lastChunkTime]);
|
|
19522
|
-
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")));
|
|
19523
19692
|
});
|
|
19524
19693
|
}
|
|
19525
19694
|
});
|
|
@@ -19565,11 +19734,11 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
19565
19734
|
const isVersion = args.includes("--version") || args.includes("-v");
|
|
19566
19735
|
const isUpdate = args[0] === "--update";
|
|
19567
19736
|
if (isVersion || isHelp || isHelpCommands || isUpdate) {
|
|
19568
|
-
const
|
|
19737
|
+
const fs24 = await import("fs");
|
|
19569
19738
|
const path21 = await import("path");
|
|
19570
19739
|
const { fileURLToPath: fileURLToPath3 } = await import("url");
|
|
19571
19740
|
const packageJsonPath2 = path21.join(path21.dirname(fileURLToPath3(import.meta.url)), "../package.json");
|
|
19572
|
-
const packageJson2 = JSON.parse(
|
|
19741
|
+
const packageJson2 = JSON.parse(fs24.readFileSync(packageJsonPath2, "utf8"));
|
|
19573
19742
|
const versionFluxflow2 = packageJson2.version;
|
|
19574
19743
|
if (isVersion) {
|
|
19575
19744
|
console.log(`v${versionFluxflow2}`);
|
|
@@ -19686,8 +19855,8 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
19686
19855
|
{ label: "Bun", value: "bun" },
|
|
19687
19856
|
{ label: "Custom Command", value: "custom" }
|
|
19688
19857
|
];
|
|
19689
|
-
const CustomItem2 = ({ label
|
|
19690
|
-
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));
|
|
19691
19860
|
};
|
|
19692
19861
|
let unmountFn;
|
|
19693
19862
|
const PromptComponent = () => {
|