from fastapi import FastAPI from app.api.router import router as edge_router from app.core.settings import EDGE_BOTS_WORKSPACE_ROOT, EDGE_NODE_ID, EDGE_NODE_NAME from app.services.provision_service import EdgeProvisionService from app.services.runtime_service import edge_runtime_service from app.services.state_store_service import EdgeStateStoreService from app.services.workspace_service import EdgeWorkspaceService app = FastAPI(title="Dashboard Edge API") app.include_router(edge_router) app.state.edge_runtime_service = edge_runtime_service from app.services import provision_service as provision_service_module from app.services import state_store_service as state_store_service_module from app.services import workspace_service as workspace_service_module provision_service_module.edge_provision_service = EdgeProvisionService(host_data_root=EDGE_BOTS_WORKSPACE_ROOT) state_store_service_module.edge_state_store_service = EdgeStateStoreService(host_data_root=EDGE_BOTS_WORKSPACE_ROOT) workspace_service_module.edge_workspace_service = EdgeWorkspaceService(host_data_root=EDGE_BOTS_WORKSPACE_ROOT) @app.get("/api/edge/health") def healthcheck(): return { "status": "ok", "service": "dashboard-edge", "node_id": EDGE_NODE_ID, "node_name": EDGE_NODE_NAME, }