fluxflow-cli 3.13.5 → 3.14.1
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 +650 -189
- package/model_config.json +1 -1
- package/package.json +73 -73
package/dist/fluxflow.js
CHANGED
|
@@ -2864,9 +2864,23 @@ var init_text = __esm({
|
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
}
|
|
2867
|
+
const originalLineIdx = res.originalStartLine - 1;
|
|
2868
|
+
const fullOrigLine = allLinesOriginal[originalLineIdx] || "";
|
|
2867
2869
|
const oldLines = res.oldContent.split("\n");
|
|
2870
|
+
const origIndentMatch = fullOrigLine.match(/^\s*/);
|
|
2871
|
+
const origIndent = origIndentMatch ? origIndentMatch[0] : "";
|
|
2868
2872
|
oldLines.forEach((line, i) => {
|
|
2869
|
-
|
|
2873
|
+
let lineText = line;
|
|
2874
|
+
if (oldLines.length === 1 && fullOrigLine.trim().length > 0 && fullOrigLine.includes(line.trim())) {
|
|
2875
|
+
lineText = fullOrigLine;
|
|
2876
|
+
} else if (i === 0) {
|
|
2877
|
+
const lineIndentMatch = line.match(/^\s*/);
|
|
2878
|
+
const lineIndent = lineIndentMatch ? lineIndentMatch[0] : "";
|
|
2879
|
+
if (lineIndent.length < origIndent.length && fullOrigLine.includes(line.trim())) {
|
|
2880
|
+
lineText = origIndent + line.trimStart();
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
diffText += `-${res.originalStartLine + i}|${lineText}
|
|
2870
2884
|
`;
|
|
2871
2885
|
});
|
|
2872
2886
|
let hunkEndInFinal = currentFinalLineIdx;
|
|
@@ -2912,7 +2926,6 @@ var init_text = __esm({
|
|
|
2912
2926
|
const isR = clean.startsWith("-");
|
|
2913
2927
|
const isA = clean.startsWith("+");
|
|
2914
2928
|
let rest = isR || isA ? clean.substring(1) : clean;
|
|
2915
|
-
rest = rest.trim();
|
|
2916
2929
|
const splitIdx = rest.indexOf("|");
|
|
2917
2930
|
const num = splitIdx !== -1 ? flattenString(rest.substring(0, splitIdx).trim()) : "";
|
|
2918
2931
|
const content = splitIdx !== -1 ? flattenString(rest.substring(splitIdx + 1)) : flattenString(rest);
|
|
@@ -5634,8 +5647,10 @@ var init_ChatLayout = __esm({
|
|
|
5634
5647
|
tableBuffer = [];
|
|
5635
5648
|
}
|
|
5636
5649
|
if (quoteBuffer.length > 0) {
|
|
5650
|
+
const quoteWidth = columns - 6;
|
|
5651
|
+
const wrappedQuoteLines = quoteBuffer.flatMap((line) => wrapText(line, quoteWidth).split("\n"));
|
|
5637
5652
|
result.push(
|
|
5638
|
-
/* @__PURE__ */ React4.createElement(Box3, { key: `quote-${key}`, borderStyle: "bold", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, borderColor: colors.borderMuted, paddingLeft: 1, marginY: 1, flexDirection: "column" },
|
|
5653
|
+
/* @__PURE__ */ React4.createElement(Box3, { key: `quote-${key}`, borderStyle: "bold", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, borderColor: colors.borderMuted, paddingLeft: 1, marginY: 1, flexDirection: "column" }, wrappedQuoteLines.map((line, qi) => /* @__PURE__ */ React4.createElement(InlineMarkdown, { key: qi, text: line, color: colors.textMuted, italic, theme })))
|
|
5639
5654
|
);
|
|
5640
5655
|
quoteBuffer = [];
|
|
5641
5656
|
}
|
|
@@ -6022,7 +6037,7 @@ var init_ChatLayout = __esm({
|
|
|
6022
6037
|
const cmdMatch = msg.text.match(/COMMAND: (.*)/);
|
|
6023
6038
|
const ptyMatch = msg.text.match(/PTY: (true|false)/);
|
|
6024
6039
|
const outputMatch = msg.text.match(/OUTPUT: ([\s\S]*)/);
|
|
6025
|
-
const cmd = cmdMatch ? cmdMatch[1] : "
|
|
6040
|
+
const cmd = cmdMatch ? cmdMatch[1] : "No Command";
|
|
6026
6041
|
const isPty = ptyMatch ? ptyMatch[1] === "true" : false;
|
|
6027
6042
|
const outputList = outputMatch ? outputMatch[1] : "";
|
|
6028
6043
|
return /* @__PURE__ */ React4.createElement(Box3, { marginBottom: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(TerminalBox, { command: cmd, output: outputList, completed: true, columns, isPty, theme }));
|
|
@@ -6590,7 +6605,7 @@ var init_arg_parser = __esm({
|
|
|
6590
6605
|
return "\\";
|
|
6591
6606
|
default:
|
|
6592
6607
|
if (char === quote) return quote;
|
|
6593
|
-
return
|
|
6608
|
+
return char;
|
|
6594
6609
|
}
|
|
6595
6610
|
});
|
|
6596
6611
|
} else if (i < argsString.length && argsString[i] === "[") {
|
|
@@ -6687,27 +6702,27 @@ Tool calls: ONLY use [tool:functions.ToolName(args)]
|
|
|
6687
6702
|
**NO OTHER SYNTAX/MARKERS/BOUNDARY ALLOWED**
|
|
6688
6703
|
|
|
6689
6704
|
**TOOL USAGE POLICY:**
|
|
6690
|
-
- MAX
|
|
6691
|
-
${mode === "Flux" ? "- Same file, many edits? Prefer multi search-replace in Patch \u2190 **HIGHLY RECOMMENDED**\n- Tool denied?Use Ask immediately for user guidance
|
|
6705
|
+
- MAX 4 TOOL CALLS/TURN${mode === "Flux" ? " (Todo: 4+, Run: max 1 or 2 consecutive)" : ""}
|
|
6706
|
+
${mode === "Flux" ? "- Same file, many edits? Prefer multi search-replace in Patch \u2190 **HIGHLY RECOMMENDED**\n- Tool denied?Use `Ask` immediately for user guidance \u2190 ** MANDATORY **\n- FileMap > ReadFile for efficient file understanding\n- Need specific text ? SearchKeyword > Guessing/ReadFile\n- Huge files ? SearchKeyword > Full Read\n- **Update Todos from realtime progress EVERY TURN**\n" : ""}
|
|
6692
6707
|
- COMMUNICATION TOOLS -
|
|
6693
|
-
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity: MUST
|
|
6708
|
+
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity: MUST for path divergence, security risk. Ask, don't finish/guess. Suggest best options; no preferences. Keep options short
|
|
6694
6709
|
|
|
6695
6710
|
- WEB TOOLS -
|
|
6696
|
-
1. [tool:functions.WebSearch(query="...", aiMode="
|
|
6711
|
+
1. [tool:functions.WebSearch(query="...", aiMode="bool optional, default: false", limit="integer 3-10, aiMode: exclude")]. Usage: unknown info/docs. aiMode: LLM search
|
|
6697
6712
|
2. [tool:functions.WebScrape(url="...")]. Proactive use for specific webpage/docs/api
|
|
6698
6713
|
|
|
6699
6714
|
${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative; FIRST ARGUMENT, path separator: '/') -
|
|
6700
|
-
1. [tool:functions.ReadFile(path="...", startLine=
|
|
6701
|
-
2. [tool:functions.ReadFolder(path="...")]. Detailed DIR stats including File Sizes
|
|
6702
|
-
3. [tool:functions.FileMap(path="
|
|
6703
|
-
4. [tool:functions.PatchFile(path="...", allowMultiple="
|
|
6704
|
-
5. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
6705
|
-
6. [tool:functions.SearchKeyword(keyword="...", path="optional, target directory
|
|
6715
|
+
1. [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. ${aiProvider !== "Google" ? `${isMultiModal ? `Supports images/docs` : ``}` : `Supports images/docs`}
|
|
6716
|
+
2. [tool:functions.ReadFolder(path="...", recurse="integer 0-4 optional, default: 0")]. Detailed DIR stats including File Sizes
|
|
6717
|
+
3. [tool:functions.FileMap(path="file")]. Shows file structure
|
|
6718
|
+
4. [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", replaceContent1="...", newContent1="...", ...MAX 15)]. Surgical patchs, TARGET SMALLEST SNIPPETS/SUB-STRINGS. allowMultiple: Replace all matches. Use replaceContent2/newContent2... for multi blocks. Verify DIFFs
|
|
6719
|
+
5. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
6720
|
+
6. [tool:functions.SearchKeyword(keyword="...", path="optional, target directory/filename", subString="bool optional, default: false", regex="bool optional, default: auto")]. path limits scope to a file/dir. Find definitions/logic without full reads. Locate relevant code
|
|
6706
6721
|
7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL` : `WINDOWS CMD ONLY` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
|
|
6707
|
-
8. [tool:functions.Todo(method="create/append/get", tasks=[ARRAY OF STRINGS], markDone=[ARRAY OF
|
|
6722
|
+
8. [tool:functions.Todo(method="create/append/get", tasks=[ARRAY OF STRINGS], markDone=[ARRAY OF TASKS])]. Task list, no Markdown in arrays. Analyze request: if long multi-task, break it down & create Todos BEFORE starting. \`tasks\` & \`markDone\` optional with \`get\`. Use \`get + markDone\` to complete tasks, or \`create + markDone\` to create completed tasks. **UPDATE EVERY TURN**${enableSubAgents ? '\n9. [tool:functions.Await(time="seconds")]. For waiting without exiting agent loop, 15s - 180s' : ""}
|
|
6708
6723
|
${_cachedAdvanceRollback ? `
|
|
6709
6724
|
- EMERGENCY SAFETY TOOLS -
|
|
6710
|
-
Info: \`initial\` = user prompt for current task. Revert \`id\` = turn BEFORE the disaster tool (e.g. disaster:\`turn_3\` \u2192 revert:\`turn_2\`). Reason explicitly
|
|
6725
|
+
Info: \`initial\` = user prompt for current task. Revert \`id\` = turn BEFORE the disaster tool (e.g. disaster:\`turn_3\` \u2192 revert:\`turn_2\`). Reason explicitly
|
|
6711
6726
|
1. [tool:functions.EmergencyRollback(method="getCheckpoint/forceRevert", id="...")]. Rollback workspace to a checkpoint in THIS agent loop.
|
|
6712
6727
|
Use ONLY for catastrophic/codebase corruption. Before ending loop, verify no catastrophe. \`id\` not required with \`getCheckPoint\`.
|
|
6713
6728
|
` : ""}${enableSubAgents ? `
|
|
@@ -6717,7 +6732,7 @@ Invocations:
|
|
|
6717
6732
|
- Invoke (async/background, \u22647 parallel). Parallelize long tasks. NEVER repeat while active
|
|
6718
6733
|
- InvokeSync (sync/blocking). Sequential, repetitive or delegated tasks. Saves tokens/cost
|
|
6719
6734
|
1. [agent:generalist.InvokeSync/Invoke(title="...", task="...")]. Task must be detailed: exact file paths, imports/exports, dependencies & folder structure
|
|
6720
|
-
2. [agent:generalist.GetProgress(id="...")]. Check async task progress. If still running, continue your work. Wait exponentially longer between checks
|
|
6735
|
+
2. [agent:generalist.GetProgress(id="...")]. Check async task progress. If still running, continue your work. Wait exponentially longer between checks
|
|
6721
6736
|
3. [agent:generalist.Cancel(id="...")]. Cancel async task ONLY if stalled (2m+) or clearly incorrect` : ""}`.trim() : `- CREATIVE TOOLS (path = relative to CWD & WILL BE FIRST ARGUMENT, path separator: '/') -
|
|
6722
6737
|
1. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout, stable margins & headers/footers, NO WATERMARKS
|
|
6723
6738
|
2. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document, NO WATERMARKS, stable margins & headers/footers
|
|
@@ -8079,9 +8094,9 @@ var init_thinking_prompts = __esm({
|
|
|
8079
8094
|
"src/data/thinking_prompts.json"() {
|
|
8080
8095
|
thinking_prompts_default = {
|
|
8081
8096
|
xHigh: "EFFORT LEVEL: HIGH\nChallenge assumptions. Verify before concluding\nPrefer the simplest correct solution\nAssess architecture, scalability & trade-offs\nVerify dependencies, regressions, failure modes & modularity\nPlan implementation: files, modules, interfaces & tests\nRULES:\n- Continuous analytical flow\n- Verify via first principles\n- Actively seek failure paths\n- Verify imports & system stability, avoid syntax errors, recheck tool results\n- MANDATORY THINKING: Full technical verification",
|
|
8082
|
-
High: "EFFORT LEVEL: HIGH\nThink in a rigorous monologue
|
|
8083
|
-
Medium: "EFFORT LEVEL: MEDIUM\nThink in a focused, technical monologue
|
|
8084
|
-
Minimal: "EFFORT LEVEL: LOW\nThink in a quick, focused monologue
|
|
8097
|
+
High: "EFFORT LEVEL: HIGH\nThink in a rigorous monologue\nPrefer the simplest correct solution\nAssess architecture, performance & maintainability\nVerify error handling, assumptions, edge cases, dependencies & regressions\nPlan: files, functions, logic & interactions\nRULES:\n- Continuous analytical flow\n- Verify via first principles\n- Actively seek failure paths\n- Verify imports & system stability, avoid syntax errors, recheck tool results\n- MANDATORY THINKING: Full technical verification",
|
|
8098
|
+
Medium: "EFFORT LEVEL: MEDIUM\nThink in a focused, technical monologue\nFind the simplest solution meeting requirements\nScan for missing error handling, invalid assumptions, edge cases & dependencies\nVerify cohesive, modular changes\nOutline changes: files, functions & key logic\nRULES:\n- Clean logical flow\n- Efficient, deliberate, implementation-focused\n- Verify imports & system stability, avoid syntax errors, recheck tool results\n- MANDATORY THINKING: Brief verification for technical tasks/greetings",
|
|
8099
|
+
Minimal: "EFFORT LEVEL: LOW\nThink in a quick, focused monologue. Verify Basics:\nConfirm intent & complexity\nIdentify required tools/files/actions\nVerify before acting\nRULES:\n- Brief thoughts\n- Think only enough to avoid obvious mistakes\n- Verify imports & system stability, avoid syntax errors, recheck tool results",
|
|
8085
8100
|
Off: "EFFORT LEVEL: LOWEST\nNo thinking. Immediate response\nRULES:\n- Verify imports & system stability, avoid syntax errors, recheck tool results"
|
|
8086
8101
|
};
|
|
8087
8102
|
}
|
|
@@ -8211,27 +8226,27 @@ Check these first; These Files > Training Data. Safety rules apply
|
|
|
8211
8226
|
const projectContextBlock = cachedProjectContextBlock;
|
|
8212
8227
|
return `=== SYSTEM PROMPT ===
|
|
8213
8228
|
Identity: Flux Flow. Sassy, CLI Agent
|
|
8214
|
-
${mode === "Flux" ? "Logical, detailed, task-driven. Prioritize scalable
|
|
8229
|
+
${mode === "Flux" ? "Logical, detailed, task-driven. Prioritize scalable project structure, modular architecture, clean abstractions, stepwise execution. Use latest industry-standard practices/libraries, clean code, verify imports, run automated tests" : `Mode: ${mode}. Concise, Conversational, Sassy, Friendly, Humorous, Sarcastic`}
|
|
8215
8230
|
|
|
8216
8231
|
-- THINKING GUIDANCE --
|
|
8217
8232
|
${aiProvider === "Mistral" || aiProvider === "Google" && !isGemini ? `${thinkingConfig}
|
|
8218
8233
|
${forcedReasoning || thinkingLevel !== "Fast" && (aiProvider === "Mistral" || thinkingLevel !== "xHigh" && !isGemini) ? `CRITICAL THINKING POLICY
|
|
8219
|
-
- Use <think> ... </think> before responding, even with simple queries/greetings
|
|
8234
|
+
- Use <think> ... </think> for reasoning before responding, even with simple queries/greetings
|
|
8220
8235
|
` : ""}` : `${thinkingConfig}
|
|
8221
8236
|
`}
|
|
8222
8237
|
${TOOL_PROTOCOL(mode, osDetected, aiProvider.toLowerCase() === "deepseek" ? false : isMultiModal, aiProvider, systemSettings?.advanceRollback, systemSettings?.subAgents !== false)}
|
|
8223
8238
|
${projectContextBlock}${isMemoryEnabled ? `
|
|
8224
8239
|
-- MEMORY RULES --
|
|
8225
|
-
- Subtly Personalize with RELEVENT
|
|
8240
|
+
- Subtly Personalize with RELEVENT CONTEXTUAL MEMORIES. Auto Saves` : ""}
|
|
8226
8241
|
- RELATIVE TIME REFERENCE eg. few mins ago
|
|
8227
8242
|
|
|
8228
8243
|
-- SECURITY RULES --
|
|
8229
8244
|
- Sensitive files? Ask before Read${isSystemDir ? "\n- PROTECTED DIRECTORY" : ""}
|
|
8230
8245
|
|
|
8231
8246
|
-- CHAT FORMATTING --
|
|
8232
|
-
- GFM Markdown
|
|
8247
|
+
- GFM Markdown ONLY
|
|
8233
8248
|
- Same Language as User Query
|
|
8234
|
-
- Before tool calls, emit one brief
|
|
8249
|
+
- Before tool calls, emit one brief current update. After tool calls, emit no further text this turn
|
|
8235
8250
|
- On completion: summarize changes (why) + edited files${mode === "Flux" ? "" : "\n- Use Kaomojis HEAVILY"}
|
|
8236
8251
|
=== END SYSTEM PROMPT ===
|
|
8237
8252
|
|
|
@@ -8552,8 +8567,11 @@ var init_history = __esm({
|
|
|
8552
8567
|
} catch (e) {
|
|
8553
8568
|
}
|
|
8554
8569
|
const extractPrompt = (msg) => {
|
|
8555
|
-
if (!msg
|
|
8556
|
-
const
|
|
8570
|
+
if (!msg) return void 0;
|
|
8571
|
+
const rawText = typeof msg === "string" ? msg : msg.text || msg.content || "";
|
|
8572
|
+
if (!rawText || typeof rawText !== "string") return void 0;
|
|
8573
|
+
let text = rawText.replace(/\s*\n+\s*\[Prompted on:.*?\]/g, "").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi, "").trim();
|
|
8574
|
+
if (!text) return void 0;
|
|
8557
8575
|
const words = text.split(/\s+/);
|
|
8558
8576
|
let prompt2 = void 0;
|
|
8559
8577
|
if (words.length > 7) {
|
|
@@ -8569,16 +8587,18 @@ var init_history = __esm({
|
|
|
8569
8587
|
const userMessages = persistentMessages.filter((m) => m.role === "user");
|
|
8570
8588
|
const firstUserMsg = userMessages[0];
|
|
8571
8589
|
const latestUserMsg = userMessages[userMessages.length - 1];
|
|
8590
|
+
const extractedLatest = extractPrompt(latestUserMsg);
|
|
8591
|
+
const extractedFirst = extractPrompt(firstUserMsg);
|
|
8572
8592
|
if (existingChat && existingChat.prompt) {
|
|
8573
|
-
if (Math.random() < 0.
|
|
8574
|
-
prompt =
|
|
8593
|
+
if (Math.random() < 0.5 && extractedLatest) {
|
|
8594
|
+
prompt = extractedLatest;
|
|
8575
8595
|
} else {
|
|
8576
8596
|
prompt = existingChat.prompt;
|
|
8577
8597
|
}
|
|
8578
8598
|
} else {
|
|
8579
|
-
prompt =
|
|
8599
|
+
prompt = extractedFirst || extractedLatest;
|
|
8580
8600
|
}
|
|
8581
|
-
const finalName = name || (existingChat ? existingChat.name :
|
|
8601
|
+
const finalName = name || (existingChat ? existingChat.name : `Session ${id.slice(-6)}`);
|
|
8582
8602
|
const chatFile = path8.join(HISTORY_DIR, `${id}.json`);
|
|
8583
8603
|
writeEncryptedJson(chatFile, persistentMessages);
|
|
8584
8604
|
history[id] = {
|
|
@@ -9928,8 +9948,17 @@ var init_web_scrape = __esm({
|
|
|
9928
9948
|
init_paths();
|
|
9929
9949
|
init_puppeteer_helper();
|
|
9930
9950
|
web_scrape = async (args) => {
|
|
9931
|
-
|
|
9932
|
-
|
|
9951
|
+
let rawUrl = args;
|
|
9952
|
+
if (typeof args === "object" && args !== null) {
|
|
9953
|
+
rawUrl = args.url || args.targetUrl || args.href || "";
|
|
9954
|
+
} else if (typeof args === "string") {
|
|
9955
|
+
const urlMatch = args.match(/url\s*=\s*["'](.*)["']/);
|
|
9956
|
+
rawUrl = urlMatch ? urlMatch[1] : args;
|
|
9957
|
+
}
|
|
9958
|
+
const url = typeof rawUrl === "string" ? rawUrl.trim() : "";
|
|
9959
|
+
if (!url) {
|
|
9960
|
+
return "ERROR: No target URL provided.";
|
|
9961
|
+
}
|
|
9933
9962
|
const maxRetries = 3;
|
|
9934
9963
|
let lastError = null;
|
|
9935
9964
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
@@ -10334,12 +10363,171 @@ ${diffText}`;
|
|
|
10334
10363
|
// src/tools/read_folder.js
|
|
10335
10364
|
import fs17 from "fs";
|
|
10336
10365
|
import path16 from "path";
|
|
10337
|
-
var read_folder;
|
|
10366
|
+
var EXCLUDED_DIRS, isExcludedDir, read_folder;
|
|
10338
10367
|
var init_read_folder = __esm({
|
|
10339
10368
|
"src/tools/read_folder.js"() {
|
|
10340
10369
|
init_arg_parser();
|
|
10370
|
+
EXCLUDED_DIRS = /* @__PURE__ */ new Set([
|
|
10371
|
+
// Version control, package managers & build clutter
|
|
10372
|
+
".git",
|
|
10373
|
+
"node_modules",
|
|
10374
|
+
".gemini",
|
|
10375
|
+
"dist",
|
|
10376
|
+
"build",
|
|
10377
|
+
".next",
|
|
10378
|
+
"out",
|
|
10379
|
+
".cache",
|
|
10380
|
+
"bin",
|
|
10381
|
+
"obj",
|
|
10382
|
+
"vendor",
|
|
10383
|
+
"venv",
|
|
10384
|
+
".idea",
|
|
10385
|
+
".gradle",
|
|
10386
|
+
".terraform",
|
|
10387
|
+
"target",
|
|
10388
|
+
"coverage",
|
|
10389
|
+
".vscode",
|
|
10390
|
+
".svn",
|
|
10391
|
+
".hg",
|
|
10392
|
+
".fslckout",
|
|
10393
|
+
".github",
|
|
10394
|
+
".gitlab",
|
|
10395
|
+
".circleci",
|
|
10396
|
+
".gitea",
|
|
10397
|
+
".gitee",
|
|
10398
|
+
".lerna",
|
|
10399
|
+
".changeset",
|
|
10400
|
+
".nx",
|
|
10401
|
+
".npm",
|
|
10402
|
+
".yarn",
|
|
10403
|
+
".pnpm-store",
|
|
10404
|
+
".expo",
|
|
10405
|
+
".nuxt",
|
|
10406
|
+
".svelte-kit",
|
|
10407
|
+
".docusaurus",
|
|
10408
|
+
".turbo",
|
|
10409
|
+
".vercel",
|
|
10410
|
+
"bower_components",
|
|
10411
|
+
".netlify",
|
|
10412
|
+
".vuepress",
|
|
10413
|
+
".quasar",
|
|
10414
|
+
".output",
|
|
10415
|
+
".angular",
|
|
10416
|
+
"jspm_packages",
|
|
10417
|
+
".parcel-cache",
|
|
10418
|
+
".rollup.cache",
|
|
10419
|
+
".rspack",
|
|
10420
|
+
".vitepress",
|
|
10421
|
+
"__pycache__",
|
|
10422
|
+
".pytest_cache",
|
|
10423
|
+
".mypy_cache",
|
|
10424
|
+
".tox",
|
|
10425
|
+
".poetry",
|
|
10426
|
+
"env",
|
|
10427
|
+
"vhdl",
|
|
10428
|
+
".ipynb_checkpoints",
|
|
10429
|
+
".jupyter",
|
|
10430
|
+
".conda",
|
|
10431
|
+
".pdm-build",
|
|
10432
|
+
".bundle",
|
|
10433
|
+
".yardoc",
|
|
10434
|
+
".metadata",
|
|
10435
|
+
"App_Data",
|
|
10436
|
+
"ClientBin",
|
|
10437
|
+
".cargo",
|
|
10438
|
+
".rustc_info",
|
|
10439
|
+
".go",
|
|
10440
|
+
"Godeps",
|
|
10441
|
+
"_vendor",
|
|
10442
|
+
".rake_tasks",
|
|
10443
|
+
"CMakefiles",
|
|
10444
|
+
".wakatime",
|
|
10445
|
+
".dart_tool",
|
|
10446
|
+
".fvm",
|
|
10447
|
+
".cocoapods",
|
|
10448
|
+
"Pods",
|
|
10449
|
+
".pub-cache",
|
|
10450
|
+
".symlinks",
|
|
10451
|
+
"DerivedData",
|
|
10452
|
+
".xcworkspace",
|
|
10453
|
+
".serverless",
|
|
10454
|
+
".aws",
|
|
10455
|
+
".gcloud",
|
|
10456
|
+
".azure",
|
|
10457
|
+
".kube",
|
|
10458
|
+
".vagrant",
|
|
10459
|
+
".docker",
|
|
10460
|
+
"postgres-data",
|
|
10461
|
+
"redis-data",
|
|
10462
|
+
"mongo-data",
|
|
10463
|
+
".Spotlight-V100",
|
|
10464
|
+
".Trashes",
|
|
10465
|
+
"$RECYCLE.BIN",
|
|
10466
|
+
"System Volume Information",
|
|
10467
|
+
".DocumentRevisions-V100",
|
|
10468
|
+
".fseventsd",
|
|
10469
|
+
"AppData",
|
|
10470
|
+
"Application Data",
|
|
10471
|
+
"Local",
|
|
10472
|
+
"LocalLow",
|
|
10473
|
+
"Roaming",
|
|
10474
|
+
"$WinREAgent",
|
|
10475
|
+
"$WINDOWS.~BT",
|
|
10476
|
+
"$WINDOWS.~WS",
|
|
10477
|
+
"scw",
|
|
10478
|
+
"System32",
|
|
10479
|
+
"SysWOW64",
|
|
10480
|
+
".AppleDouble",
|
|
10481
|
+
".AppleDB",
|
|
10482
|
+
".AppleDesktop",
|
|
10483
|
+
"_CodeSignature",
|
|
10484
|
+
".cmio",
|
|
10485
|
+
".LSOverride",
|
|
10486
|
+
".localized",
|
|
10487
|
+
".TemporaryItems",
|
|
10488
|
+
".Trash",
|
|
10489
|
+
".Trash-0",
|
|
10490
|
+
".Trash-1000",
|
|
10491
|
+
".gvfs",
|
|
10492
|
+
".local",
|
|
10493
|
+
".config",
|
|
10494
|
+
".dbus",
|
|
10495
|
+
".fontconfig",
|
|
10496
|
+
".snap",
|
|
10497
|
+
".var",
|
|
10498
|
+
".lost+found",
|
|
10499
|
+
"lost+found",
|
|
10500
|
+
".thumb",
|
|
10501
|
+
".thumbnails",
|
|
10502
|
+
"EFI",
|
|
10503
|
+
"boot",
|
|
10504
|
+
"grub",
|
|
10505
|
+
"logs",
|
|
10506
|
+
"log",
|
|
10507
|
+
".nyc_output",
|
|
10508
|
+
".sonar",
|
|
10509
|
+
".ruff_cache",
|
|
10510
|
+
".VSCodeCounter"
|
|
10511
|
+
]);
|
|
10512
|
+
isExcludedDir = (dirName) => EXCLUDED_DIRS.has(dirName) || dirName.startsWith(".pnpm");
|
|
10341
10513
|
read_folder = async (args) => {
|
|
10342
|
-
const
|
|
10514
|
+
const parsed = parseArgs(args);
|
|
10515
|
+
const targetPath = parsed.path || null;
|
|
10516
|
+
if (!targetPath) {
|
|
10517
|
+
return "ERROR: No directory path provided.";
|
|
10518
|
+
}
|
|
10519
|
+
let recurseDepth = 0;
|
|
10520
|
+
if (parsed.recurse !== void 0 && parsed.recurse !== null) {
|
|
10521
|
+
if (typeof parsed.recurse === "number") {
|
|
10522
|
+
recurseDepth = parsed.recurse;
|
|
10523
|
+
} else if (typeof parsed.recurse === "boolean") {
|
|
10524
|
+
recurseDepth = parsed.recurse ? 1 : 0;
|
|
10525
|
+
} else {
|
|
10526
|
+
const val = parseInt(String(parsed.recurse).trim(), 10);
|
|
10527
|
+
recurseDepth = isNaN(val) ? 0 : val;
|
|
10528
|
+
}
|
|
10529
|
+
}
|
|
10530
|
+
recurseDepth = Math.max(0, Math.min(5, recurseDepth));
|
|
10343
10531
|
const absolutePath = path16.resolve(process.cwd(), targetPath);
|
|
10344
10532
|
try {
|
|
10345
10533
|
if (!fs17.existsSync(absolutePath)) {
|
|
@@ -10347,52 +10535,139 @@ var init_read_folder = __esm({
|
|
|
10347
10535
|
}
|
|
10348
10536
|
const stats = fs17.statSync(absolutePath);
|
|
10349
10537
|
if (!stats.isDirectory()) {
|
|
10350
|
-
return `ERROR: Path [${targetPath}] is a file, not a directory. Use
|
|
10351
|
-
}
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
const
|
|
10359
|
-
|
|
10360
|
-
|
|
10538
|
+
return `ERROR: Path [${targetPath}] is a file, not a directory. Use ReadFile instead.`;
|
|
10539
|
+
}
|
|
10540
|
+
if (recurseDepth === 0) {
|
|
10541
|
+
const files = fs17.readdirSync(absolutePath);
|
|
10542
|
+
const totalItems = files.length;
|
|
10543
|
+
const maxDisplay = 150;
|
|
10544
|
+
const displayItems = files.slice(0, maxDisplay);
|
|
10545
|
+
const folderData = [];
|
|
10546
|
+
for (const file of displayItems) {
|
|
10547
|
+
const fPath = path16.join(absolutePath, file);
|
|
10548
|
+
let info = { name: file, type: "unknown", size: "N/A", mtime: "N/A" };
|
|
10549
|
+
try {
|
|
10550
|
+
const fStats = fs17.statSync(fPath);
|
|
10551
|
+
info = {
|
|
10552
|
+
name: file,
|
|
10553
|
+
type: fStats.isDirectory() ? "directory" : "file",
|
|
10554
|
+
size: (fStats.size / 1024).toFixed(1) + " KB",
|
|
10555
|
+
mtime: fStats.mtime.toLocaleString()
|
|
10556
|
+
};
|
|
10557
|
+
} catch (e) {
|
|
10558
|
+
info.type = "inaccessible";
|
|
10559
|
+
}
|
|
10560
|
+
folderData.push(info);
|
|
10561
|
+
}
|
|
10562
|
+
const formatted = folderData.map((f) => {
|
|
10563
|
+
const indicator = f.type === "directory" ? "\u{1F4C1}" : f.type === "file" ? "\u{1F4C4}" : "\u2753";
|
|
10564
|
+
if (f.type === "directory") {
|
|
10565
|
+
return `${indicator} ${f.name} - [DIR] - [Modified: ${f.mtime}]`;
|
|
10566
|
+
}
|
|
10567
|
+
return `${indicator} ${f.name} - [Size: ${f.size}] - [Modified: ${f.mtime}]`;
|
|
10568
|
+
}).join("\n");
|
|
10569
|
+
let footer2 = `
|
|
10570
|
+
|
|
10571
|
+
(Total items in folder: ${totalItems})`;
|
|
10572
|
+
if (totalItems > maxDisplay) {
|
|
10573
|
+
footer2 = `
|
|
10574
|
+
|
|
10575
|
+
\u26A0\uFE0F TRUNCATED: Showing first ${maxDisplay} of ${totalItems} items.`;
|
|
10576
|
+
}
|
|
10577
|
+
files.length = 0;
|
|
10578
|
+
displayItems.length = 0;
|
|
10579
|
+
folderData.length = 0;
|
|
10580
|
+
return `Detailed folder stats for [${targetPath}]:
|
|
10581
|
+
|
|
10582
|
+
${formatted}${footer2}`;
|
|
10583
|
+
}
|
|
10584
|
+
let totalDirectories = 0;
|
|
10585
|
+
let totalFiles = 0;
|
|
10586
|
+
let totalItemsScanned = 0;
|
|
10587
|
+
const maxTotalItems = 500;
|
|
10588
|
+
let truncated = false;
|
|
10589
|
+
const buildTree = (dirPath, currentDepth, prefix = "") => {
|
|
10590
|
+
if (currentDepth > recurseDepth + 1 || truncated) return [];
|
|
10591
|
+
let entries = [];
|
|
10361
10592
|
try {
|
|
10362
|
-
|
|
10363
|
-
info = {
|
|
10364
|
-
name: file,
|
|
10365
|
-
type: fStats.isDirectory() ? "directory" : "file",
|
|
10366
|
-
size: (fStats.size / 1024).toFixed(1) + " KB",
|
|
10367
|
-
mtime: fStats.mtime.toLocaleString()
|
|
10368
|
-
};
|
|
10593
|
+
entries = fs17.readdirSync(dirPath);
|
|
10369
10594
|
} catch (e) {
|
|
10370
|
-
|
|
10595
|
+
return [`${prefix}\u26A0\uFE0F [Inaccessible Directory]`];
|
|
10371
10596
|
}
|
|
10372
|
-
|
|
10373
|
-
|
|
10374
|
-
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10597
|
+
const sortedEntries = [];
|
|
10598
|
+
for (const name of entries) {
|
|
10599
|
+
const fullPath = path16.join(dirPath, name);
|
|
10600
|
+
let isDir = false;
|
|
10601
|
+
try {
|
|
10602
|
+
isDir = fs17.statSync(fullPath).isDirectory();
|
|
10603
|
+
} catch (e) {
|
|
10604
|
+
}
|
|
10605
|
+
sortedEntries.push({ name, fullPath, isDir });
|
|
10378
10606
|
}
|
|
10379
|
-
|
|
10380
|
-
|
|
10607
|
+
sortedEntries.sort((a, b) => {
|
|
10608
|
+
if (a.isDir && !b.isDir) return -1;
|
|
10609
|
+
if (!a.isDir && b.isDir) return 1;
|
|
10610
|
+
return a.name.localeCompare(b.name);
|
|
10611
|
+
});
|
|
10612
|
+
const lines = [];
|
|
10613
|
+
const count = sortedEntries.length;
|
|
10614
|
+
for (let i = 0; i < count; i++) {
|
|
10615
|
+
if (totalItemsScanned >= maxTotalItems) {
|
|
10616
|
+
truncated = true;
|
|
10617
|
+
lines.push(`${prefix}\u26A0\uFE0F [Truncated - Maximum item limit reached (${maxTotalItems})]`);
|
|
10618
|
+
break;
|
|
10619
|
+
}
|
|
10620
|
+
const item = sortedEntries[i];
|
|
10621
|
+
const isLast = i === count - 1;
|
|
10622
|
+
const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
|
|
10623
|
+
const childPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
10624
|
+
totalItemsScanned++;
|
|
10625
|
+
let itemType = "unknown";
|
|
10626
|
+
let sizeStr = "N/A";
|
|
10627
|
+
let mtimeStr = "N/A";
|
|
10628
|
+
try {
|
|
10629
|
+
const fStats = fs17.statSync(item.fullPath);
|
|
10630
|
+
if (fStats.isDirectory()) {
|
|
10631
|
+
itemType = "directory";
|
|
10632
|
+
mtimeStr = fStats.mtime.toLocaleString();
|
|
10633
|
+
totalDirectories++;
|
|
10634
|
+
} else {
|
|
10635
|
+
itemType = "file";
|
|
10636
|
+
sizeStr = (fStats.size / 1024).toFixed(1) + " KB";
|
|
10637
|
+
mtimeStr = fStats.mtime.toLocaleString();
|
|
10638
|
+
totalFiles++;
|
|
10639
|
+
}
|
|
10640
|
+
} catch (e) {
|
|
10641
|
+
itemType = "inaccessible";
|
|
10642
|
+
}
|
|
10643
|
+
const indicator = itemType === "directory" ? "\u{1F4C1}" : itemType === "file" ? "\u{1F4C4}" : "\u2753";
|
|
10644
|
+
let lineText = "";
|
|
10645
|
+
if (itemType === "directory") {
|
|
10646
|
+
lineText = `${prefix}${connector}${indicator} ${item.name} - [DIR] - [Modified: ${mtimeStr}]`;
|
|
10647
|
+
} else {
|
|
10648
|
+
lineText = `${prefix}${connector}${indicator} ${item.name} - [Size: ${sizeStr}] - [Modified: ${mtimeStr}]`;
|
|
10649
|
+
}
|
|
10650
|
+
lines.push(lineText);
|
|
10651
|
+
if (itemType === "directory" && currentDepth <= recurseDepth && !isExcludedDir(item.name)) {
|
|
10652
|
+
const childLines = buildTree(item.fullPath, currentDepth + 1, childPrefix);
|
|
10653
|
+
lines.push(...childLines);
|
|
10654
|
+
}
|
|
10655
|
+
}
|
|
10656
|
+
return lines;
|
|
10657
|
+
};
|
|
10658
|
+
const treeLines = buildTree(absolutePath, 1, "");
|
|
10659
|
+
const formattedTree = treeLines.join("\n");
|
|
10381
10660
|
let footer = `
|
|
10382
10661
|
|
|
10383
|
-
(Total items
|
|
10384
|
-
if (
|
|
10662
|
+
(Total items scanned: ${totalItemsScanned}, Directories: ${totalDirectories}, Files: ${totalFiles})`;
|
|
10663
|
+
if (truncated) {
|
|
10385
10664
|
footer = `
|
|
10386
10665
|
|
|
10387
|
-
\u26A0\uFE0F TRUNCATED:
|
|
10666
|
+
\u26A0\uFE0F TRUNCATED: Scan capped at ${maxTotalItems} items. (Directories: ${totalDirectories}, Files: ${totalFiles})`;
|
|
10388
10667
|
}
|
|
10389
|
-
|
|
10668
|
+
return `Detailed directory tree for [${targetPath}] (recurse depth: ${recurseDepth}):
|
|
10390
10669
|
|
|
10391
|
-
${
|
|
10392
|
-
files.length = 0;
|
|
10393
|
-
displayItems.length = 0;
|
|
10394
|
-
folderData.length = 0;
|
|
10395
|
-
return result;
|
|
10670
|
+
${formattedTree}${footer}`;
|
|
10396
10671
|
} catch (err) {
|
|
10397
10672
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
10398
10673
|
return `ERROR: Failed to read folder [${targetPath}]: ${errorMsg}`;
|
|
@@ -10677,7 +10952,14 @@ async function getFilesRecursively(dir, excludes, baseDir = dir, depth = 1) {
|
|
|
10677
10952
|
const fullPath = path19.join(dir, file.name);
|
|
10678
10953
|
const relativePath = path19.relative(baseDir, fullPath);
|
|
10679
10954
|
const pathSegments = relativePath.split(path19.sep).map((s) => s.toLowerCase());
|
|
10680
|
-
const
|
|
10955
|
+
const fileNameLower = file.name.toLowerCase();
|
|
10956
|
+
const isExcluded = excludes.some((ex) => {
|
|
10957
|
+
const exLower = ex.toLowerCase();
|
|
10958
|
+
if (exLower.startsWith(".") && fileNameLower.endsWith(exLower)) {
|
|
10959
|
+
return true;
|
|
10960
|
+
}
|
|
10961
|
+
return pathSegments.some((seg) => seg === exLower || seg.startsWith(".pnpm"));
|
|
10962
|
+
});
|
|
10681
10963
|
if (isExcluded) continue;
|
|
10682
10964
|
if (file.isDirectory()) {
|
|
10683
10965
|
const nestedFiles = await getFilesRecursively(fullPath, excludes, baseDir, depth + 1);
|
|
@@ -10729,46 +11011,195 @@ var init_search_keyword = __esm({
|
|
|
10729
11011
|
const keyword = String(rawKeyword);
|
|
10730
11012
|
const toBool = (v) => v === true || v === "true" || v === 1 || v === "1" || v === "yes";
|
|
10731
11013
|
const regexExplicitlyFalse = regex === false || regex === "false" || regex === 0 || regex === "0" || regex === "no";
|
|
10732
|
-
|
|
10733
|
-
let matchSubstring =
|
|
10734
|
-
|
|
10735
|
-
|
|
10736
|
-
return /[*+?{}()|]/.test(stripped) || /\[.*?\]/.test(stripped) || /^\^/.test(stripped) || /\$/.test(stripped);
|
|
10737
|
-
})();
|
|
10738
|
-
let isAutoRegex = true;
|
|
10739
|
-
if (!matchRegex && !regexExplicitlyFalse && hasRegexIndicators) {
|
|
10740
|
-
matchRegex = true;
|
|
10741
|
-
isAutoRegex = true;
|
|
10742
|
-
}
|
|
11014
|
+
const regexExplicitlyTrue = regex === true || regex === "true" || regex === 1 || regex === "1" || regex === "yes";
|
|
11015
|
+
let matchSubstring = regexExplicitlyFalse && toBool(subString);
|
|
11016
|
+
let regexPattern = null;
|
|
11017
|
+
let wordRegex = null;
|
|
10743
11018
|
if (regexExplicitlyFalse) {
|
|
10744
|
-
|
|
10745
|
-
|
|
10746
|
-
|
|
10747
|
-
|
|
10748
|
-
let wordRegex;
|
|
10749
|
-
if (matchRegex) {
|
|
11019
|
+
if (!matchSubstring) {
|
|
11020
|
+
wordRegex = new RegExp(`(?<![\\w])${keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\w])`, "i");
|
|
11021
|
+
}
|
|
11022
|
+
} else {
|
|
10750
11023
|
try {
|
|
10751
11024
|
regexPattern = new RegExp(keyword, "i");
|
|
10752
11025
|
} catch (e) {
|
|
10753
|
-
|
|
11026
|
+
if (regexExplicitlyTrue) {
|
|
11027
|
+
return `ERROR: Invalid regex pattern "${keyword}": ${e.message}`;
|
|
11028
|
+
}
|
|
10754
11029
|
}
|
|
10755
|
-
} else {
|
|
10756
11030
|
wordRegex = new RegExp(`(?<![\\w])${keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\w])`, "i");
|
|
10757
11031
|
}
|
|
10758
11032
|
const excludes = [
|
|
10759
|
-
|
|
11033
|
+
// Clutter, VCS, Cache & Build Directories
|
|
10760
11034
|
".git",
|
|
11035
|
+
"node_modules",
|
|
11036
|
+
".gemini",
|
|
10761
11037
|
"dist",
|
|
11038
|
+
"build",
|
|
10762
11039
|
".next",
|
|
10763
|
-
"
|
|
11040
|
+
"out",
|
|
11041
|
+
".cache",
|
|
11042
|
+
"bin",
|
|
11043
|
+
"obj",
|
|
11044
|
+
"vendor",
|
|
11045
|
+
"venv",
|
|
11046
|
+
".idea",
|
|
11047
|
+
".gradle",
|
|
11048
|
+
".terraform",
|
|
11049
|
+
"target",
|
|
11050
|
+
"coverage",
|
|
11051
|
+
".vscode",
|
|
11052
|
+
".svn",
|
|
11053
|
+
".hg",
|
|
11054
|
+
".fslckout",
|
|
11055
|
+
".github",
|
|
11056
|
+
".gitlab",
|
|
11057
|
+
".circleci",
|
|
11058
|
+
".gitea",
|
|
11059
|
+
".gitee",
|
|
11060
|
+
".lerna",
|
|
11061
|
+
".changeset",
|
|
11062
|
+
".nx",
|
|
11063
|
+
".npm",
|
|
11064
|
+
".yarn",
|
|
11065
|
+
".pnpm-store",
|
|
11066
|
+
".pnpm",
|
|
11067
|
+
".expo",
|
|
11068
|
+
".nuxt",
|
|
11069
|
+
".svelte-kit",
|
|
11070
|
+
".docusaurus",
|
|
11071
|
+
".turbo",
|
|
11072
|
+
".vercel",
|
|
11073
|
+
"bower_components",
|
|
11074
|
+
".netlify",
|
|
11075
|
+
".vuepress",
|
|
11076
|
+
".quasar",
|
|
11077
|
+
".output",
|
|
11078
|
+
".angular",
|
|
11079
|
+
"jspm_packages",
|
|
11080
|
+
".parcel-cache",
|
|
11081
|
+
".rollup.cache",
|
|
11082
|
+
".rspack",
|
|
11083
|
+
".vitepress",
|
|
11084
|
+
"__pycache__",
|
|
11085
|
+
".pytest_cache",
|
|
11086
|
+
".mypy_cache",
|
|
11087
|
+
".tox",
|
|
11088
|
+
".poetry",
|
|
11089
|
+
"env",
|
|
11090
|
+
"vhdl",
|
|
11091
|
+
".ipynb_checkpoints",
|
|
11092
|
+
".jupyter",
|
|
11093
|
+
".conda",
|
|
11094
|
+
".pdm-build",
|
|
11095
|
+
".bundle",
|
|
11096
|
+
".yardoc",
|
|
11097
|
+
".metadata",
|
|
11098
|
+
"App_Data",
|
|
11099
|
+
"ClientBin",
|
|
11100
|
+
".cargo",
|
|
11101
|
+
".rustc_info",
|
|
11102
|
+
".go",
|
|
11103
|
+
"Godeps",
|
|
11104
|
+
"_vendor",
|
|
11105
|
+
".rake_tasks",
|
|
11106
|
+
"CMakefiles",
|
|
11107
|
+
".wakatime",
|
|
11108
|
+
".dart_tool",
|
|
11109
|
+
".fvm",
|
|
11110
|
+
".cocoapods",
|
|
11111
|
+
"Pods",
|
|
11112
|
+
".pub-cache",
|
|
11113
|
+
".symlinks",
|
|
11114
|
+
"DerivedData",
|
|
11115
|
+
".xcworkspace",
|
|
11116
|
+
".serverless",
|
|
11117
|
+
".aws",
|
|
11118
|
+
".gcloud",
|
|
11119
|
+
".azure",
|
|
11120
|
+
".kube",
|
|
11121
|
+
".vagrant",
|
|
11122
|
+
".docker",
|
|
11123
|
+
"postgres-data",
|
|
11124
|
+
"redis-data",
|
|
11125
|
+
"mongo-data",
|
|
11126
|
+
".Spotlight-V100",
|
|
11127
|
+
".Trashes",
|
|
11128
|
+
"$RECYCLE.BIN",
|
|
11129
|
+
"System Volume Information",
|
|
11130
|
+
".DocumentRevisions-V100",
|
|
11131
|
+
".fseventsd",
|
|
11132
|
+
"AppData",
|
|
11133
|
+
"Application Data",
|
|
11134
|
+
"Local",
|
|
11135
|
+
"LocalLow",
|
|
11136
|
+
"Roaming",
|
|
11137
|
+
"$WinREAgent",
|
|
11138
|
+
"$WINDOWS.~BT",
|
|
11139
|
+
"$WINDOWS.~WS",
|
|
11140
|
+
"scw",
|
|
11141
|
+
"System32",
|
|
11142
|
+
"SysWOW64",
|
|
11143
|
+
".AppleDouble",
|
|
11144
|
+
".AppleDB",
|
|
11145
|
+
".AppleDesktop",
|
|
11146
|
+
"_CodeSignature",
|
|
11147
|
+
".cmio",
|
|
11148
|
+
".LSOverride",
|
|
11149
|
+
".localized",
|
|
11150
|
+
".TemporaryItems",
|
|
11151
|
+
".Trash",
|
|
11152
|
+
".Trash-0",
|
|
11153
|
+
".Trash-1000",
|
|
11154
|
+
".gvfs",
|
|
11155
|
+
".local",
|
|
11156
|
+
".config",
|
|
11157
|
+
".dbus",
|
|
11158
|
+
".fontconfig",
|
|
11159
|
+
".snap",
|
|
11160
|
+
".var",
|
|
11161
|
+
".lost+found",
|
|
11162
|
+
"lost+found",
|
|
11163
|
+
".thumb",
|
|
11164
|
+
".thumbnails",
|
|
11165
|
+
"EFI",
|
|
11166
|
+
"boot",
|
|
11167
|
+
"grub",
|
|
11168
|
+
"logs",
|
|
11169
|
+
"log",
|
|
11170
|
+
".nyc_output",
|
|
11171
|
+
".sonar",
|
|
11172
|
+
".ruff_cache",
|
|
11173
|
+
".VSCodeCounter",
|
|
11174
|
+
// Binaries, Media, Compressed & Font Files
|
|
10764
11175
|
".exe",
|
|
10765
11176
|
".dll",
|
|
11177
|
+
".so",
|
|
11178
|
+
".dylib",
|
|
10766
11179
|
".png",
|
|
10767
11180
|
".jpg",
|
|
10768
11181
|
".jpeg",
|
|
10769
11182
|
".gif",
|
|
11183
|
+
".ico",
|
|
11184
|
+
".svg",
|
|
11185
|
+
".webp",
|
|
11186
|
+
".mp3",
|
|
11187
|
+
".mp4",
|
|
11188
|
+
".avi",
|
|
10770
11189
|
".zip",
|
|
10771
|
-
".tgz"
|
|
11190
|
+
".tgz",
|
|
11191
|
+
".tar",
|
|
11192
|
+
".gz",
|
|
11193
|
+
".7z",
|
|
11194
|
+
".rar",
|
|
11195
|
+
".pdf",
|
|
11196
|
+
".docx",
|
|
11197
|
+
".xlsx",
|
|
11198
|
+
".pptx",
|
|
11199
|
+
".woff",
|
|
11200
|
+
".woff2",
|
|
11201
|
+
".ttf",
|
|
11202
|
+
".eot"
|
|
10772
11203
|
];
|
|
10773
11204
|
const maxMatches = 150;
|
|
10774
11205
|
try {
|
|
@@ -10802,7 +11233,7 @@ var init_search_keyword = __esm({
|
|
|
10802
11233
|
const lines = content.split(/\r?\n/);
|
|
10803
11234
|
const fileMatches = [];
|
|
10804
11235
|
for (let i = 0; i < lines.length; i++) {
|
|
10805
|
-
const matched =
|
|
11236
|
+
const matched = regexExplicitlyFalse ? matchSubstring ? lines[i].toLowerCase().includes(keyword.toLowerCase()) || fuzzyMatch(lines[i], keyword) : wordRegex && wordRegex.test(lines[i]) : regexPattern && regexPattern.test(lines[i]) || wordRegex && wordRegex.test(lines[i]);
|
|
10806
11237
|
if (matched) {
|
|
10807
11238
|
fileMatches.push({ line: i + 1, content: lines[i].trim() });
|
|
10808
11239
|
}
|
|
@@ -10828,7 +11259,7 @@ var init_search_keyword = __esm({
|
|
|
10828
11259
|
if (typeof global.gc === "function") {
|
|
10829
11260
|
global.gc();
|
|
10830
11261
|
}
|
|
10831
|
-
const modeLabel =
|
|
11262
|
+
const modeLabel = regexExplicitlyFalse ? matchSubstring ? "(subString mode)" : "(keyword mode)" : regexExplicitlyTrue ? "(regex mode)" : "(standard mode)";
|
|
10832
11263
|
if (fileGroups.length === 0) {
|
|
10833
11264
|
const zeroLocation = pathArgType === "file" ? ` in '${pathArg}'` : pathArgType === "dir" ? ` in '${pathArg}'` : ". Try to specify files";
|
|
10834
11265
|
const dirPrefix2 = pathArgType === "dir" ? "[DIR]" : "";
|
|
@@ -14612,6 +15043,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
14612
15043
|
".npm",
|
|
14613
15044
|
".yarn",
|
|
14614
15045
|
".pnpm-store",
|
|
15046
|
+
".pnpm",
|
|
14615
15047
|
".expo",
|
|
14616
15048
|
".nuxt",
|
|
14617
15049
|
".svelte-kit",
|
|
@@ -14742,7 +15174,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
14742
15174
|
const entries = safeReaddirWithTypes(dir);
|
|
14743
15175
|
for (const entry of entries) {
|
|
14744
15176
|
if (currentCount.value > 6200) break;
|
|
14745
|
-
if (COLLAPSED_DIRS_GLOBAL.includes(entry.name)) continue;
|
|
15177
|
+
if (COLLAPSED_DIRS_GLOBAL.includes(entry.name) || entry.name.startsWith(".")) continue;
|
|
14746
15178
|
if (entry.isDirectory()) {
|
|
14747
15179
|
currentCount.value++;
|
|
14748
15180
|
countFolders(path25.join(dir, entry.name), currentCount, depth + 1);
|
|
@@ -14759,8 +15191,8 @@ Provide a consolidated summary of the entire session.`;
|
|
|
14759
15191
|
}
|
|
14760
15192
|
let result = "";
|
|
14761
15193
|
const COLLAPSED_DIRS = COLLAPSED_DIRS_GLOBAL;
|
|
14762
|
-
const filtered = entries.filter((e) => !COLLAPSED_DIRS.includes(e.name));
|
|
14763
|
-
const collapsedInDir = entries.filter((e) => COLLAPSED_DIRS.includes(e.name)).map((e) => e.name).sort();
|
|
15194
|
+
const filtered = entries.filter((e) => !COLLAPSED_DIRS.includes(e.name) && !e.name.startsWith("."));
|
|
15195
|
+
const collapsedInDir = entries.filter((e) => COLLAPSED_DIRS.includes(e.name) || e.name.startsWith(".")).map((e) => e.name).sort();
|
|
14764
15196
|
filtered.sort((a, b) => {
|
|
14765
15197
|
if (a.isDirectory() && !b.isDirectory()) return -1;
|
|
14766
15198
|
if (!a.isDirectory() && b.isDirectory()) return 1;
|
|
@@ -15997,10 +16429,10 @@ ${ideErr} [/ERROR]`;
|
|
|
15997
16429
|
let label = "";
|
|
15998
16430
|
if (normToolName === "web_search") {
|
|
15999
16431
|
const { query, limit = 10, aiMode = false } = parseArgs(toolCall.args);
|
|
16000
|
-
label =
|
|
16432
|
+
label = `${query ? "\u2714" : "\u2718"} ${aiMode ? "AI Search" : "Searched"}: ${query ? `${query}` : "No Search Query"}${aiMode === false && query ? ` \u2192 ${limit}` : ""}`;
|
|
16001
16433
|
} else if (normToolName === "web_scrape") {
|
|
16002
|
-
const url = parseArgs(toolCall.args).url ||
|
|
16003
|
-
label =
|
|
16434
|
+
const url = parseArgs(toolCall.args).url || null;
|
|
16435
|
+
label = `${url ? "\u2714" : "\u2718"} Visited: ${url ? url : "No Source"}`;
|
|
16004
16436
|
} else if (normToolName === "view_file") {
|
|
16005
16437
|
const { path: targetPath2, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(toolCall.args);
|
|
16006
16438
|
const rawStart = StartLine || start_line || startLine;
|
|
@@ -16019,33 +16451,35 @@ ${ideErr} [/ERROR]`;
|
|
|
16019
16451
|
}
|
|
16020
16452
|
} catch (e) {
|
|
16021
16453
|
}
|
|
16022
|
-
const pathLower = targetPath2.toLowerCase();
|
|
16454
|
+
const pathLower = (targetPath2 || "").toLowerCase();
|
|
16023
16455
|
const isPdf = pathLower.endsWith(".pdf");
|
|
16024
16456
|
const isOfficeFile = pathLower.endsWith(".docx") || pathLower.endsWith(".doc") || pathLower.endsWith(".ppt") || pathLower.endsWith(".pptx") || pathLower.endsWith(".xls") || pathLower.endsWith(".xlsx");
|
|
16025
16457
|
const isImage = /\.(png|jpg|jpeg|webp|gif|bmp)$/.test(pathLower);
|
|
16026
16458
|
if (isPdf || isOfficeFile) {
|
|
16027
|
-
label =
|
|
16459
|
+
label = `${targetPath2.length > 0 ? "\u2714" : "\u2718"} ${targetPath2 ? `Analyzed: ${path25.basename(targetPath2)}` : "Analyzed: File Not Found"}`;
|
|
16028
16460
|
} else if (isImage) {
|
|
16029
|
-
label =
|
|
16461
|
+
label = `${targetPath2.length > 0 ? "\u2714" : "\u2718"} ${targetPath2 ? `Processed: ${path25.basename(targetPath2)}` : "Processed: File Not Found"}`;
|
|
16030
16462
|
} else {
|
|
16031
|
-
label = `${totalLines !== "..." ? "\u2714" : "\u2718"} Read: ${path25.basename(targetPath2)} \u2192 ${totalLines !== "..." ? `Lines ${sLine} - ${actualEndLine} of ${totalLines}` : "File Not Found"}`;
|
|
16463
|
+
label = `${totalLines !== "..." ? "\u2714" : "\u2718"} Read: ${targetPath2 ? `${path25.basename(targetPath2)} \u2192 ${totalLines !== "..." ? `Lines ${sLine} - ${actualEndLine} of ${totalLines}` : "File Not Found"}` : "File Not Found"}`;
|
|
16032
16464
|
}
|
|
16033
16465
|
} else if (normToolName === "list_files" || normToolName === "read_folder") {
|
|
16034
16466
|
const action = normToolName === "list_files" ? "List" : "Browsed";
|
|
16035
|
-
const path27 = parseArgs(toolCall.args).path;
|
|
16036
|
-
|
|
16467
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
16468
|
+
const recurse = parseArgs(toolCall.args).recurse || 0;
|
|
16469
|
+
label = `${path27 ? "\u2714" : "\u2718"} ${action}: ${path27 ? `${path27 === "." ? "./" : `${path27}${recurse > 0 ? `${path27.endsWith("/") ? `*${recurse}` : `/*${recurse}`}` : `${path27.endsWith("/") ? "" : "/"}`}`}` : "No Folder Selected"}`;
|
|
16037
16470
|
} else if (normToolName === "write_file" || normToolName === "update_file") {
|
|
16038
16471
|
const action = normToolName === "write_file" ? "Created" : "Edited";
|
|
16039
|
-
|
|
16472
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
16473
|
+
label = `${path27 ? "\u2714" : "\u2718"} ${action}: ${path27 || "No File Changes"}`;
|
|
16040
16474
|
} else if (normToolName === "write_pdf") {
|
|
16041
|
-
|
|
16042
|
-
`;
|
|
16475
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
16476
|
+
label = `${path27 ? "\u2714" : "\u2718"} Generated: ${path27 || "No PDF Generated"}`;
|
|
16043
16477
|
} else if (normToolName === "write_docx") {
|
|
16044
|
-
|
|
16045
|
-
`;
|
|
16478
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
16479
|
+
label = `${path27 ? "\u2714" : "\u2718"} Generated: ${path27 || "No Docx Generated"}`;
|
|
16046
16480
|
} else if (normToolName === "file_map") {
|
|
16047
16481
|
const path27 = parseArgs(toolCall.args).path;
|
|
16048
|
-
label = `${path27 ? "\u2714" : "\u2718"} Indexed${path27 ? "
|
|
16482
|
+
label = `${path27 ? "\u2714" : "\u2718"} Indexed: ${path27 ? "" + path27 : "File Not Found"}`;
|
|
16049
16483
|
} else if (normToolName.toLowerCase() === "search_keyword" || normToolName.toLowerCase() === "todo") {
|
|
16050
16484
|
label = "";
|
|
16051
16485
|
} else if (normToolName.toLowerCase() === "generate_image") {
|
|
@@ -16230,7 +16664,7 @@ ${ideErr} [/ERROR]`;
|
|
|
16230
16664
|
});
|
|
16231
16665
|
if (isViolating) {
|
|
16232
16666
|
const denyMsg = `Access Denied. Prohibited from accessing external directories while "External Workspace Access" is disabled.`;
|
|
16233
|
-
if (settings.onExecStart) settings.onExecStart(command || "
|
|
16667
|
+
if (settings.onExecStart) settings.onExecStart(command || "No Command");
|
|
16234
16668
|
yield { type: "exec_start" };
|
|
16235
16669
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
16236
16670
|
if (settings.onExecChunk) settings.onExecChunk(`ERROR: ${denyMsg}`);
|
|
@@ -16242,7 +16676,7 @@ ${ideErr} [/ERROR]`;
|
|
|
16242
16676
|
continue;
|
|
16243
16677
|
}
|
|
16244
16678
|
}
|
|
16245
|
-
if (settings.onExecStart) settings.onExecStart(command || "
|
|
16679
|
+
if (settings.onExecStart) settings.onExecStart(command || "No Command");
|
|
16246
16680
|
yield { type: "exec_start" };
|
|
16247
16681
|
}
|
|
16248
16682
|
const parsedArgs = parseArgs(toolCall.args);
|
|
@@ -16480,15 +16914,14 @@ ${ideErr} [/ERROR]`;
|
|
|
16480
16914
|
if (successes.length === 0) {
|
|
16481
16915
|
const errorMsg = `[TOOL RESULT]: ERROR: Failed to apply patches to [${path25.basename(absPath)}].
|
|
16482
16916
|
${failures.map((f) => ` \u2022 ${f.error}`).join("\n")}`;
|
|
16483
|
-
const errorLabel = `\u2714 Edited: ${path25.basename(absPath)}
|
|
16917
|
+
const errorLabel = `\u2714 Edited: ${path25.basename(absPath)}`;
|
|
16484
16918
|
let terminalWidth = 115;
|
|
16485
16919
|
if (process.stdout.isTTY) {
|
|
16486
16920
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
16487
16921
|
}
|
|
16488
16922
|
const boxWidth = Math.min(errorLabel.length + 4, terminalWidth);
|
|
16489
16923
|
const boxMid = `${errorLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`;
|
|
16490
|
-
yield { type: "visual_feedback", content: colorMainWords(`${thisIsFirstToolFeedback ? "\n" : ""}${boxMid}
|
|
16491
|
-
`) };
|
|
16924
|
+
yield { type: "visual_feedback", content: colorMainWords(`${thisIsFirstToolFeedback ? "\n" : ""}${boxMid}`) };
|
|
16492
16925
|
thisIsFirstToolFeedback = false;
|
|
16493
16926
|
toolResults.push({ role: "user", text: errorMsg });
|
|
16494
16927
|
await incrementUsage("toolFailure");
|
|
@@ -16563,12 +16996,18 @@ ${failures.map((f) => ` \u2022 ${f.error}`).join("\n")}`;
|
|
|
16563
16996
|
if (approval === "allow" && diffOpened && isBridgeConnected()) {
|
|
16564
16997
|
const { path: filePath } = parseArgs(toolCall.args);
|
|
16565
16998
|
const absPath = path25.resolve(process.cwd(), filePath);
|
|
16999
|
+
const normPath = (p) => p ? path25.resolve(p).replace(/\\/g, "/").toLowerCase() : "";
|
|
16566
17000
|
const finalIDE = await getIDEContext();
|
|
16567
17001
|
let finalContent = "";
|
|
16568
|
-
if (finalIDE && finalIDE.file_focused === absPath && finalIDE.full_content) {
|
|
17002
|
+
if (finalIDE && finalIDE.file_focused && normPath(finalIDE.file_focused) === normPath(absPath) && finalIDE.full_content) {
|
|
16569
17003
|
finalContent = finalIDE.full_content;
|
|
16570
|
-
}
|
|
17004
|
+
}
|
|
17005
|
+
if (!finalContent && fs26.existsSync(absPath)) {
|
|
16571
17006
|
finalContent = fs26.readFileSync(absPath, "utf8");
|
|
17007
|
+
if (!finalContent) {
|
|
17008
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
17009
|
+
finalContent = fs26.readFileSync(absPath, "utf8");
|
|
17010
|
+
}
|
|
16572
17011
|
}
|
|
16573
17012
|
const verifiedLines = finalContent.split(/\r?\n/);
|
|
16574
17013
|
const verifiedLineCount = verifiedLines.length;
|
|
@@ -16627,20 +17066,17 @@ ${tail}`;
|
|
|
16627
17066
|
|
|
16628
17067
|
- Stats: [${verifiedLineCount2} lines, ${(verifiedSize2 / 1024).toFixed(1)} KB]
|
|
16629
17068
|
${ancestry2}- Content Preview:
|
|
16630
|
-
${snippet2}
|
|
16631
|
-
|
|
16632
|
-
[SYSTEM] Check the content preview for verification [/SYSTEM]`;
|
|
17069
|
+
${snippet2}`;
|
|
16633
17070
|
}
|
|
16634
17071
|
const action = normToolName === "write_file" ? "Created" : "Edited";
|
|
16635
|
-
const feedbackLabel =
|
|
17072
|
+
const feedbackLabel = `${filePath ? "\u2714" : "\u2718"} ${action}: ${filePath || "No File Changes"}`;
|
|
16636
17073
|
let terminalWidth = 115;
|
|
16637
17074
|
if (process.stdout.isTTY) {
|
|
16638
17075
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
16639
17076
|
}
|
|
16640
17077
|
const boxWidth = Math.min(feedbackLabel.length + 4, terminalWidth);
|
|
16641
17078
|
const boxMid = `${feedbackLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)}`;
|
|
16642
|
-
yield { type: "visual_feedback", content: colorMainWords(`${thisIsFirstToolFeedback ? "\n" : ""}${boxMid}
|
|
16643
|
-
`) };
|
|
17079
|
+
yield { type: "visual_feedback", content: colorMainWords(`${thisIsFirstToolFeedback ? "\n" : ""}${boxMid}`) };
|
|
16644
17080
|
thisIsFirstToolFeedback = false;
|
|
16645
17081
|
const toolEnd2 = Date.now();
|
|
16646
17082
|
lastToolFinishedAt = toolEnd2;
|
|
@@ -16667,7 +17103,7 @@ ${snippet2}
|
|
|
16667
17103
|
}
|
|
16668
17104
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
16669
17105
|
const action = normToolName === "write_file" ? "Write Cancelled" : "Edit Denied";
|
|
16670
|
-
const deniedLabel = `\u2718 ${action}: ${parseArgs(toolCall.args).path || "..."}
|
|
17106
|
+
const deniedLabel = `\u2718 ${action}: ${parseArgs(toolCall.args).path || "..."}`;
|
|
16671
17107
|
let terminalWidth = 115;
|
|
16672
17108
|
if (process.stdout.isTTY) {
|
|
16673
17109
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -16774,7 +17210,7 @@ ${snippet2}
|
|
|
16774
17210
|
}
|
|
16775
17211
|
const _sp = path27 ? path27.replace(/[\/\\]+$/, "") : null;
|
|
16776
17212
|
const displayPath = _sp && _sp !== "." ? `"${_isDir ? `${_sp}/*` : _sp}"` : "./";
|
|
16777
|
-
const postLabel =
|
|
17213
|
+
const postLabel = `${keyword ? "\u2714" : "\u2718"} Searched: "${keyword ? keyword : ""}" in ${displayPath} \u2192 ${matchCount} Match${matchCount === 1 ? "" : "es"}`;
|
|
16778
17214
|
let terminalWidth = 115;
|
|
16779
17215
|
if (process.stdout.isTTY) {
|
|
16780
17216
|
terminalWidth = process.stdout.columns - 5 || 120;
|
|
@@ -17169,14 +17605,14 @@ Error Log can be found in ${path25.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
17169
17605
|
if (toolResults.length < attemptedToolsCount) {
|
|
17170
17606
|
combinedText += `
|
|
17171
17607
|
|
|
17172
|
-
[SYSTEM] Only ${toolResults.length} out of ${attemptedToolsCount} attempted tool calls were executed. Verify proper
|
|
17608
|
+
[SYSTEM] Only ${toolResults.length} out of ${attemptedToolsCount} attempted tool calls were executed. Verify proper schema compliance & try failed calls again [/SYSTEM]`;
|
|
17173
17609
|
}
|
|
17174
17610
|
const binaryPart = toolResults.find((tr) => tr.binaryPart)?.binaryPart || null;
|
|
17175
17611
|
modifiedHistory.push({ role: "user", text: combinedText, binaryPart });
|
|
17176
17612
|
}
|
|
17177
17613
|
} else {
|
|
17178
17614
|
if (wasToolCalledInLastLoop || detectedAnyToolCalls) {
|
|
17179
|
-
modifiedHistory.push({ role: "user", text: `[SYSTEM] Failed to execute some tools. Verify proper
|
|
17615
|
+
modifiedHistory.push({ role: "user", text: `[SYSTEM] Failed to execute some tools. Verify proper schema compliance & try again [/SYSTEM]` });
|
|
17180
17616
|
} else {
|
|
17181
17617
|
modifiedHistory.push({ role: "user", text: `[SYSTEM] ${isStutteringLoop && !isThinkingLoop ? `STUTTERING DETECTED by Internal System. Re-calibrate your response & proceed.` : `${isThinkingLoop ? " OVER THINKING" : " LOOP"} DETECTED by Internal System${isThinkingLoop ? " for current EFFORT_LEVEL" : ""}. ${isThinkingLoop ? "If you have planned the task, prioritize execution/output" : "If you have finished your task use [[END]]"}`} [/SYSTEM]` });
|
|
17182
17618
|
}
|
|
@@ -17199,7 +17635,7 @@ Error Log can be found in ${path25.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
17199
17635
|
})() : String(err);
|
|
17200
17636
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
17201
17637
|
const agentErrDir = path25.join(LOGS_DIR, "agent");
|
|
17202
|
-
yield { type: "text", content: `\u274C CRITICAL ERROR: ${errLog}` };
|
|
17638
|
+
yield { type: "text", content: `\u274C CRITICAL ERROR: ${errLog.includes("fetch failed") ? "Failed to Connect. Check your Internet Connection or Wait a moment" : errLog}` };
|
|
17203
17639
|
if (!fs26.existsSync(agentErrDir)) fs26.mkdirSync(agentErrDir, { recursive: true });
|
|
17204
17640
|
fs26.appendFileSync(path25.join(agentErrDir, "error.log"), `CRITICAL ERROR [${date}]: ${err}
|
|
17205
17641
|
|
|
@@ -17232,15 +17668,15 @@ Error Log can be found in ${path25.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
17232
17668
|
const mergedSettings = { ...savedSettings, ...settings };
|
|
17233
17669
|
const targetModel = model || settings?.modelName || settings?.activeModel || savedSettings.activeModel;
|
|
17234
17670
|
const SUBAGENT_TOOL_DEFINITIONS = {
|
|
17235
|
-
"readfile": '- [tool:functions.ReadFile(path="...", startLine=
|
|
17236
|
-
"readfolder": '- [tool:functions.ReadFolder(path="...")]. Detailed DIR stats including File Sizes',
|
|
17237
|
-
"filemap": '- [tool:functions.FileMap(path="
|
|
17238
|
-
"patchfile": '- [tool:functions.PatchFile(path="...", allowMultiple="
|
|
17239
|
-
"writefile": '- [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile.
|
|
17240
|
-
"searchkeyword": '- [tool:functions.SearchKeyword(keyword="...", path="optional, target directory
|
|
17241
|
-
"websearch": '- [tool:functions.WebSearch(query="...", aiMode="
|
|
17671
|
+
"readfile": '- [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. View files',
|
|
17672
|
+
"readfolder": '- [tool:functions.ReadFolder(path="...", recurse="integer 0-4 optional, default: 0")]. Detailed DIR stats including File Sizes',
|
|
17673
|
+
"filemap": '- [tool:functions.FileMap(path="file")]. Shows file structure, functions, class, import/export, variables',
|
|
17674
|
+
"patchfile": '- [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", replaceContent1="...", newContent1="...", ...MAX 15)]. Surgical patch. allowMultiple: Replace all matches. Multiple patches same file? Use replaceContent2/newContent2... Verify DIFFs',
|
|
17675
|
+
"writefile": '- [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile. VERIFY IMPORTS',
|
|
17676
|
+
"searchkeyword": '- [tool:functions.SearchKeyword(keyword="...", path="optional, target directory/filename", subString="bool optional, default: false", regex="bool optional, default: auto")]. path limits scope to a file/dir. Find definitions/logic without full reads. Locate relevant code',
|
|
17677
|
+
"websearch": '- [tool:functions.WebSearch(query="...", aiMode="bool optional, default: false", limit="integer 3-10, aiMode: exclude")]. Usage: unknown info/docs. aiMode: LLM search',
|
|
17242
17678
|
"webscrape": '- [tool:functions.WebScrape(url="...")]. Proactive use for specific webpage/docs/api',
|
|
17243
|
-
"ask": `- [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity
|
|
17679
|
+
"ask": `- [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity: MUST for path divergence, security risk. Ask, don't finish/guess. Suggest best options; no preferences. Keep options short`
|
|
17244
17680
|
};
|
|
17245
17681
|
const providedToolsSection = `-- TOOL DEFINITIONS (path = relative to CWD, path separator: '/') --
|
|
17246
17682
|
TO ACCESS TOOLS **STRICTLY USE THE EXACT FORMAT IN CHAT OUTPUT:** [tool:functions.ToolName(args)]
|
|
@@ -17252,7 +17688,7 @@ TOOL POLICY:
|
|
|
17252
17688
|
- FileMap \u2192 ReadFile for efficient file understanding
|
|
17253
17689
|
- Need specific text ? SearchKeyword > Guessing/ReadFile
|
|
17254
17690
|
- Huge files ? SearchKeyword > FileMap/Full Read
|
|
17255
|
-
- NO
|
|
17691
|
+
- NO Shell Access
|
|
17256
17692
|
|
|
17257
17693
|
-- PROVIDED TOOLS --
|
|
17258
17694
|
${Object.values(SUBAGENT_TOOL_DEFINITIONS).join("\n")}
|
|
@@ -17348,17 +17784,19 @@ ${cleanResponse}
|
|
|
17348
17784
|
const path27 = parseArgs(toolCall.args).path || "";
|
|
17349
17785
|
label = `\u2714 \x1B[95mRead\x1B[0m: ${path27}`;
|
|
17350
17786
|
} else if (normalizedToolName === "list_files" || normalizedToolName === "read_folder" || normalizedToolName === "readfolder") {
|
|
17351
|
-
const path27 = parseArgs(toolCall.args).path ||
|
|
17352
|
-
|
|
17787
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
17788
|
+
const recurse = parseArgs(toolCall.args).recurse || 0;
|
|
17789
|
+
label = `${path27 ? "\u2714" : "\u2718"} \x1B[95mBrowsed\x1B[0m: ${path27 ? `${path27}${recurse > 0 ? `${path27.endsWith("/") ? `*${recurse}` : `/*${recurse}`}` : `${path27.endsWith("/") ? "" : "/"}`}` : ""}`;
|
|
17353
17790
|
} else if (normalizedToolName === "write_file" || normalizedToolName === "writefile") {
|
|
17354
|
-
const path27 = parseArgs(toolCall.args).path ||
|
|
17355
|
-
label =
|
|
17791
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
17792
|
+
label = `${path27 ? "\u2714" : "\u2718"} \x1B[95mCreated\x1B[0m: ${path27 ? `${path27}` : "No File Changes"}`;
|
|
17356
17793
|
} else if (normalizedToolName === "update_file" || normalizedToolName === "updatefile" || normalizedToolName === "patchfile" || normalizedToolName === "patch_file" || normalizedToolName === "patchfile" || normalizedToolName === "updatefile") {
|
|
17357
|
-
const path27 = parseArgs(toolCall.args).path ||
|
|
17358
|
-
|
|
17794
|
+
const path27 = parseArgs(toolCall.args).path || null;
|
|
17795
|
+
const content = parseArgs(toolCall.args).content || null;
|
|
17796
|
+
label = `${path27 ? "\u2714" : "\u2718"} \x1B[95mEdited\x1B[0m: ${path27 ? `${path27}` : "No File Changes"}`;
|
|
17359
17797
|
} else if (normalizedToolName === "file_map" || normalizedToolName === "filemap") {
|
|
17360
17798
|
const path27 = parseArgs(toolCall.args).path || "";
|
|
17361
|
-
label =
|
|
17799
|
+
label = `${path27 ? "\u2714" : "\u2718"} \x1B[95mIndexed\x1B[0m: ${path27 ? `${path27}` : "File Not Found"}`;
|
|
17362
17800
|
} else if (normalizedToolName === "await") {
|
|
17363
17801
|
const { time } = parseArgs(toolCall.args);
|
|
17364
17802
|
let sec = parseFloat(time) || 0;
|
|
@@ -17516,9 +17954,10 @@ function ResumeModal({ onSelect, onDelete, onClose, theme = "Dark" }) {
|
|
|
17516
17954
|
width: "100%"
|
|
17517
17955
|
},
|
|
17518
17956
|
/* @__PURE__ */ React10.createElement(Box9, { flexGrow: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: isSelected ? colors.text : colors.textMuted, bold: isSelected }, isSelected ? "\u276F " : " ", (() => {
|
|
17519
|
-
|
|
17520
|
-
if (chat2?.
|
|
17521
|
-
|
|
17957
|
+
const cleanTag = (str) => (str || "").replace(/\[\/?(?:STEERING HINT|QUESTION)(?::\s*\w+)?\]/gi, "").trim();
|
|
17958
|
+
if (chat2?.name && !chat2.name.startsWith("Session")) return cleanTag(chat2.name);
|
|
17959
|
+
if (chat2?.prompt) return cleanTag(chat2.prompt);
|
|
17960
|
+
return cleanTag(chat2?.name) || id;
|
|
17522
17961
|
})(), /* @__PURE__ */ React10.createElement(Text10, { color: colors.textMuted }, " [", dateStr, " \u2022 ", id, "]"))),
|
|
17523
17962
|
isSelected && /* @__PURE__ */ React10.createElement(Box9, { flexShrink: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: colors.danger, bold: true }, "[X] DELETE "))
|
|
17524
17963
|
);
|
|
@@ -20531,7 +20970,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
20531
20970
|
case "/chats": {
|
|
20532
20971
|
const run = async () => {
|
|
20533
20972
|
const history = await loadHistory();
|
|
20534
|
-
const list = Object.entries(history).map(([id, info]) => `\u2022 ${id}: ${info.name}`).join("\n");
|
|
20973
|
+
const list = Object.entries(history).sort((a, b) => (b[1].updatedAt || 0) - (a[1].updatedAt || 0)).map(([id, info]) => `\u2022 ${id}: ${info.name}`).join("\n");
|
|
20535
20974
|
setMessages((prev) => {
|
|
20536
20975
|
setCompletedIndex(prev.length + 1);
|
|
20537
20976
|
return [...prev, { id: Date.now(), role: "system", text: `[HISTORY] Saved Chats:
|
|
@@ -21712,20 +22151,29 @@ Selection: ${val}`,
|
|
|
21712
22151
|
);
|
|
21713
22152
|
};
|
|
21714
22153
|
const renderProgressBar = (label, current, limit) => {
|
|
21715
|
-
const
|
|
22154
|
+
const actualPercent = limit > 0 ? Math.min(100, current / limit * 100) : 0;
|
|
22155
|
+
const percent = Math.round(actualPercent);
|
|
21716
22156
|
const barWidth = 15;
|
|
21717
22157
|
const filledCount = Math.round(percent / 100 * barWidth);
|
|
21718
22158
|
const barStr = "\u2588".repeat(filledCount) + "\u2591".repeat(Math.max(0, barWidth - filledCount));
|
|
21719
|
-
let barColor = "
|
|
22159
|
+
let barColor = colors.success || "green";
|
|
21720
22160
|
if (percent >= 40 && percent <= 80) {
|
|
21721
|
-
barColor = "yellow";
|
|
22161
|
+
barColor = colors.warning || "yellow";
|
|
21722
22162
|
} else if (percent > 80) {
|
|
21723
|
-
barColor = "red";
|
|
22163
|
+
barColor = colors.danger || "red";
|
|
21724
22164
|
}
|
|
21725
22165
|
const isTokens = label.toLowerCase().includes("token");
|
|
21726
22166
|
const displayLimit = shouldClearValue(limit) ? "\u221E" : isTokens ? formatTokens(limit) : limit;
|
|
21727
22167
|
const displayCurrent = isTokens ? formatTokens(current) : current;
|
|
21728
|
-
|
|
22168
|
+
let displayPercent;
|
|
22169
|
+
if (actualPercent === 0) {
|
|
22170
|
+
displayPercent = "0%";
|
|
22171
|
+
} else if (actualPercent > 0 && actualPercent < 1) {
|
|
22172
|
+
displayPercent = "<1%";
|
|
22173
|
+
} else {
|
|
22174
|
+
displayPercent = `${percent}%`;
|
|
22175
|
+
}
|
|
22176
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "row", paddingLeft: 4, key: label }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, label, ": ")), /* @__PURE__ */ React16.createElement(Text16, { color: barColor }, barStr), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, " ", displayPercent, " (", displayCurrent, "/", displayLimit, ")"));
|
|
21729
22177
|
};
|
|
21730
22178
|
const renderActiveView = () => {
|
|
21731
22179
|
switch (activeView) {
|
|
@@ -21770,7 +22218,7 @@ Selection: ${val}`,
|
|
|
21770
22218
|
title: "SELECT AI PROVIDER",
|
|
21771
22219
|
items: [
|
|
21772
22220
|
{ label: "Google (Free/Paid)", value: "Google" },
|
|
21773
|
-
{ label: "Nvidia (Free/
|
|
22221
|
+
{ label: "Nvidia (Free/Custom)", value: "NVIDIA" },
|
|
21774
22222
|
{ label: "DeepSeek (Paid)", value: "DeepSeek" },
|
|
21775
22223
|
{ label: "Mistral (Free/Paid) [EXPERIMENTAL]", value: "Mistral" },
|
|
21776
22224
|
{ label: "OpenRouter (Free/Paid) [EXPERIMENTAL]", value: "OpenRouter" },
|
|
@@ -21864,6 +22312,7 @@ Selection: ${val}`,
|
|
|
21864
22312
|
{ label: "Custom (Set reset day of month)", value: "Custom" },
|
|
21865
22313
|
{ label: "Back", value: "apiTier" }
|
|
21866
22314
|
],
|
|
22315
|
+
theme: systemSettings.theme,
|
|
21867
22316
|
onSelect: (item) => {
|
|
21868
22317
|
if (item.value === "apiTier" || item.value === "Back") {
|
|
21869
22318
|
setActiveView("apiTier");
|
|
@@ -21899,6 +22348,7 @@ Selection: ${val}`,
|
|
|
21899
22348
|
{ label: `Provider Budgets (set limits per provider individually) ${quotas.providerBudgets?.["__useProvider"] ? "\u25CF" : ""}`, value: "provider" },
|
|
21900
22349
|
{ label: "Back", value: budgetReturnView }
|
|
21901
22350
|
],
|
|
22351
|
+
theme: systemSettings.theme,
|
|
21902
22352
|
onSelect: (item) => {
|
|
21903
22353
|
if (item.value === budgetReturnView || item.value === "Back") {
|
|
21904
22354
|
setActiveView(budgetReturnView);
|
|
@@ -21957,11 +22407,11 @@ Selection: ${val}`,
|
|
|
21957
22407
|
case "providerBudgetSelect": {
|
|
21958
22408
|
const PROVIDERS_LIST = ["Google", "DeepSeek", "Mistral", "NVIDIA", "OpenRouter"];
|
|
21959
22409
|
const anySelected = PROVIDERS_LIST.some((p) => pbsSelected[p]);
|
|
21960
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22410
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, "SELECT PROVIDERS TO SET BUDGETS FOR")), PROVIDERS_LIST.map((prov, i) => {
|
|
21961
22411
|
const isActive = i === pbsCursor;
|
|
21962
22412
|
const isChecked = !!pbsSelected[prov];
|
|
21963
|
-
return /* @__PURE__ */ React16.createElement(Box14, { key: prov, backgroundColor: isActive ? "#2a2a2a" : void 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: isActive ?
|
|
21964
|
-
}), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color:
|
|
22413
|
+
return /* @__PURE__ */ React16.createElement(Box14, { key: prov, backgroundColor: isActive ? colors.highlightBg || "#2a2a2a" : void 0, paddingX: 1, width: "100%", flexDirection: "row" }, /* @__PURE__ */ React16.createElement(Text16, { color: isActive ? colors.text : colors.textMuted, bold: isActive }, isActive ? "\u276F " : " "), /* @__PURE__ */ React16.createElement(Text16, { color: isChecked ? colors.success || "green" : colors.textMuted }, isChecked ? "\u2611" : "\u2610"), /* @__PURE__ */ React16.createElement(Text16, { color: isActive ? colors.text : colors.textMuted, bold: isActive }, " ", prov), isChecked && quotas.providerBudgets?.[prov]?.agentLimit ? /* @__PURE__ */ React16.createElement(Text16, { color: colors.primary || "cyan" }, " (budget set)") : null);
|
|
22414
|
+
}), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, italic: true }, "\u2191\u2193 Navigate \u2022 Space to toggle \u2022 Enter to confirm \u2022 ESC to go back"), !anySelected && /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow", italic: true }, " Select at least one provider to continue")));
|
|
21965
22415
|
}
|
|
21966
22416
|
case "providerBudgetFlow":
|
|
21967
22417
|
return null;
|
|
@@ -21975,6 +22425,7 @@ Selection: ${val}`,
|
|
|
21975
22425
|
{ label: "Custom (Set reset day of month)", value: "Custom" },
|
|
21976
22426
|
{ label: "Back", value: "chat" }
|
|
21977
22427
|
],
|
|
22428
|
+
theme: systemSettings.theme,
|
|
21978
22429
|
onSelect: (item) => {
|
|
21979
22430
|
if (item.value === "chat" || item.value === "Back") {
|
|
21980
22431
|
setActiveView("chat");
|
|
@@ -22024,9 +22475,9 @@ Selection: ${val}`,
|
|
|
22024
22475
|
}
|
|
22025
22476
|
const resetDate = new Date(today.getFullYear(), resetMonth, resetDay);
|
|
22026
22477
|
const monthName = resetDate.toLocaleString("default", { month: "short" });
|
|
22027
|
-
resetInfo =
|
|
22478
|
+
resetInfo = `${monthName}-${resetDay}`;
|
|
22028
22479
|
}
|
|
22029
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22480
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, padding: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, "BUDGET LIMIT STATUS"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "[ ESC to Close ]")), limitsNotSet ? /* @__PURE__ */ React16.createElement(Box14, { padding: 1, justifyContent: "center", alignItems: "center", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, "LIMITS NOT SET")) : usingProviderBudgets && configuredProviders.length > 0 ? /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", gap: 1, width: "100%" }, configuredProviders.map((prov) => {
|
|
22030
22481
|
const pb = providerBudgetsMap[prov];
|
|
22031
22482
|
const provReqCurrent = dailyUsage?.providerRequests?.[prov] || 0;
|
|
22032
22483
|
let provTokenCurrent = 0;
|
|
@@ -22040,11 +22491,11 @@ Selection: ${val}`,
|
|
|
22040
22491
|
for (const m in monthlyModels) {
|
|
22041
22492
|
provMonthlyCurrent += monthlyModels[m]?.tokens || 0;
|
|
22042
22493
|
}
|
|
22043
|
-
return /* @__PURE__ */ React16.createElement(Box14, { key: prov, flexDirection: "column", borderStyle: "single", borderColor:
|
|
22044
|
-
}), resetInfo ? /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color:
|
|
22494
|
+
return /* @__PURE__ */ React16.createElement(Box14, { key: prov, flexDirection: "column", borderStyle: "single", borderColor: colors.borderMuted, paddingX: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 0 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.primary, bold: true }, "\u25C6 ", prov)), renderProgressBar("Daily Requests", provReqCurrent, pb.agentLimit || 99999999, "cyan"), renderProgressBar("Daily Tokens", provTokenCurrent, pb.tokenLimit || 99999999999999, "green"), renderProgressBar("Monthly Tokens", provMonthlyCurrent, pb.monthlyTokenLimit || 99999999999999, "yellow"));
|
|
22495
|
+
}), resetInfo ? /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "Monthly Reset: "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.accent || "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "Monthly Reset: "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary || "blue", bold: true }, "Rolling 30-Day Window"))) : /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "single", borderColor: colors.borderMuted, paddingX: 1, width: "100%" }, renderProgressBar("Daily Requests", reqCurrent, reqLimit, "cyan"), renderProgressBar("Daily Tokens", tokenCurrent, tokenLimit, "green"), renderProgressBar("Monthly Tokens", monthlyCurrent, monthlyLimit, "yellow"), resetInfo ? /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "Monthly Reset: "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.accent || "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "Monthly Reset: "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary || "blue", bold: true }, "Rolling 30-Day Window"))));
|
|
22045
22496
|
}
|
|
22046
22497
|
case "input":
|
|
22047
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22498
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, "DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, italic: true }, inputConfig.note)), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React16.createElement(
|
|
22048
22499
|
TextInput4,
|
|
22049
22500
|
{
|
|
22050
22501
|
value: inputConfig?.value || "",
|
|
@@ -22144,7 +22595,7 @@ Selection: ${val}`,
|
|
|
22144
22595
|
}
|
|
22145
22596
|
}
|
|
22146
22597
|
}
|
|
22147
|
-
)), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color:
|
|
22598
|
+
)), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
22148
22599
|
case "stats": {
|
|
22149
22600
|
const u = statsMode === "monthly" ? monthlyUsage : dailyUsage;
|
|
22150
22601
|
const trackerTitle = statsMode === "monthly" ? "LAST 30 DAYS USAGE" : "TODAY's USAGE";
|
|
@@ -22154,16 +22605,17 @@ Selection: ${val}`,
|
|
|
22154
22605
|
const imageCreditsLabel = statsMode === "monthly" ? "Image Credits:" : "Image Credits:";
|
|
22155
22606
|
const codeChangesLabel = statsMode === "monthly" ? "Code Changes:" : "Code Changes:";
|
|
22156
22607
|
const toolCallsLabel = statsMode === "monthly" ? "Tool Calls:" : "Tool Calls:";
|
|
22157
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22608
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 3, paddingY: 1, paddingBottom: 0, width: Math.min(125, (stdout?.columns || 100) - 2) }, statsMode === "modelBreakdown" ? /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, "30-DAY MODEL TOKEN BREAKDOWN"), !monthlyUsage?.models || Object.keys(monthlyUsage.models).length === 0 ? /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, italic: true }, "No model token usage recorded in the last 30 days.")) : Object.entries(monthlyUsage.models).map(([provider, models]) => {
|
|
22158
22609
|
const providerTotalTokens = Object.values(models).reduce((sum, m) => sum + (m.tokens || 0), 0);
|
|
22159
|
-
return /* @__PURE__ */ React16.createElement(Box14, { key: provider, flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 40 }, /* @__PURE__ */ React16.createElement(Text16, { color:
|
|
22160
|
-
})) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Active Context:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "+", runtimeSession.linesAdded), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "-", runtimeSession.linesRemoved))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, runtimeSession.toolSuccess + runtimeSession.toolFailure + runtimeSession.toolDenied, " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "\u2714 ", runtimeSession.toolSuccess), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, "\u{1F6C7} ", runtimeSession.toolDenied), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "\u2718 ", runtimeSession.toolFailure), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " )"))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, timeLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u?.agent || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u?.background || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, tokensLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, imagesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u.imageCalls.length)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, imageCreditsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, codeChangesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, toolCallsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "\u2714 ", u?.toolSuccess || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, "\u{1F6C7} ", u?.toolDenied || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "\u2718 ", u?.toolFailure || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " )")))), /* @__PURE__ */ React16.createElement(Text16, { dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
|
|
22610
|
+
return /* @__PURE__ */ React16.createElement(Box14, { key: provider, flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 40 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.primary, bold: true }, provider, ":")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, formatTokens(providerTotalTokens))), Object.entries(models).map(([modelName, stats]) => /* @__PURE__ */ React16.createElement(Box14, { key: modelName, flexDirection: "column", marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 36 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "\xBB ", modelName, ":")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(stats.tokens || 0))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 32 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens((stats.tokens || 0) - (stats.candidateTokens || 0)))), (stats.cachedTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 5 }, /* @__PURE__ */ React16.createElement(Box14, { width: 31 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(stats.cachedTokens))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 32 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(stats.candidateTokens || 0))))));
|
|
22611
|
+
})) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Session Duration:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, sessionAgentCalls)), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB API Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Tool Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, sessionBackgroundCalls)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Tokens Consumed:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Active Context:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Images Made:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, sessionImageCount)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Image Credits:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Code Changes (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.success || "green" }, "+", runtimeSession.linesAdded), " ", /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red" }, "-", runtimeSession.linesRemoved))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Tool Calls (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, runtimeSession.toolSuccess + runtimeSession.toolFailure + runtimeSession.toolDenied, " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.success || "green" }, "\u2714 ", runtimeSession.toolSuccess), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow" }, "\u{1F6C7} ", runtimeSession.toolDenied), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red" }, "\u2718 ", runtimeSession.toolFailure), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " )"))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, timeLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, u?.agent || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, u?.background || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, tokensLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, imagesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, u.imageCalls.length)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, imageCreditsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, codeChangesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.success || "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary }, toolCallsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.success || "green" }, "\u2714 ", u?.toolSuccess || 0), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow" }, "\u{1F6C7} ", u?.toolDenied || 0), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red" }, "\u2718 ", u?.toolFailure || 0), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, " )")))), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
|
|
22161
22612
|
}
|
|
22162
22613
|
case "autoExecDanger":
|
|
22163
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22614
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow", bold: true, underline: true }, "SECURITY WARNING: YOLO MODE"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text, bold: true }, "RISKS INVOLVED:"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake unless specified in sandbox rules."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22164
22615
|
CommandMenu,
|
|
22165
22616
|
{
|
|
22166
22617
|
title: "Confirm Intent",
|
|
22618
|
+
theme: systemSettings.theme,
|
|
22167
22619
|
items: [
|
|
22168
22620
|
{ label: "I know the risk and turning on intentionally", value: "on" },
|
|
22169
22621
|
{ label: "Keep Off (Recommended)", value: "off" }
|
|
@@ -22177,10 +22629,11 @@ Selection: ${val}`,
|
|
|
22177
22629
|
}
|
|
22178
22630
|
)));
|
|
22179
22631
|
case "advanceRollbackDanger":
|
|
22180
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22632
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 2, paddingY: 1, paddingTop: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow", bold: true }, "\u26A0 Emergency Rollback Notice"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "When enabled, full repo snapshots exist only during active AI turns."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "If catastrophic changes occur during a turn, avoid abruptly stopping the agent unless absolutely necessary (external damages out of codebase)."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "The agent may be able to automatically restore the repo to a safe state."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.textMuted }, "Once the turn ends, emergency snapshots are deleted and standard /revert takes over which may not retain full repo content."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.textMuted }, "(Requires Restart to take effect)"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22181
22633
|
CommandMenu,
|
|
22182
22634
|
{
|
|
22183
22635
|
title: "Confirm",
|
|
22636
|
+
theme: systemSettings.theme,
|
|
22184
22637
|
items: [
|
|
22185
22638
|
{ label: "I understand and wish to enable", value: "on" },
|
|
22186
22639
|
{ label: "Keep Off", value: "off" }
|
|
@@ -22194,10 +22647,11 @@ Selection: ${val}`,
|
|
|
22194
22647
|
}
|
|
22195
22648
|
)));
|
|
22196
22649
|
case "externalDanger":
|
|
22197
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22650
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.warning || "yellow", bold: true, underline: true }, "SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text, bold: true }, "RISKS INVOLVED:"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Potential for accidental or malicious deletion of OS-critical files."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Unauthorized script execution across your entire file system."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22198
22651
|
CommandMenu,
|
|
22199
22652
|
{
|
|
22200
22653
|
title: "Confirm Intent",
|
|
22654
|
+
theme: systemSettings.theme,
|
|
22201
22655
|
items: [
|
|
22202
22656
|
{ label: "I know the risk and turning on intentionally", value: "on" },
|
|
22203
22657
|
{ label: "Keep Off (Recommended)", value: "off" }
|
|
@@ -22211,10 +22665,11 @@ Selection: ${val}`,
|
|
|
22211
22665
|
}
|
|
22212
22666
|
)));
|
|
22213
22667
|
case "doubleDanger":
|
|
22214
|
-
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
22668
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red", bold: true, underline: true }, "CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "You are attempting to enable BOTH [YOLO Mode] and [External Workspace Access] simultaneously."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.danger || "red", bold: true }, "THIS IS NOT RECOMMENDED."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text, bold: true }, "THE CRITICAL RISK:"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.danger || "red", italic: true, marginTop: 1 }, "A single hallucination or error could result in full system wipe or data theft."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22215
22669
|
CommandMenu,
|
|
22216
22670
|
{
|
|
22217
22671
|
title: "Final Confirmation",
|
|
22672
|
+
theme: systemSettings.theme,
|
|
22218
22673
|
items: [
|
|
22219
22674
|
{ label: "I agree knowing the consequences", value: "on" },
|
|
22220
22675
|
{ label: "Keep Off", value: "off" }
|
|
@@ -22454,6 +22909,7 @@ Selection: ${val}`,
|
|
|
22454
22909
|
ResolutionModal,
|
|
22455
22910
|
{
|
|
22456
22911
|
data: resolutionData,
|
|
22912
|
+
theme: systemSettings.theme,
|
|
22457
22913
|
onResolve: (val) => {
|
|
22458
22914
|
setResolutionData(null);
|
|
22459
22915
|
setActiveView("chat");
|
|
@@ -22717,7 +23173,7 @@ Selection: ${val}`,
|
|
|
22717
23173
|
{
|
|
22718
23174
|
items: [
|
|
22719
23175
|
{ label: "Google (Free/Paid)", value: "Google" },
|
|
22720
|
-
{ label: "Nvidia (Free/
|
|
23176
|
+
{ label: "Nvidia (Free/Custom)", value: "NVIDIA" },
|
|
22721
23177
|
{ label: "DeepSeek (Paid)", value: "DeepSeek" },
|
|
22722
23178
|
{ label: "Mistral (Free/Paid) [EXPERIMENTAL]", value: "Mistral" },
|
|
22723
23179
|
{ label: "OpenRouter (Free/Paid) [EXPERIMENTAL]", value: "OpenRouter" }
|
|
@@ -22979,20 +23435,25 @@ var init_app = __esm({
|
|
|
22979
23435
|
packageJson = JSON.parse(fs28.readFileSync(packageJsonPath, "utf8"));
|
|
22980
23436
|
versionFluxflow = packageJson.version;
|
|
22981
23437
|
updatedOn = packageJson.date || "2026-05-20";
|
|
22982
|
-
ResolutionModal = ({ data, onResolve, onEdit
|
|
22983
|
-
|
|
22984
|
-
{
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
|
|
22992
|
-
|
|
23438
|
+
ResolutionModal = ({ data, onResolve, onEdit, theme = "Dark" }) => {
|
|
23439
|
+
const colors = getThemeColors(theme);
|
|
23440
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, data.startsWith("/btw") ? "QUESTION" : "STEERING HINT", " RESOLUTION")), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, "The agent already finished the task before your ", data.startsWith("/btw") ? "question" : "hint", " was consumed.")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, backgroundColor: colors.cardBg || colors.codeBg || "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { italic: true, color: colors.textMuted }, '"', data.replace("/btw", "").trim(), '"')), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.textDim || colors.textMuted }, "How would you like to proceed?")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 0 }, /* @__PURE__ */ React16.createElement(
|
|
23441
|
+
CommandMenu,
|
|
23442
|
+
{
|
|
23443
|
+
title: "Select Action",
|
|
23444
|
+
items: [
|
|
23445
|
+
{ label: "Send Anyway", value: "send" },
|
|
23446
|
+
{ label: "Edit Prompt", value: "edit" }
|
|
23447
|
+
],
|
|
23448
|
+
onSelect: (item) => {
|
|
23449
|
+
const val = typeof item === "object" && item !== null ? item.value : item;
|
|
23450
|
+
if (val === "send") onResolve(data);
|
|
23451
|
+
else onEdit(data);
|
|
23452
|
+
},
|
|
23453
|
+
theme
|
|
22993
23454
|
}
|
|
22994
|
-
|
|
22995
|
-
|
|
23455
|
+
)));
|
|
23456
|
+
};
|
|
22996
23457
|
getProjectFiles = /* @__PURE__ */ (() => {
|
|
22997
23458
|
let cachedFiles = null;
|
|
22998
23459
|
let lastScanTime = 0;
|