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
package/SECURITY.md CHANGED
@@ -1,177 +1,177 @@
1
- # Security Policy - mcp-code-context v3.4.0
2
-
3
- ## 🔒 Security Improvements in v3.4.0
4
-
5
- This release addresses **all critical security vulnerabilities** from comprehensive adversarial audit, implements full middleware pipeline, and hardens all 13 tool handlers.
6
-
7
- ---
8
-
9
- ## Fixed Vulnerabilities
10
-
11
- ### 1. Path Traversal (HIGH)
12
- **CVSS Score**: 8.1 (High)
13
- **Status**: ✅ FIXED in v3.2.0, **hardened in v3.4.0**
14
-
15
- **Description**: Path traversal check occurred BEFORE path normalization, allowing bypass with absolute paths.
16
-
17
- **Fix**: Check boundary AFTER `path.resolve()` normalization. In v3.4.0, **all 13 handlers** now require `projectRoot` and validate via `SecurityValidator`.
18
-
19
- ---
20
-
21
- ### 2. Regex Injection in renameSymbol (HIGH)
22
- **CVSS Score**: 7.5 (High)
23
- **Status**: ✅ FIXED in v3.2.0
24
-
25
- **Description**: User-provided symbol names used directly in regex without sanitization.
26
-
27
- **Fix**: Sanitize all regex metacharacters via `sanitizeRegexPattern()` before use.
28
-
29
- ---
30
-
31
- ### 3. Code Corruption via Invalid Syntax (CRITICAL)
32
- **CVSS Score**: 9.1 (Critical)
33
- **Status**: ✅ FIXED in v3.2.0
34
-
35
- **Description**: Write operations did not validate syntax of generated code.
36
-
37
- **Fix**: Mandatory AST syntax validation before all writes.
38
-
39
- ---
40
-
41
- ### 4. ReDoS in searchPattern and readLines (MEDIUM)
42
- **CVSS Score**: 5.3 (Medium)
43
- **Status**: ✅ FIXED in v3.4.0
44
-
45
- **Description**: User-provided regex patterns could cause catastrophic backtracking.
46
-
47
- **Fix**: All regex operations now use `safeRegexTest()` with pattern validation and timeout enforcement (1s limit).
48
-
49
- ---
50
-
51
- ### 5. Unbounded Memory in compress (MEDIUM)
52
- **CVSS Score**: 5.9 (Medium)
53
- **Status**: ✅ FIXED in v3.2.0
54
-
55
- **Fix**: `MAX_TOTAL_SIZE_BYTES` (50MB) + `MAX_FILES_REPO_MAP` (500) limits.
56
-
57
- ---
58
-
59
- ### 6. extractSymbol API Mismatch (CRITICAL)
60
- **CVSS Score**: 9.0 (Critical)
61
- **Status**: ✅ FIXED in v3.4.0
62
-
63
- **Description**: `read.ts` passed `content` as `symbolName` and real `symbolName` as `className`. Symbol extraction was 100% broken.
64
-
65
- **Fix**: Corrected argument order to match `BaseParser.extractSymbol(tree, symbolName, className?)`.
66
-
67
- ---
68
-
69
- ### 7. Handlers Without Path Validation (HIGH)
70
- **CVSS Score**: 8.5 (High)
71
- **Status**: ✅ FIXED in v3.4.0
72
-
73
- **Description**: `readLines`, `searchPattern`, `analyzeImpact`, `getSemanticRepoMap` had no path boundary check.
74
-
75
- **Fix**: All 13 handlers now require `projectRoot` and validate all paths via `SecurityValidator`.
76
-
77
- ---
78
-
79
- ### 8. renameSymbol Arbitrary Write (HIGH)
80
- **CVSS Score**: 8.0 (High)
81
- **Status**: ✅ FIXED in v3.4.0
82
-
83
- **Description**: `renameSymbol` wrote dependent files without SecurityValidator check, using non-atomic writes.
84
-
85
- **Fix**: Each dependent file path validated via SecurityValidator + atomic write (write-to-tmp + rename).
86
-
87
- ---
88
-
89
- ### 9. LCS Diff OOM (MEDIUM)
90
- **CVSS Score**: 5.0 (Medium)
91
- **Status**: ✅ FIXED in v3.4.0
92
-
93
- **Description**: LCS diff algorithm is O(n²) memory — 10K-line files cause OOM.
94
-
95
- **Fix**: `MAX_DIFF_LINES = 5000` guard — falls back to O(n) `generateSimpleDiff` for large files.
96
-
97
- ---
98
-
99
- ## Security Features
100
-
101
- ### Defense in Depth
102
-
103
- 1. **Input Validation**
104
- - Path boundary enforcement on ALL handlers (v3.4.0)
105
- - File size limits (10MB per file, 50MB total)
106
- - Regex sanitization + timeout (1s limit)
107
-
108
- 2. **Two-Phase Write Workflow** (v3.4.0)
109
- - Phase 1: Dry-run returns diff + confirmation token
110
- - Phase 2: Apply with token (5-minute expiry)
111
- - Max 50 pending operations
112
-
113
- 3. **Middleware Pipeline** (v3.4.0)
114
- - Rate limiting (token bucket per operation)
115
- - File locking (prevents concurrent writes)
116
- - Audit logging (persistent `.mcp-audit-logs/`)
117
- - Telemetry (operation metrics, percentiles)
118
-
119
- 4. **Syntax Validation**
120
- - AST parsing of generated code post-write
121
- - Rejection of invalid syntax before any file modification
122
-
123
- 5. **Atomic Writes**
124
- - Write to `.tmp` file, then rename
125
- - Prevents corruption on crash/timeout
126
-
127
- ---
128
-
129
- ## Reporting Vulnerabilities
130
-
131
- 1. **DO NOT** open public GitHub issues for security vulnerabilities
132
- 2. Include: Description, Steps to reproduce, Impact, Suggested fix
133
- 3. Response: Critical 24h, High 72h, Medium 1 week
134
-
135
- ---
136
-
137
- ## Security Testing
138
-
139
- ```bash
140
- npm run build:tests
141
- node dist-tests/tests/test-security.js
142
- ```
143
-
144
- **Coverage**:
145
- - ✅ Path traversal (all handlers)
146
- - ✅ Regex injection (sanitization + timeout)
147
- - ✅ File size validation
148
- - ✅ ReDoS detection
149
- - ✅ Two-phase write confirmation
150
- - ✅ Rate limiting
151
- - ✅ File locking
152
-
153
- ---
154
-
155
- ## Completed Security Roadmap
156
-
157
- ### v3.2.0 ✅
158
- - [x] Path traversal fix (normalize before check)
159
- - [x] Regex sanitization
160
- - [x] Syntax validation
161
- - [x] Bounded memory in compress
162
-
163
- ### v3.4.0 ✅
164
- - [x] Regex timeout enforcement (safeRegexTest)
165
- - [x] Rate limiting (token bucket)
166
- - [x] File locking (concurrent write prevention)
167
- - [x] Audit logging (persistent, rotated)
168
- - [x] Telemetry (operation metrics)
169
- - [x] Two-phase write workflow
170
- - [x] All handlers validated with projectRoot
171
- - [x] extractSymbol bug fix
172
- - [x] Diff OOM guard
173
-
174
- ---
175
-
176
- **Last Updated**: 2026-04-24
177
- **Version**: 3.4.0
1
+ # Security Policy - mcp-code-context v3.4.1
2
+
3
+ ## 🔒 Security Improvements in v3.4.1
4
+
5
+ This release addresses **all critical security vulnerabilities** from comprehensive adversarial audit, implements full middleware pipeline, and hardens all 13 tool handlers.
6
+
7
+ ---
8
+
9
+ ## Fixed Vulnerabilities
10
+
11
+ ### 1. Path Traversal (HIGH)
12
+ **CVSS Score**: 8.1 (High)
13
+ **Status**: ✅ FIXED in v3.2.0, **hardened in v3.4.1**
14
+
15
+ **Description**: Path traversal check occurred BEFORE path normalization, allowing bypass with absolute paths.
16
+
17
+ **Fix**: Check boundary AFTER `path.resolve()` normalization. In v3.4.1, **all 13 handlers** now require `projectRoot` and validate via `SecurityValidator`.
18
+
19
+ ---
20
+
21
+ ### 2. Regex Injection in renameSymbol (HIGH)
22
+ **CVSS Score**: 7.5 (High)
23
+ **Status**: ✅ FIXED in v3.2.0
24
+
25
+ **Description**: User-provided symbol names used directly in regex without sanitization.
26
+
27
+ **Fix**: Sanitize all regex metacharacters via `sanitizeRegexPattern()` before use.
28
+
29
+ ---
30
+
31
+ ### 3. Code Corruption via Invalid Syntax (CRITICAL)
32
+ **CVSS Score**: 9.1 (Critical)
33
+ **Status**: ✅ FIXED in v3.2.0
34
+
35
+ **Description**: Write operations did not validate syntax of generated code.
36
+
37
+ **Fix**: Mandatory AST syntax validation before all writes.
38
+
39
+ ---
40
+
41
+ ### 4. ReDoS in searchPattern and readLines (MEDIUM)
42
+ **CVSS Score**: 5.3 (Medium)
43
+ **Status**: ✅ FIXED in v3.4.1
44
+
45
+ **Description**: User-provided regex patterns could cause catastrophic backtracking.
46
+
47
+ **Fix**: All regex operations now use `safeRegexTest()` with pattern validation and timeout enforcement (1s limit).
48
+
49
+ ---
50
+
51
+ ### 5. Unbounded Memory in compress (MEDIUM)
52
+ **CVSS Score**: 5.9 (Medium)
53
+ **Status**: ✅ FIXED in v3.2.0
54
+
55
+ **Fix**: `MAX_TOTAL_SIZE_BYTES` (50MB) + `MAX_FILES_REPO_MAP` (500) limits.
56
+
57
+ ---
58
+
59
+ ### 6. extractSymbol API Mismatch (CRITICAL)
60
+ **CVSS Score**: 9.0 (Critical)
61
+ **Status**: ✅ FIXED in v3.4.1
62
+
63
+ **Description**: `read.ts` passed `content` as `symbolName` and real `symbolName` as `className`. Symbol extraction was 100% broken.
64
+
65
+ **Fix**: Corrected argument order to match `BaseParser.extractSymbol(tree, symbolName, className?)`.
66
+
67
+ ---
68
+
69
+ ### 7. Handlers Without Path Validation (HIGH)
70
+ **CVSS Score**: 8.5 (High)
71
+ **Status**: ✅ FIXED in v3.4.1
72
+
73
+ **Description**: `readLines`, `searchPattern`, `analyzeImpact`, `getSemanticRepoMap` had no path boundary check.
74
+
75
+ **Fix**: All 13 handlers now require `projectRoot` and validate all paths via `SecurityValidator`.
76
+
77
+ ---
78
+
79
+ ### 8. renameSymbol Arbitrary Write (HIGH)
80
+ **CVSS Score**: 8.0 (High)
81
+ **Status**: ✅ FIXED in v3.4.1
82
+
83
+ **Description**: `renameSymbol` wrote dependent files without SecurityValidator check, using non-atomic writes.
84
+
85
+ **Fix**: Each dependent file path validated via SecurityValidator + atomic write (write-to-tmp + rename).
86
+
87
+ ---
88
+
89
+ ### 9. LCS Diff OOM (MEDIUM)
90
+ **CVSS Score**: 5.0 (Medium)
91
+ **Status**: ✅ FIXED in v3.4.1
92
+
93
+ **Description**: LCS diff algorithm is O(n²) memory — 10K-line files cause OOM.
94
+
95
+ **Fix**: `MAX_DIFF_LINES = 5000` guard — falls back to O(n) `generateSimpleDiff` for large files.
96
+
97
+ ---
98
+
99
+ ## Security Features
100
+
101
+ ### Defense in Depth
102
+
103
+ 1. **Input Validation**
104
+ - Path boundary enforcement on ALL handlers (v3.4.1)
105
+ - File size limits (10MB per file, 50MB total)
106
+ - Regex sanitization + timeout (1s limit)
107
+
108
+ 2. **Two-Phase Write Workflow** (v3.4.1)
109
+ - Phase 1: Dry-run returns diff + confirmation token
110
+ - Phase 2: Apply with token (5-minute expiry)
111
+ - Max 50 pending operations
112
+
113
+ 3. **Middleware Pipeline** (v3.4.1)
114
+ - Rate limiting (token bucket per operation)
115
+ - File locking (prevents concurrent writes)
116
+ - Audit logging (persistent `.mcp-audit-logs/`)
117
+ - Telemetry (operation metrics, percentiles)
118
+
119
+ 4. **Syntax Validation**
120
+ - AST parsing of generated code post-write
121
+ - Rejection of invalid syntax before any file modification
122
+
123
+ 5. **Atomic Writes**
124
+ - Write to `.tmp` file, then rename
125
+ - Prevents corruption on crash/timeout
126
+
127
+ ---
128
+
129
+ ## Reporting Vulnerabilities
130
+
131
+ 1. **DO NOT** open public GitHub issues for security vulnerabilities
132
+ 2. Include: Description, Steps to reproduce, Impact, Suggested fix
133
+ 3. Response: Critical 24h, High 72h, Medium 1 week
134
+
135
+ ---
136
+
137
+ ## Security Testing
138
+
139
+ ```bash
140
+ npm run build:tests
141
+ node dist-tests/tests/test-security.js
142
+ ```
143
+
144
+ **Coverage**:
145
+ - ✅ Path traversal (all handlers)
146
+ - ✅ Regex injection (sanitization + timeout)
147
+ - ✅ File size validation
148
+ - ✅ ReDoS detection
149
+ - ✅ Two-phase write confirmation
150
+ - ✅ Rate limiting
151
+ - ✅ File locking
152
+
153
+ ---
154
+
155
+ ## Completed Security Roadmap
156
+
157
+ ### v3.2.0 ✅
158
+ - [x] Path traversal fix (normalize before check)
159
+ - [x] Regex sanitization
160
+ - [x] Syntax validation
161
+ - [x] Bounded memory in compress
162
+
163
+ ### v3.4.1 ✅
164
+ - [x] Regex timeout enforcement (safeRegexTest)
165
+ - [x] Rate limiting (token bucket)
166
+ - [x] File locking (concurrent write prevention)
167
+ - [x] Audit logging (persistent, rotated)
168
+ - [x] Telemetry (operation metrics)
169
+ - [x] Two-phase write workflow
170
+ - [x] All handlers validated with projectRoot
171
+ - [x] extractSymbol bug fix
172
+ - [x] Diff OOM guard
173
+
174
+ ---
175
+
176
+ **Last Updated**: 2026-04-24
177
+ **Version**: 3.4.1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Core Engine - v3.4.0
2
+ * Core Engine - v3.4.1
3
3
  * ASYNC I/O: Migrated to fs.promises
4
4
  */
5
5
  import { Parser, Language } from "web-tree-sitter";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Core Engine - v3.4.0
2
+ * Core Engine - v3.4.1
3
3
  * ASYNC I/O: Migrated to fs.promises
4
4
  */
5
5
  import { Parser, Language } from "web-tree-sitter";
@@ -7,6 +7,7 @@ import * as path from "node:path";
7
7
  import * as fs from "node:fs/promises";
8
8
  import { fileURLToPath } from "node:url";
9
9
  import { dirname } from "path";
10
+ import { createRequire } from "node:module";
10
11
  export class CodeContextEngine {
11
12
  config;
12
13
  initialized = false;
@@ -39,6 +40,15 @@ export class CodeContextEngine {
39
40
  // 3. Fallback to process.cwd()
40
41
  path.join(process.cwd(), "node_modules", "tree-sitter-wasms", "out", wasmFile),
41
42
  ];
43
+ // 4. Robust Node.js module resolution (handles npx hoisting and global installs)
44
+ try {
45
+ const require = createRequire(import.meta.url);
46
+ const pkgPath = require.resolve("tree-sitter-wasms/package.json");
47
+ possiblePaths.unshift(path.join(path.dirname(pkgPath), "out", wasmFile));
48
+ }
49
+ catch {
50
+ // Ignore resolution errors, fallback to manual paths
51
+ }
42
52
  let wasmPath = null;
43
53
  for (const p of possiblePaths) {
44
54
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../../src/core/engine.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM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MAAM,CAAC,CAAC,CAAC,CAAC;gBACnB,QAAQ,GAAG,CAAC,CAAC;gBACb,MAAM;YACR,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,kBAAkB,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChG,CAAC;QAED,0BAA0B;QAC1B,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,YAAY;QACV,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Security Validator - v3.4.0
2
+ * Security Validator - v3.4.1
3
3
  * CRITICAL FIX: Path traversal check AFTER normalization
4
4
  */
5
5
  export interface ValidationResult {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Security Validator - v3.4.0
2
+ * Security Validator - v3.4.1
3
3
  * CRITICAL FIX: Path traversal check AFTER normalization
4
4
  */
5
5
  import * as path from "node:path";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * mcp-code-context v3.4.0 - Tree-sitter WASM Edition
3
+ * mcp-code-context v3.4.1 - Tree-sitter WASM Edition
4
4
  *
5
5
  * Production-ready with:
6
6
  * - Tree-sitter WASM for 100% AST accuracy (TypeScript, Python, PHP, Dart)
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * mcp-code-context v3.4.0 - Tree-sitter WASM Edition
3
+ * mcp-code-context v3.4.1 - Tree-sitter WASM Edition
4
4
  *
5
5
  * Production-ready with:
6
6
  * - Tree-sitter WASM for 100% AST accuracy (TypeScript, Python, PHP, Dart)
@@ -28,7 +28,7 @@ import { streamFile } from "./utils/streaming.js";
28
28
  import { BackupManager } from "./utils/backupManager.js";
29
29
  import * as fs from "node:fs/promises";
30
30
  const SERVER_NAME = "mcp-code-context";
31
- const SERVER_VERSION = "3.4.0";
31
+ const SERVER_VERSION = "3.4.1";
32
32
  // Global instances
33
33
  let engine;
34
34
  let registry;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Semantic Compression - v3.4.0
2
+ * Semantic Compression - v3.4.1
3
3
  * IMPROVEMENTS: Centralized constants + size limits + timeout
4
4
  */
5
5
  import { ParserRegistry } from "../parsers/registry.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Semantic Compression - v3.4.0
2
+ * Semantic Compression - v3.4.1
3
3
  * IMPROVEMENTS: Centralized constants + size limits + timeout
4
4
  */
5
5
  import * as fs from "node:fs/promises";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Confirmation Store - v3.4.0
2
+ * Confirmation Store - v3.4.1
3
3
  * Two-phase write: dry-run preview → confirm with token
4
4
  * Stores pending write operations with auto-expiry
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Confirmation Store - v3.4.0
2
+ * Confirmation Store - v3.4.1
3
3
  * Two-phase write: dry-run preview → confirm with token
4
4
  * Stores pending write operations with auto-expiry
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read Operations - v3.4.0
2
+ * Read Operations - v3.4.1
3
3
  * FIXES: extractSymbol args, safe regex in readLines, forEach+async → for...of
4
4
  */
5
5
  import { BaseParser } from "../parsers/base.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read Operations - v3.4.0
2
+ * Read Operations - v3.4.1
3
3
  * FIXES: extractSymbol args, safe regex in readLines, forEach+async → for...of
4
4
  */
5
5
  import * as fs from "node:fs/promises";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Write Operations - v3.4.0
2
+ * Write Operations - v3.4.1
3
3
  * FIXES: SecurityValidator in renameSymbol, atomic writes, AST-based positioning
4
4
  */
5
5
  import { BaseParser } from "../parsers/base.js";
@@ -47,7 +47,7 @@ export declare function insertCode(options: InsertOptions): Promise<WriteResult>
47
47
  export declare function removeSymbol(options: RemoveOptions): Promise<WriteResult>;
48
48
  /**
49
49
  * Rename symbol using AST-aware replacement
50
- * v3.4.0 - SECURITY FIX: Validates all paths + uses atomic writes
50
+ * v3.4.1 - SECURITY FIX: Validates all paths + uses atomic writes
51
51
  */
52
52
  export declare function renameSymbol(params: {
53
53
  filePath: string;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Write Operations - v3.4.0
2
+ * Write Operations - v3.4.1
3
3
  * FIXES: SecurityValidator in renameSymbol, atomic writes, AST-based positioning
4
4
  */
5
5
  import * as fs from "node:fs/promises";
@@ -163,7 +163,7 @@ export async function removeSymbol(options) {
163
163
  }
164
164
  /**
165
165
  * Rename symbol using AST-aware replacement
166
- * v3.4.0 - SECURITY FIX: Validates all paths + uses atomic writes
166
+ * v3.4.1 - SECURITY FIX: Validates all paths + uses atomic writes
167
167
  */
168
168
  export async function renameSymbol(params) {
169
169
  try {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Base Parser - v3.4.0
2
+ * Base Parser - v3.4.1
3
3
  * Abstract base for all language parsers
4
4
  * IMPROVEMENT: replaceSymbol moved here using AST indices (eliminates indexOf fragility)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Base Parser - v3.4.0
2
+ * Base Parser - v3.4.1
3
3
  * Abstract base for all language parsers
4
4
  * IMPROVEMENT: replaceSymbol moved here using AST indices (eliminates indexOf fragility)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dart Tree-sitter Parser - v3.4.0
2
+ * Dart Tree-sitter Parser - v3.4.1
3
3
  * 100% AST accuracy via WASM
4
4
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Dart Tree-sitter Parser - v3.4.0
2
+ * Dart Tree-sitter Parser - v3.4.1
3
3
  * 100% AST accuracy via WASM
4
4
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PHP Parser - v3.4.0
2
+ * PHP Parser - v3.4.1
3
3
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
4
4
  */
5
5
  import { Tree } from "web-tree-sitter";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PHP Parser - v3.4.0
2
+ * PHP Parser - v3.4.1
3
3
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
4
4
  */
5
5
  import { BaseParser } from "./base.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Python Parser - v3.4.0
2
+ * Python Parser - v3.4.1
3
3
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
4
4
  */
5
5
  import { Tree } from "web-tree-sitter";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Python Parser - v3.4.0
2
+ * Python Parser - v3.4.1
3
3
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
4
4
  */
5
5
  import { BaseParser } from "./base.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parser Registry - v3.4.0
2
+ * Parser Registry - v3.4.1
3
3
  * Manages all language parsers
4
4
  */
5
5
  import { BaseParser } from "./base.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Parser Registry - v3.4.0
2
+ * Parser Registry - v3.4.1
3
3
  * Manages all language parsers
4
4
  */
5
5
  import { TypeScriptParser } from "./typescript.js";
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TypeScript Parser - v3.4.0
2
+ * TypeScript Parser - v3.4.1
3
3
  * Tree-sitter based TS/JS parser
4
4
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * TypeScript Parser - v3.4.0
2
+ * TypeScript Parser - v3.4.1
3
3
  * Tree-sitter based TS/JS parser
4
4
  * CLEANUP: replaceSymbol removed (inherited from BaseParser)
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Audit Logger - v3.4.0
2
+ * Audit Logger - v3.4.1
3
3
  * Comprehensive audit trail for all operations
4
4
  */
5
5
  export interface AuditEntry {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Audit Logger - v3.4.0
2
+ * Audit Logger - v3.4.1
3
3
  * Comprehensive audit trail for all operations
4
4
  */
5
5
  import * as fs from "node:fs/promises";
@@ -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
  export declare class BackupManager {