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.
Files changed (52) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/CHANGELOG_v3.2.0.md +196 -196
  3. package/CHANGELOG_v3.3.0.md +266 -266
  4. package/SECURITY.md +177 -177
  5. package/dist/src/core/engine.d.ts +1 -1
  6. package/dist/src/core/engine.js +11 -1
  7. package/dist/src/core/engine.js.map +1 -1
  8. package/dist/src/core/validator.d.ts +1 -1
  9. package/dist/src/core/validator.js +1 -1
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.js +2 -2
  12. package/dist/src/operations/compress.d.ts +1 -1
  13. package/dist/src/operations/compress.js +1 -1
  14. package/dist/src/operations/confirmationStore.d.ts +1 -1
  15. package/dist/src/operations/confirmationStore.js +1 -1
  16. package/dist/src/operations/read.d.ts +1 -1
  17. package/dist/src/operations/read.js +1 -1
  18. package/dist/src/operations/write.d.ts +2 -2
  19. package/dist/src/operations/write.js +2 -2
  20. package/dist/src/parsers/base.d.ts +1 -1
  21. package/dist/src/parsers/base.js +1 -1
  22. package/dist/src/parsers/dartTreeSitter.d.ts +1 -1
  23. package/dist/src/parsers/dartTreeSitter.js +1 -1
  24. package/dist/src/parsers/php.d.ts +1 -1
  25. package/dist/src/parsers/php.js +1 -1
  26. package/dist/src/parsers/python.d.ts +1 -1
  27. package/dist/src/parsers/python.js +1 -1
  28. package/dist/src/parsers/registry.d.ts +1 -1
  29. package/dist/src/parsers/registry.js +1 -1
  30. package/dist/src/parsers/typescript.d.ts +1 -1
  31. package/dist/src/parsers/typescript.js +1 -1
  32. package/dist/src/utils/auditLogger.d.ts +1 -1
  33. package/dist/src/utils/auditLogger.js +1 -1
  34. package/dist/src/utils/backupManager.d.ts +1 -1
  35. package/dist/src/utils/backupManager.js +1 -1
  36. package/dist/src/utils/constants.d.ts +1 -1
  37. package/dist/src/utils/constants.js +1 -1
  38. package/dist/src/utils/diff.d.ts +1 -1
  39. package/dist/src/utils/diff.js +1 -1
  40. package/dist/src/utils/fileLock.d.ts +1 -1
  41. package/dist/src/utils/fileLock.js +1 -1
  42. package/dist/src/utils/rateLimiter.d.ts +1 -1
  43. package/dist/src/utils/rateLimiter.js +1 -1
  44. package/dist/src/utils/safeRegex.d.ts +1 -1
  45. package/dist/src/utils/safeRegex.js +1 -1
  46. package/dist/src/utils/streaming.d.ts +1 -1
  47. package/dist/src/utils/streaming.js +1 -1
  48. package/dist/src/utils/telemetry.d.ts +1 -1
  49. package/dist/src/utils/telemetry.js +1 -1
  50. package/llms.txt +5 -5
  51. package/package.json +1 -1
  52. package/scripts/replace-version.js +59 -0
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Backup Manager - v3.4.0
2
+ * Backup Manager - v3.4.1
3
3
  * Handles rolling backups for file modifications
4
4
  */
5
5
  import * as fs from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Constants - Centralized configuration
3
- * v3.4.0
3
+ * v3.4.1
4
4
  */
5
5
  export declare const EXCLUDE_DIRS: string[];
6
6
  export declare const SUPPORTED_EXTENSIONS: string[];
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Constants - Centralized configuration
3
- * v3.4.0
3
+ * v3.4.1
4
4
  */
5
5
  export const EXCLUDE_DIRS = [
6
6
  "node_modules",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Diff Engine - v3.4.0
2
+ * Diff Engine - v3.4.1
3
3
  * LCS-based unified diff with memory safety cap
4
4
  */
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Diff Engine - v3.4.0
2
+ * Diff Engine - v3.4.1
3
3
  * LCS-based unified diff with memory safety cap
4
4
  */
5
5
  const MAX_DIFF_LINES = 5000;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * File Lock Manager - v3.4.0
2
+ * File Lock Manager - v3.4.1
3
3
  * Prevents concurrent writes to same file
4
4
  */
5
5
  interface LockInfo {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * File Lock Manager - v3.4.0
2
+ * File Lock Manager - v3.4.1
3
3
  * Prevents concurrent writes to same file
4
4
  */
5
5
  export class FileLockManager {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Rate Limiter - v3.4.0
2
+ * Rate Limiter - v3.4.1
3
3
  * Token bucket algorithm for DoS protection
4
4
  */
5
5
  interface RateLimitConfig {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Rate Limiter - v3.4.0
2
+ * Rate Limiter - v3.4.1
3
3
  * Token bucket algorithm for DoS protection
4
4
  */
5
5
  export class RateLimiter {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Safe Regex - v3.4.0
2
+ * Safe Regex - v3.4.1
3
3
  * Regex execution with timeout to prevent ReDoS
4
4
  */
5
5
  export interface RegexResult {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Safe Regex - v3.4.0
2
+ * Safe Regex - v3.4.1
3
3
  * Regex execution with timeout to prevent ReDoS
4
4
  */
5
5
  import { REGEX_TIMEOUT_MS } from './constants.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * File Streaming - v3.4.0
2
+ * File Streaming - v3.4.1
3
3
  * Stream large files in chunks to avoid memory exhaustion
4
4
  */
5
5
  export interface StreamOptions {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * File Streaming - v3.4.0
2
+ * File Streaming - v3.4.1
3
3
  * Stream large files in chunks to avoid memory exhaustion
4
4
  */
5
5
  import * as fs from "node:fs";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Telemetry - v3.4.0
2
+ * Telemetry - v3.4.1
3
3
  * Metrics collection and monitoring
4
4
  */
5
5
  export interface Metric {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Telemetry - v3.4.0
2
+ * Telemetry - v3.4.1
3
3
  * Metrics collection and monitoring
4
4
  */
5
5
  export class TelemetryCollector {
package/llms.txt CHANGED
@@ -1,8 +1,8 @@
1
- # mcp-code-context v3.4.0
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.0
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.0 Two-Phase Workflow)
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.0):**
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.0)
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.0",
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.');