@@ -192,7 +192,14 @@ def _heartbeat_payload(details: Optional[Dict[str, Any]] = None) -> Dict[str, An
192192async def root () -> Dict [str , Any ]:
193193 """Root endpoint — simple success response for Hugging Face Spaces."""
194194 log .debug ("Root endpoint accessed" )
195- return {"status" : "ok" , "name" : "missionctrl" }
195+ return {
196+ "status" : "ok" ,
197+ "name" : "missionctrl" ,
198+ "endpoints" : ["/health" , "/reset" , "/step" , "/state" , "/dashboard" , "/history" , "/web" , "/ports" ],
199+ "heartbeat" : _heartbeat_payload (),
200+ "log_summary" : {"entries" : len (_request_logs ), "errors" : sum (1 for e in _request_logs if e .status_code >= 400 )},
201+ "uptime_seconds" : round (time .monotonic () - _started_at_monotonic , 3 ),
202+ }
196203
197204
198205# ---------------------------------------------------------------------------
@@ -202,17 +209,19 @@ async def root() -> Dict[str, Any]:
202209async def health () -> Dict [str , Any ]:
203210 """Simple health check for Hugging Face Spaces - returns instantly."""
204211 log .debug ("Health check accessed" )
205- return {"status" : "ok" }
212+ return {
213+ "healthy" : True ,
214+ ** _heartbeat_payload (),
215+ }
206216
207217
208218@app .get ("/web" )
209219async def web_info () -> Dict [str , Any ]:
210220 return {
211- "service" : "MissionCtrl" ,
212- "version" : "1.0.0" ,
213- "status" : "running" ,
214- "dashboard" : "/dashboard" ,
215- "logs" : "/logs" ,
221+ ** _heartbeat_payload ({
222+ "dashboard" : "/dashboard" ,
223+ "logs" : "/logs" ,
224+ }),
216225 }
217226
218227
0 commit comments