mcp-code-context 3.6.2 → 3.7.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/CHANGELOG.md +140 -268
- package/INSTRUCTIONS.md +31 -12
- package/README.md +223 -107
- package/SECURITY.md +55 -21
- package/dist/src/core/cacheManager.d.ts +4 -5
- package/dist/src/core/cacheManager.js +49 -33
- package/dist/src/core/cacheManager.js.map +1 -1
- package/dist/src/core/engine.d.ts +1 -1
- package/dist/src/core/engine.js +3 -3
- package/dist/src/core/engine.js.map +1 -1
- package/dist/src/core/indexManager.d.ts +58 -0
- package/dist/src/core/indexManager.js +252 -0
- package/dist/src/core/indexManager.js.map +1 -0
- package/dist/src/core/indexManagerQueries.d.ts +14 -0
- package/dist/src/core/indexManagerQueries.js +95 -0
- package/dist/src/core/indexManagerQueries.js.map +1 -0
- package/dist/src/core/sessionManager.d.ts +117 -0
- package/dist/src/core/sessionManager.js +231 -0
- package/dist/src/core/sessionManager.js.map +1 -0
- package/dist/src/core/validator.d.ts +1 -1
- package/dist/src/core/validator.js +18 -10
- package/dist/src/core/validator.js.map +1 -1
- package/dist/src/index.d.ts +1 -13
- package/dist/src/index.js +25 -999
- package/dist/src/index.js.map +1 -1
- package/dist/src/operations/astTransform.d.ts +38 -0
- package/dist/src/operations/astTransform.js +239 -0
- package/dist/src/operations/astTransform.js.map +1 -0
- package/dist/src/operations/compress.d.ts +5 -3
- package/dist/src/operations/compress.js +73 -7
- package/dist/src/operations/compress.js.map +1 -1
- package/dist/src/operations/confirmationStore.d.ts +35 -8
- package/dist/src/operations/confirmationStore.js +112 -14
- package/dist/src/operations/confirmationStore.js.map +1 -1
- package/dist/src/operations/impactAnalysis.d.ts +9 -0
- package/dist/src/operations/impactAnalysis.js +61 -0
- package/dist/src/operations/impactAnalysis.js.map +1 -0
- package/dist/src/operations/pendingStore.d.ts +51 -0
- package/dist/src/operations/pendingStore.js +201 -0
- package/dist/src/operations/pendingStore.js.map +1 -0
- package/dist/src/operations/pendingStoreInit.d.ts +6 -0
- package/dist/src/operations/pendingStoreInit.js +42 -0
- package/dist/src/operations/pendingStoreInit.js.map +1 -0
- package/dist/src/operations/read.d.ts +6 -92
- package/dist/src/operations/read.js +4 -445
- package/dist/src/operations/read.js.map +1 -1
- package/dist/src/operations/readCore.d.ts +33 -0
- package/dist/src/operations/readCore.js +142 -0
- package/dist/src/operations/readCore.js.map +1 -0
- package/dist/src/operations/rename.d.ts +13 -0
- package/dist/src/operations/rename.js +130 -0
- package/dist/src/operations/rename.js.map +1 -0
- package/dist/src/operations/searchOperation.d.ts +16 -0
- package/dist/src/operations/searchOperation.js +113 -0
- package/dist/src/operations/searchOperation.js.map +1 -0
- package/dist/src/operations/symbolQuery.d.ts +38 -0
- package/dist/src/operations/symbolQuery.js +194 -0
- package/dist/src/operations/symbolQuery.js.map +1 -0
- package/dist/src/operations/write.d.ts +11 -14
- package/dist/src/operations/write.js +6 -125
- package/dist/src/operations/write.js.map +1 -1
- package/dist/src/parsers/base.d.ts +1 -1
- package/dist/src/parsers/base.js +1 -1
- package/dist/src/parsers/csharp.d.ts +12 -0
- package/dist/src/parsers/csharp.js +67 -0
- package/dist/src/parsers/csharp.js.map +1 -0
- package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
- package/dist/src/parsers/dartTreeSitter.js +1 -1
- package/dist/src/parsers/go.d.ts +11 -0
- package/dist/src/parsers/go.js +74 -0
- package/dist/src/parsers/go.js.map +1 -0
- package/dist/src/parsers/java.d.ts +12 -0
- package/dist/src/parsers/java.js +62 -0
- package/dist/src/parsers/java.js.map +1 -0
- package/dist/src/parsers/kotlin.d.ts +12 -0
- package/dist/src/parsers/kotlin.js +75 -0
- package/dist/src/parsers/kotlin.js.map +1 -0
- package/dist/src/parsers/php.d.ts +1 -1
- package/dist/src/parsers/php.js +1 -1
- package/dist/src/parsers/python.d.ts +1 -1
- package/dist/src/parsers/python.js +1 -1
- package/dist/src/parsers/registry.d.ts +1 -1
- package/dist/src/parsers/registry.js +63 -2
- package/dist/src/parsers/registry.js.map +1 -1
- package/dist/src/parsers/ruby.d.ts +12 -0
- package/dist/src/parsers/ruby.js +73 -0
- package/dist/src/parsers/ruby.js.map +1 -0
- package/dist/src/parsers/rust.d.ts +12 -0
- package/dist/src/parsers/rust.js +66 -0
- package/dist/src/parsers/rust.js.map +1 -0
- package/dist/src/parsers/typescript.d.ts +1 -1
- package/dist/src/parsers/typescript.js +28 -38
- package/dist/src/parsers/typescript.js.map +1 -1
- package/dist/src/tools/adminHandlers.d.ts +67 -0
- package/dist/src/tools/adminHandlers.js +129 -0
- package/dist/src/tools/adminHandlers.js.map +1 -0
- package/dist/src/tools/context.d.ts +9 -0
- package/dist/src/tools/context.js +21 -0
- package/dist/src/tools/context.js.map +1 -0
- package/dist/src/tools/handlers.d.ts +4 -0
- package/dist/src/tools/handlers.js +5 -0
- package/dist/src/tools/handlers.js.map +1 -0
- package/dist/src/tools/pipeline.d.ts +6 -0
- package/dist/src/tools/pipeline.js +100 -0
- package/dist/src/tools/pipeline.js.map +1 -0
- package/dist/src/tools/readHandlers.d.ts +55 -0
- package/dist/src/tools/readHandlers.js +220 -0
- package/dist/src/tools/readHandlers.js.map +1 -0
- package/dist/src/tools/toolDefinitions.d.ts +1037 -0
- package/dist/src/tools/toolDefinitions.js +13 -0
- package/dist/src/tools/toolDefinitions.js.map +1 -0
- package/dist/src/tools/toolDefinitionsAdmin.d.ts +89 -0
- package/dist/src/tools/toolDefinitionsAdmin.js +99 -0
- package/dist/src/tools/toolDefinitionsAdmin.js.map +1 -0
- package/dist/src/tools/toolDefinitionsCore.d.ts +949 -0
- package/dist/src/tools/toolDefinitionsCore.js +267 -0
- package/dist/src/tools/toolDefinitionsCore.js.map +1 -0
- package/dist/src/tools/writeHandlers.d.ts +37 -0
- package/dist/src/tools/writeHandlers.js +199 -0
- package/dist/src/tools/writeHandlers.js.map +1 -0
- package/dist/src/utils/appDir.d.ts +19 -0
- package/dist/src/utils/appDir.js +50 -0
- package/dist/src/utils/appDir.js.map +1 -0
- package/dist/src/utils/auditLogWriter.d.ts +9 -0
- package/dist/src/utils/auditLogWriter.js +49 -0
- package/dist/src/utils/auditLogWriter.js.map +1 -0
- package/dist/src/utils/auditLogger.d.ts +1 -10
- package/dist/src/utils/auditLogger.js +14 -109
- package/dist/src/utils/auditLogger.js.map +1 -1
- package/dist/src/utils/auditQuery.d.ts +23 -0
- package/dist/src/utils/auditQuery.js +67 -0
- package/dist/src/utils/auditQuery.js.map +1 -0
- package/dist/src/utils/backupManager.d.ts +2 -2
- package/dist/src/utils/backupManager.js +29 -12
- package/dist/src/utils/backupManager.js.map +1 -1
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +8 -1
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/diff.d.ts +12 -1
- package/dist/src/utils/diff.js +41 -1
- package/dist/src/utils/diff.js.map +1 -1
- package/dist/src/utils/fileLock.d.ts +7 -2
- package/dist/src/utils/fileLock.js +14 -11
- package/dist/src/utils/fileLock.js.map +1 -1
- package/dist/src/utils/fileWalker.d.ts +1 -1
- package/dist/src/utils/fileWalker.js +1 -1
- package/dist/src/utils/fileWatcher.d.ts +1 -1
- package/dist/src/utils/fileWatcher.js +1 -1
- package/dist/src/utils/fuzzySearch.d.ts +1 -1
- package/dist/src/utils/fuzzySearch.js +1 -1
- package/dist/src/utils/logger.d.ts +1 -1
- package/dist/src/utils/logger.js +2 -2
- package/dist/src/utils/logger.js.map +1 -1
- package/dist/src/utils/rateLimiter.d.ts +9 -1
- package/dist/src/utils/rateLimiter.js +12 -1
- package/dist/src/utils/rateLimiter.js.map +1 -1
- package/dist/src/utils/regexValidator.d.ts +12 -0
- package/dist/src/utils/regexValidator.js +48 -0
- package/dist/src/utils/regexValidator.js.map +1 -0
- package/dist/src/utils/safeRegex.d.ts +2 -92
- package/dist/src/utils/safeRegex.js +41 -222
- package/dist/src/utils/safeRegex.js.map +1 -1
- package/dist/src/utils/safeRegexApi.d.ts +56 -0
- package/dist/src/utils/safeRegexApi.js +99 -0
- package/dist/src/utils/safeRegexApi.js.map +1 -0
- package/dist/src/utils/safeRegexPool.d.ts +7 -0
- package/dist/src/utils/safeRegexPool.js +102 -0
- package/dist/src/utils/safeRegexPool.js.map +1 -0
- package/dist/src/utils/searchTools.js +6 -6
- package/dist/src/utils/searchTools.js.map +1 -1
- package/dist/src/utils/streaming.d.ts +4 -3
- package/dist/src/utils/streaming.js +1 -1
- package/dist/src/utils/streaming.js.map +1 -1
- package/dist/src/utils/telemetry.d.ts +1 -1
- package/dist/src/utils/telemetry.js +1 -1
- package/dist/src/utils/toctou.d.ts +7 -0
- package/dist/src/utils/toctou.js +24 -0
- package/dist/src/utils/toctou.js.map +1 -0
- package/llms.txt +199 -31
- package/package.json +2 -2
- package/scripts/replace-version.js +0 -59
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/mcp-code-context)
|
|
5
5
|
[](https://www.npmjs.com/package/mcp-code-context)
|
|
6
6
|
[]()
|
|
7
|
-
[]()
|
|
8
8
|
[](https://ko-fi.com/achatainga)
|
|
9
9
|
[](https://paypal.me/achatainga)
|
|
10
10
|
|
|
11
|
-
> MCP server with **Tree-sitter WASM parsers** for 100% AST accuracy. Zero native dependencies. Production-ready with persistent caching, structured logging, fuzzy search,
|
|
11
|
+
> MCP server with **Tree-sitter WASM parsers** for 100% AST accuracy. Zero native dependencies. Production-ready with persistent caching, structured logging, fuzzy search, multi-process safety, and **session-scoped state**.
|
|
12
12
|
|
|
13
13
|
## 🚀 Quick Start (Claude Desktop)
|
|
14
14
|
|
|
@@ -52,7 +52,7 @@ LLMs working with code face two bottlenecks:
|
|
|
52
52
|
|
|
53
53
|
## The Solution
|
|
54
54
|
|
|
55
|
-
`mcp-code-context` provides **
|
|
55
|
+
`mcp-code-context` provides **25 tools** — covering reading, writing, AST transformation, search, and session management — all operating at the **symbol level** (functions, classes, methods). Tools support a `className` scope to correctly isolate identical symbol names in the same file (e.g. Flutter `build()` methods). Read tools extract structural skeletons. Write tools splice changes into the exact AST location.
|
|
56
56
|
|
|
57
57
|
| File | Original | Compressed | Reduction |
|
|
58
58
|
|------|----------|------------|-----------|
|
|
@@ -60,13 +60,47 @@ LLMs working with code face two bottlenecks:
|
|
|
60
60
|
| Dart repository (230 lines) | 230 | 30 | **87.0%** |
|
|
61
61
|
| PHP config (68 lines) | 68 | 15 | **77.9%** |
|
|
62
62
|
|
|
63
|
+
### Token Savings
|
|
64
|
+
|
|
65
|
+
**Real-world results**:
|
|
66
|
+
- TypeScript project: 73% reduction in tokens sent to LLM
|
|
67
|
+
- PHP application: 82% reduction
|
|
68
|
+
- Dart codebase: 79% reduction
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
63
72
|
## Reliability & Testing
|
|
64
73
|
|
|
65
74
|
Built to be robust and precise. Both read and write engines are tested against real-world, complex codebases (including nested generic types in Dart, complex interfaces in PHP, and multi-file rename operations) with a **100% test pass rate** across all languages and operations.
|
|
66
75
|
|
|
76
|
+
### Production-Ready Features
|
|
77
|
+
|
|
78
|
+
| Feature | v3.6.x | v3.7.0 | Benefit |
|
|
79
|
+
|---------|--------|--------|---------|
|
|
80
|
+
| Multi-process safety | ✅ | ✅ | No file corruption |
|
|
81
|
+
| Persistent cache | ✅ | ✅ | <100ms cache hits |
|
|
82
|
+
| Session-scoped state | ❌ | ✅ | No state leakage between clients |
|
|
83
|
+
| Crash recovery | ❌ | ✅ | Pending operations survive restart |
|
|
84
|
+
| Expanded ReDoS protection | 6 patterns | 15+ patterns | Better security |
|
|
85
|
+
| Auto-persist before eviction | ❌ | ✅ | Cache data preserved |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
67
89
|
## Features
|
|
68
90
|
|
|
69
|
-
### What's New in v3.
|
|
91
|
+
### What's New in v3.7.0
|
|
92
|
+
|
|
93
|
+
| Feature | Description |
|
|
94
|
+
|---------|-------------|
|
|
95
|
+
| 🔒 **Session-scoped state** | Each MCP client gets isolated locks, confirmation store, rate limiter (no state leakage) |
|
|
96
|
+
| 💾 **Crash recovery** | SQLite-backed pending operations store - survive restarts |
|
|
97
|
+
| 🔍 **Expanded ReDoS protection** | 15+ patterns (was 6) - better protection against regex DoS |
|
|
98
|
+
| ⚡ **Auto-persist before eviction** | CacheManager now persists before LRU eviction |
|
|
99
|
+
| 📊 **Higher file limits** | MAX_FILES_REPO_MAP = 2000 (was 500) |
|
|
100
|
+
| 🧪 **Multi-client tests** | New integration tests for concurrent MCP clients |
|
|
101
|
+
| 📝 **New tools**: `get_session_stats`, `clear_session_cache`, `list_pending_operations` | Session-aware operations |
|
|
102
|
+
|
|
103
|
+
### Previous Versions (v3.6.x)
|
|
70
104
|
|
|
71
105
|
| Feature | Description |
|
|
72
106
|
|---------|-------------|
|
|
@@ -93,11 +127,13 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
93
127
|
- 🔄 **Repository-wide rename** — Rename a symbol in its definition AND all files that import it, atomically.
|
|
94
128
|
- 🗑️ **Safe symbol removal** — Delete code with automatic dependency checking to prevent breakage.
|
|
95
129
|
- 🔍 **Mandatory dry-run flow** — Write tools return a preview diff and a `confirmationToken` by default. Changes are only applied after explicit confirmation.
|
|
96
|
-
- 💾 **Robust rolling backups** — Automatically keeps the last 5 versions of modified files in
|
|
130
|
+
- 💾 **Robust rolling backups** — Automatically keeps the last 5 versions of modified files in the OS temp directory.
|
|
97
131
|
- ⏪ **Surgical rollback** — Revert files to any of the 5 previous states using the `rollback_file` tool.
|
|
98
|
-
-
|
|
132
|
+
- ���� **Fuzzy symbol matching** — When a symbol is not found, the server provides structured suggestions based on Levenshtein distance.
|
|
99
133
|
- 🔐 **Private symbol support** — Full support for `_` and `__` prefixed symbols in Dart and Python.
|
|
100
134
|
|
|
135
|
+
---
|
|
136
|
+
|
|
101
137
|
## Supported Languages
|
|
102
138
|
|
|
103
139
|
| Language | Read (Compress + Extract) | Write (Replace + Insert + Rename + Remove) | Import Analysis |
|
|
@@ -108,26 +144,24 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
108
144
|
| Python | ✅ AST (Tree-sitter WASM) | ✅ Indentation-aware | ✅ |
|
|
109
145
|
| Others (JSON, YAML, CSS, etc.) | Passthrough / truncation | — | — |
|
|
110
146
|
|
|
147
|
+
---
|
|
148
|
+
|
|
111
149
|
## ⚠️ Known Limitations
|
|
112
150
|
|
|
113
151
|
### `rename_symbol` Tool
|
|
114
152
|
|
|
115
|
-
**
|
|
116
|
-
|
|
117
|
-
- **Reason**: No AST parser available for safe cross-file refactoring
|
|
118
|
-
- **Risk**: Regex-based rename may corrupt strings, comments, or unrelated code
|
|
119
|
-
- **Recommendation**: Use IDE refactoring tools instead:
|
|
120
|
-
- **Dart**: VS Code with Dart extension (F2 key) or IntelliJ IDEA
|
|
121
|
-
- **Python**: PyCharm, VS Code with Pylance (F2 key)
|
|
122
|
-
- **Alternative**: Use `write_file_surgical` to rename within a single file
|
|
153
|
+
**All languages**: The definition file is renamed using **AST (Tree-sitter)** — safe and precise. ✅
|
|
123
154
|
|
|
124
|
-
**
|
|
155
|
+
**Cross-file rename (dependent files)**: Updated using **regex word-boundaries** for all languages, including TypeScript, JavaScript, and PHP.
|
|
125
156
|
|
|
126
|
-
**
|
|
157
|
+
- **Risk**: Regex may match strings, comments, or unrelated identifiers sharing the same name
|
|
158
|
+
- **Dart and Python**: Higher risk — import syntax (`import 'package:...'`, `from module import name`) is less reliably matched by the current regex patterns
|
|
159
|
+
- **Recommendation**: Always review the generated diff carefully before confirming
|
|
160
|
+
- **Alternative**: Use `write_file_surgical` to rename within a single file safely
|
|
127
161
|
|
|
128
162
|
### `get_semantic_repo_map` Tool
|
|
129
163
|
|
|
130
|
-
- **Max files**: Limited to
|
|
164
|
+
- **Max files**: Limited to 2000 files to prevent timeouts (increased from 500 in v3.7.0)
|
|
131
165
|
- **Performance**: Synchronous I/O may take 10-30 seconds on large repositories
|
|
132
166
|
- **Recommendation**: Use `@folder` syntax to target specific directories
|
|
133
167
|
|
|
@@ -136,6 +170,9 @@ Built to be robust and precise. Both read and write engines are tested against r
|
|
|
136
170
|
- **Validation**: No automatic syntax checking after edits. Always review diffs carefully before confirming.
|
|
137
171
|
- **Backups**: 5-version rolling backup system. Use `rollback_file` if something goes wrong.
|
|
138
172
|
- **Large files**: Files >10MB are skipped for safety.
|
|
173
|
+
- **Phase 2 tokens**: Confirmation tokens expire after 5 minutes.
|
|
174
|
+
|
|
175
|
+
---
|
|
139
176
|
|
|
140
177
|
## Installation
|
|
141
178
|
|
|
@@ -149,6 +186,50 @@ npx -y mcp-code-context
|
|
|
149
186
|
|
|
150
187
|
**Note**: Unlike v2.x, this version uses **web-tree-sitter (WASM)** instead of native bindings. No Visual Studio, Python, or node-gyp required!
|
|
151
188
|
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Session State (v3.7.0+)
|
|
192
|
+
|
|
193
|
+
**Important**: v3.7.0 introduces **session-scoped state** for each MCP client connection. This prevents state leakage when multiple agents (Amazon Q, Kiro, Cursor, etc.) use the same server instance.
|
|
194
|
+
|
|
195
|
+
### What Changed
|
|
196
|
+
|
|
197
|
+
| Before (v3.6.x) | After (v3.7.0) |
|
|
198
|
+
|----------------|----------------|
|
|
199
|
+
| Global `LockManager` (shared by all clients) | Session-scoped `sessionStates` Map |
|
|
200
|
+
| Global `ConfirmationStore` (in-memory Map) | Session-scoped confirmation store + SQLite persistence |
|
|
201
|
+
| Global `RateLimiter` (shared tokens) | Per-session token bucket |
|
|
202
|
+
| No crash recovery | SQLite-backed pending operations store |
|
|
203
|
+
|
|
204
|
+
### Benefits
|
|
205
|
+
|
|
206
|
+
- ✅ **No state leakage**: Each agent gets isolated locks, confirmation store, and rate limiter
|
|
207
|
+
- ✅ **Crash recovery**: Pending operations survive server restarts
|
|
208
|
+
- ✅ **Multi-agent safe**: Amazon Q and Kiro can run simultaneously without conflicts
|
|
209
|
+
|
|
210
|
+
### Configuration
|
|
211
|
+
|
|
212
|
+
**No additional configuration needed**. Session isolation is automatic. Just configure your MCP server normally:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"mcpServers": {
|
|
217
|
+
"mcp-code-context": {
|
|
218
|
+
"command": "npx",
|
|
219
|
+
"args": ["-y", "mcp-code-context"]
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### New Tools (v3.7.0)
|
|
226
|
+
|
|
227
|
+
- `get_session_stats` — Get stats for current session only
|
|
228
|
+
- `clear_session_cache` — Clear cache for current session only
|
|
229
|
+
- `list_pending_operations` — List pending operations for recovery
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
152
233
|
## Configuration
|
|
153
234
|
|
|
154
235
|
### Claude Desktop
|
|
@@ -196,99 +277,108 @@ Add to your Windsurf MCP config:
|
|
|
196
277
|
}
|
|
197
278
|
```
|
|
198
279
|
|
|
199
|
-
### Amazon Q
|
|
280
|
+
### Amazon Q
|
|
281
|
+
|
|
282
|
+
Add to your Amazon Q MCP config:
|
|
283
|
+
|
|
284
|
+
```json
|
|
285
|
+
{
|
|
286
|
+
"mcpServers": {
|
|
287
|
+
"mcp-code-context": {
|
|
288
|
+
"command": "npx",
|
|
289
|
+
"args": ["-y", "mcp-code-context"]
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Kiro
|
|
296
|
+
|
|
297
|
+
Add to your Kiro MCP config (`.kiro/settings/mcp.json`):
|
|
298
|
+
|
|
299
|
+
```json
|
|
300
|
+
{
|
|
301
|
+
"mcpServers": {
|
|
302
|
+
"mcp-code-context": {
|
|
303
|
+
"command": "npx",
|
|
304
|
+
"args": ["-y", "mcp-code-context"]
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Antigravity
|
|
311
|
+
|
|
312
|
+
Add to your Antigravity MCP config (`.antigravity/mcp.json`):
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"mcpServers": {
|
|
317
|
+
"mcp-code-context": {
|
|
318
|
+
"command": "npx",
|
|
319
|
+
"args": ["-y", "mcp-code-context"]
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Other MCP Clients
|
|
200
326
|
|
|
201
327
|
Any MCP-compatible client can use this server. The transport is **stdio** (JSON-RPC over stdin/stdout). Point your client to `npx -y mcp-code-context`.
|
|
202
328
|
|
|
329
|
+
---
|
|
330
|
+
|
|
203
331
|
## Tools
|
|
204
332
|
|
|
205
|
-
###
|
|
206
|
-
|
|
207
|
-
####
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
All write tools follow a **Two-Phase Workflow**:
|
|
256
|
-
1. **Call without token**: Returns a unified `diff` and a `confirmationToken`.
|
|
257
|
-
2. **Call with token**: Set `confirm: true` and provide the token to apply the changes.
|
|
258
|
-
|
|
259
|
-
#### 8. `write_file_surgical`
|
|
260
|
-
Replace the full source code of a named symbol in a file.
|
|
261
|
-
- `filePath` (required) — Path to the file
|
|
262
|
-
- `symbolName` (required) — Symbol to replace
|
|
263
|
-
- `newContent` (required) — Replacement code (signature + body)
|
|
264
|
-
- `confirmationToken` (optional) — Token from Phase 1 to apply changes
|
|
265
|
-
- `confirm` (optional) — Set to `true` to apply
|
|
266
|
-
- `className` (optional) — Scope the symbol to a specific class
|
|
267
|
-
|
|
268
|
-
#### 9. `insert_symbol`
|
|
269
|
-
Insert new code at a precise location relative to an existing symbol.
|
|
270
|
-
- `filePath` (required) — Path to the file
|
|
271
|
-
- `code` (required) — Code to insert
|
|
272
|
-
- `anchorSymbol` (optional) — Symbol to position relative to
|
|
273
|
-
- `position` (optional) — `"before"`, `"after"`, `"inside_start"`, `"inside_end"`
|
|
274
|
-
- `className` (optional) — Scope the anchor to a specific class
|
|
275
|
-
- `confirmationToken`, `confirm` (optional)
|
|
276
|
-
|
|
277
|
-
#### 10. `rename_symbol`
|
|
278
|
-
Rename a symbol across the entire repository (definition + all usages).
|
|
279
|
-
- `filePath` (required) — File where the symbol is defined
|
|
280
|
-
- `oldName` (required) — Current name
|
|
281
|
-
- `newName` (required) — New name
|
|
282
|
-
- `rootDir` (optional) — Repository root
|
|
283
|
-
- `confirmationToken`, `confirm` (optional)
|
|
284
|
-
|
|
285
|
-
#### 11. `remove_symbol`
|
|
286
|
-
Safely remove a symbol from a file with dependency checking.
|
|
287
|
-
- `filePath` (required) — Path to the file
|
|
288
|
-
- `symbolName` (required) — Symbol to remove
|
|
289
|
-
- `className` (optional) — Scope the symbol to a specific class
|
|
290
|
-
- `force` (optional) — Skip dependency check
|
|
291
|
-
- `confirmationToken`, `confirm` (optional)
|
|
333
|
+
### Tool Reference (25 tools)
|
|
334
|
+
|
|
335
|
+
#### Read Tools
|
|
336
|
+
|
|
337
|
+
| Tool | Key Params | Description |
|
|
338
|
+
|------|-----------|-------------|
|
|
339
|
+
| `get_semantic_repo_map` | `directoryPath`, `projectRoot`, `format` | Compressed XML/Markdown repo overview with AST symbols |
|
|
340
|
+
| `read_file_surgical` | `filePath`, `projectRoot`, `symbolName?`, `className?` | Extract one symbol or full file |
|
|
341
|
+
| `analyze_impact` | `filePath`, `projectRoot`, `rootDir?` | All files that depend on this file |
|
|
342
|
+
| `read_file_lines` | `filePath`, `projectRoot`, `startLine?`, `endLine?`, `aroundPattern?` | Read a line range or pattern context |
|
|
343
|
+
| `search_code_pattern` | `rootDir`, `projectRoot`, `pattern`, `fileExtensions?`, `fuzzyMatch?` | Regex search across files (ripgrep-fast) |
|
|
344
|
+
| `parse_file` | `filePath`, `projectRoot` | All symbols with line numbers (cheap index) |
|
|
345
|
+
| `search_symbols` | `rootDir`, `projectRoot`, `query`, `fuzzy?`, `types?` | AST symbol search by name, not text |
|
|
346
|
+
| `explain_symbol` | `filePath`, `projectRoot`, `symbolName`, `rootDir?` | Signature + location + callers in one call |
|
|
347
|
+
| `batch_read` | `reads[]`, `projectRoot` | N symbols from N files in 1 round-trip |
|
|
348
|
+
| `get_rate_limit_status` | — | Token balance + `canAfford` map |
|
|
349
|
+
|
|
350
|
+
#### Write Tools (Two-Phase: preview → confirm)
|
|
351
|
+
|
|
352
|
+
All write tools require two calls:
|
|
353
|
+
1. **Phase 1** — Call normally → returns `diff` + `confirmationToken`
|
|
354
|
+
2. **Phase 2** — Call again with `confirm: true` + `confirmationToken` → applies changes
|
|
355
|
+
|
|
356
|
+
`newContent`/`code` are **not required** in Phase 2 — the server stores them from Phase 1.
|
|
357
|
+
|
|
358
|
+
| Tool | Key Params | Description |
|
|
359
|
+
|------|-----------|-------------|
|
|
360
|
+
| `write_file_surgical` | `filePath`, `projectRoot`, `symbolName`, `newContent`, `className?` | Replace a symbol with new code |
|
|
361
|
+
| `insert_symbol` | `filePath`, `projectRoot`, `code`, `anchorSymbol?`, `position?`, `className?` | Insert code before/after/inside a symbol |
|
|
362
|
+
| `remove_symbol` | `filePath`, `projectRoot`, `symbolName`, `className?`, `force?` | Remove a symbol (with dependency check) |
|
|
363
|
+
| `rename_symbol` | `filePath`, `projectRoot`, `oldName`, `newName`, `rootDir?` | Rename across entire repo (AST + regex) |
|
|
364
|
+
| `ast_transform` | `filePath`, `projectRoot`, `symbolName`, `transform`, `className?` | Declarative transforms: `wrap_with_try_catch`, `add_parameter`, `add_decorator`, `change_return_type`, `extract_variable` |
|
|
365
|
+
|
|
366
|
+
#### Admin / Recovery Tools
|
|
367
|
+
|
|
368
|
+
| Tool | Key Params | Description |
|
|
369
|
+
|------|-----------|-------------|
|
|
370
|
+
| `rollback_file` | `filePath`, `projectRoot`, `steps?` | Restore file from rolling backup (up to 5 versions) |
|
|
371
|
+
| `clean_backups` | `projectRoot` | Delete all backups for this project |
|
|
372
|
+
| `get_server_stats` | — | Telemetry, audit stats, rate limiter state |
|
|
373
|
+
| `get_cache_stats` | `projectRoot` | Cache entries, size, hit rate |
|
|
374
|
+
| `clear_cache` | `projectRoot` | Invalidate cache for this project |
|
|
375
|
+
| `configure_file_watcher` | `projectRoot`, `action` (`start`/`stop`), `debounceMs?` | Auto-invalidate cache on file changes |
|
|
376
|
+
| `get_file_watcher_status` | `projectRoot` | Watcher state + watched paths |
|
|
377
|
+
| `get_session_stats` | — | Per-session: pending ops, locks, tokens |
|
|
378
|
+
| `clear_session_cache` | `projectRoot?` | Clear cache for current session only |
|
|
379
|
+
| `list_pending_operations` | — | List pending Phase 1 tokens (crash recovery) |
|
|
380
|
+
|
|
381
|
+
---
|
|
292
382
|
|
|
293
383
|
## Recommended Workflow
|
|
294
384
|
|
|
@@ -416,6 +506,8 @@ npm test
|
|
|
416
506
|
npm run dev
|
|
417
507
|
```
|
|
418
508
|
|
|
509
|
+
---
|
|
510
|
+
|
|
419
511
|
## Technical Details
|
|
420
512
|
|
|
421
513
|
- **Transport:** stdio (JSON-RPC over stdin/stdout)
|
|
@@ -430,18 +522,35 @@ npm run dev
|
|
|
430
522
|
- **File Locking:** proper-lockfile@4.1.2 (multi-process safe, OS temp)
|
|
431
523
|
- **Diff:** diff-match-patch@1.0.5 (Myers algorithm, O(n+d²))
|
|
432
524
|
- **Ignore Engine:** `ignore` npm package (full .gitignore spec support)
|
|
433
|
-
- **Safety Features:** Mandatory two-phase confirmation, rolling 5-version backups, fuzzy matching, dependency checking, surgical restoration, ReDoS protection via worker_threads.
|
|
525
|
+
- **Safety Features:** Mandatory two-phase confirmation, rolling 5-version backups, fuzzy matching, dependency checking, surgical restoration, ReDoS protection via worker_threads, session-scoped state.
|
|
434
526
|
- **Portability:** 100% WASM - no native dependencies, works on all platforms
|
|
435
|
-
- **Tests:**
|
|
527
|
+
- **Tests:** 83 passing (unit + integration + performance + stress)
|
|
528
|
+
|
|
529
|
+
### v3.7.0 Key Changes
|
|
530
|
+
|
|
531
|
+
| Component | Change | Benefit |
|
|
532
|
+
|-----------|--------|---------|
|
|
533
|
+
| State management | Session-scoped instead of global | No state leakage between clients |
|
|
534
|
+
| Pending operations | SQLite-backed | Survive server restarts |
|
|
535
|
+
| ReDoS patterns | 6 → 15+ | Better security |
|
|
536
|
+
| Cache eviction | Auto-persist before close | Cache data preserved |
|
|
537
|
+
| File limits | MAX_FILES = 2000 (was 500) | Better support for large projects |
|
|
538
|
+
| Tests | Added multi-client concurrency tests | Production readiness verified |
|
|
539
|
+
|
|
540
|
+
---
|
|
436
541
|
|
|
437
542
|
## Contributing
|
|
438
543
|
|
|
439
544
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
440
545
|
|
|
546
|
+
---
|
|
547
|
+
|
|
441
548
|
## Security
|
|
442
549
|
|
|
443
550
|
See [SECURITY.md](SECURITY.md) for security policies and reporting vulnerabilities.
|
|
444
551
|
|
|
552
|
+
---
|
|
553
|
+
|
|
445
554
|
## Troubleshooting
|
|
446
555
|
|
|
447
556
|
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common issues and solutions.
|
|
@@ -453,6 +562,9 @@ Because MCP uses `stdout` for protocol communication, all logs are safely routed
|
|
|
453
562
|
- **Claude Desktop (macOS)**: `~/Library/Logs/Claude/mcp-server-mcp-code-context.log`
|
|
454
563
|
- **Claude Desktop (Windows)**: `%APPDATA%\Claude\logs\mcp-server-mcp-code-context.log`
|
|
455
564
|
- **Cursor**: `Output` panel → Select `mcp-code-context` from the dropdown
|
|
565
|
+
- **Amazon Q**: Check `stderr` output in the MCP server configuration
|
|
566
|
+
- **Kiro**: Check logs in the MCP server view
|
|
567
|
+
- **Antigravity**: Check logs in the MCP server view
|
|
456
568
|
|
|
457
569
|
**Environment Variables** (optional):
|
|
458
570
|
|
|
@@ -473,10 +585,14 @@ Because MCP uses `stdout` for protocol communication, all logs are safely routed
|
|
|
473
585
|
|
|
474
586
|
Supported `LOG_LEVEL` values: `fatal`, `error`, `warn`, `info`, `debug`, `trace` (default: `info`).
|
|
475
587
|
|
|
588
|
+
---
|
|
589
|
+
|
|
476
590
|
## Changelog
|
|
477
591
|
|
|
478
592
|
See [CHANGELOG.md](CHANGELOG.md) for version history.
|
|
479
593
|
|
|
594
|
+
---
|
|
595
|
+
|
|
480
596
|
## License
|
|
481
597
|
|
|
482
598
|
[MIT](LICENSE)
|
package/SECURITY.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Security Policy - mcp-code-context v3.
|
|
1
|
+
# Security Policy - mcp-code-context v3.7.0
|
|
2
2
|
|
|
3
|
-
## 🔒 Security Improvements in v3.
|
|
3
|
+
## 🔒 Security Improvements in v3.7.0
|
|
4
4
|
|
|
5
|
-
This release addresses **all critical security vulnerabilities** from comprehensive adversarial audit, implements full middleware pipeline, and hardens all 13 tool handlers.
|
|
5
|
+
This release addresses **all critical security vulnerabilities** from comprehensive adversarial audit, implements full middleware pipeline, and hardens all 13 tool handlers. **NEW**: Session-scoped state isolation prevents cross-client data leakage.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -10,11 +10,11 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
10
10
|
|
|
11
11
|
### 1. Path Traversal (HIGH)
|
|
12
12
|
**CVSS Score**: 8.1 (High)
|
|
13
|
-
**Status**: ✅ FIXED in v3.2.0, **hardened in v3.
|
|
13
|
+
**Status**: ✅ FIXED in v3.2.0, **hardened in v3.7.0**
|
|
14
14
|
|
|
15
15
|
**Description**: Path traversal check occurred BEFORE path normalization, allowing bypass with absolute paths.
|
|
16
16
|
|
|
17
|
-
**Fix**: Check boundary AFTER `path.resolve()` normalization. In v3.
|
|
17
|
+
**Fix**: Check boundary AFTER `path.resolve()` normalization. In v3.7.0, **all 13 handlers** now require `projectRoot` and validate via `SecurityValidator`.
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -40,11 +40,11 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
40
40
|
|
|
41
41
|
### 4. ReDoS in searchPattern and readLines (MEDIUM)
|
|
42
42
|
**CVSS Score**: 5.3 (Medium)
|
|
43
|
-
**Status**: ✅ FIXED in v3.
|
|
43
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
44
44
|
|
|
45
45
|
**Description**: User-provided regex patterns could cause catastrophic backtracking.
|
|
46
46
|
|
|
47
|
-
**Fix**: All regex operations now use `safeRegexTest()` with pattern validation and timeout enforcement (1s limit).
|
|
47
|
+
**Fix**: All regex operations now use `safeRegexTest()` with pattern validation and timeout enforcement (1s limit). **NEW**: 15+ patterns detected (was 6).
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
@@ -52,13 +52,13 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
52
52
|
**CVSS Score**: 5.9 (Medium)
|
|
53
53
|
**Status**: ✅ FIXED in v3.2.0
|
|
54
54
|
|
|
55
|
-
**Fix**: `MAX_TOTAL_SIZE_BYTES` (50MB) + `MAX_FILES_REPO_MAP` (
|
|
55
|
+
**Fix**: `MAX_TOTAL_SIZE_BYTES` (50MB) + `MAX_FILES_REPO_MAP` (2000) limits.
|
|
56
56
|
|
|
57
57
|
---
|
|
58
58
|
|
|
59
59
|
### 6. extractSymbol API Mismatch (CRITICAL)
|
|
60
60
|
**CVSS Score**: 9.0 (Critical)
|
|
61
|
-
**Status**: ✅ FIXED in v3.
|
|
61
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
62
62
|
|
|
63
63
|
**Description**: `read.ts` passed `content` as `symbolName` and real `symbolName` as `className`. Symbol extraction was 100% broken.
|
|
64
64
|
|
|
@@ -68,7 +68,7 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
68
68
|
|
|
69
69
|
### 7. Handlers Without Path Validation (HIGH)
|
|
70
70
|
**CVSS Score**: 8.5 (High)
|
|
71
|
-
**Status**: ✅ FIXED in v3.
|
|
71
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
72
72
|
|
|
73
73
|
**Description**: `readLines`, `searchPattern`, `analyzeImpact`, `getSemanticRepoMap` had no path boundary check.
|
|
74
74
|
|
|
@@ -78,7 +78,7 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
78
78
|
|
|
79
79
|
### 8. renameSymbol Arbitrary Write (HIGH)
|
|
80
80
|
**CVSS Score**: 8.0 (High)
|
|
81
|
-
**Status**: ✅ FIXED in v3.
|
|
81
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
82
82
|
|
|
83
83
|
**Description**: `renameSymbol` wrote dependent files without SecurityValidator check, using non-atomic writes.
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
88
88
|
|
|
89
89
|
### 9. LCS Diff OOM (MEDIUM)
|
|
90
90
|
**CVSS Score**: 5.0 (Medium)
|
|
91
|
-
**Status**: ✅ FIXED in v3.
|
|
91
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
92
92
|
|
|
93
93
|
**Description**: LCS diff algorithm is O(n²) memory — 10K-line files cause OOM.
|
|
94
94
|
|
|
@@ -96,31 +96,60 @@ This release addresses **all critical security vulnerabilities** from comprehens
|
|
|
96
96
|
|
|
97
97
|
---
|
|
98
98
|
|
|
99
|
+
### 10. Session State Leakage (HIGH) — **NEW**
|
|
100
|
+
**CVSS Score**: 7.5 (High)
|
|
101
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
102
|
+
|
|
103
|
+
**Description**: Global state (`globalLockManager`, `globalConfirmationStore`, `rateLimiter`) accumulated across client sessions with no cleanup.
|
|
104
|
+
|
|
105
|
+
**Impact**: Memory leak guaranteed in long-running server instances. After 24h uptime, OOM likely.
|
|
106
|
+
|
|
107
|
+
**Fix**: Implemented `sessionStates` Map with proper cleanup on disconnect. Added `close()` method for each session to release WASM heap and file watchers.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### 11. Pending Operations Not Persistent (HIGH) — **NEW**
|
|
112
|
+
**CVSS Score**: 7.0 (High)
|
|
113
|
+
**Status**: ✅ FIXED in v3.7.0
|
|
114
|
+
|
|
115
|
+
**Description**: Pending operations stored in `globalConfirmationStore` (in-memory Map). No persistence.
|
|
116
|
+
|
|
117
|
+
**Impact**: If server crashes between Phase 1 and Phase 2, ALL work is lost. No way for user to recover.
|
|
118
|
+
|
|
119
|
+
**Fix**: Implemented `PendingOperationStore` using same SQLite DB as `CacheManager`. Operations persist across restarts.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
99
123
|
## Security Features
|
|
100
124
|
|
|
101
125
|
### Defense in Depth
|
|
102
126
|
|
|
103
127
|
1. **Input Validation**
|
|
104
|
-
- Path boundary enforcement on ALL handlers (v3.
|
|
128
|
+
- Path boundary enforcement on ALL handlers (v3.7.0)
|
|
105
129
|
- File size limits (10MB per file, 50MB total)
|
|
106
130
|
- Regex sanitization + timeout (1s limit)
|
|
131
|
+
- **NEW**: 15+ ReDoS patterns detected (was 6)
|
|
107
132
|
|
|
108
|
-
2. **Two-Phase Write Workflow** (v3.
|
|
133
|
+
2. **Two-Phase Write Workflow** (v3.7.0)
|
|
109
134
|
- Phase 1: Dry-run returns diff + confirmation token
|
|
110
135
|
- Phase 2: Apply with token (5-minute expiry)
|
|
111
136
|
- Max 50 pending operations
|
|
112
137
|
|
|
113
|
-
3. **Middleware Pipeline** (v3.
|
|
138
|
+
3. **Middleware Pipeline** (v3.7.0)
|
|
114
139
|
- Rate limiting (token bucket per operation)
|
|
115
140
|
- File locking (prevents concurrent writes)
|
|
116
141
|
- Audit logging (persistent `.mcp-audit-logs/`)
|
|
117
142
|
- Telemetry (operation metrics, percentiles)
|
|
118
143
|
|
|
119
|
-
4. **
|
|
144
|
+
4. **Session-Scoped State** (v3.7.0)
|
|
145
|
+
- Each MCP client gets isolated locks, confirmation store, rate limiter
|
|
146
|
+
- No state leakage between clients (Amazon Q, Kiro, Cursor, etc.)
|
|
147
|
+
|
|
148
|
+
5. **Syntax Validation**
|
|
120
149
|
- AST parsing of generated code post-write
|
|
121
150
|
- Rejection of invalid syntax before any file modification
|
|
122
151
|
|
|
123
|
-
|
|
152
|
+
6. **Atomic Writes**
|
|
124
153
|
- Write to `.tmp` file, then rename
|
|
125
154
|
- Prevents corruption on crash/timeout
|
|
126
155
|
|
|
@@ -145,10 +174,12 @@ node dist-tests/tests/test-security.js
|
|
|
145
174
|
- ✅ Path traversal (all handlers)
|
|
146
175
|
- ✅ Regex injection (sanitization + timeout)
|
|
147
176
|
- ✅ File size validation
|
|
148
|
-
- ✅ ReDoS detection
|
|
177
|
+
- ✅ ReDoS detection (15+ patterns)
|
|
149
178
|
- ✅ Two-phase write confirmation
|
|
150
179
|
- ✅ Rate limiting
|
|
151
180
|
- ✅ File locking
|
|
181
|
+
- ✅ Session isolation
|
|
182
|
+
- ✅ Crash recovery
|
|
152
183
|
|
|
153
184
|
---
|
|
154
185
|
|
|
@@ -160,8 +191,9 @@ node dist-tests/tests/test-security.js
|
|
|
160
191
|
- [x] Syntax validation
|
|
161
192
|
- [x] Bounded memory in compress
|
|
162
193
|
|
|
163
|
-
### v3.
|
|
194
|
+
### v3.7.0 ✅
|
|
164
195
|
- [x] Regex timeout enforcement (safeRegexTest)
|
|
196
|
+
- [x] Expanded ReDoS detection (15+ patterns)
|
|
165
197
|
- [x] Rate limiting (token bucket)
|
|
166
198
|
- [x] File locking (concurrent write prevention)
|
|
167
199
|
- [x] Audit logging (persistent, rotated)
|
|
@@ -170,8 +202,10 @@ node dist-tests/tests/test-security.js
|
|
|
170
202
|
- [x] All handlers validated with projectRoot
|
|
171
203
|
- [x] extractSymbol bug fix
|
|
172
204
|
- [x] Diff OOM guard
|
|
205
|
+
- [x] Session-scoped state isolation
|
|
206
|
+
- [x] SQLite-backed pending operations store
|
|
173
207
|
|
|
174
208
|
---
|
|
175
209
|
|
|
176
|
-
**Last Updated**: 2026-
|
|
177
|
-
**Version**: 3.
|
|
210
|
+
**Last Updated**: 2026-06-08
|
|
211
|
+
**Version**: 3.7.0
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* WASM SQLite cache with debounced persistence
|
|
4
|
-
*/
|
|
1
|
+
/** Cache Manager - WASM SQLite cache with debounced persistence */
|
|
2
|
+
import type { SymbolInfo } from '../parsers/base.js';
|
|
5
3
|
export interface CachedFile {
|
|
6
4
|
filePath: string;
|
|
7
5
|
hash: string;
|
|
8
|
-
symbols:
|
|
6
|
+
symbols: SymbolInfo[];
|
|
9
7
|
lastModified: number;
|
|
10
8
|
cachedAt: number;
|
|
11
9
|
}
|
|
@@ -14,6 +12,7 @@ export declare class CacheManager {
|
|
|
14
12
|
private dbPath;
|
|
15
13
|
private cacheDir;
|
|
16
14
|
private isDirty;
|
|
15
|
+
private isPersisting;
|
|
17
16
|
private persistTimer;
|
|
18
17
|
private initPromise;
|
|
19
18
|
private watcher;
|