mcp-code-context 3.4.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -3
- package/CHANGELOG_v3.2.0.md +196 -196
- package/CHANGELOG_v3.3.0.md +266 -266
- package/SECURITY.md +177 -177
- package/dist/src/core/engine.d.ts +1 -1
- package/dist/src/core/engine.js +11 -1
- package/dist/src/core/engine.js.map +1 -1
- package/dist/src/core/validator.d.ts +1 -1
- package/dist/src/core/validator.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +2 -2
- package/dist/src/operations/compress.d.ts +1 -1
- package/dist/src/operations/compress.js +1 -1
- package/dist/src/operations/confirmationStore.d.ts +1 -1
- package/dist/src/operations/confirmationStore.js +1 -1
- package/dist/src/operations/read.d.ts +1 -1
- package/dist/src/operations/read.js +1 -1
- package/dist/src/operations/write.d.ts +2 -2
- package/dist/src/operations/write.js +2 -2
- package/dist/src/parsers/base.d.ts +1 -1
- package/dist/src/parsers/base.js +1 -1
- package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
- package/dist/src/parsers/dartTreeSitter.js +1 -1
- 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 +1 -1
- package/dist/src/parsers/typescript.d.ts +1 -1
- package/dist/src/parsers/typescript.js +1 -1
- package/dist/src/utils/auditLogger.d.ts +1 -1
- package/dist/src/utils/auditLogger.js +1 -1
- package/dist/src/utils/backupManager.d.ts +1 -1
- package/dist/src/utils/backupManager.js +1 -1
- package/dist/src/utils/constants.d.ts +1 -1
- package/dist/src/utils/constants.js +1 -1
- package/dist/src/utils/diff.d.ts +1 -1
- package/dist/src/utils/diff.js +1 -1
- package/dist/src/utils/fileLock.d.ts +1 -1
- package/dist/src/utils/fileLock.js +1 -1
- package/dist/src/utils/rateLimiter.d.ts +1 -1
- package/dist/src/utils/rateLimiter.js +1 -1
- package/dist/src/utils/safeRegex.d.ts +1 -1
- package/dist/src/utils/safeRegex.js +1 -1
- package/dist/src/utils/streaming.d.ts +1 -1
- package/dist/src/utils/streaming.js +1 -1
- package/dist/src/utils/telemetry.d.ts +1 -1
- package/dist/src/utils/telemetry.js +1 -1
- package/llms.txt +5 -5
- package/package.json +1 -1
- package/scripts/replace-version.js +59 -0
package/dist/src/utils/diff.d.ts
CHANGED
package/dist/src/utils/diff.js
CHANGED
package/llms.txt
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# mcp-code-context v3.4.
|
|
1
|
+
# mcp-code-context v3.4.1
|
|
2
2
|
|
|
3
3
|
> A Model Context Protocol (MCP) server with **Tree-sitter WASM parsers** for 100% AST accuracy. Zero native dependencies. Production-ready with middleware pipeline.
|
|
4
4
|
|
|
5
|
-
## What's New in v3.4.
|
|
5
|
+
## What's New in v3.4.1
|
|
6
6
|
|
|
7
7
|
🔒 **Production Hardening**:
|
|
8
8
|
- ✅ Two-phase write workflow (dry-run + confirmation token)
|
|
@@ -142,13 +142,13 @@ This MCP server solves two problems:
|
|
|
142
142
|
- `steps` (optional): Number of versions to go back (1-5, default: 1).
|
|
143
143
|
**What it does:** Reverts the file to the state it was in before the last 1-5 modifications.
|
|
144
144
|
|
|
145
|
-
### Write Tools (v3.4.
|
|
145
|
+
### Write Tools (v3.4.1 Two-Phase Workflow)
|
|
146
146
|
|
|
147
147
|
All write tools follow a **Two-Phase Workflow**:
|
|
148
148
|
1. **Phase 1 (Preview)**: Call without a token to get a unified `diff` and a `confirmationToken`.
|
|
149
149
|
2. **Phase 2 (Apply)**: Call with `confirmationToken` and `confirm: true` to apply the changes.
|
|
150
150
|
|
|
151
|
-
**Important Notes (v3.4.
|
|
151
|
+
**Important Notes (v3.4.1):**
|
|
152
152
|
- ✅ **Windows CRLF Support**: Fully resolved. All operations work correctly on Windows files with CRLF line endings.
|
|
153
153
|
- ✅ **Parameter Brace Handling**: Methods with braces in parameters (e.g., `{int? cart}`) are now handled correctly.
|
|
154
154
|
|
|
@@ -236,7 +236,7 @@ All write tools follow a **Two-Phase Workflow**:
|
|
|
236
236
|
5. **Phase 2: Apply Edit** → Verify the diff, then call with the token and `confirm: true`.
|
|
237
237
|
6. **Recovery** → Use `rollback_file` if needed.
|
|
238
238
|
|
|
239
|
-
### Additional Tools (v3.4.
|
|
239
|
+
### Additional Tools (v3.4.1)
|
|
240
240
|
|
|
241
241
|
#### 11. `parse_file`
|
|
242
242
|
**Purpose:** Parse a file using Tree-sitter and extract all symbols.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-code-context",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "Powerful MCP server with Tree-sitter WASM parsers for 100% AST accuracy. Zero native dependencies. Production-ready with streaming, telemetry, audit logging, rate limiting, file locking, and ReDoS protection. Supports TypeScript, JavaScript, PHP, Dart, and Python.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Universal Version Replacer - v1.0.0
|
|
6
|
+
* Usage: node scripts/replace-version.js <oldVersion> <newVersion>
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const [,, oldVersion, newVersion] = process.argv;
|
|
10
|
+
|
|
11
|
+
if (!oldVersion || !newVersion) {
|
|
12
|
+
console.error('Usage: node scripts/replace-version.js <oldVersion> <newVersion>');
|
|
13
|
+
console.error('Example: node scripts/replace-version.js 3.4.0 3.4.1');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const root = process.cwd();
|
|
18
|
+
const oldRegex = new RegExp(oldVersion.replace(/\./g, '\\.'), 'g');
|
|
19
|
+
|
|
20
|
+
console.log(`🚀 Starting global replace: ${oldVersion} -> ${newVersion}`);
|
|
21
|
+
|
|
22
|
+
function walk(dir) {
|
|
23
|
+
const files = fs.readdirSync(dir);
|
|
24
|
+
for (const file of files) {
|
|
25
|
+
const fullPath = path.join(dir, file);
|
|
26
|
+
|
|
27
|
+
// Safety boundaries
|
|
28
|
+
if (fullPath.includes('.git') ||
|
|
29
|
+
fullPath.includes('node_modules') ||
|
|
30
|
+
fullPath.includes('scripts') ||
|
|
31
|
+
file === 'stderr.txt' ||
|
|
32
|
+
file === 'stdout.txt') continue;
|
|
33
|
+
|
|
34
|
+
const stat = fs.statSync(fullPath);
|
|
35
|
+
if (stat.isDirectory()) {
|
|
36
|
+
walk(fullPath);
|
|
37
|
+
} else {
|
|
38
|
+
// Process only relevant text files
|
|
39
|
+
const ext = path.extname(file).toLowerCase();
|
|
40
|
+
const textExtensions = ['.ts', '.js', '.json', '.md', '.txt', '.d.ts', '.map'];
|
|
41
|
+
|
|
42
|
+
if (textExtensions.includes(ext) || file.endsWith('.d.ts')) {
|
|
43
|
+
try {
|
|
44
|
+
const content = fs.readFileSync(fullPath, 'utf8');
|
|
45
|
+
if (content.includes(oldVersion)) {
|
|
46
|
+
const updated = content.replace(oldRegex, newVersion);
|
|
47
|
+
fs.writeFileSync(fullPath, updated, 'utf8');
|
|
48
|
+
console.log(`✅ Updated: ${fullPath}`);
|
|
49
|
+
}
|
|
50
|
+
} catch (err) {
|
|
51
|
+
console.warn(`⚠️ Skipped ${fullPath}: ${err.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
walk(root);
|
|
59
|
+
console.log('✨ Version update complete.');
|