Spaces:
Sleeping
Sleeping
File size: 868 Bytes
cce8120 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/usr/bin/env bash
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
import re
p=Path("backend/main.py")
src=p.read_text()
pattern=r'app\s*=\s*FastAPI\([\s\S]*?version="1\.0\.0"\s*\)'
replacement='''
app = FastAPI(
title="Website Builder Agent Backend",
description="Unified API combining Code Intelligence, Task Execution, Autonomous Builder, MCP JSON-RPC, and Workspace Operations",
version="1.0.0"
)
# -------- Dolor3V Engine --------
llm_gateway = LLMGateway()
dolor3v = Orchestrator(
gateway=llm_gateway
)
app.state.dolor3v = dolor3v
'''
src=re.sub(pattern,replacement,src,count=1)
p.write_text(src)
print("FastAPI constructor repaired.")
PY
python3 -m py_compile backend/main.py
echo
echo "SUCCESS"
|