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
package/TROUBLESHOOTING.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Troubleshooting Guide: Surgical Editing Edge Cases
|
|
2
|
-
|
|
3
|
-
This document covers known edge cases and behaviors for the Antigravity MCP surgical tools. These insights are derived from real-world usage scenarios.
|
|
4
|
-
|
|
5
|
-
## 1. `write_file_surgical` - False Brace Imbalance
|
|
6
|
-
**Problem:** The server rejects a code change, claiming the resulting file has unbalanced braces, even if the code provided is syntactically valid.
|
|
7
|
-
**Cause:**
|
|
8
|
-
- Discrepancies between character counting and line endings (CRLF vs LF).
|
|
9
|
-
- Braces found inside string literals or comments being counted as structural braces.
|
|
10
|
-
- Braces in method parameters (e.g., `{int? cart}`) being counted as method body braces.
|
|
11
|
-
**Solution (Internal):**
|
|
12
|
-
- v2.1.2: State-aware brace counting that ignores literals and comments.
|
|
13
|
-
- v2.1.3: CRLF normalization and parameter brace detection. **RESOLVED**.
|
|
14
|
-
**Workaround:** No longer needed as of v2.1.3.
|
|
15
|
-
|
|
16
|
-
## 2. `rename_symbol` - Dependents Not Updating
|
|
17
|
-
**Problem:** The symbol is renamed in the definition file, but imports and references in other files are unchanged.
|
|
18
|
-
**Cause:** The tool was previously looking for the *definition* of the symbol in every file.
|
|
19
|
-
**Solution (Internal):** The tool now separates definition renaming from reference updating. It will update any whole-word match of the symbol in files that are detected as dependents.
|
|
20
|
-
**Workaround:** Run `analyze_impact` first to verify the server detects the dependencies. If missed, perform a manual surgical replace on the import line.
|
|
21
|
-
|
|
22
|
-
## 3. `insert_symbol` - Ambiguous Positioning
|
|
23
|
-
**Problem:** Using `position: "after"` on a method sometimes inserts the new code *inside* the closing brace of that method.
|
|
24
|
-
**Cause:** Ambiguity in block-end detection when the closing brace is on a line with other content or when braces are presence in strings inside the body.
|
|
25
|
-
**Solution (Internal):** Improved block detection in v2.1.2.
|
|
26
|
-
**Best Practice:** For inserting new members inside a class, prefer using `position: "inside_end"` with the `className` as the anchor, rather than `after` on the last method.
|
|
27
|
-
|
|
28
|
-
## 4. `remove_symbol` - False Positive Dependency Check
|
|
29
|
-
**Problem:** The tool refuses to remove a symbol because it "might be used" in another file, but the reference is actually a comment or a different symbol with the same name.
|
|
30
|
-
**Cause:** To stay fast, the dependency check uses a whole-word regex search rather than a full cross-file AST index.
|
|
31
|
-
**Solution:**
|
|
32
|
-
1. Run `analyze_impact` to verify the actual blast radius.
|
|
33
|
-
2. If you confirm the "matches" are false positives, use the `force: true` parameter to bypass the check.
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
> [!TIP]
|
|
38
|
-
> **Always use the Two-Phase Workflow.** Review the `diff` provided in the first response carefully before providing the `confirmationToken`. This is your strongest guard against edge-case misbehavior.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dartCompressor — Regex + brace-counting Dart semantic compressor.
|
|
3
|
-
*
|
|
4
|
-
* Dart has no npm AST parser, so we use a high-fidelity regex engine combined
|
|
5
|
-
* with precise brace-counting to extract structural signatures from Dart source.
|
|
6
|
-
* This approach handles all real-world Flutter/Dart patterns including generics,
|
|
7
|
-
* factory constructors, mixins, extensions, and enum members.
|
|
8
|
-
*
|
|
9
|
-
* Design principles:
|
|
10
|
-
* 1. Brace-counting for block boundaries — never fails on nested blocks
|
|
11
|
-
* 2. Regex for signature detection — generics-aware, handles multi-line
|
|
12
|
-
* 3. Preserve doc comments (///) for semantic context
|
|
13
|
-
* 4. Preserve annotations (@override, @visibleForTesting, etc.)
|
|
14
|
-
* 5. Preserve field declarations (they ARE the structural contract)
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Compress a Dart file into its semantic skeleton.
|
|
18
|
-
* Returns only structural signatures — no function/method bodies.
|
|
19
|
-
*/
|
|
20
|
-
export declare function compressDart(content: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Extract the full source code of a named symbol from a Dart file.
|
|
23
|
-
* Supports classes, mixins, extensions, enums, functions, and methods.
|
|
24
|
-
* When className is provided, scopes method search to within that class only.
|
|
25
|
-
* Returns null if the symbol is not found.
|
|
26
|
-
*/
|
|
27
|
-
export declare function extractDartSymbol(content: string, symbolName: string, className?: string): string | null;
|