From c93cf95cbe30b5cf3385658a67fe7d551dc97c4b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 11:18:22 +0000 Subject: [PATCH] Type runtime event fanout by websocket channel contracts Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index d1b784cf38..465cb3403b 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -13,6 +13,7 @@ import { type ProviderSession, type WsClientMessage, type WsResponseMessage, + type WsServerMessage, WS_EVENT_CHANNELS, WS_CLOSE_CODES, WS_CLOSE_REASONS, @@ -68,6 +69,8 @@ interface BootstrapSessionResult { bootstrapError: string | undefined; } +type WsServerEventMessage = Extract; + function raceWithTimeout( promise: Promise, timeoutMs: number, @@ -368,7 +371,10 @@ export async function startRuntimeApiServer( let launchSessionPromise: Promise | null = null; let bootstrapFallbackSession: ProviderSession | null = null; - const emitEvent = (channel: string, payload: unknown) => { + const emitEvent = ( + channel: TChannel, + payload: Extract["payload"], + ) => { if (!activeClient) { return; }