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
+5 -1
View File
@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import "./globals.css";
import { RealtimeProvider } from "@/lib/realtime";
import { SessionProvider } from "@/lib/session";
export const metadata: Metadata = {
@@ -11,7 +12,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
<html lang="fa" dir="rtl" className="dark">
<body>
<SessionProvider>{children}</SessionProvider>
<SessionProvider>
{/* One socket for the whole app: every live feed rides on it. */}
<RealtimeProvider>{children}</RealtimeProvider>
</SessionProvider>
</body>
</html>
);