fluxflow-cli 3.19.3 โ 3.20.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/README.md +139 -138
- package/dist/fluxflow.js +81 -22
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,138 +1,139 @@
|
|
|
1
|
-
# ๐ Flux Flow (`fluxflow-cli`)
|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
<p align="left">
|
|
5
|
-
<a href="https://github.com/KushalRoyChowdhury/fluxflow-cli"><img src="https://img.shields.io/badge/FluxFlow-v3-blue?style=plastic" alt="FluxFlow Version"></a>
|
|
6
|
-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic" alt="License MIT"></a>
|
|
7
|
-
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-%3E%3D20-green?style=plastic" alt="Node Compatibility"></a>
|
|
8
|
-
</p>
|
|
9
|
-
|
|
10
|
-
### *The High-Fidelity Agentic CLI with Sub-Agents for the Flux Era.*
|
|
11
|
-
|
|
12
|
-
๐ **[Official Documentation](https://fluxflow-cli.onrender.com/)**
|
|
13
|
-
|
|
14
|
-
**Flux Flow** is not just another CLIโit's a high-speed, sassy, and goal-oriented CLI AI Agent powered by multi-provider frontier models (Google Gemini, DeepSeek, OpenRouter, and more). Designed for developers who demand a premium UI/UX while managing complex file-system tasks, web research, and autonomous workflows.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## ๐ Instant Ignition (No Setup Required)
|
|
19
|
-
You don't even need to install it. Just fire up your terminal and run:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
# Run instantly (Zero Setup)
|
|
23
|
-
npx fluxflow-cli
|
|
24
|
-
|
|
25
|
-
# OR Install Globally
|
|
26
|
-
npm install -g fluxflow-cli
|
|
27
|
-
fluxflow-cli
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
*The agent will prompt you for your API Key on the first run and store it securely in an encrypted vault.*
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
52
|
-
- **
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
- **
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- **
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
- **
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
- **
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
85
|
-
- **
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
- **
|
|
98
|
-
- **
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- `--
|
|
114
|
-
- `--
|
|
115
|
-
- `--
|
|
116
|
-
- `--
|
|
117
|
-
- `--
|
|
118
|
-
- `--
|
|
119
|
-
- `--
|
|
120
|
-
- `--
|
|
121
|
-
- `--
|
|
122
|
-
- `--
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- **
|
|
130
|
-
- **
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
1
|
+
# ๐ Flux Flow (`fluxflow-cli`)
|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
<p align="left">
|
|
5
|
+
<a href="https://github.com/KushalRoyChowdhury/fluxflow-cli"><img src="https://img.shields.io/badge/FluxFlow-v3-blue?style=plastic" alt="FluxFlow Version"></a>
|
|
6
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic" alt="License MIT"></a>
|
|
7
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/Node-%3E%3D20-green?style=plastic" alt="Node Compatibility"></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
### *The High-Fidelity Agentic CLI with Sub-Agents for the Flux Era.*
|
|
11
|
+
|
|
12
|
+
๐ **[Official Documentation](https://fluxflow-cli.onrender.com/)**
|
|
13
|
+
|
|
14
|
+
**Flux Flow** is not just another CLIโit's a high-speed, sassy, and goal-oriented CLI AI Agent powered by multi-provider frontier models (Google Gemini, DeepSeek, OpenRouter, and more). Designed for developers who demand a premium UI/UX while managing complex file-system tasks, web research, and autonomous workflows.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## ๐ Instant Ignition (No Setup Required)
|
|
19
|
+
You don't even need to install it. Just fire up your terminal and run:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Run instantly (Zero Setup)
|
|
23
|
+
npx fluxflow-cli
|
|
24
|
+
|
|
25
|
+
# OR Install Globally
|
|
26
|
+
npm install -g fluxflow-cli
|
|
27
|
+
fluxflow-cli
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
*The agent will prompt you for your API Key on the first run and store it securely in an encrypted vault.*
|
|
31
|
+
|
|
32
|
+
- **Multi-Provider Support**: Choose your preferred engine!
|
|
33
|
+
- **Google GenAI** (Gemini & Gemma models)
|
|
34
|
+
- **DeepSeek** (Deepseek v4 Models)
|
|
35
|
+
- **NVIDIA** (Access to open models)
|
|
36
|
+
- **Ollama** (Local Models / Ollama Cloud Models)
|
|
37
|
+
- **Mistral** (Access to selected models; *Experimental*)
|
|
38
|
+
- **OpenRouter** (Access to hundreds of models; *Experimental*)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## โจ Why Flux Flow?
|
|
43
|
+
|
|
44
|
+
### ๐จ **Premium Visual Sovereignty**
|
|
45
|
+
Experience a terminal UI that feels alive. Built with **Ink** and **React**, Flux Flow features:
|
|
46
|
+
- **Dynamic Status Bar**: Real-time telemetry showing your "Neural Headroom" (token usage), Thinking Level, and Session ID.
|
|
47
|
+
|
|
48
|
+
### ๐ **High-Fidelity IDE Companion**
|
|
49
|
+
Flux Flow now pairs with a dedicated VS Code extension to bridge the gap between terminal and editor:
|
|
50
|
+
- **Surgical Diagnostic Sync**: Proactive background scanning for errors. If your project breaks, a "Magic Wand" icon $(\text{sparkle})$ appears in your editor title bar for an instant AI fix.
|
|
51
|
+
- **Live Status Heartbeat**: The VS Code Status Bar acts as a live feed, showing the agent's current task (*Thinking*, *Web Searching*, *Patching*, etc.).
|
|
52
|
+
- **Clickable Terminal Links**: Jump from the terminal output straight to your code with clickable file:line links.
|
|
53
|
+
- **Right-Click Integration**: "FluxFlow > Chat" is available in the editor, explorer, and tab bars, even when no files are open.
|
|
54
|
+
- **Selection-Driven Reasoning**: Select a block of code and ask "What does this do?"โthe agent receives your selection instantly.
|
|
55
|
+
- **Universal Compatibility**: Works flawlessly with VS Code, Cursor, VSCodium, Trae, and Antigravity.
|
|
56
|
+
|
|
57
|
+
### ๐๏ธ **Native Multimodality**
|
|
58
|
+
Flux Flow can now see! Use the `view_file` tool to analyze images (JPG, PNG) or deep-dive into PDF technical papers. The agent extracts high-fidelity visual context natively, making it a true multimodal companion.
|
|
59
|
+
|
|
60
|
+
### ๐ **Document Engineering Suite**
|
|
61
|
+
Need a report or a presentation? Just ask. Flux Flow features a high-fidelity "Printing Press" that generates professional, branded documents natively:
|
|
62
|
+
- **PDF**: Branded documents from HTML/CSS with automatic watermarking.
|
|
63
|
+
- **DOCX**: Native Word documents with multi-page support and automatic numbering.
|
|
64
|
+
|
|
65
|
+
### โฑ๏ธ **Codebase Time Travel (Git-less Reversion)**
|
|
66
|
+
Refactor and build with absolute fearlessness. Flux Flow maintains transaction-based secure snapshots of files before they are generated or edited:
|
|
67
|
+
- **Instant Rollback**: Revert your workspace files (source code, generated documents, images) to their exact state prior to any selected prompt in the history.
|
|
68
|
+
- **Double-ESC Shortcut**: Press `ESC` twice while idle to pop open a sleek selection modal.
|
|
69
|
+
- **`/revert` Command**: Run the `/revert` command directly in the chat to open the checkpoint viewer.
|
|
70
|
+
|
|
71
|
+
### ๐ **Self-Healing Infrastructure**
|
|
72
|
+
Zero setup means zero setup. On first run, Flux Flow performs an integrity check and autonomously installs its own Chromium engine if needed, ensuring features like PDF generation work 100% of the time without manual intervention.
|
|
73
|
+
|
|
74
|
+
- **Archived Terminal Flow**: See execution outputs transform from live elements into permanent conversation records.
|
|
75
|
+
- **Rich Aesthetics**: High-contrast, sleek design with smooth transitions and micro-animations.
|
|
76
|
+
|
|
77
|
+
### ๐ง **The Dual-Intelligence System**
|
|
78
|
+
- **Flux Mode (Dev)**: High-speed, agentic problem solving for massive coding tasks.
|
|
79
|
+
- **Flow Mode (Chat)**: Optimized for high-quality conversation and web-assisted reasoning.
|
|
80
|
+
|
|
81
|
+
### ๐ก๏ธ **Digital Fortress Governance**
|
|
82
|
+
Security isn't an afterthought; it's a boundary.
|
|
83
|
+
- **Sandbox Presets**: Choose from **Strict**, **Balanced**, **Autonomous**, or **Custom** security profiles to control agent autonomy.
|
|
84
|
+
- **Granular Command Policies**: Configure Auto-Approve (`Auto` / `Read-Only` / `None`), Auto-Disallow (`Auto` / `Destructive` / `None`), Network Access toggle, and Auto-Approve Git Commits independently.
|
|
85
|
+
- **External Path Hardlock**: Restricts the agent to your Current Working Directory (CWD) unless you explicitly unlock it.
|
|
86
|
+
- **Human-in-the-Loop (HITL)**: Every file write and terminal command requires your high-fidelity approval.
|
|
87
|
+
|
|
88
|
+
### ๐งน **The Background Janitor**
|
|
89
|
+
While you move at high speed, the Janitor follows behindโrefining session titles, compressing data, and ensuring your context window remains at absolute peak performance.
|
|
90
|
+
|
|
91
|
+
### ๐ค **Autonomous Subagent System**
|
|
92
|
+
Delegate complex tasks to subagents. Spawns blocking subagents (`invokeSync`) or asynchronous background subagents (`invoke`) with distinct telemetry and silent background logging. Built-in transaction-safe reversion logs all subagent changes under the active turn, preserving rollback security.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## ๐ ๏ธ Key Capabilities
|
|
97
|
+
- **Deep File-System Interaction**: Edit, move, and refactor code across multiple files with atomic precision.
|
|
98
|
+
- **Real-Time Web Intelligence**: Autonomous web-searching via DuckDuckGo for live news and technical research.
|
|
99
|
+
- **Autonomous Project Alignment**: Automatically detects and adheres to project-specific instructions in `Agent.md`, `Skills.md`, and `Fluxflow.md` for high-fidelity alignment with your coding standards and custom workflows.
|
|
100
|
+
|
|
101
|
+
- **Persistent Memory**: The agent learns from your preferences and project requirements across sessions.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## ๐ป CLI Startup Arguments
|
|
106
|
+
Customize your session parameters directly from your console launch command:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
fluxflow [options]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Supported Flags:
|
|
113
|
+
- `--model <model-name>`: Temporary override for the active AI model (e.g., `gemini-2.5-pro`). Keeps settings file untouched.
|
|
114
|
+
- `--memory <on | off>`: Toggle persistent long-term agent memory for the session.
|
|
115
|
+
- `--resume <session-id>`: Resume a previous chat session programmatically.
|
|
116
|
+
- `--update <check | latest>`: Manually run an update check (`check`) or execute latest update setup (`latest`).
|
|
117
|
+
- `--package <npm | pnpm | yarn | bun>`: Override default package manager to run core application updates.
|
|
118
|
+
- `--auto-del <1d | 7d | 30d>`: Set automated chat log deletion schedule.
|
|
119
|
+
- `--yolo <on | off>`: Toggle autonomous execution permission.
|
|
120
|
+
- `--external-access <on | off>`: Toggle permission to let agent read files outside CWD.
|
|
121
|
+
- `--thinking <Fast | Low | Medium/Standard | High | xHigh>`: Override thinking level for reasoning depth. `Medium` and `Standard` is the same (Deepseek compatibility).
|
|
122
|
+
- `--key <key@google | key@deepseek | key@openrouter>`: Set API key and provider.
|
|
123
|
+
- `--provider <google | deepseek | openrouter>`: Override default provider.
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## โ๏ธ Configuration
|
|
128
|
+
Type `/settings` in-app to live-configure:
|
|
129
|
+
- **Thinking Level**: Fast (No Reasoning), Low, Medium, High, xHigh (Extended Reasoning).
|
|
130
|
+
- **Sandbox Preset**: Strict, Balanced, Autonomous, or Custom security profiles.
|
|
131
|
+
- **Security Perimeter**: Toggle External Workspace access, Network Access, and Git Commit auto-approval.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## ๐ License
|
|
136
|
+
MIT ยฉ 2026 Flux Flow.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
*Forged with โก and ๐งฌ. Welcome to the FluxFlow.*
|
package/dist/fluxflow.js
CHANGED
|
@@ -795,7 +795,8 @@ var init_settings = __esm({
|
|
|
795
795
|
SubAgentProvider: "",
|
|
796
796
|
dynamicDirAwareness: false,
|
|
797
797
|
indentationTree: true,
|
|
798
|
-
ollamaEndpoint: "Cloud"
|
|
798
|
+
ollamaEndpoint: "Cloud",
|
|
799
|
+
compressToolResults: false
|
|
799
800
|
},
|
|
800
801
|
profileData: {
|
|
801
802
|
name: null,
|
|
@@ -2936,7 +2937,7 @@ var init_text = __esm({
|
|
|
2936
2937
|
}
|
|
2937
2938
|
return { content: finalContent, results };
|
|
2938
2939
|
};
|
|
2939
|
-
generateHighFidelityDiff = (originalContent, finalContent, patchResults, threshold = 8) => {
|
|
2940
|
+
generateHighFidelityDiff = (originalContent, finalContent, patchResults, threshold = 8, compressToolResults = false) => {
|
|
2940
2941
|
if (!patchResults || patchResults.length === 0) return "";
|
|
2941
2942
|
const allLinesOriginal = originalContent.split(/\r?\n/);
|
|
2942
2943
|
const allLinesFinal = finalContent.split(/\r?\n/);
|
|
@@ -3040,6 +3041,24 @@ var init_text = __esm({
|
|
|
3040
3041
|
currentFinalLineIdx++;
|
|
3041
3042
|
}
|
|
3042
3043
|
}
|
|
3044
|
+
if (compressToolResults) {
|
|
3045
|
+
const header = `[DIFF_START]
|
|
3046
|
+
`;
|
|
3047
|
+
const body = diffText.substring(header.length);
|
|
3048
|
+
const sep = `[UI_CONTEXT] ${separatorLine}
|
|
3049
|
+
`;
|
|
3050
|
+
const blocks = body.split(sep);
|
|
3051
|
+
const processedBlocks = blocks.map((block) => {
|
|
3052
|
+
const lines = block.split("\n").filter((l) => l.trim() !== "");
|
|
3053
|
+
if (lines.length > 45) {
|
|
3054
|
+
return `[[VERIFIED]]
|
|
3055
|
+
${block}
|
|
3056
|
+
[[/VERIFIED]]`;
|
|
3057
|
+
}
|
|
3058
|
+
return block;
|
|
3059
|
+
});
|
|
3060
|
+
diffText = header + processedBlocks.join(sep);
|
|
3061
|
+
}
|
|
3043
3062
|
diffText += `[DIFF_END]`;
|
|
3044
3063
|
return flattenString(diffText);
|
|
3045
3064
|
};
|
|
@@ -7012,7 +7031,7 @@ ${mode === "Flux" ? `- JSON ESCAPE ALL LITERAL ESCAPE SEQUENCES IN TOOL ARGUMENT
|
|
|
7012
7031
|
${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative; FIRST ARGUMENT, path separator: '/') -
|
|
7013
7032
|
- [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. ${aiProvider !== "Google" ? `${isMultiModal ? `Supports images/docs` : ""}` : `Supports images/docs`}
|
|
7014
7033
|
- [tool:functions.ReadFolder(path="...", recurse="integer 1-3 optional, default: 1")]. DIR Contents + File Size. Minimize recursion
|
|
7015
|
-
- [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", searchContent1="string OR ^LINE:start..end$", newContent1="...", ...MAX15)].
|
|
7034
|
+
- [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", searchContent1="search string OR ^LINE:start..end$", newContent1="...", ...MAX15)]. Line Range MUST for large blocks AND escape sequences. ^...$ MUST for line ranges. Verify diffs
|
|
7016
7035
|
- [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
7017
7036
|
- [tool:functions.SearchKeyword(keyword="...", path="optional, dir/file/glob/regex", fuzzy="bool optional, default: false", regex="bool optional, default: auto")]. path scopes search. Find definitions, logic, relevant code
|
|
7018
7037
|
- [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `POWERSHELL` : `WINDOWS CMD` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
|
|
@@ -7917,7 +7936,8 @@ function SettingsMenu({
|
|
|
7917
7936
|
{ label: "Sub-Agent Model", value: "subAgentModel", status: systemSettings2.CustomSubAgent && systemSettings2.SubAgentModel ? systemSettings2.SubAgentModel : "Default" },
|
|
7918
7937
|
{ label: "Preserve Thinking", value: "preserveThinking", status: systemSettings2.preserveThinking !== false ? "ON" : "OFF" },
|
|
7919
7938
|
{ label: "Dynamic Directory Awareness", value: "dynamicDirAwareness", status: systemSettings2.dynamicDirAwareness ? "ON" : "OFF" },
|
|
7920
|
-
{ label: "Directory Tree Design", value: "indentationTree", status: systemSettings2.indentationTree !== false ? "Modern" : "Classic (deprecated)" }
|
|
7939
|
+
{ label: "Directory Tree Design", value: "indentationTree", status: systemSettings2.indentationTree !== false ? "Modern" : "Classic (deprecated)" },
|
|
7940
|
+
{ label: "Compact Large Tool Results", value: "compressToolResults", status: systemSettings2.compressToolResults ? "ON" : "OFF" }
|
|
7921
7941
|
// { label: 'Download Language Parsers', value: 'parserDownload', status: 'ACTION' } // Dont remove this comment
|
|
7922
7942
|
];
|
|
7923
7943
|
default:
|
|
@@ -8178,6 +8198,12 @@ function SettingsMenu({
|
|
|
8178
8198
|
saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
|
|
8179
8199
|
return newSysSettings;
|
|
8180
8200
|
});
|
|
8201
|
+
} else if (item.value === "compressToolResults") {
|
|
8202
|
+
setSystemSettings((s) => {
|
|
8203
|
+
const newSysSettings = { ...s, compressToolResults: !s.compressToolResults };
|
|
8204
|
+
saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
|
|
8205
|
+
return newSysSettings;
|
|
8206
|
+
});
|
|
8181
8207
|
} else if (item.value === "subAgents") {
|
|
8182
8208
|
setSystemSettings((s) => {
|
|
8183
8209
|
const newSysSettings = { ...s, subAgents: s.subAgents === false ? true : false };
|
|
@@ -11897,6 +11923,7 @@ var init_write_file = __esm({
|
|
|
11897
11923
|
"src/tools/write_file.js"() {
|
|
11898
11924
|
init_arg_parser();
|
|
11899
11925
|
init_revert();
|
|
11926
|
+
init_settings();
|
|
11900
11927
|
write_file = async (args, context = {}) => {
|
|
11901
11928
|
let { path: targetPath, content } = parseArgs(args);
|
|
11902
11929
|
if (!targetPath) return 'ERROR: Missing "path" argument for write_file.';
|
|
@@ -11936,7 +11963,7 @@ ${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
|
|
|
11936
11963
|
const verifiedLineCount = verifiedLines.length;
|
|
11937
11964
|
if (verifiedSize === 0 && originalSize > 0) {
|
|
11938
11965
|
verifiedContent = null;
|
|
11939
|
-
return `ERROR: CRITICAL FAILURE: Verification failed. File [${targetPath}] is empty on disk
|
|
11966
|
+
return `ERROR: CRITICAL FAILURE: Verification failed. File [${targetPath}] is empty on disk!`;
|
|
11940
11967
|
}
|
|
11941
11968
|
let snippet = "";
|
|
11942
11969
|
if (verifiedLineCount <= 100) {
|
|
@@ -11951,11 +11978,22 @@ ${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
|
|
|
11951
11978
|
${tail}`;
|
|
11952
11979
|
}
|
|
11953
11980
|
verifiedContent = null;
|
|
11954
|
-
|
|
11981
|
+
const { systemSettings: systemSettings2 } = await loadSettings();
|
|
11982
|
+
let resultString = `SUCCESS: File [${targetPath}] saved.
|
|
11955
11983
|
- Stats: [${verifiedLineCount} lines, ${(verifiedSize / 1024).toFixed(1)} KB]
|
|
11956
11984
|
${ancestry}- Content Preview:
|
|
11957
11985
|
|
|
11958
11986
|
${snippet}`;
|
|
11987
|
+
if (systemSettings2?.compressToolResults && verifiedLineCount > 60) {
|
|
11988
|
+
const contentLines = finalContent.split(/\r?\n/);
|
|
11989
|
+
const headMatches = contentLines.slice(0, 25).join("\n") === verifiedLines.slice(0, 25).join("\n");
|
|
11990
|
+
const tailMatches = contentLines.slice(-25).join("\n") === verifiedLines.slice(-25).join("\n");
|
|
11991
|
+
if (headMatches && tailMatches) {
|
|
11992
|
+
resultString = `[[SAME]]
|
|
11993
|
+
${resultString}`;
|
|
11994
|
+
}
|
|
11995
|
+
}
|
|
11996
|
+
return resultString;
|
|
11959
11997
|
} catch (err) {
|
|
11960
11998
|
const errorMsg = err instanceof Error ? err.message : String(err);
|
|
11961
11999
|
return `ERROR: Failed to write file [${targetPath}]: ${errorMsg}`;
|
|
@@ -11973,6 +12011,7 @@ var init_update_file = __esm({
|
|
|
11973
12011
|
init_arg_parser();
|
|
11974
12012
|
init_revert();
|
|
11975
12013
|
init_text();
|
|
12014
|
+
init_settings();
|
|
11976
12015
|
update_file = async (args, context = {}) => {
|
|
11977
12016
|
const parsed = parseArgs(args);
|
|
11978
12017
|
const targetPath = parsed.path;
|
|
@@ -12000,7 +12039,8 @@ ${failures.map((f) => ` \u2022 ${f.error}`).join("\n")}`;
|
|
|
12000
12039
|
}
|
|
12001
12040
|
await RevertManager.recordFileChange(absolutePath, originalContent);
|
|
12002
12041
|
fs16.writeFileSync(absolutePath, finalContent, "utf8");
|
|
12003
|
-
const
|
|
12042
|
+
const { systemSettings: systemSettings2 } = await loadSettings();
|
|
12043
|
+
const diffText = generateHighFidelityDiff(originalContent, finalContent, results, 12, systemSettings2?.compressToolResults);
|
|
12004
12044
|
if (failures.length > 0) {
|
|
12005
12045
|
return `SUCCESS: File [${targetPath}] updated with some blocks failed. [${successes.length}/${patchPairs.length}] blocks applied.
|
|
12006
12046
|
|
|
@@ -15113,7 +15153,7 @@ import dotenv from "dotenv";
|
|
|
15113
15153
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
15114
15154
|
import path26, { normalize } from "path";
|
|
15115
15155
|
import fs28 from "fs";
|
|
15116
|
-
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_CALL_ANY, RE_TOOL_PARTIAL_ARGS_FALLBACK, RE_STRIP_QUOTES, RE_BACKSLASH_SLASH, RE_STRIP_THINK_CLOSED, RE_STRIP_THINK_OPEN, RE_STRIP_THINK_SIMPLE, RE_STRIP_THINK_FULL, RE_BACKTICK_SPAN, RE_BACKTICK_OPEN, RE_KIMI_TOOL_CALL, RE_KIMI_JSON_PAIR, RE_KIMI_SECTION_BEGIN, RE_KIMI_SECTION_END, client, globalSettings, systemInstructionCache, colorMainWords, withRetry, TERMINATION_SIGNAL, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getMistralStream, getNVIDIAStream, wrapNvidiaStreamWithQueueDepth, getOpenRouterStream, getOllamaStream, signalTermination, isTerminationSignaled, TOOL_LABELS2, getToolDetail, getGoogleClient, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, REGEX_PLACEHOLDER_ARG, REGEX_PLACEHOLDER_VAL, isPlaceholderVal, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
|
|
15156
|
+
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_CALL_ANY, RE_TOOL_PARTIAL_ARGS_FALLBACK, RE_STRIP_QUOTES, RE_BACKSLASH_SLASH, RE_STRIP_THINK_CLOSED, RE_STRIP_THINK_OPEN, RE_STRIP_THINK_SIMPLE, RE_STRIP_THINK_FULL, RE_BACKTICK_SPAN, RE_BACKTICK_OPEN, RE_KIMI_TOOL_CALL, RE_KIMI_JSON_PAIR, RE_KIMI_SECTION_BEGIN, RE_KIMI_SECTION_END, RE_TOOL_WRAPPER_CODE_FENCE, RE_XML_TAG_OPEN, RE_XML_TAG_CLOSE, client, globalSettings, systemInstructionCache, colorMainWords, withRetry, TERMINATION_SIGNAL, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getMistralStream, getNVIDIAStream, wrapNvidiaStreamWithQueueDepth, getOpenRouterStream, getOllamaStream, signalTermination, isTerminationSignaled, TOOL_LABELS2, getToolDetail, getGoogleClient, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, REGEX_PLACEHOLDER_ARG, REGEX_PLACEHOLDER_VAL, isPlaceholderVal, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
|
|
15117
15157
|
var init_ai = __esm({
|
|
15118
15158
|
async "src/utils/ai.js"() {
|
|
15119
15159
|
init_dist();
|
|
@@ -15160,6 +15200,9 @@ var init_ai = __esm({
|
|
|
15160
15200
|
RE_KIMI_JSON_PAIR = /"([^"]+)"\s*:\s*(?:"([^"]*)"|(\d+)|true|false|null)/g;
|
|
15161
15201
|
RE_KIMI_SECTION_BEGIN = /<\|\s*tool_calls_section_begin\s*\|>/gi;
|
|
15162
15202
|
RE_KIMI_SECTION_END = /<\|\s*tool_calls_section_end\s*\|>/gi;
|
|
15203
|
+
RE_TOOL_WRAPPER_CODE_FENCE = /```(?:tool|yaml|function|json)?\s*\n?([\s\S]*?)\n?\```/gi;
|
|
15204
|
+
RE_XML_TAG_OPEN = /<(\w+)(?:[^>]*)>\r?\n?/gi;
|
|
15205
|
+
RE_XML_TAG_CLOSE = /\r?\n?<\/\w+(?:[^>]*)>/gi;
|
|
15163
15206
|
client = null;
|
|
15164
15207
|
globalSettings = {};
|
|
15165
15208
|
systemInstructionCache = { key: null, value: null };
|
|
@@ -17964,7 +18007,7 @@ ${combinedNudge}`;
|
|
|
17964
18007
|
const THINK_OPEN_PH = "___THINK_OPEN_TAG___";
|
|
17965
18008
|
const THINK_CLOSE_PH = "___THINK_CLOSE_TAG___";
|
|
17966
18009
|
text = text.replace("<think>", THINK_OPEN_PH).replace("</think>", THINK_CLOSE_PH);
|
|
17967
|
-
text = text.replace(
|
|
18010
|
+
text = text.replace(RE_TOOL_WRAPPER_CODE_FENCE, (match2, inner) => {
|
|
17968
18011
|
if (inner.includes("[tool:")) return inner.trim();
|
|
17969
18012
|
return match2;
|
|
17970
18013
|
});
|
|
@@ -17973,11 +18016,11 @@ ${combinedNudge}`;
|
|
|
17973
18016
|
while (i < text.length) {
|
|
17974
18017
|
const toolIdx = text.indexOf("[tool:", i);
|
|
17975
18018
|
if (toolIdx === -1) {
|
|
17976
|
-
result += text.substring(i).replace(
|
|
18019
|
+
result += text.substring(i).replace(RE_XML_TAG_OPEN, "").replace(RE_XML_TAG_CLOSE, "");
|
|
17977
18020
|
break;
|
|
17978
18021
|
}
|
|
17979
18022
|
const beforeTool = text.substring(i, toolIdx);
|
|
17980
|
-
result += beforeTool.replace(
|
|
18023
|
+
result += beforeTool.replace(RE_XML_TAG_OPEN, "").replace(RE_XML_TAG_CLOSE, "");
|
|
17981
18024
|
const endToolIdx = text.indexOf("]", toolIdx);
|
|
17982
18025
|
if (endToolIdx === -1) {
|
|
17983
18026
|
result += text.substring(toolIdx);
|
|
@@ -19411,7 +19454,7 @@ ${tail}`;
|
|
|
19411
19454
|
}
|
|
19412
19455
|
let result2 = "";
|
|
19413
19456
|
if (normToolName === "update_file") {
|
|
19414
|
-
const diffReport = generateHighFidelityDiff(originalContentForReporting, finalContent, patchResults, 12);
|
|
19457
|
+
const diffReport = generateHighFidelityDiff(originalContentForReporting, finalContent, patchResults, 12, settings?.compressToolResults || globalSettings?.systemSettings?.compressToolResults);
|
|
19415
19458
|
result2 = `SUCCESS: File [${filePath}] updated via IDE Companion (May have user edits). [${patchResults.length}/${requestedPatchCount}] blocks applied.
|
|
19416
19459
|
|
|
19417
19460
|
${diffReport}`;
|
|
@@ -19689,10 +19732,25 @@ ${snippet2}`;
|
|
|
19689
19732
|
await incrementUsage("toolFailure");
|
|
19690
19733
|
if (settings.onToolResult) settings.onToolResult("failure", normToolName);
|
|
19691
19734
|
}
|
|
19692
|
-
const
|
|
19735
|
+
const rawResult = (result || "").toString().replaceAll("[UI_CONTEXT]", "");
|
|
19736
|
+
let processedResult = rawResult;
|
|
19737
|
+
if (processedResult.includes("[[VERIFIED]]")) {
|
|
19738
|
+
processedResult = processedResult.replace(/\[\[VERIFIED\]\][\s\S]*?\[\[\/VERIFIED\]\]/g, "[SYSTEM NOTE]: Patch Block matched & applied successfully. Large Block omitted to conserve context.\n");
|
|
19739
|
+
}
|
|
19740
|
+
let aiContent;
|
|
19741
|
+
if (processedResult.startsWith("[[SAME]]")) {
|
|
19742
|
+
const cleanText = processedResult.replace(/^\[\[SAME\]\]\s*\r?\n?/, "");
|
|
19743
|
+
const lines = cleanText.split(/\r?\n/);
|
|
19744
|
+
const successLines = lines.filter((l) => l.startsWith("SUCCESS:") || l.trim().startsWith("- Stats:"));
|
|
19745
|
+
const headerPart = successLines.length > 0 ? successLines.join("\n") : lines.slice(0, 2).join("\n");
|
|
19746
|
+
aiContent = `[TOOL RESULT]: ${headerPart}
|
|
19747
|
+
[SYSTEM NOTE]: Content verified and persisted to disk. Full preview omitted to conserve context.`;
|
|
19748
|
+
} else {
|
|
19749
|
+
aiContent = `[TOOL RESULT]: ${processedResult}`;
|
|
19750
|
+
}
|
|
19693
19751
|
toolResults.push({ role: "user", text: aiContent, binaryPart });
|
|
19694
19752
|
anyToolExecutedInThisTurn = true;
|
|
19695
|
-
let uiContent = `[TOOL RESULT]: ${result || ""}`;
|
|
19753
|
+
let uiContent = `[TOOL RESULT]: ${result.replaceAll("[[VERIFIED]]\n", "").replaceAll("\n[[/VERIFIED]]", "") || ""}`;
|
|
19696
19754
|
if (normToolName === "view_file" || normToolName === "web_scrape" || normToolName === "file_map") {
|
|
19697
19755
|
uiContent = `[TOOL RESULT]: ${label} (Context Locked for UI Clarity)`;
|
|
19698
19756
|
}
|
|
@@ -19870,31 +19928,33 @@ ${recoveryText}`
|
|
|
19870
19928
|
}
|
|
19871
19929
|
for (let i = waitTime / 1e3; i > 0; i--) {
|
|
19872
19930
|
if (TERMINATION_SIGNAL) break;
|
|
19873
|
-
yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [Retrying in ${i}s]...` };
|
|
19931
|
+
yield { type: "status", content: `Error Occured. Recovering Stream (${inStreamRetryCount}/${MAX_RETRIES}) [Retrying in ${i.toFixed(0)}s]...` };
|
|
19874
19932
|
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
19875
19933
|
}
|
|
19876
19934
|
yield { type: "status", content: `Error Occured. Recovering Stream...` };
|
|
19877
19935
|
} else {
|
|
19878
19936
|
throw new Error(`Stream collapsed too many times. (Failed to resolve ${MAX_RETRIES} times)
|
|
19879
|
-
Error
|
|
19937
|
+
Error log can be found in \`/export logs\``);
|
|
19880
19938
|
}
|
|
19881
19939
|
} else {
|
|
19882
19940
|
if (retryCount <= MAX_RETRIES) {
|
|
19883
19941
|
retryCount++;
|
|
19884
19942
|
inStreamRetryCount = 1;
|
|
19885
19943
|
accumulatedContext = "";
|
|
19886
|
-
const
|
|
19944
|
+
const baseWaitTime = Math.min(1e3 * Math.pow(2, retryCount - 1), 32e3);
|
|
19945
|
+
const jitter = 0.8 + Math.random() * 0.4;
|
|
19946
|
+
const waitTime = Math.round(baseWaitTime * jitter);
|
|
19887
19947
|
isInitialAttempt = true;
|
|
19888
19948
|
yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${(waitTime / 1e3).toFixed(0)}s]` };
|
|
19889
19949
|
for (let i = waitTime / 1e3; i > 0; i--) {
|
|
19890
19950
|
if (TERMINATION_SIGNAL) break;
|
|
19891
|
-
yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${i}s]` };
|
|
19951
|
+
yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${i.toFixed(0)}s]` };
|
|
19892
19952
|
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
19893
19953
|
}
|
|
19894
19954
|
yield { type: "status", content: `Trying to reach ${modelName}` };
|
|
19895
19955
|
} else {
|
|
19896
19956
|
throw new Error(`Model ${modelName} cannot be reached. (Failed ${MAX_RETRIES} times)
|
|
19897
|
-
Error
|
|
19957
|
+
Error log can be found in \`/export logs\``);
|
|
19898
19958
|
}
|
|
19899
19959
|
}
|
|
19900
19960
|
}
|
|
@@ -20140,7 +20200,7 @@ ${isAsync ? `- [tool:functions.AskMain(question="...")]. Communicate with PARENT
|
|
|
20140
20200
|
- [tool:functions.SearchKeyword(keyword="...", path="optional, dir/file/glob/regex", fuzzy="bool optional, default: false", regex="bool optional, default: auto")]. path scopes search. Find definitions, logic, relevant code
|
|
20141
20201
|
- [tool:functions.ReadFolder(path="...", recurse="integer 1-3 optional, default: 1")]. DIR Contents + File Size. Minimize recursion
|
|
20142
20202
|
- [tool:functions.ReadFile(path="...", startLine="integer", endLine="integer")]. View files
|
|
20143
|
-
- [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", searchContent1="string OR ^LINE:start..end$", newContent1="...", ...MAX15)].
|
|
20203
|
+
- [tool:functions.PatchFile(path="...", allowMultiple="bool optional, default: false", searchContent1="search string OR ^LINE:start..end$", newContent1="...", ...MAX15)]. Line Range MUST for large blocks AND escape sequences. ^...$ MUST for line ranges. Verify diffs
|
|
20144
20204
|
- [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile. VERIFY IMPORTS
|
|
20145
20205
|
- [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL` : `WINDOWS CMD` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user`.trim();
|
|
20146
20206
|
const systemInstructionSubAgent = `=== START SYSTEM PROMPT ===
|
|
@@ -23069,7 +23129,7 @@ function App({ args = [] }) {
|
|
|
23069
23129
|
{
|
|
23070
23130
|
cmd: "/model",
|
|
23071
23131
|
desc: "Select Agent Model",
|
|
23072
|
-
subs:
|
|
23132
|
+
subs: getModels(aiProvider, apiTier)
|
|
23073
23133
|
},
|
|
23074
23134
|
{
|
|
23075
23135
|
cmd: "/wildcard-tooling",
|
|
@@ -26169,7 +26229,6 @@ Selection: ${val}`,
|
|
|
26169
26229
|
url = "https://build.nvidia.com/settings/api-keys";
|
|
26170
26230
|
label = "billing";
|
|
26171
26231
|
}
|
|
26172
|
-
return /* @__PURE__ */ React16.createElement(Text16, { color: colors.textMuted, dimColor: true, italic: true }, "Paid API Strategy has more models. Configure ", /* @__PURE__ */ React16.createElement(Text16, { color: colors.secondary, underline: true }, `\x1B]8;;${url}\x07${label}\x1B]8;;\x07`), " & /settings");
|
|
26173
26232
|
})() : null),
|
|
26174
26233
|
visible.slice(0, suggestionVisibleCount).map((s, i) => {
|
|
26175
26234
|
const actualIdx = startIdx + i;
|