fluxflow-cli 3.14.1 → 3.15.0
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 +163 -66
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -779,7 +779,8 @@ var init_settings = __esm({
|
|
|
779
779
|
loadingPhrases: true,
|
|
780
780
|
progressiveRendering: true,
|
|
781
781
|
showTPMEstimate: false,
|
|
782
|
-
subAgents: true
|
|
782
|
+
subAgents: true,
|
|
783
|
+
dynamicDirAwareness: false
|
|
783
784
|
},
|
|
784
785
|
profileData: {
|
|
785
786
|
name: null,
|
|
@@ -3309,31 +3310,32 @@ var init_text = __esm({
|
|
|
3309
3310
|
return result;
|
|
3310
3311
|
};
|
|
3311
3312
|
TOOL_LABELS = {
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
//
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3313
|
+
// DEPRECATED LABELS
|
|
3314
|
+
// 'write_file': 'WriteFile',
|
|
3315
|
+
// 'update_file': 'UpdateFile',
|
|
3316
|
+
// 'read_folder': 'ReadFolder',
|
|
3317
|
+
// 'view_file': 'ViewFile',
|
|
3318
|
+
// 'exec_command': 'ExecuteCommand',
|
|
3319
|
+
// 'web_search': 'WebSearch',
|
|
3320
|
+
// 'web_scrape': 'ReadSite',
|
|
3321
|
+
// 'search_keyword': 'SearchKeyword',
|
|
3322
|
+
// 'write_pdf': 'CreatePDF',
|
|
3323
|
+
// 'write_docx': 'CreateDocument',
|
|
3324
|
+
// 'generate_image': 'GenerateImage',
|
|
3325
|
+
// // PascalCase Support
|
|
3326
|
+
// 'WriteFile': 'WriteFile',
|
|
3327
|
+
// 'PatchFile': 'PatchFile',
|
|
3328
|
+
// 'ReadFolder': 'ReadFolder',
|
|
3329
|
+
// 'ReadFile': 'ReadFile',
|
|
3330
|
+
// 'Run': 'RunCommand',
|
|
3331
|
+
// 'WebSearch': 'WebSearch',
|
|
3332
|
+
// 'WebScrape': 'WebScrape',
|
|
3333
|
+
// 'SearchKeyword': 'SearchKeyword',
|
|
3334
|
+
// 'WritePDF': 'WritePDF',
|
|
3335
|
+
// 'WriteDoc': 'WriteDoc',
|
|
3336
|
+
// 'Memory': 'Memory',
|
|
3337
|
+
// 'Chat': 'Chat',
|
|
3338
|
+
// 'GenerateImage': 'GenerateImage'
|
|
3337
3339
|
};
|
|
3338
3340
|
REGEX_INITIAL_THINK = /<\/think>(\r?\n){2}/gi;
|
|
3339
3341
|
REGEX_INITIAL_TOOL = /(\r?\n){2}(?=\[?(?:tool:functions|tool\.functions|agent:generalist|agent\.generalist|\s*turn\s*:))/gi;
|
|
@@ -6703,7 +6705,7 @@ Tool calls: ONLY use [tool:functions.ToolName(args)]
|
|
|
6703
6705
|
|
|
6704
6706
|
**TOOL USAGE POLICY:**
|
|
6705
6707
|
- 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
|
|
6708
|
+
${mode === "Flux" ? '- **Escape quotes: \\" for code strings **\n- ** Literal escapes: Double - escape sequences(e.g., \\\\n) **\n- ** File structure: Real newlines for code formatting**\n- 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' : ""}
|
|
6707
6709
|
- COMMUNICATION TOOLS -
|
|
6708
6710
|
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
|
|
6709
6711
|
|
|
@@ -6712,13 +6714,13 @@ ${mode === "Flux" ? "- Same file, many edits? Prefer multi search-replace in Pat
|
|
|
6712
6714
|
2. [tool:functions.WebScrape(url="...")]. Proactive use for specific webpage/docs/api
|
|
6713
6715
|
|
|
6714
6716
|
${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative; FIRST ARGUMENT, path separator: '/') -
|
|
6715
|
-
1. [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. ${aiProvider !== "Google" ? `${isMultiModal ? `Supports images/docs` :
|
|
6716
|
-
2. [tool:functions.ReadFolder(path="...", recurse="integer 0-4 optional, default: 0")]. Detailed DIR stats
|
|
6717
|
+
1. [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. ${aiProvider !== "Google" ? `${isMultiModal ? `Supports images/docs` : ""}` : `Supports images/docs`}
|
|
6718
|
+
2. [tool:functions.ReadFolder(path="...", recurse="integer 0-4 optional, default: 0")]. Detailed DIR stats & metadata
|
|
6717
6719
|
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
|
|
6720
|
+
4. [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", replaceContent1="...", newContent1="...", ...MAX 15)]. Surgical patchs, TARGET SMALLEST LINES/SUB-STRINGS. allowMultiple: Replace all matches. Use replaceContent2/newContent2... for multi blocks. Verify DIFFs
|
|
6719
6721
|
5. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
6720
6722
|
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
|
|
6721
|
-
7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL` : `WINDOWS CMD
|
|
6723
|
+
7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL` : `WINDOWS CMD` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
|
|
6722
6724
|
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' : ""}
|
|
6723
6725
|
${_cachedAdvanceRollback ? `
|
|
6724
6726
|
- EMERGENCY SAFETY TOOLS -
|
|
@@ -6736,12 +6738,7 @@ Invocations:
|
|
|
6736
6738
|
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: '/') -
|
|
6737
6739
|
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
|
|
6738
6740
|
2. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document, NO WATERMARKS, stable margins & headers/footers
|
|
6739
|
-
- WORKSPACE & SUB AGENT TOOLS ARE NOT AVAILABLE IN FLOW`.trim()}
|
|
6740
|
-
|
|
6741
|
-
- VERIFY TOOL RESULT CONTENTS. Fix errors. No hallucinations
|
|
6742
|
-
- **Escape quotes: \\" for code strings**
|
|
6743
|
-
- **Literal escapes: Double-escape sequences (e.g., \\\\n)**
|
|
6744
|
-
- **File structure: Real newlines for code formatting**`.trim();
|
|
6741
|
+
- WORKSPACE & SUB AGENT TOOLS ARE NOT AVAILABLE IN FLOW`.trim()}`.trim();
|
|
6745
6742
|
};
|
|
6746
6743
|
}
|
|
6747
6744
|
});
|
|
@@ -7515,6 +7512,7 @@ function SettingsMenu({
|
|
|
7515
7512
|
return [
|
|
7516
7513
|
{ label: "Sub-Agents", value: "subAgents", status: systemSettings.subAgents !== false ? "ON" : "OFF" },
|
|
7517
7514
|
{ label: "Preserve Thinking", value: "preserveThinking", status: systemSettings.preserveThinking !== false ? "ON" : "OFF" },
|
|
7515
|
+
{ label: "Dynamic Directory Awareness", value: "dynamicDirAwareness", status: systemSettings.dynamicDirAwareness ? "ON" : "OFF" },
|
|
7518
7516
|
{ label: "Download Language Parsers", value: "parserDownload", status: "ACTION" }
|
|
7519
7517
|
];
|
|
7520
7518
|
default:
|
|
@@ -7569,6 +7567,11 @@ function SettingsMenu({
|
|
|
7569
7567
|
setActiveView("chat");
|
|
7570
7568
|
}
|
|
7571
7569
|
} else if (activeColumn === "items") {
|
|
7570
|
+
const currentItem = currentItems[selectedItemIndex];
|
|
7571
|
+
if (input === "?" && currentItem?.value === "dynamicDirAwareness") {
|
|
7572
|
+
setActiveView("dynamicDirHelp");
|
|
7573
|
+
return;
|
|
7574
|
+
}
|
|
7572
7575
|
if (key.upArrow) {
|
|
7573
7576
|
setSelectedItemIndex((prev) => (prev - 1 + currentItems.length) % currentItems.length);
|
|
7574
7577
|
} else if (key.downArrow) {
|
|
@@ -7706,6 +7709,16 @@ function SettingsMenu({
|
|
|
7706
7709
|
saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
|
|
7707
7710
|
return newSysSettings;
|
|
7708
7711
|
});
|
|
7712
|
+
} else if (item.value === "dynamicDirAwareness") {
|
|
7713
|
+
if (!systemSettings.dynamicDirAwareness) {
|
|
7714
|
+
setActiveView("dynamicDirDanger");
|
|
7715
|
+
} else {
|
|
7716
|
+
setSystemSettings((s) => {
|
|
7717
|
+
const newSysSettings = { ...s, dynamicDirAwareness: false };
|
|
7718
|
+
saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
|
|
7719
|
+
return newSysSettings;
|
|
7720
|
+
});
|
|
7721
|
+
}
|
|
7709
7722
|
} else if (item.value === "loadingPhrases") {
|
|
7710
7723
|
setSystemSettings((s) => {
|
|
7711
7724
|
const newSysSettings = { ...s, loadingPhrases: s.loadingPhrases === false ? true : false };
|
|
@@ -7829,7 +7842,7 @@ function SettingsMenu({
|
|
|
7829
7842
|
);
|
|
7830
7843
|
}
|
|
7831
7844
|
return elements;
|
|
7832
|
-
})() : /* @__PURE__ */ React7.createElement(Box6, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", italic: true }, CATEGORIES[selectedCategoryIndex].desc), currentCatId === "exit" && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Box6, { key: "pty-notice", marginTop: 19, paddingX: 0 }, /* @__PURE__ */ React7.createElement(Text7, { color: colors.text }, isPtyAvailable ? "\u2713 Advance Interactive Terminal Supported" : "\u26A0 Interactive Terminal is Limited")), /* @__PURE__ */ React7.createElement(Box6, { key: "memory-load-2026", paddingX: 0 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray" }, "Memory Load: ", currentMemory, "/", maxMemory, " ", memoryUnit)))))), /* @__PURE__ */ React7.createElement(Box6, { paddingX: 1, marginTop: 0, flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", italic: true }, activeColumn === "categories" ? "\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure" : "\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"), activeColumn === "categories" && /* @__PURE__ */ React7.createElement(Text7, { color: "gray" }, CATEGORIES[selectedCategoryIndex].desc)));
|
|
7845
|
+
})() : /* @__PURE__ */ React7.createElement(Box6, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", italic: true }, CATEGORIES[selectedCategoryIndex].desc), currentCatId === "exit" && /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Box6, { key: "pty-notice", marginTop: 19, paddingX: 0 }, /* @__PURE__ */ React7.createElement(Text7, { color: colors.text }, isPtyAvailable ? "\u2713 Advance Interactive Terminal Supported" : "\u26A0 Interactive Terminal is Limited")), /* @__PURE__ */ React7.createElement(Box6, { key: "memory-load-2026", paddingX: 0 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray" }, "Memory Load: ", currentMemory, "/", maxMemory, " ", memoryUnit)))))), /* @__PURE__ */ React7.createElement(Box6, { paddingX: 1, marginTop: 0, flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", italic: true }, activeColumn === "categories" ? "\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure" : currentItems[selectedItemIndex]?.value === "dynamicDirAwareness" ? "\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 ? HELP \u2022 \u25C4/ESC to go back" : "\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"), activeColumn === "categories" && /* @__PURE__ */ React7.createElement(Text7, { color: "gray" }, CATEGORIES[selectedCategoryIndex].desc)));
|
|
7833
7846
|
}
|
|
7834
7847
|
var themeOptions, CATEGORIES, getActivePreset, truncateCSV;
|
|
7835
7848
|
var init_SettingsMenu = __esm({
|
|
@@ -8146,8 +8159,7 @@ var init_prompts = __esm({
|
|
|
8146
8159
|
if (!isMemoryEnabled) return "";
|
|
8147
8160
|
const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `-- RECENT CONTEXT FROM OTHER CHATS (PRIORITY: DYNAMIC-LOW, FOCUS: Chat Context > Recent) --
|
|
8148
8161
|
${tempMemories}` : "";
|
|
8149
|
-
return tempMemoriesStr ? `${tempMemoriesStr}
|
|
8150
|
-
` : "";
|
|
8162
|
+
return tempMemoriesStr ? `${tempMemoriesStr}` : "";
|
|
8151
8163
|
};
|
|
8152
8164
|
getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, isMemoryEnabled = true, isFirstPrompt = false, aiProvider = "Google", isMultiModal = false, isGemini, chatId) => {
|
|
8153
8165
|
let forcedReasoning = false;
|
|
@@ -10161,8 +10173,10 @@ var init_view_file = __esm({
|
|
|
10161
10173
|
let { path: targetPath, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(args);
|
|
10162
10174
|
const sLine = parseInt(StartLine || start_line || startLine);
|
|
10163
10175
|
const eLine = parseInt(EndLine || end_line || endLine);
|
|
10164
|
-
const
|
|
10165
|
-
const
|
|
10176
|
+
const startProvided = !isNaN(sLine);
|
|
10177
|
+
const endProvided = !isNaN(eLine);
|
|
10178
|
+
let finalStart = sLine || 1;
|
|
10179
|
+
let finalEnd = eLine || (sLine ? sLine + 800 : 800);
|
|
10166
10180
|
if (!targetPath) return 'ERROR: Missing "path" argument for view_file.';
|
|
10167
10181
|
const absolutePath = path13.resolve(process.cwd(), targetPath);
|
|
10168
10182
|
try {
|
|
@@ -10213,6 +10227,10 @@ var init_view_file = __esm({
|
|
|
10213
10227
|
content = content.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
10214
10228
|
const lines = content.split("\n");
|
|
10215
10229
|
const totalLines = lines.length;
|
|
10230
|
+
if (!startProvided && !endProvided && totalLines > 800) {
|
|
10231
|
+
finalStart = 1;
|
|
10232
|
+
finalEnd = 50;
|
|
10233
|
+
}
|
|
10216
10234
|
const start = Math.max(0, finalStart - 1);
|
|
10217
10235
|
const end = Math.min(totalLines, finalEnd);
|
|
10218
10236
|
const resultLines = lines.slice(start, end);
|
|
@@ -13026,7 +13044,7 @@ import dotenv from "dotenv";
|
|
|
13026
13044
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
13027
13045
|
import path25, { normalize } from "path";
|
|
13028
13046
|
import fs26 from "fs";
|
|
13029
|
-
var RE_STUTTER_CODE_BLOCK_CLOSED, RE_STUTTER_CODE_BLOCK_OPEN, RE_STUTTER_INLINE_CODE, RE_STUTTER_TABLE_ROW, RE_STUTTER_WORD_BOUNDARY, RE_STUTTER_NON_ALNUM, RE_TOOL_CALL_FUNC, RE_TOOL_PARTIAL_ARGS_FALLBACK, RE_STRIP_QUOTES, RE_BACKSLASH_SLASH, client, globalSettings, colorMainWords, withRetry, TERMINATION_SIGNAL, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getMistralStream, getNVIDIAStream, wrapNvidiaStreamWithQueueDepth, getOpenRouterStream, signalTermination, isTerminationSignaled, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
|
|
13047
|
+
var RE_STUTTER_CODE_BLOCK_CLOSED, RE_STUTTER_CODE_BLOCK_OPEN, RE_STUTTER_INLINE_CODE, RE_STUTTER_TABLE_ROW, RE_STUTTER_WORD_BOUNDARY, RE_STUTTER_NON_ALNUM, RE_TOOL_CALL_FUNC, RE_TOOL_PARTIAL_ARGS_FALLBACK, RE_STRIP_QUOTES, RE_BACKSLASH_SLASH, client, globalSettings, dirTreeCache, cachedChatId2, getCachedDirTree, colorMainWords, withRetry, TERMINATION_SIGNAL, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getMistralStream, getNVIDIAStream, wrapNvidiaStreamWithQueueDepth, getOpenRouterStream, signalTermination, isTerminationSignaled, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
|
|
13030
13048
|
var init_ai = __esm({
|
|
13031
13049
|
async "src/utils/ai.js"() {
|
|
13032
13050
|
await init_prompts();
|
|
@@ -13059,6 +13077,23 @@ var init_ai = __esm({
|
|
|
13059
13077
|
RE_BACKSLASH_SLASH = /\\/g;
|
|
13060
13078
|
client = null;
|
|
13061
13079
|
globalSettings = {};
|
|
13080
|
+
dirTreeCache = null;
|
|
13081
|
+
cachedChatId2 = null;
|
|
13082
|
+
getCachedDirTree = (fn, chatId, isDynamicDirAwareness) => {
|
|
13083
|
+
if (isDynamicDirAwareness) {
|
|
13084
|
+
dirTreeCache = null;
|
|
13085
|
+
cachedChatId2 = chatId;
|
|
13086
|
+
return fn();
|
|
13087
|
+
}
|
|
13088
|
+
if (cachedChatId2 !== chatId) {
|
|
13089
|
+
dirTreeCache = null;
|
|
13090
|
+
cachedChatId2 = chatId;
|
|
13091
|
+
}
|
|
13092
|
+
if (dirTreeCache === null) {
|
|
13093
|
+
dirTreeCache = fn();
|
|
13094
|
+
}
|
|
13095
|
+
return dirTreeCache;
|
|
13096
|
+
};
|
|
13062
13097
|
colorMainWords = (label) => {
|
|
13063
13098
|
if (!label) return label;
|
|
13064
13099
|
return label.replace(/(?:(\x1b\[\d+m))?([✔✘✖🔍📖→➕↻↷•🛇])(?:(\x1b\[\d+m))?\s*\b(Created|Read|Edited|Viewed|Processed|Auto-Read|Skipped|List|Generated|Written|Searched|AI Search|Get Map|Write Canceled|Edit Canceled|Write Cancelled|Edit Denied|Visited|Updated|Reviewed|Delegated|Background|Checked|Indexed|Analyzed|Browsed|Elevating SubAgent|Checking SubAgent Work|Started Generalist|Called Generalist|Unsupported Modality|Awaiting|Cancelled|Aligning Moon Phase|Contemplating Existence|Staring At Void|Rollback Point Checked|Emergency Rollback Failed|Emergency Rollback|Delaying Professionally|Negotiating With Electrons|Touching Grass (virtually)|Panicking Softly|Rethinking Career Choices|Loading Cat Videos|Giving Up Entirely|Summoning Braincell #2|Pretending To Be Busy|Waiting For Motivation DLC|Rotating Internal Screaming|Downloading More RAM|Feeding The Hamsters|Gaslighting Scheduler|Performing Dramatic Pause|Buffering Social Energy|Calculating Regret|Reading Terms And Conditions|Becoming Sentient Briefly|Contacting Ancestors)\b/ig, (match, ansiBefore, icon, ansiAfter, word) => {
|
|
@@ -14300,16 +14335,17 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
14300
14335
|
}
|
|
14301
14336
|
};
|
|
14302
14337
|
getActiveToolContext = (text) => {
|
|
14338
|
+
const cleanText = text.replace(/(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])/gi, "").replace(/(?:<(think|thought)>|\[(think|thought)\])[\s\S]*$/gi, "");
|
|
14303
14339
|
RE_TOOL_CALL_FUNC.lastIndex = 0;
|
|
14304
14340
|
let match;
|
|
14305
|
-
while ((match = RE_TOOL_CALL_FUNC.exec(
|
|
14341
|
+
while ((match = RE_TOOL_CALL_FUNC.exec(cleanText)) !== null) {
|
|
14306
14342
|
const startIdx = match.index + match[0].length - 1;
|
|
14307
14343
|
let balance = 0;
|
|
14308
14344
|
let inString = null;
|
|
14309
14345
|
let isEscaped = false;
|
|
14310
14346
|
let closed = false;
|
|
14311
|
-
for (let i = startIdx; i <
|
|
14312
|
-
const char =
|
|
14347
|
+
for (let i = startIdx; i < cleanText.length; i++) {
|
|
14348
|
+
const char = cleanText[i];
|
|
14313
14349
|
if (!inString && (char === '"' || char === "'" || char === "`")) {
|
|
14314
14350
|
inString = char;
|
|
14315
14351
|
isEscaped = false;
|
|
@@ -14321,8 +14357,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
14321
14357
|
else if (char === ")") balance--;
|
|
14322
14358
|
if (balance === 0) {
|
|
14323
14359
|
let j = i + 1;
|
|
14324
|
-
while (j <
|
|
14325
|
-
if (j <
|
|
14360
|
+
while (j < cleanText.length && /\s/.test(cleanText[j])) j++;
|
|
14361
|
+
if (j < cleanText.length && cleanText[j] === "]") {
|
|
14326
14362
|
closed = true;
|
|
14327
14363
|
RE_TOOL_CALL_FUNC.lastIndex = j + 1;
|
|
14328
14364
|
break;
|
|
@@ -14333,7 +14369,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
14333
14369
|
else isEscaped = false;
|
|
14334
14370
|
}
|
|
14335
14371
|
if (!closed) {
|
|
14336
|
-
return { inside: true, toolName: match[1], startIndex: match.index, args:
|
|
14372
|
+
return { inside: true, toolName: match[1], startIndex: match.index, args: cleanText.substring(match.index + match[0].length) };
|
|
14337
14373
|
}
|
|
14338
14374
|
}
|
|
14339
14375
|
return { inside: false };
|
|
@@ -15004,7 +15040,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
15004
15040
|
const otherMemories = [...cachedSummaries, ...otherRawMemories].map((mem) => `- ${mem}`).join("\n");
|
|
15005
15041
|
const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
|
|
15006
15042
|
const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
|
|
15007
|
-
const isContext32k = (sessionStats?.tokens || 0) >=
|
|
15043
|
+
const isContext32k = (sessionStats?.tokens || 0) >= 1e4;
|
|
15008
15044
|
const memoryPrompt = getMemoryPrompt(otherMemories, mainUserMemories, isMemoryEnabled, isContext32k);
|
|
15009
15045
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString([], { year: "numeric", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: true });
|
|
15010
15046
|
const COLLAPSED_DIRS_GLOBAL = [
|
|
@@ -15281,12 +15317,12 @@ ${currentSummary}
|
|
|
15281
15317
|
**CONTEXT SUMMARY OF PREVIOUS TURNS**
|
|
15282
15318
|
${currentSummary}
|
|
15283
15319
|
` : "";
|
|
15284
|
-
let dirStructure = "
|
|
15285
|
-
` + getDirTree(process.cwd(), dynamicMaxDepth);
|
|
15320
|
+
let dirStructure = "\n**DIRECTORY STRUCTURE**\nCWD: " + process.cwd() + `${isPlayground ? " [PLAYGROUND MODE]" : ""}${cwdMismatch ? ` (WARNING: CWD Mismatch! Previous Path: ${lastCwd})` : ""}
|
|
15321
|
+
` + getCachedDirTree(() => getDirTree(process.cwd(), dynamicMaxDepth), chatId, systemSettings?.dynamicDirAwareness);
|
|
15286
15322
|
const ideCtx = await getIDEContext();
|
|
15287
15323
|
let ideBlock = "";
|
|
15288
15324
|
if (isBridgeConnected()) {
|
|
15289
|
-
ideBlock = "[IDE CONTEXT]\n";
|
|
15325
|
+
ideBlock = "\n[ADDITIONAL IDE CONTEXT]\n";
|
|
15290
15326
|
if (ideCtx.file_focused !== "none") {
|
|
15291
15327
|
const relFocused = path25.relative(process.cwd(), ideCtx.file_focused);
|
|
15292
15328
|
const relOpened = (ideCtx.opened_editors || []).map((p) => {
|
|
@@ -15484,7 +15520,7 @@ ${ideCtx.warnings}
|
|
|
15484
15520
|
lineCount = fs26.readFileSync(absPath, "utf8").split(/\r\n|\r|\n/).length;
|
|
15485
15521
|
} catch (e) {
|
|
15486
15522
|
}
|
|
15487
|
-
if (lineCount >
|
|
15523
|
+
if (lineCount > 300) {
|
|
15488
15524
|
const label = `\u21B7 Skipped (Too Large): ${path25.basename(filePath)}`;
|
|
15489
15525
|
let terminalWidth = 115;
|
|
15490
15526
|
if (process.stdout.isTTY) {
|
|
@@ -15498,9 +15534,9 @@ ${ideCtx.warnings}
|
|
|
15498
15534
|
}
|
|
15499
15535
|
}
|
|
15500
15536
|
const finalStart = startLine !== null ? startLine : 1;
|
|
15501
|
-
let finalEnd = endLine !== null ? endLine : startLine !== null ? startLine : finalStart +
|
|
15502
|
-
if (finalEnd - finalStart >
|
|
15503
|
-
finalEnd = finalStart +
|
|
15537
|
+
let finalEnd = endLine !== null ? endLine : startLine !== null ? startLine : finalStart + 299;
|
|
15538
|
+
if (finalEnd - finalStart > 300) {
|
|
15539
|
+
finalEnd = finalStart + 300;
|
|
15504
15540
|
}
|
|
15505
15541
|
const argsStr = `path=${JSON.stringify(filePath)}, startLine=${finalStart}, endLine=${finalEnd}`;
|
|
15506
15542
|
const result = await view_file(argsStr, { isMultiModal: isSupported });
|
|
@@ -15555,17 +15591,18 @@ ${ideCtx.warnings}
|
|
|
15555
15591
|
}
|
|
15556
15592
|
let taggedContextStr = "";
|
|
15557
15593
|
if (taggedContextBlocks.length > 0) {
|
|
15558
|
-
taggedContextStr = "[TAGGED FILE CONTENTS] Auto Read
|
|
15594
|
+
taggedContextStr = "[TAGGED FILE CONTENTS] Auto Read User Tagged files by System, No need to re-read\n" + taggedContextBlocks.join("\n\n") + "\n[/TAGGED FILE CONTENTS]\n";
|
|
15559
15595
|
}
|
|
15560
15596
|
const osDetected = process.platform === "win32" ? "Windows" : process.platform === "darwin" ? "macOS" : "Linux";
|
|
15561
15597
|
const cleanPromptForModel = cleanAgentText.replace(/\\(@\[[^\]]+\])/g, "$1");
|
|
15562
|
-
const firstUserMsg = `[
|
|
15598
|
+
const firstUserMsg = `[METADATA, Chat Context > Metadata]
|
|
15563
15599
|
Time: ${dateTimeStr}
|
|
15564
|
-
OS: ${osDetected}
|
|
15565
|
-
|
|
15566
|
-
${dirStructure}${memoryPrompt}${ideBlock}
|
|
15600
|
+
OS: ${osDetected}${systemSettings?.dynamicDirAwareness ? dirStructure : ""}${memoryPrompt}${ideBlock}
|
|
15601
|
+
[/METADATA]
|
|
15567
15602
|
${activeSummaryBlock}${thinkingLevel !== "Fast" && (aiProvider === "Mistral" || thinkingLevel !== "xHigh" && aiProvider === "Google") ? `${aiProvider === "Mistral" || modelName.toLowerCase().startsWith("gemma") ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS HIGH PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think>** [/SYSTEM]\n" : ""}` : ""}[SYSTEM Priority: HIGH] ONLY use the system prompt tool schema. eg: [tool:functions.ReadFolder(path=".")] [/SYSTEM]
|
|
15568
|
-
${taggedContextStr}[USER PROMPT]
|
|
15603
|
+
${taggedContextStr}[USER PROMPT]
|
|
15604
|
+
${cleanPromptForModel.trim()}
|
|
15605
|
+
[/USER PROMPT]`.trim();
|
|
15569
15606
|
const userMsgObj = { role: "user", text: firstUserMsg };
|
|
15570
15607
|
if (attachedBinaryPart) {
|
|
15571
15608
|
userMsgObj.binaryPart = attachedBinaryPart;
|
|
@@ -15734,6 +15771,10 @@ ${taggedContextStr}[USER PROMPT] ${cleanPromptForModel.trim()} [/USER PROMPT]`.t
|
|
|
15734
15771
|
}
|
|
15735
15772
|
targetModel = modelName;
|
|
15736
15773
|
currentSystemInstruction = getSystemInstruction(profile, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? thinkingLevel : thinkingLevel, mode, systemSettings, isMemoryEnabled, isFirstPrompt, aiProvider, aiProvider === "Google" ? true : isMultiModal, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? true : false, chatId);
|
|
15774
|
+
if (!systemSettings?.dynamicDirAwareness) {
|
|
15775
|
+
currentSystemInstruction += `
|
|
15776
|
+
${dirStructure.replace("\n**DIRECTORY STRUCTURE**", "\n**DIRECTORY STRUCTURE AT CONVERSATION START**")}`;
|
|
15777
|
+
}
|
|
15737
15778
|
const lastUserMsg = contents[contents.length - 1];
|
|
15738
15779
|
if (isBridgeConnected() & loop > 0) {
|
|
15739
15780
|
await new Promise((resolve) => setTimeout(resolve, 2500));
|
|
@@ -15787,7 +15828,7 @@ ${ideErr} [/ERROR]`;
|
|
|
15787
15828
|
const currentStep = loop + 1;
|
|
15788
15829
|
if (currentStep >= stepThreshold && lastUserMsg && lastUserMsg.parts?.[0]) {
|
|
15789
15830
|
lastUserMsg.parts[0].text += `
|
|
15790
|
-
[SYSTEM] WARNING, Turn Limit Impending: Step ${currentStep}/${MAX_LOOPS}. Wrap up quickly/prompt user to continue
|
|
15831
|
+
[SYSTEM] WARNING, Turn Limit Impending: Step ${currentStep}/${MAX_LOOPS}. Wrap up quickly/prompt user to continue. [/SYSTEM]`;
|
|
15791
15832
|
}
|
|
15792
15833
|
const abortPromise = new Promise((_, reject) => {
|
|
15793
15834
|
if (abortController.signal.aborted) {
|
|
@@ -16447,7 +16488,11 @@ ${ideErr} [/ERROR]`;
|
|
|
16447
16488
|
const content = fs26.readFileSync(absPath, "utf8");
|
|
16448
16489
|
const lines = content.split("\n").length;
|
|
16449
16490
|
totalLines = lines;
|
|
16450
|
-
|
|
16491
|
+
if (!rawStart && !rawEnd && lines > 800) {
|
|
16492
|
+
actualEndLine = Math.min(50, lines);
|
|
16493
|
+
} else {
|
|
16494
|
+
actualEndLine = Math.min(eLine, lines);
|
|
16495
|
+
}
|
|
16451
16496
|
}
|
|
16452
16497
|
} catch (e) {
|
|
16453
16498
|
}
|
|
@@ -17614,7 +17659,7 @@ Error Log can be found in ${path25.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
17614
17659
|
if (wasToolCalledInLastLoop || detectedAnyToolCalls) {
|
|
17615
17660
|
modifiedHistory.push({ role: "user", text: `[SYSTEM] Failed to execute some tools. Verify proper schema compliance & try again [/SYSTEM]` });
|
|
17616
17661
|
} else {
|
|
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
|
|
17662
|
+
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 provide a simple summary and end"}`} [/SYSTEM]` });
|
|
17618
17663
|
}
|
|
17619
17664
|
isThinkingLoop = false;
|
|
17620
17665
|
isStutteringLoop = false;
|
|
@@ -17780,6 +17825,11 @@ ${cleanResponse}
|
|
|
17780
17825
|
label = `\u2714 \x1B[95mSearched\x1B[0m`;
|
|
17781
17826
|
} else if (normalizedToolName === "web_scrape" || normalizedToolName === "webscrape") {
|
|
17782
17827
|
label = `\u2714 \x1B[95mScraped\x1B[0m`;
|
|
17828
|
+
} else if (normalizedToolName === "search_keyword" || normalizedToolName === "searchkeyword") {
|
|
17829
|
+
const pArgs = parseArgs(toolCall.args);
|
|
17830
|
+
const keyword = pArgs.keyword || "";
|
|
17831
|
+
const keywordPath = pArgs.path || "";
|
|
17832
|
+
label = `${keyword ? "\u2714" : "\u2718"} \x1B[95mSearched\x1B[0m: ${keyword || "No Query"}${keywordPath ? ` \u2192 ${keywordPath}` : ""}`;
|
|
17783
17833
|
} else if (normalizedToolName === "view_file" || normalizedToolName === "viewfile" || normalizedToolName === "readfile") {
|
|
17784
17834
|
const path27 = parseArgs(toolCall.args).path || "";
|
|
17785
17835
|
label = `\u2714 \x1B[95mRead\x1B[0m: ${path27}`;
|
|
@@ -19895,6 +19945,19 @@ function App({ args = [] }) {
|
|
|
19895
19945
|
}
|
|
19896
19946
|
}
|
|
19897
19947
|
if (key.tab && activeView === "chat") {
|
|
19948
|
+
if (suggestions.length > 0) {
|
|
19949
|
+
const nextMatch = suggestions[selectedIndex] || suggestions[0];
|
|
19950
|
+
const parts = input.split(" ");
|
|
19951
|
+
if (parts.length === 1) {
|
|
19952
|
+
setInput(nextMatch.cmd + " ");
|
|
19953
|
+
} else {
|
|
19954
|
+
const parentParts = parts.slice(0, -1);
|
|
19955
|
+
setInput(parentParts.join(" ") + " " + nextMatch.cmd + " ");
|
|
19956
|
+
}
|
|
19957
|
+
setSelectedIndex(0);
|
|
19958
|
+
setInputKey((prev) => prev + 1);
|
|
19959
|
+
return;
|
|
19960
|
+
}
|
|
19898
19961
|
}
|
|
19899
19962
|
if (key.ctrl && inputText === "c" && activeView !== "exit") {
|
|
19900
19963
|
if (input.length > 0) {
|
|
@@ -22610,6 +22673,40 @@ Selection: ${val}`,
|
|
|
22610
22673
|
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
22674
|
})) : /* @__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)"));
|
|
22612
22675
|
}
|
|
22676
|
+
case "dynamicDirDanger":
|
|
22677
|
+
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 }, "DYNAMIC DIRECTORY AWARENESS"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: colors.text }, "Enabling this keeps the agent aware of filesystem state in real time, but may reduce prompt cache efficiency."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text }, "\n", "RECOMMENDED SCENARIOS TO TURN ON:"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Repo is small."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 The task benefits from real-time filesystem awareness."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Files are often created, renamed, or deleted."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 You know exactly what you're signing up for."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 You don't have conflicting decisions regarding token bills."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 You want to see your wallet crying at 3am."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22678
|
+
CommandMenu,
|
|
22679
|
+
{
|
|
22680
|
+
title: "Confirm Intent",
|
|
22681
|
+
theme: systemSettings.theme,
|
|
22682
|
+
items: [
|
|
22683
|
+
{ label: "Turn On Dynamic Directory Awareness", value: "on" },
|
|
22684
|
+
{ label: "Keep Off (Recommended)", value: "off" }
|
|
22685
|
+
],
|
|
22686
|
+
onSelect: (item) => {
|
|
22687
|
+
if (item.value === "on") {
|
|
22688
|
+
setSystemSettings((s) => {
|
|
22689
|
+
const updated = { ...s, dynamicDirAwareness: true };
|
|
22690
|
+
saveSettings({ systemSettings: updated, apiTier, quotas });
|
|
22691
|
+
return updated;
|
|
22692
|
+
});
|
|
22693
|
+
}
|
|
22694
|
+
setActiveView("settings");
|
|
22695
|
+
}
|
|
22696
|
+
}
|
|
22697
|
+
)));
|
|
22698
|
+
case "dynamicDirHelp":
|
|
22699
|
+
return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: colors.borderMuted, paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true, underline: true }, "DYNAMIC DIRECTORY AWARENESS \u2014 HELP & EXPLANATION"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, "\n", "OFF (Default):"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Takes a static directory snapshot at conversation/session start and places it in System Context."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Prompt cache remains stable across user turns, saving tokens and money."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.text, bold: true }, "\n", "ON:"), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Rescans and updates the directory's state dynamically on every single user turn."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Provides real-time filesystem awareness if files are continuously created, renamed, or removed."), /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted }, "\u2022 Changes Prompt Context on each turn, invalidating part of prompt caches and increasing token usage."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
|
|
22700
|
+
CommandMenu,
|
|
22701
|
+
{
|
|
22702
|
+
title: "Actions",
|
|
22703
|
+
theme: systemSettings.theme,
|
|
22704
|
+
items: [
|
|
22705
|
+
{ label: "Back to Settings", value: "back" }
|
|
22706
|
+
],
|
|
22707
|
+
onSelect: () => setActiveView("settings")
|
|
22708
|
+
}
|
|
22709
|
+
)));
|
|
22613
22710
|
case "autoExecDanger":
|
|
22614
22711
|
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(
|
|
22615
22712
|
CommandMenu,
|