You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(mcp): migrate ExploreAdapter and RefsAdapter to SearchService
Migrate two more MCP adapters to use the service layer with dependency
injection for better testability and consistency.
Adapters Refactored:
- ExploreAdapter: Now uses SearchService for search() and findSimilar()
- RefsAdapter: Now uses SearchService for all call graph queries
Changes:
- ExploreAdapterConfig: searchService replaces repositoryIndexer
- RefsAdapterConfig: searchService replaces repositoryIndexer
- Updated adapter instantiation in MCP server and CLI
- Updated test mocks from mockIndexer to mockSearchService
- Fixed similar code tests to use findSimilar() method
- Removed unused imports (chalk, formatBytes, loadConfig) in CLI
Benefits:
- Consistent service layer usage across adapters
- Better testability with dependency injection
- Easier to mock for unit tests
- Reduced coupling to implementation details
Adapters by Refactoring Status:
✅ Service Layer (5/9):
- SearchAdapter → SearchService
- StatusAdapter → StatsService, GitHubService
- GitHubAdapter → GitHubService
- ExploreAdapter → SearchService
- RefsAdapter → SearchService
⏭️ Thin Wrappers (4/9 - no refactor needed):
- MapAdapter: Utility wrapper around generateCodebaseMap
- HistoryAdapter: Uses GitIndexer (would need GitHistoryService)
- PlanAdapter: Utility wrapper around assembleContext
- HealthAdapter: Different interface than HealthService
The remaining 4 adapters are already well-designed as thin wrappers
around core utilities. Further refactoring would add complexity without
providing testability or maintainability benefits.
Tests: All 1918 tests passing
Lint: No warnings or errors
0 commit comments