Summary
Add tree-sitter-based parsing for Python and Go alongside the existing TypeScript Compiler API parser. TypeScript-only support locks out 80%+ of the market.
Motivation
- codebase-memory-mcp supports 64 languages via tree-sitter — single Go binary
- CKB uses SCIP indexes for multi-language support
- CodePathfinder is Python-only but proves demand for non-TS analysis
- Every competitive analysis perspective flagged single-language as the existential risk
- Python is the most common language in AI agent codebases
Approach
Phase 1: Parser Abstraction
- Extract parser interface from current TS Compiler API implementation
- Define
ParsedFile contract that both parsers satisfy
- Keep TS Compiler API for TypeScript (higher quality: type resolution, call sites)
Phase 2: tree-sitter Integration
- Add
tree-sitter + language grammars as dependencies
- Implement parser for Python (functions, classes, imports, exports)
- Implement parser for Go (functions, structs, imports, packages)
- Map tree-sitter AST nodes to existing
ParsedFile interface
Phase 3: Graph Unification
- Multi-language files in same graph
- Cross-language edges (e.g., Python calling TS via API)
- Metrics compute identically regardless of source language
Tradeoffs
| Aspect |
TS Compiler API |
tree-sitter |
| Type resolution |
Full |
None |
| Call site confidence |
type-resolved |
text-inferred only |
| Language support |
TypeScript only |
64+ languages |
| Parse speed |
Slower |
Faster |
| Dependency |
typescript npm |
tree-sitter + grammars |
Acceptance Criteria
Priority
Short-term — Critical for market viability. Start with Python.
Summary
Add tree-sitter-based parsing for Python and Go alongside the existing TypeScript Compiler API parser. TypeScript-only support locks out 80%+ of the market.
Motivation
Approach
Phase 1: Parser Abstraction
ParsedFilecontract that both parsers satisfyPhase 2: tree-sitter Integration
tree-sitter+ language grammars as dependenciesParsedFileinterfacePhase 3: Graph Unification
Tradeoffs
Acceptance Criteria
Priority
Short-term — Critical for market viability. Start with Python.