// Local type aliases mirroring @repo/core-realtime's contracts. Kept inline to // avoid a build-graph cycle between core-testing (tooling) and core-realtime (core). // Same pattern recording-event-bus + recording-job-queue use. import type { z } from "zod"; type RealtimeChannelDescriptor = { readonly name: TName; readonly schema: TSchema; readonly scope: string | { role: string } | { userScoped: true; template: string }; }; interface IRealtimeBroadcaster { broadcast( descriptor: RealtimeChannelDescriptor>, payload: T, ): Promise; } export class RecordingRealtimeBroadcaster implements IRealtimeBroadcaster { readonly broadcasts: { channel: string; payload: unknown }[] = []; async broadcast( descriptor: RealtimeChannelDescriptor>, payload: T, ): Promise { descriptor.schema.parse(payload); this.broadcasts.push({ channel: descriptor.name, payload }); } }