Spaces:
Sleeping
Sleeping
David Prince
fix: add all missing local module stubs (remote_mcp_registry, mcp_auth, mcp_transport, etc)
cce8120 | set -euo pipefail | |
| ROOT=/root/projects/website-builder-backend-clean | |
| cd "$ROOT" | |
| cp backend/main.py backend/main.py.bak.$(date +%Y%m%d_%H%M%S) | |
| python3 <<'PY' | |
| from pathlib import Path | |
| p=Path("backend/main.py") | |
| lines=p.read_text().splitlines() | |
| required=[ | |
| "from backend.models.gateway import ModelGateway", | |
| "from backend.agents.memory import AgentMemoryStore", | |
| "from backend.agents.messaging import MessageBus", | |
| "from backend.agents.base import BaseAgent", | |
| ] | |
| # remove duplicates | |
| clean=[] | |
| for line in lines: | |
| if line in required: | |
| continue | |
| clean.append(line) | |
| insert=0 | |
| for i,line in enumerate(clean): | |
| if line.startswith("import ") or line.startswith("from "): | |
| insert=i+1 | |
| for stmt in reversed(required): | |
| clean.insert(insert,stmt) | |
| p.write_text("\n".join(clean)+"\n") | |
| print("Import block repaired.") | |
| PY | |
| echo | |
| echo "========== IMPORTS ==========" | |
| nl -ba backend/main.py | sed -n '35,55p' | |
| echo | |
| echo "========== COMPILE ==========" | |
| python3 -m py_compile backend/main.py | |
| echo | |
| echo "========== VERIFY ==========" | |
| python3 <<'PY' | |
| from backend.agents.memory import AgentMemoryStore | |
| from backend.agents.messaging import MessageBus | |
| from backend.agents.base import BaseAgent | |
| from backend.models.gateway import ModelGateway | |
| print("AgentMemoryStore:",AgentMemoryStore) | |
| print("MessageBus:",MessageBus) | |
| print("BaseAgent:",BaseAgent) | |
| print("ModelGateway:",ModelGateway) | |
| PY | |
| echo | |
| echo "[OK] Runtime import block repaired." | |