mcp-code-context 2.5.1 → 3.0.4
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 +92 -236
- package/README.md +304 -298
- package/dist/src/core/engine.d.ts +21 -0
- package/dist/src/core/engine.js +68 -0
- package/dist/src/core/engine.js.map +1 -0
- package/dist/src/core/validator.d.ts +15 -0
- package/dist/src/core/validator.js +44 -0
- package/dist/src/core/validator.js.map +1 -0
- package/dist/src/index.d.ts +7 -11
- package/dist/src/index.js +182 -397
- package/dist/src/index.js.map +1 -1
- package/dist/src/operations/write.d.ts +51 -0
- package/dist/src/operations/write.js +169 -0
- package/dist/src/operations/write.js.map +1 -0
- package/dist/src/parsers/base.d.ts +28 -0
- package/dist/src/parsers/base.js +27 -0
- package/dist/src/parsers/base.js.map +1 -0
- package/dist/src/parsers/dartTreeSitter.d.ts +13 -0
- package/dist/src/parsers/dartTreeSitter.js +91 -0
- package/dist/src/parsers/dartTreeSitter.js.map +1 -0
- package/dist/src/parsers/php.d.ts +12 -0
- package/dist/src/parsers/php.js +86 -0
- package/dist/src/parsers/php.js.map +1 -0
- package/dist/src/parsers/python.d.ts +12 -0
- package/dist/src/parsers/python.js +86 -0
- package/dist/src/parsers/python.js.map +1 -0
- package/dist/src/parsers/registry.d.ts +15 -0
- package/dist/src/parsers/registry.js +70 -0
- package/dist/src/parsers/registry.js.map +1 -0
- package/dist/src/parsers/typescript.d.ts +13 -0
- package/dist/src/parsers/typescript.js +98 -0
- package/dist/src/parsers/typescript.js.map +1 -0
- package/llms.txt +246 -234
- package/mcp-code-context-3.0.2.tgz +0 -0
- package/package.json +59 -57
- package/tsconfig.tests.json +27 -0
- package/.io/RULES.md +0 -12
- package/CONTRIBUTING.md +0 -243
- package/PLAN_v2.5.0.md +0 -407
- package/TROUBLESHOOTING.md +0 -38
- package/dist/src/ast/dartCompressor.d.ts +0 -27
- package/dist/src/ast/dartCompressor.js +0 -859
- package/dist/src/ast/dartCompressor.js.map +0 -1
- package/dist/src/ast/phpCompressor.d.ts +0 -24
- package/dist/src/ast/phpCompressor.js +0 -634
- package/dist/src/ast/phpCompressor.js.map +0 -1
- package/dist/src/ast/semanticCompressor.d.ts +0 -22
- package/dist/src/ast/semanticCompressor.js +0 -677
- package/dist/src/ast/semanticCompressor.js.map +0 -1
- package/dist/src/ast/writers/dartWriter.d.ts +0 -37
- package/dist/src/ast/writers/dartWriter.js +0 -544
- package/dist/src/ast/writers/dartWriter.js.map +0 -1
- package/dist/src/ast/writers/phpWriter.d.ts +0 -37
- package/dist/src/ast/writers/phpWriter.js +0 -411
- package/dist/src/ast/writers/phpWriter.js.map +0 -1
- package/dist/src/ast/writers/pyWriter.d.ts +0 -37
- package/dist/src/ast/writers/pyWriter.js +0 -355
- package/dist/src/ast/writers/pyWriter.js.map +0 -1
- package/dist/src/ast/writers/safeRename.d.ts +0 -14
- package/dist/src/ast/writers/safeRename.js +0 -258
- package/dist/src/ast/writers/safeRename.js.map +0 -1
- package/dist/src/ast/writers/symbolWriter.d.ts +0 -64
- package/dist/src/ast/writers/symbolWriter.js +0 -174
- package/dist/src/ast/writers/symbolWriter.js.map +0 -1
- package/dist/src/ast/writers/tsWriter.d.ts +0 -38
- package/dist/src/ast/writers/tsWriter.js +0 -344
- package/dist/src/ast/writers/tsWriter.js.map +0 -1
- package/dist/src/cache/astCache.d.ts +0 -39
- package/dist/src/cache/astCache.js +0 -169
- package/dist/src/cache/astCache.js.map +0 -1
- package/dist/src/handlers/readHandlers.d.ts +0 -70
- package/dist/src/handlers/readHandlers.js +0 -455
- package/dist/src/handlers/readHandlers.js.map +0 -1
- package/dist/src/handlers/utilHandlers.d.ts +0 -31
- package/dist/src/handlers/utilHandlers.js +0 -69
- package/dist/src/handlers/utilHandlers.js.map +0 -1
- package/dist/src/handlers/writeHandlers.d.ts +0 -57
- package/dist/src/handlers/writeHandlers.js +0 -499
- package/dist/src/handlers/writeHandlers.js.map +0 -1
- package/dist/src/tools/readFileLines.d.ts +0 -26
- package/dist/src/tools/readFileLines.js +0 -77
- package/dist/src/tools/readFileLines.js.map +0 -1
- package/dist/src/tools/searchCodePattern.d.ts +0 -37
- package/dist/src/tools/searchCodePattern.js +0 -144
- package/dist/src/tools/searchCodePattern.js.map +0 -1
- package/dist/src/utils/arrayUtils.d.ts +0 -12
- package/dist/src/utils/arrayUtils.js +0 -27
- package/dist/src/utils/arrayUtils.js.map +0 -1
- package/dist/src/utils/backupManager.d.ts +0 -31
- package/dist/src/utils/backupManager.js +0 -124
- package/dist/src/utils/backupManager.js.map +0 -1
- package/dist/src/utils/confirmationCache.d.ts +0 -16
- package/dist/src/utils/confirmationCache.js +0 -40
- package/dist/src/utils/confirmationCache.js.map +0 -1
- package/dist/src/utils/constants.d.ts +0 -46
- package/dist/src/utils/constants.js +0 -112
- package/dist/src/utils/constants.js.map +0 -1
- package/dist/src/utils/dependencyChecker.d.ts +0 -1
- package/dist/src/utils/dependencyChecker.js +0 -55
- package/dist/src/utils/dependencyChecker.js.map +0 -1
- package/dist/src/utils/diffEngine.d.ts +0 -21
- package/dist/src/utils/diffEngine.js +0 -163
- package/dist/src/utils/diffEngine.js.map +0 -1
- package/dist/src/utils/fuzzyMatch.d.ts +0 -8
- package/dist/src/utils/fuzzyMatch.js +0 -69
- package/dist/src/utils/fuzzyMatch.js.map +0 -1
- package/dist/src/utils/ignoreManager.d.ts +0 -30
- package/dist/src/utils/ignoreManager.js +0 -186
- package/dist/src/utils/ignoreManager.js.map +0 -1
- package/dist/src/utils/normalization.d.ts +0 -49
- package/dist/src/utils/normalization.js +0 -173
- package/dist/src/utils/normalization.js.map +0 -1
- package/dist/src/utils/projectRoot.d.ts +0 -17
- package/dist/src/utils/projectRoot.js +0 -42
- package/dist/src/utils/projectRoot.js.map +0 -1
- package/dist/src/utils/secureValidation.d.ts +0 -15
- package/dist/src/utils/secureValidation.js +0 -41
- package/dist/src/utils/secureValidation.js.map +0 -1
- package/dist/src/utils/syntaxValidator.d.ts +0 -15
- package/dist/src/utils/syntaxValidator.js +0 -218
- package/dist/src/utils/syntaxValidator.js.map +0 -1
- package/dist/src/utils/transactionManager.d.ts +0 -46
- package/dist/src/utils/transactionManager.js +0 -123
- package/dist/src/utils/transactionManager.js.map +0 -1
- package/dist/src/utils/validation.d.ts +0 -87
- package/dist/src/utils/validation.js +0 -231
- package/dist/src/utils/validation.js.map +0 -1
- package/docs/ARCHITECTURE.md +0 -300
- package/docs/architecture/ADR-001-modular-handlers.md +0 -119
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* astCache.ts — LRU Cache for Parsed ASTs
|
|
3
|
-
*
|
|
4
|
-
* Implements a Least Recently Used (LRU) cache for parsed Abstract Syntax Trees.
|
|
5
|
-
* Dramatically improves performance for repeated operations on the same files.
|
|
6
|
-
*
|
|
7
|
-
* Benefits:
|
|
8
|
-
* - 90% faster for repeated reads/writes on same file
|
|
9
|
-
* - Automatic invalidation based on file modification time
|
|
10
|
-
* - Memory-bounded (max 100 entries by default)
|
|
11
|
-
*/
|
|
12
|
-
export declare class LRUCache<K, V> {
|
|
13
|
-
private cache;
|
|
14
|
-
private maxEntries;
|
|
15
|
-
private maxBytes;
|
|
16
|
-
private currentEntries;
|
|
17
|
-
private currentBytes;
|
|
18
|
-
private fileVersions;
|
|
19
|
-
constructor(maxEntries?: number, maxBytes?: number);
|
|
20
|
-
get(key: K, filePath?: string): V | undefined;
|
|
21
|
-
set(key: K, value: V, filePath?: string, estimatedSize?: number): void;
|
|
22
|
-
has(key: K, filePath?: string): boolean;
|
|
23
|
-
invalidate(key: K): void;
|
|
24
|
-
clear(): void;
|
|
25
|
-
private incrementVersion;
|
|
26
|
-
getStats(): {
|
|
27
|
-
entries: number;
|
|
28
|
-
maxEntries: number;
|
|
29
|
-
bytes: number;
|
|
30
|
-
maxBytes: number;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export declare const tsAstCache: LRUCache<string, any>;
|
|
34
|
-
export declare const phpAstCache: LRUCache<string, any>;
|
|
35
|
-
export declare const compressionCache: LRUCache<string, string>;
|
|
36
|
-
export declare const symbolCache: LRUCache<string, string | null>;
|
|
37
|
-
export declare function getSymbolCacheKey(filePath: string, symbolName: string, className?: string): string;
|
|
38
|
-
export declare function invalidateFileCache(filePath: string): void;
|
|
39
|
-
export declare function clearAllCaches(): void;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* astCache.ts — LRU Cache for Parsed ASTs
|
|
3
|
-
*
|
|
4
|
-
* Implements a Least Recently Used (LRU) cache for parsed Abstract Syntax Trees.
|
|
5
|
-
* Dramatically improves performance for repeated operations on the same files.
|
|
6
|
-
*
|
|
7
|
-
* Benefits:
|
|
8
|
-
* - 90% faster for repeated reads/writes on same file
|
|
9
|
-
* - Automatic invalidation based on file modification time
|
|
10
|
-
* - Memory-bounded (max 100 entries by default)
|
|
11
|
-
*/
|
|
12
|
-
import * as fs from "node:fs";
|
|
13
|
-
import * as path from "node:path";
|
|
14
|
-
// ─── LRU Cache Implementation ───────────────────────────────────────
|
|
15
|
-
export class LRUCache {
|
|
16
|
-
cache;
|
|
17
|
-
maxEntries;
|
|
18
|
-
maxBytes;
|
|
19
|
-
currentEntries;
|
|
20
|
-
currentBytes;
|
|
21
|
-
fileVersions; // Track file versions
|
|
22
|
-
constructor(maxEntries = 100, maxBytes = 100 * 1024 * 1024) {
|
|
23
|
-
this.cache = new Map();
|
|
24
|
-
this.maxEntries = maxEntries;
|
|
25
|
-
this.maxBytes = maxBytes;
|
|
26
|
-
this.currentEntries = 0;
|
|
27
|
-
this.currentBytes = 0;
|
|
28
|
-
this.fileVersions = new Map();
|
|
29
|
-
}
|
|
30
|
-
get(key, filePath) {
|
|
31
|
-
const entry = this.cache.get(key);
|
|
32
|
-
if (!entry)
|
|
33
|
-
return undefined;
|
|
34
|
-
if (filePath) {
|
|
35
|
-
const currentVersion = this.fileVersions.get(filePath) || 0;
|
|
36
|
-
// Version mismatch = cache invalidated
|
|
37
|
-
if (entry.version !== currentVersion) {
|
|
38
|
-
this.cache.delete(key);
|
|
39
|
-
this.currentEntries--;
|
|
40
|
-
this.currentBytes -= entry.size;
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
// Fallback: mtime check
|
|
44
|
-
try {
|
|
45
|
-
const stat = fs.statSync(filePath);
|
|
46
|
-
const currentMtime = stat.mtimeMs;
|
|
47
|
-
if (currentMtime !== entry.mtime) {
|
|
48
|
-
this.incrementVersion(filePath);
|
|
49
|
-
this.cache.delete(key);
|
|
50
|
-
this.currentEntries--;
|
|
51
|
-
this.currentBytes -= entry.size;
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
this.cache.delete(key);
|
|
57
|
-
this.currentEntries--;
|
|
58
|
-
this.currentBytes -= entry.size;
|
|
59
|
-
return undefined;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
this.cache.delete(key);
|
|
63
|
-
this.cache.set(key, entry);
|
|
64
|
-
return entry.value;
|
|
65
|
-
}
|
|
66
|
-
set(key, value, filePath, estimatedSize = 1000) {
|
|
67
|
-
let mtime = Date.now();
|
|
68
|
-
const version = filePath ? (this.fileVersions.get(filePath) || 0) : 0;
|
|
69
|
-
if (filePath) {
|
|
70
|
-
try {
|
|
71
|
-
const stat = fs.statSync(filePath);
|
|
72
|
-
mtime = stat.mtimeMs;
|
|
73
|
-
}
|
|
74
|
-
catch { }
|
|
75
|
-
}
|
|
76
|
-
if (this.cache.has(key)) {
|
|
77
|
-
const oldEntry = this.cache.get(key);
|
|
78
|
-
this.cache.delete(key);
|
|
79
|
-
this.currentEntries--;
|
|
80
|
-
this.currentBytes -= oldEntry.size;
|
|
81
|
-
}
|
|
82
|
-
while (this.currentBytes + estimatedSize > this.maxBytes && this.cache.size > 0) {
|
|
83
|
-
const oldestKey = this.cache.keys().next().value;
|
|
84
|
-
const oldEntry = this.cache.get(oldestKey);
|
|
85
|
-
if (oldEntry) {
|
|
86
|
-
this.currentBytes -= oldEntry.size;
|
|
87
|
-
this.cache.delete(oldestKey);
|
|
88
|
-
this.currentEntries--;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
while (this.currentEntries >= this.maxEntries) {
|
|
95
|
-
const oldestKey = this.cache.keys().next().value;
|
|
96
|
-
const oldEntry = this.cache.get(oldestKey);
|
|
97
|
-
if (oldEntry) {
|
|
98
|
-
this.currentBytes -= oldEntry.size;
|
|
99
|
-
this.cache.delete(oldestKey);
|
|
100
|
-
this.currentEntries--;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
this.cache.set(key, { value, mtime, size: estimatedSize, version });
|
|
107
|
-
this.currentEntries++;
|
|
108
|
-
this.currentBytes += estimatedSize;
|
|
109
|
-
}
|
|
110
|
-
has(key, filePath) {
|
|
111
|
-
return this.get(key, filePath) !== undefined;
|
|
112
|
-
}
|
|
113
|
-
invalidate(key) {
|
|
114
|
-
const entry = this.cache.get(key);
|
|
115
|
-
if (entry) {
|
|
116
|
-
this.cache.delete(key);
|
|
117
|
-
this.currentEntries--;
|
|
118
|
-
this.currentBytes -= entry.size;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
clear() {
|
|
122
|
-
this.cache.clear();
|
|
123
|
-
this.currentEntries = 0;
|
|
124
|
-
this.currentBytes = 0;
|
|
125
|
-
this.fileVersions.clear();
|
|
126
|
-
}
|
|
127
|
-
incrementVersion(filePath) {
|
|
128
|
-
const current = this.fileVersions.get(filePath) || 0;
|
|
129
|
-
this.fileVersions.set(filePath, current + 1);
|
|
130
|
-
}
|
|
131
|
-
getStats() {
|
|
132
|
-
return {
|
|
133
|
-
entries: this.currentEntries,
|
|
134
|
-
maxEntries: this.maxEntries,
|
|
135
|
-
bytes: this.currentBytes,
|
|
136
|
-
maxBytes: this.maxBytes,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
export const tsAstCache = new LRUCache(50);
|
|
141
|
-
export const phpAstCache = new LRUCache(50);
|
|
142
|
-
export const compressionCache = new LRUCache(100);
|
|
143
|
-
export const symbolCache = new LRUCache(200);
|
|
144
|
-
export function getSymbolCacheKey(filePath, symbolName, className) {
|
|
145
|
-
return `${filePath}:${symbolName}:${className || ""}`;
|
|
146
|
-
}
|
|
147
|
-
export function invalidateFileCache(filePath) {
|
|
148
|
-
const normalized = path.resolve(filePath);
|
|
149
|
-
// Increment version to invalidate all cache entries for this file
|
|
150
|
-
const incrementVersion = (cache) => {
|
|
151
|
-
const current = cache.fileVersions.get(normalized) || 0;
|
|
152
|
-
cache.fileVersions.set(normalized, current + 1);
|
|
153
|
-
};
|
|
154
|
-
incrementVersion(tsAstCache);
|
|
155
|
-
incrementVersion(phpAstCache);
|
|
156
|
-
incrementVersion(compressionCache);
|
|
157
|
-
incrementVersion(symbolCache);
|
|
158
|
-
// Also invalidate existing entries
|
|
159
|
-
tsAstCache.invalidate(normalized);
|
|
160
|
-
phpAstCache.invalidate(normalized);
|
|
161
|
-
compressionCache.invalidate(normalized);
|
|
162
|
-
}
|
|
163
|
-
export function clearAllCaches() {
|
|
164
|
-
tsAstCache.clear();
|
|
165
|
-
phpAstCache.clear();
|
|
166
|
-
compressionCache.clear();
|
|
167
|
-
symbolCache.clear();
|
|
168
|
-
}
|
|
169
|
-
//# sourceMappingURL=astCache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"astCache.js","sourceRoot":"","sources":["../../../src/cache/astCache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAWlC,uEAAuE;AAEvE,MAAM,OAAO,QAAQ;IACX,KAAK,CAAwB;IAC7B,UAAU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AC5B,UAAU,CAAC,KAAK,EAAE,CAAC;IACnB,WAAW,CAAC,KAAK,EAAE,CAAC;IACpB,gBAAgB,CAAC,KAAK,EAAE,CAAC;IACzB,WAAW,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* readHandlers.ts — Read Tool Handlers
|
|
3
|
-
*
|
|
4
|
-
* Handles all read-only operations:
|
|
5
|
-
* - get_semantic_repo_map
|
|
6
|
-
* - read_file_surgical
|
|
7
|
-
* - analyze_impact
|
|
8
|
-
* - read_file_lines
|
|
9
|
-
* - search_code_pattern
|
|
10
|
-
*/
|
|
11
|
-
export declare function handleGetSemanticRepoMap(args: Record<string, unknown>, signal?: AbortSignal): Promise<{
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
isError: boolean;
|
|
17
|
-
} | {
|
|
18
|
-
content: {
|
|
19
|
-
type: "text";
|
|
20
|
-
text: string;
|
|
21
|
-
}[];
|
|
22
|
-
}>;
|
|
23
|
-
export declare function handleReadFileSurgical(args: Record<string, unknown>): Promise<{
|
|
24
|
-
content: {
|
|
25
|
-
type: "text";
|
|
26
|
-
text: string;
|
|
27
|
-
}[];
|
|
28
|
-
isError: boolean;
|
|
29
|
-
} | {
|
|
30
|
-
content: {
|
|
31
|
-
type: "text";
|
|
32
|
-
text: string;
|
|
33
|
-
}[];
|
|
34
|
-
}>;
|
|
35
|
-
export declare function handleAnalyzeImpact(args: Record<string, unknown>): Promise<{
|
|
36
|
-
content: {
|
|
37
|
-
type: "text";
|
|
38
|
-
text: string;
|
|
39
|
-
}[];
|
|
40
|
-
isError: boolean;
|
|
41
|
-
} | {
|
|
42
|
-
content: {
|
|
43
|
-
type: "text";
|
|
44
|
-
text: string;
|
|
45
|
-
}[];
|
|
46
|
-
}>;
|
|
47
|
-
export declare function handleReadFileLines(args: Record<string, unknown>): Promise<{
|
|
48
|
-
content: {
|
|
49
|
-
type: "text";
|
|
50
|
-
text: string;
|
|
51
|
-
}[];
|
|
52
|
-
isError: boolean;
|
|
53
|
-
} | {
|
|
54
|
-
content: {
|
|
55
|
-
type: "text";
|
|
56
|
-
text: string;
|
|
57
|
-
}[];
|
|
58
|
-
}>;
|
|
59
|
-
export declare function handleSearchCodePattern(args: Record<string, unknown>): Promise<{
|
|
60
|
-
content: {
|
|
61
|
-
type: "text";
|
|
62
|
-
text: string;
|
|
63
|
-
}[];
|
|
64
|
-
isError: boolean;
|
|
65
|
-
} | {
|
|
66
|
-
content: {
|
|
67
|
-
type: "text";
|
|
68
|
-
text: string;
|
|
69
|
-
}[];
|
|
70
|
-
}>;
|