minovative-mind-cli 2.13.5 → 2.14.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 +102 -39
- package/dist/services/agent/slashCommands.js +47 -7
- package/dist/services/agent/syntaxAgent.js +13 -0
- package/dist/services/agent-tools.d.ts +1 -1
- package/dist/services/agent-tools.js +2 -2
- package/dist/services/agent.js +119 -7
- package/dist/services/ai.d.ts +19 -0
- package/dist/services/ai.js +96 -5
- package/dist/services/contextAgent.js +23 -0
- package/dist/services/investigationComplexity.js +1 -1
- package/dist/services/mentionEngine.d.ts +385 -0
- package/dist/services/mentionEngine.js +1395 -0
- package/dist/services/orchestration/investigationAgent.js +4 -1
- package/dist/services/orchestration/messageBus.d.ts +26 -3
- package/dist/services/orchestration/messageBus.js +204 -14
- package/dist/services/orchestration/orchestrator.js +4 -0
- package/dist/services/orchestration/scopedTools.js +16 -2
- package/dist/services/orchestration/subAgent.js +14 -2
- package/dist/services/proxyClient.d.ts +38 -2
- package/dist/services/proxyClient.js +42 -24
- package/dist/utils/config.d.ts +75 -0
- package/dist/utils/config.js +93 -0
- package/dist/utils/contextPrompts.d.ts +28 -4
- package/dist/utils/contextPrompts.js +70 -1
- package/dist/utils/historyPrompt.d.ts +166 -7
- package/dist/utils/historyPrompt.js +775 -30
- package/dist/utils/symbolExtractor.d.ts +111 -8
- package/dist/utils/symbolExtractor.js +616 -64
- package/dist/utils/systemPrompts.d.ts +3 -3
- package/dist/utils/systemPrompts.js +5 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ and hope for the best.
|
|
|
7
7
|
|
|
8
8
|
This CLI does the opposite — it uses a custom built agentic system called,
|
|
9
9
|
**Precision-Context Verification (PCV)** engine to feed lightweight Flash models
|
|
10
|
-
exactly the right context
|
|
10
|
+
exactly the right context via **AST-level targeted reads** and **2-tier context compression**, execute code, verify compilation, execute Property-Based Testing (PBT) suites and diff-scoped mutation audits, and self-correct (if it even needs to), until
|
|
11
11
|
the build/performance metrics are green.
|
|
12
12
|
|
|
13
13
|
> The result: **Genuine Pro reasoning accuracy at Flash-level speed and efficiency.**
|
|
@@ -82,7 +82,7 @@ Works in any terminal — SSH, Docker, CI pipelines, Vim, Windows Command Prompt
|
|
|
82
82
|
|
|
83
83
|
### 🔬 Automated SWE-bench Evaluation Runner
|
|
84
84
|
|
|
85
|
-
Evaluate the agent on SWE-bench Lite datasets with automated repo isolation, patch extraction, and public-ready telemetry reporting:
|
|
85
|
+
Evaluate the agent on SWE-bench Lite datasets with automated repo isolation, patch extraction, AST-scoped context minimization, and public-ready telemetry reporting:
|
|
86
86
|
|
|
87
87
|
```bash
|
|
88
88
|
# Run SWE-bench evaluation and generate JSON report
|
|
@@ -92,20 +92,31 @@ minovative-mind-cli eval -i test_instances.jsonl -o predictions.jsonl -r evaluat
|
|
|
92
92
|
minovative-mind-cli eval -i instances.jsonl --repo astropy/astropy --concurrency 2
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
> **Token Economics & Efficiency**: With AST-level symbol chunking (`targetElements`), SHA-256 context caching, and in-place historical tool response pruning, benchmark evaluations achieve up to **85%–95% lower token usage per instance**, eliminating token-per-minute (TPM) rate limit thrashing while preserving deep reasoning fidelity.
|
|
96
96
|
|
|
97
|
+
---
|
|
97
98
|
|
|
98
99
|
## Models
|
|
99
100
|
|
|
100
|
-
Hot-swap during a session using `/models`:
|
|
101
|
+
Minovative Mind CLI features native support for Google's Gemini 3.x reasoning capabilities (`thinking_config`), allocating dynamic thinking budgets before tool execution and code generation. Hot-swap models and customize reasoning levels during a session using `/models`:
|
|
102
|
+
|
|
103
|
+
| Model | Default Thinking Level | Best for |
|
|
104
|
+
| ------------------------- | ---------------------- | --------------------------------------------------- |
|
|
105
|
+
| **Auto** (default) | `Medium` (`MEDIUM`) | Automatically selects (3.7 Flash or 3.5 Flash Lite) |
|
|
106
|
+
| **Gemini 3.7 Flash** | `Medium` (`MEDIUM`) | Next-gen performance, reasoning & fast execution |
|
|
107
|
+
| **Gemini 3.6 Flash** | `Medium` (`MEDIUM`) | Everyday coding — fast and accurate |
|
|
108
|
+
| **Gemini 3.1 Pro** | `High` (`HIGH`) | Complex architectural changes & deep reasoning |
|
|
109
|
+
| **Gemini 3.5 Flash Lite** | `Low` (`LOW`) | Best for speed and cost efficiency |
|
|
110
|
+
|
|
111
|
+
### Native Thinking & Reasoning Levels
|
|
112
|
+
|
|
113
|
+
Gemini 3.x models support native provider-level reasoning control via `thinking_config`. When switching models or invoking `/models`, you can interactively customize the thinking depth across three streamlined developer tiers:
|
|
101
114
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| **Gemini 3.1 Pro** | Complex architectural changes |
|
|
108
|
-
| **Gemini 3.5 Flash Lite** | Best for speed and cost efficiency |
|
|
115
|
+
- **`Low` (`LOW`)**: Fast, lightweight reasoning for routine tasks, minor bug fixes, and quick code edits.
|
|
116
|
+
- **`Medium` (`MEDIUM`)**: Balanced reasoning depth for multi-file refactoring, debugging, and feature development (default for 3.7 Flash, 3.6 Flash, and Auto).
|
|
117
|
+
- **`High` (`HIGH`)**: Exhaustive chain-of-thought deliberation for complex architectural transformations, intricate algorithmic puzzles, and large-scale migrations (default for 3.1 Pro).
|
|
118
|
+
|
|
119
|
+
_(Note: Internal `Minimal` reasoning is strictly reserved for lightweight background micro-agents and is excluded from user-facing selection to ensure optimal coding performance.)_
|
|
109
120
|
|
|
110
121
|
### BYOK (Bring Your Own Key)
|
|
111
122
|
|
|
@@ -114,17 +125,21 @@ If you prefer to use your own API key instead of credits, you can configure it v
|
|
|
114
125
|
- **Configuration:** Use `/config-key` in the chat session to set and manage your API key.
|
|
115
126
|
- **Error Handling:** If your key is invalid, expired, or you hit rate limits, the CLI will report a `BYOK AI Error`. Please check your API key status in the [Google AI Studio dashboard](https://aistudio.google.com).
|
|
116
127
|
|
|
117
|
-
### Auxiliary Model Routing Defaults
|
|
128
|
+
### Auxiliary Model Routing Defaults & Reasoning Invariants
|
|
118
129
|
|
|
119
|
-
Background tasks automatically route to dedicated auxiliary models with native `responseSchema` constraints for optimal latency, cost efficiency, and structured output reliability:
|
|
130
|
+
Background tasks automatically route to dedicated auxiliary models with native `responseSchema` constraints, AST symbol extractors, persistent caches, and deterministic reasoning invariants for optimal latency, cost efficiency, and structured output reliability:
|
|
120
131
|
|
|
121
|
-
- **Intent Routing (`routeIntent`)**: `Gemini 3.7 Flash` (Temp 0, native `responseSchema`) — permissive zero-temperature classification into `SEARCH` vs `SKIP` and `CHAT` vs `EXECUTE` with resilient fallback to repository exploration.
|
|
122
|
-
- **Complexity Evaluators (`evaluateInvestigationComplexity`)**: `Gemini 3.7 Flash` (Temp 0, native `responseSchema`) — permissive parallel domain partitioning, global override detection, primary sub-path auto-focusing, and dynamic agent assignment recovery.
|
|
123
|
-
- **Context Compressor**: `Gemini 3.7 Flash` (Temp 0.2) — surgical code distillation for files exceeding 2,000 characters.
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
132
|
+
- **Intent Routing (`routeIntent`)**: `Gemini 3.7 Flash` (Temp 0, native `responseSchema`, `MINIMAL` invariant) — permissive zero-temperature classification into `SEARCH` vs `SKIP` and `CHAT` vs `EXECUTE` with resilient fallback to repository exploration.
|
|
133
|
+
- **Complexity Evaluators (`evaluateInvestigationComplexity`)**: `Gemini 3.7 Flash` (Temp 0, native `responseSchema`, `MINIMAL` invariant) — permissive parallel domain partitioning, global override detection, primary sub-path auto-focusing, and dynamic agent assignment recovery.
|
|
134
|
+
- **Context Compressor & Caching**: `Gemini 3.7 Flash` (Temp 0.2, `MINIMAL` invariant) — surgical code distillation for files exceeding 2,000 characters backed by a persistent 2-tier SHA-256 disk cache (`context_cache.json`) capped at 5MB LRU. Files under 2,000 characters retain 100% full fidelity without compression overhead.
|
|
135
|
+
- **AST Symbol Extraction & Targeted Reads**: Polyglot AST declaration extractor (`symbolExtractor.ts`) enabling granular `targetElements` symbol chunking in `read_file`, slashing input token bloat by up to 85%–95%.
|
|
136
|
+
- **In-Place Tool History Pruning**: Active working memory management preserving raw workspace file blocks while compacting historical command/test outputs across multi-turn reasoning loops.
|
|
137
|
+
- **Session Titling**: `Gemini 3.7 Flash` (Temp 0.7, native `responseSchema`, `MINIMAL` invariant) — automated concise chat session titling.
|
|
138
|
+
- **Semantic Cache Classifier**: `Gemini 3.5 Flash Lite` (Temp 0, native `responseSchema`, `MINIMAL` invariant) — intent and topic classification for cache hits.
|
|
139
|
+
- **History Summarizer**: `Gemini 3.7 Flash` (Temp 0.2, `MINIMAL` invariant) — 3-part structured conversation compression preserving recent history.
|
|
140
|
+
- **Commit Generator**: `Gemini 3.5 Flash Lite` (`MINIMAL` invariant) — conventional commit message synthesis.
|
|
141
|
+
- **Micro-Agent Safety Invariants & Normalization**: All internal background micro-agents enforce a hardcoded `MINIMAL` invariant to guarantee zero-latency execution without conversational token burn. The generation pipeline's `normalizeGenerationConfig` automatically strips unsupported internal minimal payloads before dispatching to Google's API, preventing `400 Bad Request` schema errors while ensuring user-selected thinking levels never pollute lightweight background micro-agents.
|
|
142
|
+
- **Subsystem Reasoning Budgets**: Orchestrated subsystems maintain tailored reasoning allocations: **PM Kernel Task Decomposition** operates at `HIGH` reasoning depth for optimal topological dependency sorting; **Investigation & Context Sub-Agents** operate at `MEDIUM` reasoning depth for comprehensive repository reconnaissance; **Syntax Repair Agents** operate at `LOW` reasoning depth for precise AST corrections; and **Execution Sub-Agents / Main Agent** dynamically inherit your configured model thinking level (`LOW` | `MEDIUM` | `HIGH`).
|
|
128
143
|
|
|
129
144
|
> You pay for auxiliary model background AI operations and for your selected model during chat and code execution. Use `/debug` to inspect real-time routing diagnostics.
|
|
130
145
|
|
|
@@ -136,13 +151,13 @@ Background tasks automatically route to dedicated auxiliary models with native `
|
|
|
136
151
|
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
137
152
|
| `/config-key` | Configure custom Google AI Studio API key (BYOK mode) |
|
|
138
153
|
| `/profile` | View, inspect, delete, or reset global adaptive persona memory and AI side-notes |
|
|
139
|
-
| `/models` | Hot-swap the active model
|
|
154
|
+
| `/models` | Hot-swap the active model or configure its native reasoning thinking level (`Low`, `Medium`, `High`) |
|
|
140
155
|
| `/paste` | Multi-line input mode (cancel with Ctrl+C) |
|
|
141
156
|
| `/clear` | Clear conversation history |
|
|
142
157
|
| `/debug` | Expose internal agent diagnostics |
|
|
143
158
|
| `/auto-approve` | Toggle skipping confirmation prompts for commands |
|
|
144
159
|
| `/sub-agents` | Toggle the MMAAK Engine for parallel investigation and execution (concurrency limited to 2) |
|
|
145
|
-
| `/stats` | View session and all-time statistics,
|
|
160
|
+
| `/stats` | View session and all-time statistics, token telemetry, active model settings, and live thinking level runtime telemetry |
|
|
146
161
|
| `/commit` | Generate a conventional commit message from your diff |
|
|
147
162
|
| `/revert` | Undo changes from the last turn, or toggle the revert logger |
|
|
148
163
|
| `/chats` | View, resume, rename, or delete previous chat sessions (with centralized token telemetry, Git branch, auto-approve status, and sub-agent state) |
|
|
@@ -151,6 +166,54 @@ Background tasks automatically route to dedicated auxiliary models with native `
|
|
|
151
166
|
|
|
152
167
|
---
|
|
153
168
|
|
|
169
|
+
## 🏷️ @ Context Mentions & Interactive Autocomplete
|
|
170
|
+
|
|
171
|
+
Minovative Mind CLI features real-time, interactive **@ Context Mentions** directly in your terminal prompt. Type `@` anywhere while writing a prompt to trigger fuzzy-filtered autocomplete and inject targeted codebase context, AST symbols, Git status/diffs, diagnostics, or cross-workspace files directly into the model's reasoning loop without manual copy-pasting or extra discovery tool turns.
|
|
172
|
+
|
|
173
|
+
### Interactive Autocomplete & Keyboard Navigation
|
|
174
|
+
|
|
175
|
+
When typing `@`, the interactive terminal autocomplete popup immediately renders:
|
|
176
|
+
- **10-Option Pagination**: Displays up to 10 ranked suggestions per page with dynamic page indexing `(1/10)`.
|
|
177
|
+
- **Cyan Navigation Helper**: Highlights the action footer in light blue (`Tab to insert • ↑/↓ navigate • Esc dismiss`) for clear guidance.
|
|
178
|
+
- **Keyboard Controls**:
|
|
179
|
+
- `↑` / `↓` (Up / Down Arrows): Cycle smoothly through ranked suggestions with automatic window scrolling.
|
|
180
|
+
- `Tab` or `Enter`: Select and insert the highlighted mention directly at the cursor.
|
|
181
|
+
- `Esc`: Dismiss the autocomplete dropdown.
|
|
182
|
+
- `Backspace` / Alphanumeric keys: Filter suggestions in real-time with fuzzy matching.
|
|
183
|
+
|
|
184
|
+
### Supported Mention Types
|
|
185
|
+
|
|
186
|
+
| Mention Syntax | Category Badge | Type | What it Resolves & Injects |
|
|
187
|
+
| :--- | :--- | :--- | :--- |
|
|
188
|
+
| `@<path>` or `@file:<path>` | `[file]` | **File** | Injects the complete content of a workspace file (e.g. `@src/index.ts` or `@file:package.json`). |
|
|
189
|
+
| `@<path>:<start>-<end>` | `[lines]` | **Line Range Slicing** | Surgically slices and injects only the specified line numbers (e.g. `@src/utils/config.ts:10-50`), saving tokens. |
|
|
190
|
+
| `@symbol:<name>` or `@#<name>` | `[sym]` | **AST Symbol** | Injects exact definitions of functions, classes, interfaces, types, methods, or structs (e.g. `@symbol:getUser` or `@#AuthService`) using polyglot AST extraction. |
|
|
191
|
+
| `@symbol:<path>:<name>` | `[sym]` | **Scoped Symbol** | Injects a specific symbol definition directly from a designated source file (e.g. `@symbol:src/services/auth.ts:validateToken`). |
|
|
192
|
+
| `@git:diff` or `@diff` | `[git]` | **Git Diff** | Injects the active unstaged working tree diff. |
|
|
193
|
+
| `@git:staged` | `[git]` | **Git Staged** | Injects currently staged git changes (`git diff --staged`). |
|
|
194
|
+
| `@git:status` | `[git]` | **Git Status** | Injects the current branch state and working tree status (`git status --short`). |
|
|
195
|
+
| `@git:branch` | `[git]` | **Git Branch** | Injects the current active Git branch and upstream tracking info. |
|
|
196
|
+
| `@git:log` | `[git]` | **Git Commit Log** | Injects the recent commit history (last 10 commits with hashes, authors, and messages). |
|
|
197
|
+
| `@diagnostics` / `@problems` / `@errors` | `[diag]` / `[prob]` | **Diagnostics** | Injects active compiler, linter, or syntax error diagnostics. |
|
|
198
|
+
| `@terminal` / `@console` | `[term]` | **Terminal Context** | Injects recent terminal environment context, shell environment, and command execution state. |
|
|
199
|
+
| `@<alias>/<path>` | `[ws]` | **Cross-Workspace File** | Injects file contents from registered external workspaces (e.g. `@backend/src/routes.ts` or `@frontend/src/App.tsx`). |
|
|
200
|
+
| `@<alias>` | `[ws]` | **Workspace Summary** | Injects configuration, manifest overview, and path details for a registered external workspace. |
|
|
201
|
+
|
|
202
|
+
### Visual Terminal Indicators & Status Tracking
|
|
203
|
+
|
|
204
|
+
When a prompt with `@` context mentions is submitted, the CLI provides real-time, high-contrast visual confirmation indicators in the terminal:
|
|
205
|
+
- **Success Indicators (`✔`)**: High-contrast green checkmark with dim status summary confirming successful extraction (e.g. `✔ Context @src/index.ts:1-25 (lines 1-25, 420 chars)`, `✔ Context @symbol:startServer (src/index.ts, 12 lines)`, `✔ Context @git:status (short status, clean)`, `✔ Context @diagnostics (syntax scan clean)`, `✔ Context @terminal (Darwin arm64, node v20.x)`, `✔ Context @backend (external workspace)`).
|
|
206
|
+
- **Failure Indicators (`✖`)**: Clear red indicator with explicit error reasoning when resolution fails (e.g. `✖ Context @missing.ts (File does not exist)`, `✖ Context @symbol:unknownFunc (Could not find declaration for symbol)`).
|
|
207
|
+
- **Structured Metadata Status Tracking**: Every resolved mention produces a rich `metadata` envelope (capturing line counts, char counts, symbol kind, git diff stats, and syntax scan metrics) powering both visual indicators and token-budgeted prompt injection.
|
|
208
|
+
|
|
209
|
+
### Context Resolution & Safety Architecture
|
|
210
|
+
|
|
211
|
+
- **Token Budgeting & Safety Allocation**: All parsed mentions are resolved into structured XML blocks (`<context_mentions>`) wrapped in CDATA sections with strict token budgeting and prompt injection defenses.
|
|
212
|
+
- **Read-Guard Pre-Registration (`fileReadGuard`)**: Files referenced via `@` mentions are automatically registered in the system's `fileReadGuard`. This allows the AI agent to immediately invoke file modifications (`modify_file`, `write_file`) without redundant `read_file` roundtrips, accelerating execution speed.
|
|
213
|
+
- **Multi-Workspace Path Resolution**: Automatically validates boundaries across registered workspaces via `resolveAndValidateMultiWorkspacePath`, preventing directory traversal escapes (`../`).
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
154
217
|
## 🌐 Multi-Workspace, Sub-Path Focusing & Security Guardrails
|
|
155
218
|
|
|
156
219
|
Minovative Mind CLI doesn't restrict you to a single repository. You can logically group multiple external repositories into **Master Workspaces** (Profiles) containing dedicated **Sub-Workspaces** (mapped to short aliases like `@backend` or `@frontend`).
|
|
@@ -166,28 +229,28 @@ Minovative Mind CLI doesn't restrict you to a single repository. You can logical
|
|
|
166
229
|
|
|
167
230
|
Minovative Mind CLI fundamentally supports **ALL programming languages** for chat, code generation, and execution, as it relies on Gemini's vast training data.
|
|
168
231
|
|
|
169
|
-
However, the PCV engine features deep, context-aware analysis across **12 major programming language families**. Our core advanced engines—**Smart Dependency Tracing**, **Property-Based & Mutation Verification**, **Performance Auditing** (across 9 language families), and **Ephemeral Analysis Scripts**—provide tailored support depending on the language's syntax and runtime model:
|
|
170
|
-
|
|
171
|
-
| Language Family | Supported Extensions | Dependency Tracing | Performance Auditing | Ephemeral Analysis |
|
|
172
|
-
| :--------------------------- | :------------------------------------------- | :----------------: | :------------------: | :----------------: |
|
|
173
|
-
| **JavaScript / TypeScript** | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs`, `.cjs` | ✅ | ✅ | ✅ |
|
|
174
|
-
| **Python** | `.py`, `.pyw` | ✅ | ✅ | ✅ |
|
|
175
|
-
| **Rust** | `.rs` | ✅ | ✅ | ✅ |
|
|
176
|
-
| **Go** | `.go` | ✅ | ✅ | ✅ |
|
|
177
|
-
| **C / C++** | `.c`, `.h`, `.cpp`, `.hpp`, `.cc`, `.cxx` | ✅ | ✅ | ⚠️ \* |
|
|
178
|
-
| **C#** | `.cs` | ✅ | ✅ | ❌ |
|
|
179
|
-
| **Java / Kotlin** | `.java`, `.kt`, `.kts` | ✅ | ✅ | ⚠️ \* |
|
|
180
|
-
| **PHP** | `.php` | ✅ | ✅ | ❌ |
|
|
181
|
-
| **Ruby** | `.rb` | ✅ | ✅ | ❌ |
|
|
182
|
-
| **CSS / SCSS / SASS / LESS** | `.css`, `.scss`, `.sass`, `.less` | ✅ | ❌ | ❌ |
|
|
183
|
-
| **Swift** | `.swift` | ✅ | ❌ | ❌ |
|
|
184
|
-
| **Dart** | `.dart` | ✅ | ❌ | ❌ |
|
|
232
|
+
However, the PCV engine features deep, context-aware analysis across **12 major programming language families**. Our core advanced engines—**Smart Dependency Tracing**, **AST Symbol Extraction & Chunking**, **Property-Based & Mutation Verification**, **Performance Auditing** (across 9 language families), and **Ephemeral Analysis Scripts**—provide tailored support depending on the language's syntax and runtime model:
|
|
233
|
+
|
|
234
|
+
| Language Family | Supported Extensions | Dependency Tracing | AST Extraction | Performance Auditing | Ephemeral Analysis |
|
|
235
|
+
| :--------------------------- | :------------------------------------------- | :----------------: | :------------: | :------------------: | :----------------: |
|
|
236
|
+
| **JavaScript / TypeScript** | `.js`, `.jsx`, `.ts`, `.tsx`, `.mjs`, `.cjs` | ✅ | ✅ | ✅ | ✅ |
|
|
237
|
+
| **Python** | `.py`, `.pyw` | ✅ | ✅ | ✅ | ✅ |
|
|
238
|
+
| **Rust** | `.rs` | ✅ | ✅ | ✅ | ✅ |
|
|
239
|
+
| **Go** | `.go` | ✅ | ✅ | ✅ | ✅ |
|
|
240
|
+
| **C / C++** | `.c`, `.h`, `.cpp`, `.hpp`, `.cc`, `.cxx` | ✅ | ✅ | ✅ | ⚠️ \* |
|
|
241
|
+
| **C#** | `.cs` | ✅ | ✅ | ✅ | ❌ |
|
|
242
|
+
| **Java / Kotlin** | `.java`, `.kt`, `.kts` | ✅ | ✅ | ✅ | ⚠️ \* |
|
|
243
|
+
| **PHP** | `.php` | ✅ | ✅ | ✅ | ❌ |
|
|
244
|
+
| **Ruby** | `.rb` | ✅ | ✅ | ✅ | ❌ |
|
|
245
|
+
| **CSS / SCSS / SASS / LESS** | `.css`, `.scss`, `.sass`, `.less` | ✅ | ❌ | ❌ | ❌ |
|
|
246
|
+
| **Swift** | `.swift` | ✅ | ✅ | ❌ | ❌ |
|
|
247
|
+
| **Dart** | `.dart` | ✅ | ✅ | ❌ | ❌ |
|
|
185
248
|
|
|
186
249
|
_⚠️\*Support is limited or requires custom local system tooling/environment setup._
|
|
187
250
|
|
|
188
251
|
### Why do some features only support specific languages?
|
|
189
252
|
|
|
190
|
-
1. **Dependency Tracing:** Fully supported across language families. It uses lightning-fast static regex pattern matching to resolve local import structures and determine the "blast radius" of code changes without requiring
|
|
253
|
+
1. **Dependency Tracing & AST Symbol Extraction:** Fully supported across major language families. It uses lightning-fast static regex pattern matching and AST outline parsers to resolve local import structures, extract targeted symbol definitions (`targetElements`), and determine the "blast radius" of code changes without requiring heavy compilations.
|
|
191
254
|
2. **Performance Auditing:** Executed natively across 9 major language families (JavaScript/TypeScript, Python, Go, Rust, PHP, C#, Java, C/C++, and Ruby). It uses zero-dependency, ultra-fast (<50ms) language-aware regex heuristics with comment/string stripping and line-preserving offset tracking to detect severe runtime anti-patterns (such as unbounded loops, synchronous I/O, chained array allocations, unnecessary allocations, and unclosed resources).
|
|
192
255
|
3. **Ephemeral Analysis & Property-Based Probing:** Defaults to Node.js as a safe baseline, but natively leverages host-installed runtimes (Python, Rust, Go compilers) and standard libraries whenever available in the workspace.
|
|
193
256
|
|
|
@@ -17,8 +17,8 @@ import { ProxyClient, getAndResetTurnUsage } from '../proxyClient.js';
|
|
|
17
17
|
import { checkByokSubscription } from '../auth.js';
|
|
18
18
|
import { GEMINI_MODELS, isByokEnabled } from '../../utils/config.js';
|
|
19
19
|
import { loadCredentials, updateCredentialField } from '../../utils/credentialStore.js';
|
|
20
|
-
import { getGlobalActiveModel, setGlobalActiveModel, ProxyChatSession } from '../ai.js';
|
|
21
|
-
import { loadUserProfile, deleteSideNote, clearUserProfile, getUserProfilePath
|
|
20
|
+
import { getGlobalActiveModel, setGlobalActiveModel, getModelThinkingLevel, setModelThinkingLevel, ProxyChatSession } from '../ai.js';
|
|
21
|
+
import { loadUserProfile, deleteSideNote, clearUserProfile, getUserProfilePath } from '../userProfileService.js';
|
|
22
22
|
/**
|
|
23
23
|
* @file slashCommands.ts
|
|
24
24
|
* @description Interactive slash command handler module for Minovative Mind CLI.
|
|
@@ -139,7 +139,41 @@ export async function handleSlashCommand(command, context) {
|
|
|
139
139
|
if (!p.isCancel(selectedModel)) {
|
|
140
140
|
chat.setModel(selectedModel);
|
|
141
141
|
setGlobalActiveModel(selectedModel);
|
|
142
|
-
|
|
142
|
+
const activeModelThinking = getModelThinkingLevel(selectedModel);
|
|
143
|
+
const selectedThinking = await p['select']({
|
|
144
|
+
message: `Configure Thinking Level for ${pc.cyan(selectedModel)} (Current: ${pc.cyan(activeModelThinking)})`,
|
|
145
|
+
initialValue: activeModelThinking,
|
|
146
|
+
options: [
|
|
147
|
+
{
|
|
148
|
+
value: 'LOW',
|
|
149
|
+
label: 'Low',
|
|
150
|
+
hint: 'Quick reasoning with low token overhead',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
value: 'MEDIUM',
|
|
154
|
+
label: 'Medium',
|
|
155
|
+
hint: 'Balanced reasoning for everyday coding and debugging',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
value: 'HIGH',
|
|
159
|
+
label: 'High',
|
|
160
|
+
hint: 'Deepest reasoning for complex architectural tasks',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
});
|
|
164
|
+
if (!p.isCancel(selectedThinking)) {
|
|
165
|
+
setModelThinkingLevel(selectedModel, selectedThinking);
|
|
166
|
+
if (typeof chat.setThinkingLevel === 'function') {
|
|
167
|
+
chat.setThinkingLevel(selectedThinking);
|
|
168
|
+
}
|
|
169
|
+
p.log.success(`Model successfully switched to ${pc.cyan(selectedModel)} with thinking level ${pc.cyan(selectedThinking)}`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (typeof chat.setThinkingLevel === 'function') {
|
|
173
|
+
chat.setThinkingLevel(activeModelThinking);
|
|
174
|
+
}
|
|
175
|
+
p.log.success(`Model successfully switched to ${pc.cyan(selectedModel)}`);
|
|
176
|
+
}
|
|
143
177
|
}
|
|
144
178
|
return { shouldContinue: true };
|
|
145
179
|
}
|
|
@@ -149,7 +183,10 @@ export async function handleSlashCommand(command, context) {
|
|
|
149
183
|
if (lowerCommand === '/debug') {
|
|
150
184
|
const debugMode = toggleDebugMode();
|
|
151
185
|
if (debugMode) {
|
|
152
|
-
|
|
186
|
+
const currentModel = chat.getModel();
|
|
187
|
+
const currentThinkingLevel = (typeof chat.getThinkingLevel === 'function' ? chat.getThinkingLevel() : undefined) ||
|
|
188
|
+
getModelThinkingLevel(currentModel);
|
|
189
|
+
p.log.info(`Debug mode enabled. Active Model: ${pc.cyan(currentModel)} (thinking: ${pc.cyan(currentThinkingLevel)}). Internal logs will now be shown.`);
|
|
153
190
|
}
|
|
154
191
|
else {
|
|
155
192
|
p.log.info('Debug mode disabled.');
|
|
@@ -210,12 +247,15 @@ export async function handleSlashCommand(command, context) {
|
|
|
210
247
|
else {
|
|
211
248
|
displayModel = modelStatsStr || currentModel;
|
|
212
249
|
}
|
|
250
|
+
const currentThinkingLevel = (typeof chat.getThinkingLevel === 'function' ? chat.getThinkingLevel() : undefined) ||
|
|
251
|
+
getModelThinkingLevel(currentModel);
|
|
213
252
|
const autoApprove = getApprovalMode() === 'skip-all' ? 'Enabled' : 'Disabled';
|
|
214
253
|
const subAgents = isSubAgentsEnabled() ? 'Enabled' : 'Disabled';
|
|
215
254
|
const byokEnabled = (await isByokEnabled()) ? 'Enabled' : 'Disabled';
|
|
216
255
|
p.log.step(pc.magenta('📊 Session Statistics & Status'));
|
|
217
256
|
console.log(pc.dim('----------------------------------------'));
|
|
218
257
|
console.log(`${pc.bold('AI Model:')} ${pc.cyan(displayModel)}`);
|
|
258
|
+
console.log(`${pc.bold('Thinking Level:')} ${pc.cyan(currentThinkingLevel)}`);
|
|
219
259
|
console.log(`${pc.bold('Auto-Approve:')} ${autoApprove === 'Enabled' ? pc.green(autoApprove) : pc.yellow(autoApprove)}`);
|
|
220
260
|
console.log(`${pc.bold('Sub-Agents:')} ${subAgents === 'Enabled' ? pc.green(subAgents) : pc.yellow(subAgents)}`);
|
|
221
261
|
console.log(`${pc.bold('BYOK:')} ${byokEnabled === 'Enabled' ? pc.green(byokEnabled) : pc.yellow(byokEnabled)}`);
|
|
@@ -1024,10 +1064,10 @@ Output ONLY the raw commit message text. Absolutely NO conversational preambles,
|
|
|
1024
1064
|
|
|
1025
1065
|
Strict Formatting Rules:
|
|
1026
1066
|
1. First line must follow Conventional Commits format: type(scope): description
|
|
1027
|
-
- Allowed types: feat, fix, refactor, test, docs, chore, perf, style
|
|
1028
|
-
- Subject line must be in imperative mood (e.g. "
|
|
1067
|
+
- Allowed types: feat, fix, refactor, test, docs, chore, perf, style, etc
|
|
1068
|
+
- Subject line must be in imperative mood (e.g. "added support for...", "fixed bug in...") and strictly under limited characters.
|
|
1029
1069
|
2. Leave a single blank line after the subject.
|
|
1030
|
-
3. Provide a concise bulleted list (using '-' or '*') explaining the architectural "what" and "why" of the changes based on the provided diff
|
|
1070
|
+
3. Provide a concise bulleted list (using '-' or '*') explaining the architectural "what" and "why" of the changes based on the provided diff.`;
|
|
1031
1071
|
const commitAgent = new ProxyChatSession(GEMINI_MODELS.FLASH_LITE, commitSystemPrompt, [], {});
|
|
1032
1072
|
const commitResult = await commitAgent.sendMessage(prompt);
|
|
1033
1073
|
let commitMsg = commitResult.response.text().trim();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProxyChatSession } from '../ai.js';
|
|
2
2
|
import { GEMINI_MODELS, MAX_OUTPUT_TOKENS } from '../../utils/config.js';
|
|
3
3
|
import { localValidate } from '../../utils/localSyntaxValidator.js';
|
|
4
|
+
import { debugLog } from '../../utils/logger.js';
|
|
4
5
|
/**
|
|
5
6
|
* Extracts a numeric character position from a syntax error message if present.
|
|
6
7
|
*/
|
|
@@ -100,6 +101,9 @@ Your job is to fix syntax errors in source code snippets extracted from large fi
|
|
|
100
101
|
const snippetChat = new ProxyChatSession(model, snippetSystemInstruction, [], {
|
|
101
102
|
maxOutputTokens: MAX_OUTPUT_TOKENS,
|
|
102
103
|
temperature: 0.1,
|
|
104
|
+
thinkingConfig: {
|
|
105
|
+
thinkingLevel: 'LOW',
|
|
106
|
+
},
|
|
103
107
|
});
|
|
104
108
|
const snippetPrompt = `File Path: ${filePath}
|
|
105
109
|
Line Range: Lines ${win.startLine} to ${win.endLine} (Error near position ${errorPos})
|
|
@@ -109,6 +113,7 @@ Code Snippet to Repair:
|
|
|
109
113
|
${win.snippet}
|
|
110
114
|
|
|
111
115
|
Please fix the syntax error in the snippet above and return ONLY the raw repaired code snippet:`;
|
|
116
|
+
debugLog(`Attempting AI snippet syntax repair for ${filePath} with model ${model} (thinking: LOW)...`);
|
|
112
117
|
try {
|
|
113
118
|
const result = await snippetChat.sendMessage(snippetPrompt, undefined, abortSignal);
|
|
114
119
|
const repairedSnippet = cleanOutput(result.response.text());
|
|
@@ -145,6 +150,9 @@ Your sole job is to read source code and verify or repair its syntax.
|
|
|
145
150
|
const fullChat = new ProxyChatSession(model, fullSystemInstruction, [], {
|
|
146
151
|
maxOutputTokens: MAX_OUTPUT_TOKENS,
|
|
147
152
|
temperature: 0.1,
|
|
153
|
+
thinkingConfig: {
|
|
154
|
+
thinkingLevel: 'LOW',
|
|
155
|
+
},
|
|
148
156
|
});
|
|
149
157
|
const fullPrompt = `File Path: ${filePath}
|
|
150
158
|
|
|
@@ -153,6 +161,7 @@ ${effectiveError}
|
|
|
153
161
|
|
|
154
162
|
Content:
|
|
155
163
|
${content}`;
|
|
164
|
+
debugLog(`Attempting AI full syntax repair for ${filePath} with model ${model} (thinking: LOW)...`);
|
|
156
165
|
try {
|
|
157
166
|
const result = await fullChat.sendMessage(fullPrompt, undefined, abortSignal);
|
|
158
167
|
const output = cleanOutput(result.response.text());
|
|
@@ -215,6 +224,9 @@ Your primary job is to perform fuzzy search matching and replacement on source c
|
|
|
215
224
|
const chat = new ProxyChatSession(model, systemInstruction, [], {
|
|
216
225
|
maxOutputTokens: MAX_OUTPUT_TOKENS,
|
|
217
226
|
temperature: 0.1,
|
|
227
|
+
thinkingConfig: {
|
|
228
|
+
thinkingLevel: 'LOW',
|
|
229
|
+
},
|
|
218
230
|
});
|
|
219
231
|
const prompt = `File Path: ${filePath}
|
|
220
232
|
|
|
@@ -226,6 +238,7 @@ ${replaceContent}
|
|
|
226
238
|
|
|
227
239
|
File Content:
|
|
228
240
|
${fileContent}`;
|
|
241
|
+
debugLog(`Attempting AI fuzzy search and replace for ${filePath} with model ${model} (thinking: LOW)...`);
|
|
229
242
|
try {
|
|
230
243
|
const response = await chat.sendMessage(prompt, undefined, options.abortSignal);
|
|
231
244
|
const rawOutput = response.response.text();
|
|
@@ -87,7 +87,7 @@ export declare function consumeSkipOnce(): void;
|
|
|
87
87
|
* @param targetElements - Optional array of specific symbol or function names to extract.
|
|
88
88
|
* @returns A promise resolving to a {@link ToolResult} containing the file content or error details.
|
|
89
89
|
*/
|
|
90
|
-
export declare function readFile(workspaceRoot: string, filePath: string, startLine?: number, endLine?: number, targetElements?: string[]): Promise<ToolResult>;
|
|
90
|
+
export declare function readFile(workspaceRoot: string, filePath: string, startLine?: number, endLine?: number, targetElements?: string[], outlineOnly?: boolean): Promise<ToolResult>;
|
|
91
91
|
/**
|
|
92
92
|
* Creates a new file or completely overwrites an existing file with the provided content,
|
|
93
93
|
* performing local syntax validation and iterative AI syntax auto-correction if validation fails.
|
|
@@ -570,7 +570,7 @@ async function getIgnoredPaths(workspaceRoot) {
|
|
|
570
570
|
* @param targetElements - Optional array of specific symbol or function names to extract.
|
|
571
571
|
* @returns A promise resolving to a {@link ToolResult} containing the file content or error details.
|
|
572
572
|
*/
|
|
573
|
-
export async function readFile(workspaceRoot, filePath, startLine, endLine, targetElements) {
|
|
573
|
+
export async function readFile(workspaceRoot, filePath, startLine, endLine, targetElements, outlineOnly) {
|
|
574
574
|
try {
|
|
575
575
|
const absPath = resolveAndValidatePath(workspaceRoot, filePath);
|
|
576
576
|
// Check if file is explicitly ignored
|
|
@@ -1809,7 +1809,7 @@ export async function executeTool(workspaceRoot, toolName, args, abortSignal) {
|
|
|
1809
1809
|
break;
|
|
1810
1810
|
}
|
|
1811
1811
|
case 'read_file':
|
|
1812
|
-
result = await readFile(effectiveRoot, resolvedArgs.filePath, resolvedArgs.startLine, resolvedArgs.endLine, resolvedArgs.targetElements);
|
|
1812
|
+
result = await readFile(effectiveRoot, resolvedArgs.filePath, resolvedArgs.startLine, resolvedArgs.endLine, resolvedArgs.targetElements, resolvedArgs.outlineOnly);
|
|
1813
1813
|
// Record successful reads so the file-read guard allows subsequent modify_file calls
|
|
1814
1814
|
if (!result.error) {
|
|
1815
1815
|
recordFileRead(resolvedArgs.filePath);
|
package/dist/services/agent.js
CHANGED
|
@@ -26,7 +26,7 @@ const execAsync = promisify(exec);
|
|
|
26
26
|
import { debugLog, isDebugOn } from '../utils/logger.js';
|
|
27
27
|
import { ensureProjectStorage, ensureIgnored, readCache, writeCache, invalidateCacheForDependents, } from '../utils/projectStorage.js';
|
|
28
28
|
import { GEMINI_MODELS, TPM_COOLING_DELAYS } from '../utils/config.js';
|
|
29
|
-
import { createSharedChatSession, getGeneralChatConfig, getPlanExecutionConfig, compressTextUsingFlashLite, generateChatTitle, getGlobalActiveModel, summarizeChatHistory, } from './ai.js';
|
|
29
|
+
import { createSharedChatSession, getGeneralChatConfig, getPlanExecutionConfig, compressTextUsingFlashLite, generateChatTitle, getGlobalActiveModel, getModelThinkingLevel, summarizeChatHistory, } from './ai.js';
|
|
30
30
|
import { getAndResetTurnUsage } from './proxyClient.js';
|
|
31
31
|
import { changeLogger } from './changeLogger.js';
|
|
32
32
|
import { chatHistoryService } from './chatHistoryService.js';
|
|
@@ -35,7 +35,7 @@ import { verifyChangedFiles } from './verificationService.js';
|
|
|
35
35
|
import { buildContextInjection } from '../utils/contextPrompts.js';
|
|
36
36
|
import { registerContextFiles } from '../utils/fileReadGuard.js';
|
|
37
37
|
import { historyText } from '../utils/historyPrompt.js';
|
|
38
|
-
import { loadUserProfile, formatUserProfileForContext, extractAndSaveUserInsights
|
|
38
|
+
import { loadUserProfile, formatUserProfileForContext, extractAndSaveUserInsights } from './userProfileService.js';
|
|
39
39
|
// Submodule Imports
|
|
40
40
|
import { AsyncInputHandler } from './agent/inputHandler.js';
|
|
41
41
|
import { processResponse } from './agent/toolLoop.js';
|
|
@@ -164,7 +164,7 @@ export async function startAgentLoop(workspaceRoot, version) {
|
|
|
164
164
|
}
|
|
165
165
|
inputHandler.stop();
|
|
166
166
|
// Input collection (delegated to a helper function to avoid nested loop warning)
|
|
167
|
-
const { userInput: rawInput, canceled } = await collectUserInput(sessionInputHistory);
|
|
167
|
+
const { userInput: rawInput, canceled } = await collectUserInput(sessionInputHistory, workspaceRoot);
|
|
168
168
|
if (canceled) {
|
|
169
169
|
p.outro(pc.green('Goodbye! Happy coding. 🚀'));
|
|
170
170
|
return;
|
|
@@ -402,6 +402,78 @@ export async function executeSingleTurn(workspaceRoot, userInput, chat, inputHan
|
|
|
402
402
|
collector.recordCompressedContextSize(contextInjection.length);
|
|
403
403
|
dynamicSystemInstruction += '\n\n' + contextInjection;
|
|
404
404
|
}
|
|
405
|
+
// Resolve and inject explicit @ Context Mentions (files, symbols, git diffs, diagnostics, external workspaces)
|
|
406
|
+
try {
|
|
407
|
+
const { mentionEngine } = await import('./mentionEngine.js');
|
|
408
|
+
const resolvedMentions = await mentionEngine.resolveMentions(userInput, workspaceRoot);
|
|
409
|
+
if (resolvedMentions.hasMentions) {
|
|
410
|
+
const isPrompting = inputHandler.isCurrentlyPrompting();
|
|
411
|
+
if (!isPrompting) {
|
|
412
|
+
spinner.stop();
|
|
413
|
+
}
|
|
414
|
+
for (const item of resolvedMentions.mentions) {
|
|
415
|
+
if (item.resolved) {
|
|
416
|
+
const label = item.statusLabel ? ` ${pc.dim(`(${item.statusLabel})`)}` : '';
|
|
417
|
+
p.log.step(`${pc.green('✔')} Context ${pc.cyan(item.mention.raw)}${label}`);
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
const reason = item.error ? ` ${pc.dim(`(${item.error})`)}` : '';
|
|
421
|
+
p.log.warn(`${pc.red('✖')} Context ${pc.yellow(item.mention.raw)}${reason}`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (!isPrompting) {
|
|
425
|
+
spinner.start('Preparing agent configuration...');
|
|
426
|
+
}
|
|
427
|
+
if (resolvedMentions.formattedContext) {
|
|
428
|
+
debugLog(`Resolved ${resolvedMentions.mentions.length} context mention(s) (${resolvedMentions.totalTokens} tokens estimated)`);
|
|
429
|
+
dynamicSystemInstruction += '\n\n' + resolvedMentions.formattedContext;
|
|
430
|
+
// Pre-register all resolved file mention paths with the read-guard
|
|
431
|
+
const mentionedFiles = resolvedMentions.mentions
|
|
432
|
+
.filter((m) => m.mention.type === 'file' && m.resolved)
|
|
433
|
+
.map((m) => m.mention.target);
|
|
434
|
+
if (mentionedFiles.length > 0) {
|
|
435
|
+
registerContextFiles(mentionedFiles);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
// Also resolve mentions from any chained follow-up instructions received during investigation
|
|
440
|
+
if (gatherRes.chainedMessages.length > 0) {
|
|
441
|
+
const chainedContent = gatherRes.chainedMessages.join('\n');
|
|
442
|
+
const chainedMentions = await mentionEngine.resolveMentions(chainedContent, workspaceRoot);
|
|
443
|
+
if (chainedMentions.hasMentions) {
|
|
444
|
+
const isPrompting = inputHandler.isCurrentlyPrompting();
|
|
445
|
+
if (!isPrompting) {
|
|
446
|
+
spinner.stop();
|
|
447
|
+
}
|
|
448
|
+
for (const item of chainedMentions.mentions) {
|
|
449
|
+
if (item.resolved) {
|
|
450
|
+
const label = item.statusLabel ? ` ${pc.dim(`(${item.statusLabel})`)}` : '';
|
|
451
|
+
p.log.step(`${pc.green('✔')} Chained Context ${pc.cyan(item.mention.raw)}${label}`);
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
const reason = item.error ? ` ${pc.dim(`(${item.error})`)}` : '';
|
|
455
|
+
p.log.warn(`${pc.red('✖')} Chained Context ${pc.yellow(item.mention.raw)}${reason}`);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
if (!isPrompting) {
|
|
459
|
+
spinner.start('Preparing agent configuration...');
|
|
460
|
+
}
|
|
461
|
+
if (chainedMentions.formattedContext) {
|
|
462
|
+
debugLog(`Resolved ${chainedMentions.mentions.length} chained context mention(s) (${chainedMentions.totalTokens} tokens estimated)`);
|
|
463
|
+
dynamicSystemInstruction += '\n\n' + chainedMentions.formattedContext;
|
|
464
|
+
const chainedFiles = chainedMentions.mentions
|
|
465
|
+
.filter((m) => m.mention.type === 'file' && m.resolved)
|
|
466
|
+
.map((m) => m.mention.target);
|
|
467
|
+
if (chainedFiles.length > 0) {
|
|
468
|
+
registerContextFiles(chainedFiles);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
catch (mentionErr) {
|
|
475
|
+
debugLog(`Context mention resolution encountered an error: ${mentionErr?.message || mentionErr}`);
|
|
476
|
+
}
|
|
405
477
|
// Inject global adaptive user persona and learned preferences
|
|
406
478
|
try {
|
|
407
479
|
const userProfile = await loadUserProfile();
|
|
@@ -429,10 +501,20 @@ export async function executeSingleTurn(workspaceRoot, userInput, chat, inputHan
|
|
|
429
501
|
selectedModel = complexity === 'EASY' ? GEMINI_MODELS.FLASH_LITE : GEMINI_MODELS.FLASH;
|
|
430
502
|
}
|
|
431
503
|
chat.setModel(selectedModel);
|
|
432
|
-
|
|
504
|
+
const thinkingLevel = getModelThinkingLevel(selectedModel);
|
|
505
|
+
if (typeof chat.setThinkingLevel === 'function') {
|
|
506
|
+
chat.setThinkingLevel(thinkingLevel);
|
|
507
|
+
}
|
|
508
|
+
debugLog(`Auto-routing to model ${selectedModel} (thinking: ${thinkingLevel}) based on intent ${effectiveTargetAgent}`);
|
|
433
509
|
}
|
|
434
510
|
else {
|
|
435
|
-
|
|
511
|
+
const activeModel = getGlobalActiveModel();
|
|
512
|
+
chat.setModel(activeModel);
|
|
513
|
+
const thinkingLevel = getModelThinkingLevel(activeModel);
|
|
514
|
+
if (typeof chat.setThinkingLevel === 'function') {
|
|
515
|
+
chat.setThinkingLevel(thinkingLevel);
|
|
516
|
+
}
|
|
517
|
+
debugLog(`Active model set to ${activeModel} (thinking: ${thinkingLevel})`);
|
|
436
518
|
}
|
|
437
519
|
if (ac.signal.aborted) {
|
|
438
520
|
spinner.stop();
|
|
@@ -599,6 +681,10 @@ export async function executeSingleTurn(workspaceRoot, userInput, chat, inputHan
|
|
|
599
681
|
// Send the formulated prompt payload to the generative model
|
|
600
682
|
let result;
|
|
601
683
|
try {
|
|
684
|
+
const activeModel = chat.getModel();
|
|
685
|
+
const currentThinking = (typeof chat.getThinkingLevel === 'function' ? chat.getThinkingLevel() : undefined) ||
|
|
686
|
+
getModelThinkingLevel(activeModel);
|
|
687
|
+
debugLog(`Dispatching turn to model ${activeModel} (thinking: ${currentThinking})`);
|
|
602
688
|
result = await chat.sendMessage(finalInput, undefined, ac.signal);
|
|
603
689
|
}
|
|
604
690
|
catch (e) {
|
|
@@ -794,14 +880,40 @@ export async function executeSingleTurn(workspaceRoot, userInput, chat, inputHan
|
|
|
794
880
|
}
|
|
795
881
|
});
|
|
796
882
|
}
|
|
797
|
-
async function collectUserInput(history) {
|
|
883
|
+
async function collectUserInput(history, workspaceRoot = process.cwd()) {
|
|
798
884
|
let lines = [];
|
|
799
885
|
let isMultiLine = false;
|
|
800
886
|
while (true) {
|
|
801
887
|
const userInputRaw = await historyText({
|
|
802
888
|
message: isMultiLine ? ' ' : pc.magenta('❯'),
|
|
803
|
-
placeholder: isMultiLine
|
|
889
|
+
placeholder: isMultiLine
|
|
890
|
+
? ''
|
|
891
|
+
: 'Use ' + String.fromCharCode(92) + ' for new lines or @ to mention file paths and more',
|
|
804
892
|
history,
|
|
893
|
+
autocomplete: {
|
|
894
|
+
workspaceRoot,
|
|
895
|
+
getSuggestions: async (query) => {
|
|
896
|
+
try {
|
|
897
|
+
const { mentionEngine } = await import('./mentionEngine.js');
|
|
898
|
+
const suggestions = await mentionEngine.getSuggestionsForQuery(query, { workspaceRoot });
|
|
899
|
+
return suggestions.map((s) => ({
|
|
900
|
+
value: s.value,
|
|
901
|
+
label: s.label,
|
|
902
|
+
category: s.category,
|
|
903
|
+
description: s.description,
|
|
904
|
+
metadata: {
|
|
905
|
+
filePath: s.filePath,
|
|
906
|
+
symbol: s.label,
|
|
907
|
+
helperLabel: s.helperLabel,
|
|
908
|
+
symbolKind: s.symbolKind,
|
|
909
|
+
},
|
|
910
|
+
}));
|
|
911
|
+
}
|
|
912
|
+
catch {
|
|
913
|
+
return [];
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
},
|
|
805
917
|
});
|
|
806
918
|
if (p.isCancel(userInputRaw)) {
|
|
807
919
|
if (isMultiLine) {
|
package/dist/services/ai.d.ts
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
import { type Content, type FunctionCall } from '@google/generative-ai';
|
|
2
|
+
import { type ThinkingLevel } from '../utils/config.js';
|
|
2
3
|
export declare function getMultiWorkspaceBlock(): string;
|
|
3
4
|
export declare function setModelOverride(agent: 'context' | 'execution', overrideStr: string): void;
|
|
4
5
|
export declare function clearModelOverrides(): void;
|
|
5
6
|
export declare function setGlobalActiveModel(model: string): void;
|
|
6
7
|
export declare function getGlobalActiveModel(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the thinking reasoning level configured for a specific model or active model.
|
|
10
|
+
* Falls back to default model thinking levels or 'MEDIUM' if not explicitly configured.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getModelThinkingLevel(model?: string): ThinkingLevel;
|
|
13
|
+
/**
|
|
14
|
+
* Sets the user-configured thinking reasoning level for a specific model.
|
|
15
|
+
*/
|
|
16
|
+
export declare function setModelThinkingLevel(model: string, level: ThinkingLevel): void;
|
|
17
|
+
/**
|
|
18
|
+
* Resets user-configured thinking levels back to default model presets.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resetModelThinkingLevels(): void;
|
|
7
21
|
export declare class ProxyChatSession {
|
|
8
22
|
private history;
|
|
9
23
|
private fullHistory;
|
|
@@ -12,6 +26,7 @@ export declare class ProxyChatSession {
|
|
|
12
26
|
private tools;
|
|
13
27
|
private toolConfig?;
|
|
14
28
|
private generationConfig;
|
|
29
|
+
private configuredThinkingLevel?;
|
|
15
30
|
private latestUsageMetadata;
|
|
16
31
|
constructor(modelName: string, systemInstruction: string, tools: any[], generationConfig: any, toolConfig?: any);
|
|
17
32
|
getLatestUsageMetadata(): any;
|
|
@@ -20,6 +35,10 @@ export declare class ProxyChatSession {
|
|
|
20
35
|
getToolConfig(): any;
|
|
21
36
|
setModel(modelName: string): void;
|
|
22
37
|
getModel(): string;
|
|
38
|
+
setThinkingLevel(level: ThinkingLevel): void;
|
|
39
|
+
getThinkingLevel(): ThinkingLevel | undefined;
|
|
40
|
+
setGenerationConfig(generationConfig: any): void;
|
|
41
|
+
getGenerationConfig(): any;
|
|
23
42
|
clearHistory(): void;
|
|
24
43
|
getRawHistory(): Content[];
|
|
25
44
|
getFullHistory(): Content[];
|