2026-02-28 19:12:45 +01:00
|
|
|
/**
|
|
|
|
|
* @fileoverview Event port — capabilities for broadcasting events to SSE clients.
|
|
|
|
|
* Route modules that need to notify the frontend depend on this port.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type { BackgroundTask } from '../../session.js';
|
|
|
|
|
|
|
|
|
|
export interface EventPort {
|
|
|
|
|
broadcast(event: string, data: unknown): void;
|
|
|
|
|
sendPushNotifications(event: string, data: Record<string, unknown>): void;
|
|
|
|
|
batchTerminalData(sessionId: string, data: string): void;
|
|
|
|
|
broadcastSessionStateDebounced(sessionId: string): void;
|
|
|
|
|
batchTaskUpdate(sessionId: string, task: BackgroundTask): void;
|
2026-03-08 16:06:15 +01:00
|
|
|
getSseClientCount(): number;
|
2026-02-28 19:12:45 +01:00
|
|
|
}
|