feat: realtime WebSocket layer for live events and streaming logs

- Backend: ConnectionManager, Redis-backed bus with in-process fallback,
  channel authorization, and typed emit helpers wired into workers
  (ai_runtime, sandbox_gateway), workforce/sandbox/billing/audit/error services.
- Frontend: single shared WS client with backoff + heartbeat, RealtimeProvider,
  useLiveChannel/useLiveEvent hooks, live indicators on task detail, manager
  chat, dashboard, traces, sandbox terminal, admin errors, and billing.
- Contracts: WsEvent/WsServerFrame/WsClientFrame types mirroring the port.

All 255 backend tests pass; web typecheck and build pass.
This commit is contained in:
mjalmoudy94
2026-10-13 12:56:36 +03:30
parent afdef4b444
commit f1e5df29ce
31 changed files with 2981 additions and 28 deletions
+9
View File
@@ -53,6 +53,15 @@ class Settings(BaseSettings):
database_url: str = "sqlite+aiosqlite:///./agy_web.db"
redis_url: str = "redis://localhost:6379/0"
# --- realtime push -------------------------------------------------------
#: How live events travel between processes. ``auto`` mirrors published
#: events onto Redis pub/sub so the standalone workers' pushes reach the
#: API process's browser sockets; if no broker is reachable the bus falls
#: back to in-process fan-out and every API-driven feed stays live.
#: ``local`` pins the bus to in-process delivery (tests, single-process
#: deployments without a broker).
realtime_transport: str = "auto"
# --- security ------------------------------------------------------------
jwt_secret: str = "change-me"
jwt_algorithm: str = "HS256"