mcp-code-context 2.6.0 → 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 -260
- 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 -236
- 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/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 -70
- package/dist/src/utils/fuzzyMatch.js.map +0 -1
- package/dist/src/utils/ignoreManager.d.ts +0 -29
- package/dist/src/utils/ignoreManager.js +0 -144
- 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,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* symbolWriter.ts — Central Dispatcher for Surgical Write Operations
|
|
3
|
-
*
|
|
4
|
-
* Routes write operations to the correct language-specific writer based
|
|
5
|
-
* on file extension. This is the "write" counterpart to semanticCompressor.ts.
|
|
6
|
-
*
|
|
7
|
-
* Supports:
|
|
8
|
-
* - TypeScript/JavaScript (.ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs)
|
|
9
|
-
* - PHP (.php, .phtml)
|
|
10
|
-
* - Dart (.dart)
|
|
11
|
-
* - Python (.py, .pyi)
|
|
12
|
-
*/
|
|
13
|
-
import { type WriteResult, type InsertPosition } from "./tsWriter.js";
|
|
14
|
-
export type { WriteResult, InsertPosition };
|
|
15
|
-
/** All extensions supported for surgical writing */
|
|
16
|
-
export declare const WRITABLE_EXTENSIONS: Set<string>;
|
|
17
|
-
/**
|
|
18
|
-
* Replace the full source code of a named symbol in a file.
|
|
19
|
-
* Dispatches to the correct language-specific writer.
|
|
20
|
-
*
|
|
21
|
-
* @param filePath - Used to detect language via extension
|
|
22
|
-
* @param content - Current file content
|
|
23
|
-
* @param symbolName - Name of the symbol to replace
|
|
24
|
-
* @param newContent - Complete replacement code (signature + body)
|
|
25
|
-
* @param className - Optional. Scopes search to within a specific class
|
|
26
|
-
*/
|
|
27
|
-
export declare function replaceSymbol(filePath: string, content: string, symbolName: string, newContent: string, className?: string): WriteResult;
|
|
28
|
-
/**
|
|
29
|
-
* Insert new code at a precise location relative to an anchor symbol.
|
|
30
|
-
*
|
|
31
|
-
* @param filePath - Used to detect language via extension
|
|
32
|
-
* @param content - Current file content
|
|
33
|
-
* @param code - The code to insert
|
|
34
|
-
* @param anchorSymbol - Symbol to position relative to (null = end of file)
|
|
35
|
-
* @param position - Where to insert: before, after, inside_start, inside_end
|
|
36
|
-
* @param className - Optional. Scopes anchor search to within a specific class
|
|
37
|
-
*/
|
|
38
|
-
export declare function insertCode(filePath: string, content: string, code: string, anchorSymbol: string | null, position: InsertPosition, className?: string): WriteResult;
|
|
39
|
-
/**
|
|
40
|
-
* Rename all occurrences of a symbol within a single file.
|
|
41
|
-
*
|
|
42
|
-
* @param filePath - Used to detect language via extension
|
|
43
|
-
* @param content - Current file content
|
|
44
|
-
* @param oldName - Current symbol name
|
|
45
|
-
* @param newName - New symbol name
|
|
46
|
-
*/
|
|
47
|
-
export declare function renameInFile(filePath: string, content: string, oldName: string, newName: string): WriteResult;
|
|
48
|
-
/**
|
|
49
|
-
* Renames all whole-word occurrences of a symbol in a file.
|
|
50
|
-
* UNLIKE renameInFile, this does NOT check for the symbol definition.
|
|
51
|
-
* Used for updating references in dependent files.
|
|
52
|
-
*
|
|
53
|
-
* NOW USES AST-AWARE SAFE RENAMING (v2.3.0+)
|
|
54
|
-
*/
|
|
55
|
-
export declare function renameReferencesInFile(filePath: string, content: string, oldName: string, newName: string): WriteResult;
|
|
56
|
-
/**
|
|
57
|
-
* Remove a named symbol from a file.
|
|
58
|
-
*
|
|
59
|
-
* @param filePath - Used to detect language via extension
|
|
60
|
-
* @param content - Current file content
|
|
61
|
-
* @param symbolName - Name of the symbol to remove
|
|
62
|
-
* @param className - Optional. Scopes search to within a specific class
|
|
63
|
-
*/
|
|
64
|
-
export declare function removeSymbolFromFile(filePath: string, content: string, symbolName: string, className?: string): WriteResult;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* symbolWriter.ts — Central Dispatcher for Surgical Write Operations
|
|
3
|
-
*
|
|
4
|
-
* Routes write operations to the correct language-specific writer based
|
|
5
|
-
* on file extension. This is the "write" counterpart to semanticCompressor.ts.
|
|
6
|
-
*
|
|
7
|
-
* Supports:
|
|
8
|
-
* - TypeScript/JavaScript (.ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs)
|
|
9
|
-
* - PHP (.php, .phtml)
|
|
10
|
-
* - Dart (.dart)
|
|
11
|
-
* - Python (.py, .pyi)
|
|
12
|
-
*/
|
|
13
|
-
import * as path from "node:path";
|
|
14
|
-
import { safeRenameReferences } from "./safeRename.js";
|
|
15
|
-
import { replaceTSSymbol, insertTSCode, renameTSSymbol, removeTSSymbol, } from "./tsWriter.js";
|
|
16
|
-
import { replacePHPSymbol, insertPHPCode, renamePHPSymbol, removePHPSymbol, } from "./phpWriter.js";
|
|
17
|
-
import { replaceDartSymbol, insertDartCode, renameDartSymbol, removeDartSymbol, } from "./dartWriter.js";
|
|
18
|
-
import { replacePySymbol, insertPyCode, renamePySymbol, removePySymbol, } from "./pyWriter.js";
|
|
19
|
-
// ─── Extension Sets ─────────────────────────────────────────────────
|
|
20
|
-
const TS_EXTENSIONS = new Set([
|
|
21
|
-
".ts", ".tsx", ".js", ".jsx", ".mts", ".mjs", ".cts", ".cjs",
|
|
22
|
-
]);
|
|
23
|
-
const PHP_EXTENSIONS = new Set([".php", ".phtml"]);
|
|
24
|
-
const DART_EXTENSIONS = new Set([".dart"]);
|
|
25
|
-
const PY_EXTENSIONS = new Set([".py", ".pyi"]);
|
|
26
|
-
/** All extensions supported for surgical writing */
|
|
27
|
-
export const WRITABLE_EXTENSIONS = new Set([
|
|
28
|
-
...TS_EXTENSIONS,
|
|
29
|
-
...PHP_EXTENSIONS,
|
|
30
|
-
...DART_EXTENSIONS,
|
|
31
|
-
...PY_EXTENSIONS,
|
|
32
|
-
]);
|
|
33
|
-
// ─── Replace Symbol ─────────────────────────────────────────────────
|
|
34
|
-
/**
|
|
35
|
-
* Replace the full source code of a named symbol in a file.
|
|
36
|
-
* Dispatches to the correct language-specific writer.
|
|
37
|
-
*
|
|
38
|
-
* @param filePath - Used to detect language via extension
|
|
39
|
-
* @param content - Current file content
|
|
40
|
-
* @param symbolName - Name of the symbol to replace
|
|
41
|
-
* @param newContent - Complete replacement code (signature + body)
|
|
42
|
-
* @param className - Optional. Scopes search to within a specific class
|
|
43
|
-
*/
|
|
44
|
-
export function replaceSymbol(filePath, content, symbolName, newContent, className) {
|
|
45
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
46
|
-
if (TS_EXTENSIONS.has(ext)) {
|
|
47
|
-
return replaceTSSymbol(content, symbolName, newContent, filePath, className);
|
|
48
|
-
}
|
|
49
|
-
if (PHP_EXTENSIONS.has(ext)) {
|
|
50
|
-
return replacePHPSymbol(content, symbolName, newContent, className);
|
|
51
|
-
}
|
|
52
|
-
if (DART_EXTENSIONS.has(ext)) {
|
|
53
|
-
return replaceDartSymbol(content, symbolName, newContent, className);
|
|
54
|
-
}
|
|
55
|
-
if (PY_EXTENSIONS.has(ext)) {
|
|
56
|
-
return replacePySymbol(content, symbolName, newContent, className);
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
success: false,
|
|
60
|
-
newContent: content,
|
|
61
|
-
symbolsAffected: [],
|
|
62
|
-
error: `Unsupported file type "${ext}" for surgical writing. Supported: TypeScript, JavaScript, PHP, Dart, Python.`,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
// ─── Insert Code ────────────────────────────────────────────────────
|
|
66
|
-
/**
|
|
67
|
-
* Insert new code at a precise location relative to an anchor symbol.
|
|
68
|
-
*
|
|
69
|
-
* @param filePath - Used to detect language via extension
|
|
70
|
-
* @param content - Current file content
|
|
71
|
-
* @param code - The code to insert
|
|
72
|
-
* @param anchorSymbol - Symbol to position relative to (null = end of file)
|
|
73
|
-
* @param position - Where to insert: before, after, inside_start, inside_end
|
|
74
|
-
* @param className - Optional. Scopes anchor search to within a specific class
|
|
75
|
-
*/
|
|
76
|
-
export function insertCode(filePath, content, code, anchorSymbol, position, className) {
|
|
77
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
78
|
-
if (TS_EXTENSIONS.has(ext)) {
|
|
79
|
-
return insertTSCode(content, code, anchorSymbol, position, filePath, className);
|
|
80
|
-
}
|
|
81
|
-
if (PHP_EXTENSIONS.has(ext)) {
|
|
82
|
-
return insertPHPCode(content, code, anchorSymbol, position, className);
|
|
83
|
-
}
|
|
84
|
-
if (DART_EXTENSIONS.has(ext)) {
|
|
85
|
-
return insertDartCode(content, code, anchorSymbol, position, className);
|
|
86
|
-
}
|
|
87
|
-
if (PY_EXTENSIONS.has(ext)) {
|
|
88
|
-
return insertPyCode(content, code, anchorSymbol, position, className);
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
success: false,
|
|
92
|
-
newContent: content,
|
|
93
|
-
symbolsAffected: [],
|
|
94
|
-
error: `Unsupported file type "${ext}" for code insertion.`,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
// ─── Rename Symbol ──────────────────────────────────────────────────
|
|
98
|
-
/**
|
|
99
|
-
* Rename all occurrences of a symbol within a single file.
|
|
100
|
-
*
|
|
101
|
-
* @param filePath - Used to detect language via extension
|
|
102
|
-
* @param content - Current file content
|
|
103
|
-
* @param oldName - Current symbol name
|
|
104
|
-
* @param newName - New symbol name
|
|
105
|
-
*/
|
|
106
|
-
export function renameInFile(filePath, content, oldName, newName) {
|
|
107
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
108
|
-
if (TS_EXTENSIONS.has(ext)) {
|
|
109
|
-
return renameTSSymbol(content, oldName, newName, filePath);
|
|
110
|
-
}
|
|
111
|
-
if (PHP_EXTENSIONS.has(ext)) {
|
|
112
|
-
return renamePHPSymbol(content, oldName, newName);
|
|
113
|
-
}
|
|
114
|
-
if (DART_EXTENSIONS.has(ext)) {
|
|
115
|
-
return renameDartSymbol(content, oldName, newName);
|
|
116
|
-
}
|
|
117
|
-
if (PY_EXTENSIONS.has(ext)) {
|
|
118
|
-
return renamePySymbol(content, oldName, newName);
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
success: false,
|
|
122
|
-
newContent: content,
|
|
123
|
-
symbolsAffected: [],
|
|
124
|
-
error: `Unsupported file type "${ext}" for symbol renaming.`,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Renames all whole-word occurrences of a symbol in a file.
|
|
129
|
-
* UNLIKE renameInFile, this does NOT check for the symbol definition.
|
|
130
|
-
* Used for updating references in dependent files.
|
|
131
|
-
*
|
|
132
|
-
* NOW USES AST-AWARE SAFE RENAMING (v2.3.0+)
|
|
133
|
-
*/
|
|
134
|
-
export function renameReferencesInFile(filePath, content, oldName, newName) {
|
|
135
|
-
// Delegate to AST-aware safe rename module
|
|
136
|
-
const result = safeRenameReferences(filePath, content, oldName, newName);
|
|
137
|
-
return {
|
|
138
|
-
success: result.success,
|
|
139
|
-
newContent: result.newContent,
|
|
140
|
-
symbolsAffected: result.symbolsAffected,
|
|
141
|
-
error: result.error
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
// ─── Remove Symbol ──────────────────────────────────────────────────
|
|
145
|
-
/**
|
|
146
|
-
* Remove a named symbol from a file.
|
|
147
|
-
*
|
|
148
|
-
* @param filePath - Used to detect language via extension
|
|
149
|
-
* @param content - Current file content
|
|
150
|
-
* @param symbolName - Name of the symbol to remove
|
|
151
|
-
* @param className - Optional. Scopes search to within a specific class
|
|
152
|
-
*/
|
|
153
|
-
export function removeSymbolFromFile(filePath, content, symbolName, className) {
|
|
154
|
-
const ext = path.extname(filePath).toLowerCase();
|
|
155
|
-
if (TS_EXTENSIONS.has(ext)) {
|
|
156
|
-
return removeTSSymbol(content, symbolName, filePath, className);
|
|
157
|
-
}
|
|
158
|
-
if (PHP_EXTENSIONS.has(ext)) {
|
|
159
|
-
return removePHPSymbol(content, symbolName, className);
|
|
160
|
-
}
|
|
161
|
-
if (DART_EXTENSIONS.has(ext)) {
|
|
162
|
-
return removeDartSymbol(content, symbolName, className);
|
|
163
|
-
}
|
|
164
|
-
if (PY_EXTENSIONS.has(ext)) {
|
|
165
|
-
return removePySymbol(content, symbolName, className);
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
success: false,
|
|
169
|
-
newContent: content,
|
|
170
|
-
symbolsAffected: [],
|
|
171
|
-
error: `Unsupported file type "${ext}" for symbol removal.`,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=symbolWriter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"symbolWriter.js","sourceRoot":"","sources":["../../../../src/ast/writers/symbolWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,GAGf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,eAAe,CAAC;AAKvB,uEAAuE;AAEvE,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAC7D,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEnD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAE3C,MAAM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AC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;IAEjD,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,OAAO,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACxD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,OAAO;QACnB,eAAe,EAAE,EAAE;QACnB,KAAK,EAAE,0BAA0B,GAAG,uBAAuB;KAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tsWriter.ts — TypeScript / JavaScript Surgical Writer
|
|
3
|
-
*
|
|
4
|
-
* Uses ts-morph to perform AST-aware code modifications on TypeScript
|
|
5
|
-
* and JavaScript files. This is the most robust writer because ts-morph
|
|
6
|
-
* provides a full read-write AST with source manipulation capabilities.
|
|
7
|
-
*
|
|
8
|
-
* Supports: .ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs
|
|
9
|
-
*/
|
|
10
|
-
export interface WriteResult {
|
|
11
|
-
success: boolean;
|
|
12
|
-
newContent: string;
|
|
13
|
-
symbolsAffected: string[];
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Replace the full text of a named symbol in a TypeScript/JavaScript file.
|
|
18
|
-
* The newContent should be the complete replacement (signature + body).
|
|
19
|
-
* When className is provided, scopes the search to within that class only.
|
|
20
|
-
*/
|
|
21
|
-
export declare function replaceTSSymbol(content: string, symbolName: string, newContent: string, filePath: string, className?: string): WriteResult;
|
|
22
|
-
export type InsertPosition = "before" | "after" | "inside_start" | "inside_end";
|
|
23
|
-
/**
|
|
24
|
-
* Insert new code at a precise location relative to an anchor symbol.
|
|
25
|
-
* When className is provided, scopes the anchor search to within that class only.
|
|
26
|
-
*/
|
|
27
|
-
export declare function insertTSCode(content: string, code: string, anchorSymbol: string | null, position: InsertPosition, filePath: string, className?: string): WriteResult;
|
|
28
|
-
/**
|
|
29
|
-
* Rename all occurrences of a symbol within a single TypeScript/JavaScript file.
|
|
30
|
-
* This performs a smart rename that understands scoping.
|
|
31
|
-
*/
|
|
32
|
-
export declare function renameTSSymbol(content: string, oldName: string, newName: string, filePath: string): WriteResult;
|
|
33
|
-
/**
|
|
34
|
-
* Remove a named symbol from a TypeScript/JavaScript file.
|
|
35
|
-
* Returns the file content without the symbol.
|
|
36
|
-
* When className is provided, scopes the search to within that class only.
|
|
37
|
-
*/
|
|
38
|
-
export declare function removeTSSymbol(content: string, symbolName: string, filePath: string, className?: string): WriteResult;
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tsWriter.ts — TypeScript / JavaScript Surgical Writer
|
|
3
|
-
*
|
|
4
|
-
* Uses ts-morph to perform AST-aware code modifications on TypeScript
|
|
5
|
-
* and JavaScript files. This is the most robust writer because ts-morph
|
|
6
|
-
* provides a full read-write AST with source manipulation capabilities.
|
|
7
|
-
*
|
|
8
|
-
* Supports: .ts, .tsx, .js, .jsx, .mts, .mjs, .cts, .cjs
|
|
9
|
-
*/
|
|
10
|
-
import { Project, } from "ts-morph";
|
|
11
|
-
import * as path from "node:path";
|
|
12
|
-
// ─── Singleton Project ──────────────────────────────────────────────
|
|
13
|
-
let _project = null;
|
|
14
|
-
function getProject() {
|
|
15
|
-
if (!_project) {
|
|
16
|
-
_project = new Project({
|
|
17
|
-
compilerOptions: {
|
|
18
|
-
allowJs: true,
|
|
19
|
-
jsx: 2, // React
|
|
20
|
-
},
|
|
21
|
-
useInMemoryFileSystem: true,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return _project;
|
|
25
|
-
}
|
|
26
|
-
function createSourceFile(content, filePath) {
|
|
27
|
-
const project = getProject();
|
|
28
|
-
const ext = path.extname(filePath);
|
|
29
|
-
const tempName = `write_${Date.now()}_${Math.random().toString(36).slice(2)}${ext}`;
|
|
30
|
-
return project.createSourceFile(tempName, content, { overwrite: true });
|
|
31
|
-
}
|
|
32
|
-
function cleanupSourceFile(sf) {
|
|
33
|
-
try {
|
|
34
|
-
sf.getProject().removeSourceFile(sf);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
// Ignore cleanup errors
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
// ─── Replace Symbol ─────────────────────────────────────────────────
|
|
41
|
-
/**
|
|
42
|
-
* Replace the full text of a named symbol in a TypeScript/JavaScript file.
|
|
43
|
-
* The newContent should be the complete replacement (signature + body).
|
|
44
|
-
* When className is provided, scopes the search to within that class only.
|
|
45
|
-
*/
|
|
46
|
-
export function replaceTSSymbol(content, symbolName, newContent, filePath, className) {
|
|
47
|
-
const sf = createSourceFile(content, filePath);
|
|
48
|
-
try {
|
|
49
|
-
const node = findNode(sf, symbolName, className);
|
|
50
|
-
if (!node) {
|
|
51
|
-
return {
|
|
52
|
-
success: false,
|
|
53
|
-
newContent: content,
|
|
54
|
-
symbolsAffected: [],
|
|
55
|
-
error: className
|
|
56
|
-
? `Symbol "${symbolName}" not found in class "${className}"`
|
|
57
|
-
: `Symbol "${symbolName}" not found in file`,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
// Replace the node's full text with the new content
|
|
61
|
-
node.replaceWithText(newContent.trim());
|
|
62
|
-
const result = sf.getFullText();
|
|
63
|
-
// Validate that the result is parseable
|
|
64
|
-
const validationSf = createSourceFile(result, filePath);
|
|
65
|
-
const diagnostics = validationSf.getPreEmitDiagnostics();
|
|
66
|
-
const hasSyntaxErrors = diagnostics.some((d) => d.getCategory() === 1);
|
|
67
|
-
cleanupSourceFile(validationSf);
|
|
68
|
-
if (hasSyntaxErrors) {
|
|
69
|
-
// Still return the result but mark potential syntax issues
|
|
70
|
-
// We don't reject because some "errors" are just type errors, not syntax
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
success: true,
|
|
74
|
-
newContent: result,
|
|
75
|
-
symbolsAffected: [symbolName],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
80
|
-
return {
|
|
81
|
-
success: false,
|
|
82
|
-
newContent: content,
|
|
83
|
-
symbolsAffected: [],
|
|
84
|
-
error: `Failed to replace symbol "${symbolName}": ${msg}`,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
cleanupSourceFile(sf);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Insert new code at a precise location relative to an anchor symbol.
|
|
93
|
-
* When className is provided, scopes the anchor search to within that class only.
|
|
94
|
-
*/
|
|
95
|
-
export function insertTSCode(content, code, anchorSymbol, position, filePath, className) {
|
|
96
|
-
const sf = createSourceFile(content, filePath);
|
|
97
|
-
try {
|
|
98
|
-
if (!anchorSymbol) {
|
|
99
|
-
// No anchor — append at end of file
|
|
100
|
-
sf.addStatements(code.trim());
|
|
101
|
-
return {
|
|
102
|
-
success: true,
|
|
103
|
-
newContent: sf.getFullText(),
|
|
104
|
-
symbolsAffected: [],
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const node = findNode(sf, anchorSymbol, className);
|
|
108
|
-
if (!node) {
|
|
109
|
-
return {
|
|
110
|
-
success: false,
|
|
111
|
-
newContent: content,
|
|
112
|
-
symbolsAffected: [],
|
|
113
|
-
error: className
|
|
114
|
-
? `Anchor symbol "${anchorSymbol}" not found in class "${className}"`
|
|
115
|
-
: `Anchor symbol "${anchorSymbol}" not found`,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
const trimmedCode = code.trim();
|
|
119
|
-
switch (position) {
|
|
120
|
-
case "before": {
|
|
121
|
-
const startPos = node.getStart();
|
|
122
|
-
sf.insertText(startPos, trimmedCode + "\n\n");
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
case "after": {
|
|
126
|
-
const endPos = node.getEnd();
|
|
127
|
-
sf.insertText(endPos, "\n\n" + trimmedCode);
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
case "inside_start": {
|
|
131
|
-
// Only valid for classes/interfaces
|
|
132
|
-
const cls = sf.getClass(anchorSymbol) || sf.getInterface(anchorSymbol);
|
|
133
|
-
if (!cls) {
|
|
134
|
-
return {
|
|
135
|
-
success: false,
|
|
136
|
-
newContent: content,
|
|
137
|
-
symbolsAffected: [],
|
|
138
|
-
error: `"inside_start" requires a class or interface. "${anchorSymbol}" is not one.`,
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
if ("insertMember" in cls) {
|
|
142
|
-
cls.insertMember(0, trimmedCode);
|
|
143
|
-
}
|
|
144
|
-
break;
|
|
145
|
-
}
|
|
146
|
-
case "inside_end": {
|
|
147
|
-
const cls2 = sf.getClass(anchorSymbol) || sf.getInterface(anchorSymbol);
|
|
148
|
-
if (!cls2) {
|
|
149
|
-
return {
|
|
150
|
-
success: false,
|
|
151
|
-
newContent: content,
|
|
152
|
-
symbolsAffected: [],
|
|
153
|
-
error: `"inside_end" requires a class or interface. "${anchorSymbol}" is not one.`,
|
|
154
|
-
};
|
|
155
|
-
}
|
|
156
|
-
if ("addMember" in cls2) {
|
|
157
|
-
cls2.addMember(trimmedCode);
|
|
158
|
-
}
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
success: true,
|
|
164
|
-
newContent: sf.getFullText(),
|
|
165
|
-
symbolsAffected: [anchorSymbol],
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
170
|
-
return {
|
|
171
|
-
success: false,
|
|
172
|
-
newContent: content,
|
|
173
|
-
symbolsAffected: [],
|
|
174
|
-
error: `Failed to insert code: ${msg}`,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
finally {
|
|
178
|
-
cleanupSourceFile(sf);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
// ─── Rename Symbol ──────────────────────────────────────────────────
|
|
182
|
-
/**
|
|
183
|
-
* Rename all occurrences of a symbol within a single TypeScript/JavaScript file.
|
|
184
|
-
* This performs a smart rename that understands scoping.
|
|
185
|
-
*/
|
|
186
|
-
export function renameTSSymbol(content, oldName, newName, filePath) {
|
|
187
|
-
const sf = createSourceFile(content, filePath);
|
|
188
|
-
try {
|
|
189
|
-
const node = findNode(sf, oldName);
|
|
190
|
-
if (!node) {
|
|
191
|
-
return {
|
|
192
|
-
success: false,
|
|
193
|
-
newContent: content,
|
|
194
|
-
symbolsAffected: [],
|
|
195
|
-
error: `Symbol "${oldName}" not found for renaming`,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
// Use regex-based replacement scoped to identifiers
|
|
199
|
-
// ts-morph rename in single-file mode: find all references within the file
|
|
200
|
-
const fullText = sf.getFullText();
|
|
201
|
-
// Smart rename: replace whole-word occurrences of oldName with newName
|
|
202
|
-
// This is not a naive replace — it respects word boundaries
|
|
203
|
-
const escaped = oldName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
204
|
-
const regex = new RegExp(`\\b${escaped}\\b`, "g");
|
|
205
|
-
const newText = fullText.replace(regex, newName);
|
|
206
|
-
// Validate result is parseable
|
|
207
|
-
const validationSf = createSourceFile(newText, filePath);
|
|
208
|
-
cleanupSourceFile(validationSf);
|
|
209
|
-
return {
|
|
210
|
-
success: true,
|
|
211
|
-
newContent: newText,
|
|
212
|
-
symbolsAffected: [oldName],
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
catch (error) {
|
|
216
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
217
|
-
return {
|
|
218
|
-
success: false,
|
|
219
|
-
newContent: content,
|
|
220
|
-
symbolsAffected: [],
|
|
221
|
-
error: `Failed to rename "${oldName}" to "${newName}": ${msg}`,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
finally {
|
|
225
|
-
cleanupSourceFile(sf);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
// ─── Remove Symbol ──────────────────────────────────────────────────
|
|
229
|
-
/**
|
|
230
|
-
* Remove a named symbol from a TypeScript/JavaScript file.
|
|
231
|
-
* Returns the file content without the symbol.
|
|
232
|
-
* When className is provided, scopes the search to within that class only.
|
|
233
|
-
*/
|
|
234
|
-
export function removeTSSymbol(content, symbolName, filePath, className) {
|
|
235
|
-
const sf = createSourceFile(content, filePath);
|
|
236
|
-
try {
|
|
237
|
-
const node = findNode(sf, symbolName, className);
|
|
238
|
-
if (!node) {
|
|
239
|
-
return {
|
|
240
|
-
success: false,
|
|
241
|
-
newContent: content,
|
|
242
|
-
symbolsAffected: [],
|
|
243
|
-
error: className
|
|
244
|
-
? `Symbol "${symbolName}" not found in class "${className}" for removal`
|
|
245
|
-
: `Symbol "${symbolName}" not found for removal`,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
node.remove();
|
|
249
|
-
// Clean up double blank lines left behind
|
|
250
|
-
let result = sf.getFullText();
|
|
251
|
-
result = result.replace(/\n{3,}/g, "\n\n");
|
|
252
|
-
return {
|
|
253
|
-
success: true,
|
|
254
|
-
newContent: result,
|
|
255
|
-
symbolsAffected: [symbolName],
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
260
|
-
return {
|
|
261
|
-
success: false,
|
|
262
|
-
newContent: content,
|
|
263
|
-
symbolsAffected: [],
|
|
264
|
-
error: `Failed to remove symbol "${symbolName}": ${msg}`,
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
finally {
|
|
268
|
-
cleanupSourceFile(sf);
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
// ─── Node Finder ────────────────────────────────────────────────────
|
|
272
|
-
/**
|
|
273
|
-
* Find a named declaration node in a source file.
|
|
274
|
-
* Searches: functions, classes, interfaces, type aliases, enums,
|
|
275
|
-
* class methods, getters, setters, and variable declarations.
|
|
276
|
-
* When className is provided, scopes method/property search to within that class only.
|
|
277
|
-
*/
|
|
278
|
-
function findNode(sf, symbolName, className) {
|
|
279
|
-
// If className is provided, scope search to within that class
|
|
280
|
-
if (className) {
|
|
281
|
-
const cls = sf.getClass(className);
|
|
282
|
-
if (!cls)
|
|
283
|
-
return null;
|
|
284
|
-
const method = cls.getMethod(symbolName);
|
|
285
|
-
if (method)
|
|
286
|
-
return method;
|
|
287
|
-
const getter = cls.getGetAccessor(symbolName);
|
|
288
|
-
if (getter)
|
|
289
|
-
return getter;
|
|
290
|
-
const setter = cls.getSetAccessor(symbolName);
|
|
291
|
-
if (setter)
|
|
292
|
-
return setter;
|
|
293
|
-
const prop = cls.getProperty(symbolName);
|
|
294
|
-
if (prop)
|
|
295
|
-
return prop;
|
|
296
|
-
return null;
|
|
297
|
-
}
|
|
298
|
-
// Top-level function
|
|
299
|
-
const func = sf.getFunction(symbolName);
|
|
300
|
-
if (func)
|
|
301
|
-
return func;
|
|
302
|
-
// Class
|
|
303
|
-
const cls = sf.getClass(symbolName);
|
|
304
|
-
if (cls)
|
|
305
|
-
return cls;
|
|
306
|
-
// Interface
|
|
307
|
-
const iface = sf.getInterface(symbolName);
|
|
308
|
-
if (iface)
|
|
309
|
-
return iface;
|
|
310
|
-
// Type alias
|
|
311
|
-
const typeAlias = sf.getTypeAlias(symbolName);
|
|
312
|
-
if (typeAlias)
|
|
313
|
-
return typeAlias;
|
|
314
|
-
// Enum
|
|
315
|
-
const enumDecl = sf.getEnum(symbolName);
|
|
316
|
-
if (enumDecl)
|
|
317
|
-
return enumDecl;
|
|
318
|
-
// Methods inside classes
|
|
319
|
-
for (const c of sf.getClasses()) {
|
|
320
|
-
const method = c.getMethod(symbolName);
|
|
321
|
-
if (method)
|
|
322
|
-
return method;
|
|
323
|
-
const getter = c.getGetAccessor(symbolName);
|
|
324
|
-
if (getter)
|
|
325
|
-
return getter;
|
|
326
|
-
const setter = c.getSetAccessor(symbolName);
|
|
327
|
-
if (setter)
|
|
328
|
-
return setter;
|
|
329
|
-
// Properties
|
|
330
|
-
const prop = c.getProperty(symbolName);
|
|
331
|
-
if (prop)
|
|
332
|
-
return prop;
|
|
333
|
-
}
|
|
334
|
-
// Variable declarations (const, let, var — including arrow functions)
|
|
335
|
-
for (const varStmt of sf.getVariableStatements()) {
|
|
336
|
-
for (const decl of varStmt.getDeclarations()) {
|
|
337
|
-
if (decl.getName() === symbolName) {
|
|
338
|
-
return varStmt;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
//# sourceMappingURL=tsWriter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsWriter.js","sourceRoot":"","sources":["../../../../src/ast/writers/tsWriter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,OAAO,GAKR,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAWlC,uEAAuE;AAEvE,IAAI,QAAQ,GAAmB,IAAI,CAAC;AAEpC,SAAS,UAAU;IACjB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,OAAO,CAAC;YACrB,eAAe,EAAE;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