brand renaming, scenario reloads flight

This commit is contained in:
2026-04-12 08:39:12 -03:00
parent 9dbf89da02
commit 5c82703ebe
25 changed files with 433 additions and 482 deletions

View File

@@ -10,7 +10,7 @@ from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from agents.efhas import run_efhas
from agents.fce import run_fce
from agents.handover import run_handover
from agents.shared.mcp_client import connect_servers
from mcp_servers.data.scenarios.manager import scenario_manager
@@ -66,7 +66,7 @@ app.add_middleware(
# ── Request/Response models ──
class EFHaSRequest(BaseModel):
class FCERequest(BaseModel):
flight_id: str
class HandoverRequest(BaseModel):
@@ -78,15 +78,15 @@ class ScenarioUpdate(BaseModel):
# ── Agent routes ──
@app.post("/agents/efhas")
async def trigger_efhas(req: EFHaSRequest):
@app.post("/agents/fce")
async def trigger_fce(req: FCERequest):
run_id = str(uuid.uuid4())[:8]
runs[run_id] = {"status": "running", "agent": "efhas", "flight_id": req.flight_id}
runs[run_id] = {"status": "running", "agent": "fce", "flight_id": req.flight_id}
async def _run():
await event_hub.broadcast({
"type": "agent_start", "run_id": run_id,
"agent": "efhas", "flight_id": req.flight_id,
"agent": "fce", "flight_id": req.flight_id,
"timestamp": datetime.now(timezone.utc).isoformat(),
})
@@ -95,10 +95,10 @@ async def trigger_efhas(req: EFHaSRequest):
try:
async with connect_servers(["shared", "ops", "passenger"]) as mcp:
result = await run_efhas(req.flight_id, mcp, on_event=on_event)
runs[run_id] = {"status": "completed", "agent": "efhas", "result": result}
result = await run_fce(req.flight_id, mcp, on_event=on_event)
runs[run_id] = {"status": "completed", "agent": "fce", "result": result}
except Exception as e:
runs[run_id] = {"status": "error", "agent": "efhas", "error": str(e)}
runs[run_id] = {"status": "error", "agent": "fce", "error": str(e)}
asyncio.create_task(_run())
return {"run_id": run_id, "status": "running"}