# ---- existing /api/status ---------------------
@app.get("/api/status")
async def status():
return {"ok": True}
# ---- new /api/web/health ----------------------
@app.get("/api/web/health")
async def web_health(req: Request):
checks: dict[str, CheckResult] = {}
checks["gateway"] = await _probe_gateway()
checks["token"] = _probe_token(req)
checks["home"] = _probe_home()
checks["model"] = await _probe_model()
checks["skills"] = _probe_skills()
checks["mcp"] = await _probe_mcp()
checks["workspace"] = _probe_workspace(req)
ok = all(c.status != "fail" for c in checks.values())
return {"ok": ok}
return {"ok": ok, "checks": checks, "ts": utcnow()}