@startuml dispatcher_actual
!define COMPONENT_INTERFACE <<Component Interface>>
!define INTERNAL <<Internal>>
!define NOT_IMPLEMENTED <<Not Implemented>>
!includeurl https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml
title Dispatcher - Code Level (Actual Implementation)
package "mcp_server.dispatcher" <<Component>> {
' ========================================
' ACTUAL Implementation
' ========================================
class Dispatcher #LightGreen {
-_plugins: List[IPlugin]
-_by_lang: Dict[str, IPlugin]
-_file_cache: Dict[Path, str]
--
+__init__(plugins: List[IPlugin])
+@property plugins(): Dict[str, IPlugin]
+lookup(symbol: str) -> SymbolDef | None
+search(query: str, semantic: bool = False, limit: int = 20) -> Iterable[SearchResult]
+index_file(path: Path) -> None
+get_statistics() -> Dict[str, Any]
-_get_file_hash(path: Path) -> str
-_match_plugin(path: Path) -> IPlugin | None
}
' ========================================
' What's Actually Implemented
' ========================================
note right of Dispatcher #LightGreen
IMPLEMENTED:
- Basic plugin management
- File extension based routing
- Simple caching (file hashes)
- Sequential plugin search
- Index file functionality
- Basic statistics
end note
' ========================================
' What's Missing
' ========================================
note bottom of Dispatcher #FF6B6B
NOT IMPLEMENTED:
- No IDispatcher interface
- No IRequestRouter interface
- No Plugin Router component
- No Result Aggregator component
- No parallel processing
- No error aggregation
- No request queueing
- No priority handling
- No load balancing
- No circuit breakers
- No retry logic
end note
' ========================================
' Dependencies and Types
' ========================================
class IPlugin <<interface>> {
+lang: str
+supports(path: str | Path) -> bool
+indexFile(path: str | Path, content: str) -> IndexShard
+getDefinition(symbol: str) -> SymbolDef | None
+findReferences(symbol: str) -> Iterable[Reference]
+search(query: str, opts: SearchOpts | None) -> Iterable[SearchResult]
}
class SymbolDef <<TypedDict>> {
+name: str
+kind: str
+file: str
+line: int
+character: int
+docstring: str | None
+parent: str | None
}
class SearchResult <<TypedDict>> {
+file: str
+line: int
+snippet: str
+score: float | None
}
' ========================================
' Actual Relationships
' ========================================
Dispatcher --> IPlugin : manages list of
Dispatcher ..> SymbolDef : returns
Dispatcher ..> SearchResult : yields
Dispatcher --> "_file_cache" : maintains
}
' ========================================
' Implementation Status Legend
' ========================================
legend right
|<#90EE90>| Implemented |
|<#FFD700>| Partially Implemented |
|<#FFA500>| Stub Only |
|<#FF6B6B>| Not Implemented |
endlegend
@enduml