cli-cleanup (#2)
Some checks reported errors
continuous-integration/drone/tag Build was killed

Reviewed-on: #2
Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
This commit is contained in:
2026-01-21 13:25:57 +00:00
committed by aetos
parent 94c1818103
commit ff92906720
13 changed files with 242 additions and 122 deletions

View File

@@ -15,6 +15,10 @@ class MCPRenderer:
def generate_sources(self, project: Project, out_dir: Path) -> None:
"""
Generate MCP-compatible JSON resources and navigation for the project.
Args:
project: The project model to render.
out_dir: Target directory for the generated JSON files.
"""
modules_dir = out_dir / "modules"
modules_dir.mkdir(parents=True, exist_ok=True)
@@ -50,7 +54,11 @@ class MCPRenderer:
def _write_module(self, module: Module, modules_dir: Path) -> None:
"""
Serialize a module into an MCP JSON resource.
Serialize a module into an MCP JSON resource on disk.
Args:
module: The module instance to serialize.
modules_dir: The directory where the module JSON file should be written.
"""
payload = {
"module": module.path,
@@ -64,6 +72,12 @@ class MCPRenderer:
def _render_module(self, module: Module) -> Dict:
"""
Render a Module into MCP-friendly structured data.
Args:
module: The module instance to render.
Returns:
A dictionary following the MCP documentation resource schema.
"""
data: Dict = {
"path": module.path,
@@ -79,6 +93,12 @@ class MCPRenderer:
def _render_object(self, obj: DocObject) -> Dict:
"""
Recursively render a DocObject into structured MCP data.
Args:
obj: The documented object (class, func, etc.) to render.
Returns:
A dictionary representing the object and its members.
"""
data: Dict = {
"name": obj.name,