diff --git a/cfg/amar/.env.example b/cfg/amar/.env.example index 2a1c049..71093e5 100644 --- a/cfg/amar/.env.example +++ b/cfg/amar/.env.example @@ -36,11 +36,8 @@ DB_DUMP=test.sql BACKEND_PORT=8000 FRONTEND_PORT=3000 -# Soleprint ports +# Soleprint port SOLEPRINT_PORT=12000 -ARTERY_PORT=12001 -ATLAS_PORT=12002 -STATION_PORT=12003 # ============================================================================= # BACKEND SERVER (Uvicorn) diff --git a/cfg/amar/config.json b/cfg/amar/config.json index 9af9c57..8971389 100644 --- a/cfg/amar/config.json +++ b/cfg/amar/config.json @@ -22,7 +22,6 @@ "slug": "artery", "title": "Artery", "tagline": "Todo lo vital", - "port": 12001, "icon": "💉" }, { @@ -31,7 +30,6 @@ "slug": "atlas", "title": "Atlas", "tagline": "Documentación accionable", - "port": 12002, "icon": "🗺️" }, { @@ -40,7 +38,6 @@ "slug": "station", "title": "Station", "tagline": "Monitores, Entornos y Herramientas", - "port": 12003, "icon": "🎛️" } ], diff --git a/cfg/amar/soleprint/.env b/cfg/amar/soleprint/.env index 5436253..1e23f82 100644 --- a/cfg/amar/soleprint/.env +++ b/cfg/amar/soleprint/.env @@ -21,9 +21,6 @@ SOLEPRINT_BARE_PATH=/home/mariano/wdir/spr/gen # PORTS # ============================================================================= SOLEPRINT_PORT=12000 -ARTERY_PORT=12001 -ATLAS_PORT=12002 -STATION_PORT=12003 # ============================================================================= # DATABASE (amar's DB for station tools) diff --git a/cfg/standalone/config.json b/cfg/standalone/config.json index ec62d31..74572a2 100644 --- a/cfg/standalone/config.json +++ b/cfg/standalone/config.json @@ -15,7 +15,6 @@ "slug": "artery", "title": "Artery", "tagline": "Todo lo vital", - "port": 12001, "icon": "💉" }, { @@ -24,7 +23,6 @@ "slug": "atlas", "title": "Atlas", "tagline": "Documentación accionable", - "port": 12002, "icon": "🗺️" }, { @@ -33,7 +31,6 @@ "slug": "station", "title": "Station", "tagline": "Monitores, Entornos y Herramientas", - "port": 12003, "icon": "🎛️" } ], diff --git a/cfg/standalone/data/books.json b/cfg/standalone/data/books.json index d201c7f..69852c7 100644 --- a/cfg/standalone/data/books.json +++ b/cfg/standalone/data/books.json @@ -1,79 +1,14 @@ { "items": [ - { - "name": "arch-model", - "slug": "arch-model", - "title": "Architecture Model", - "status": "ready", - "template": null, - "larder": { - "name": "arch-model", - "slug": "arch-model", - "title": "Architecture Model", - "status": "ready", - "source_template": null, - "data_path": "album/book/arch-model" - }, - "output_larder": null, - "system": "album" - }, { "name": "feature-flow", "slug": "feature-flow", "title": "Feature Flow Pipeline", "status": "ready", "template": null, - "larder": { - "name": "feature-flow", - "slug": "feature-flow", - "title": "Feature Flow Pipeline", - "status": "ready", - "source_template": null, - "data_path": "album/book/feature-flow" - }, + "larder": null, "output_larder": null, - "system": "album" - }, - { - "name": "gherkin-samples", - "slug": "gherkin-samples", - "title": "Gherkin Samples", - "status": "ready", - "template": null, - "larder": { - "name": "gherkin-samples", - "slug": "gherkin-samples", - "title": "Gherkin Samples", - "status": "ready", - "source_template": null, - "data_path": "album/book/gherkin-samples" - }, - "output_larder": null, - "system": "album" - }, - { - "name": "feature-form-samples", - "slug": "feature-form-samples", - "title": "Feature Form Samples", - "status": "ready", - "template": { - "name": "feature-form", - "slug": "feature-form", - "title": "Feature Form Template", - "status": "ready", - "template_path": "album/template/feature-form", - "system": "album" - }, - "larder": { - "name": "feature-form", - "slug": "feature-form", - "title": "Feature Forms", - "status": "ready", - "source_template": "feature-form", - "data_path": "album/book/feature-form-samples/feature-form" - }, - "output_larder": null, - "system": "album" + "system": "atlas" } ] } diff --git a/soleprint/atlas/index.html b/soleprint/atlas/index.html index 95da078..dea9e62 100644 --- a/soleprint/atlas/index.html +++ b/soleprint/atlas/index.html @@ -205,7 +205,7 @@
{readme.read_text()}")
+
+ return JSONResponse(
+ {"book": book_name, "files": [f.name for f in book_path.iterdir()]}
+ )
+
+
@app.get("/atlas/{path:path}")
def atlas_route(path: str):
"""Atlas sub-routes."""
- return {"system": "atlas", "path": path, "message": "Atlas route placeholder"}
+ return {"system": "atlas", "path": path}
# === Station ===
@@ -271,7 +293,7 @@ def station_index(request: Request):
@app.get("/station/{path:path}")
def station_route(path: str):
"""Station sub-routes."""
- return {"system": "station", "path": path, "message": "Station route placeholder"}
+ return {"system": "station", "path": path}
# === Generate ===
@@ -290,7 +312,6 @@ def generate_config(req: dict):
"""Generate a config.json for a new room."""
config = load_config()
hub_port = config.get("framework", {}).get("hub_port", 12000)
- system_ports = {s["key"]: s["port"] for s in config.get("systems", [])}
framework = req.get("framework", {})
systems = req.get("systems", {})
@@ -307,17 +328,14 @@ def generate_config(req: dict):
{
"key": "data_flow",
"name": systems.get("artery", "artery"),
- "port": system_ports.get("data_flow", 12001),
},
{
"key": "documentation",
"name": systems.get("atlas", "atlas"),
- "port": system_ports.get("documentation", 12002),
},
{
"key": "execution",
"name": systems.get("station", "station"),
- "port": system_ports.get("execution", 12003),
},
],
}
diff --git a/soleprint/station/tools/modelgen/config_loader.py b/soleprint/station/tools/modelgen/config_loader.py
index a7e222f..1bc2bf4 100644
--- a/soleprint/station/tools/modelgen/config_loader.py
+++ b/soleprint/station/tools/modelgen/config_loader.py
@@ -5,14 +5,15 @@ Loads and validates framework configuration files.
"""
import json
-from pathlib import Path
-from typing import Dict, Any, List, Optional
from dataclasses import dataclass
+from pathlib import Path
+from typing import Any, Dict, List, Optional
@dataclass
class FrameworkConfig:
"""Framework metadata"""
+
name: str
slug: str
version: str
@@ -25,18 +26,19 @@ class FrameworkConfig:
@dataclass
class SystemConfig:
"""System configuration"""
+
key: str
name: str
- slug: str
- title: str
- tagline: str
- port: int
- icon: str
+ slug: str = ""
+ title: str = ""
+ tagline: str = ""
+ icon: str = ""
@dataclass
class ComponentConfig:
"""Component configuration"""
+
name: str
title: str
description: str
@@ -54,7 +56,7 @@ class ConfigLoader:
self.systems: List[SystemConfig] = []
self.components: Dict[str, Dict[str, ComponentConfig]] = {}
- def load(self) -> 'ConfigLoader':
+ def load(self) -> "ConfigLoader":
"""Load configuration from file"""
with open(self.config_path) as f:
self.raw_config = json.load(f)
@@ -67,25 +69,25 @@ class ConfigLoader:
def _parse_framework(self):
"""Parse framework metadata"""
- fw = self.raw_config['framework']
+ fw = self.raw_config["framework"]
self.framework = FrameworkConfig(**fw)
def _parse_systems(self):
"""Parse system configurations"""
- for sys in self.raw_config['systems']:
+ for sys in self.raw_config["systems"]:
self.systems.append(SystemConfig(**sys))
def _parse_components(self):
"""Parse component configurations"""
- comps = self.raw_config['components']
+ comps = self.raw_config["components"]
# Shared components
- self.components['shared'] = {}
- for key, value in comps.get('shared', {}).items():
- self.components['shared'][key] = ComponentConfig(**value)
+ self.components["shared"] = {}
+ for key, value in comps.get("shared", {}).items():
+ self.components["shared"][key] = ComponentConfig(**value)
# System-specific components
- for system_key in ['data_flow', 'documentation', 'execution']:
+ for system_key in ["data_flow", "documentation", "execution"]:
self.components[system_key] = {}
for comp_key, comp_value in comps.get(system_key, {}).items():
self.components[system_key][comp_key] = ComponentConfig(**comp_value)
@@ -97,13 +99,15 @@ class ConfigLoader:
return sys
return None
- def get_component(self, system_key: str, component_key: str) -> Optional[ComponentConfig]:
+ def get_component(
+ self, system_key: str, component_key: str
+ ) -> Optional[ComponentConfig]:
"""Get component config"""
return self.components.get(system_key, {}).get(component_key)
def get_shared_component(self, key: str) -> Optional[ComponentConfig]:
"""Get shared component config"""
- return self.components.get('shared', {}).get(key)
+ return self.components.get("shared", {}).get(key)
def load_config(config_path: str | Path) -> ConfigLoader:
@@ -115,6 +119,7 @@ def load_config(config_path: str | Path) -> ConfigLoader:
if __name__ == "__main__":
# Test with pawprint config
import sys
+
config_path = Path(__file__).parent.parent / "pawprint.config.json"
loader = load_config(config_path)
@@ -126,5 +131,5 @@ if __name__ == "__main__":
print(f" {sys.icon} {sys.title} ({sys.name}) - {sys.tagline}")
print(f"\nShared Components:")
- for key, comp in loader.components['shared'].items():
+ for key, comp in loader.components["shared"].items():
print(f" {comp.name} - {comp.description}")