Add realtime terminal tab badges

This commit is contained in:
Federico Jaramillo Martinez
2026-05-11 10:45:56 +02:00
parent 045f4e247a
commit 80cf879e0f
16 changed files with 219 additions and 27 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
import type { GlobalSessionEvent, SessionUiEvent } from "../../shared/apiTypes.js";
import type { GlobalSessionEvent, RealtimeEvent, SessionUiEvent } from "../../shared/apiTypes.js";
import type { WebSocket } from "ws";
export class SessionEventHub {
@@ -30,6 +30,10 @@ export class SessionEventHub {
}
publishGlobal(event: GlobalSessionEvent): void {
this.publishRealtime(event);
}
publishRealtime(event: RealtimeEvent): void {
const payload = JSON.stringify(event);
for (const socket of this.globalSockets) {
if (socket.readyState === socket.OPEN) socket.send(payload);