/** * Notification Relay — Redis Pub/Sub Cross-Pod Messaging * * Each pod subscribes to its own channel (`mcp:ha:notify:{nodeId}`). * When a notification targets a session on a different pod, * it's published to that pod's channel for local delivery. */ import { type HaConfig } from './ha.types'; /** * Notification message relayed between pods. */ export interface RelayMessage { /** Target session ID */ sessionId: string; /** MCP notification to deliver */ notification: { method: string; params?: Record; }; /** Source pod that originated the notification */ sourceNodeId: string; /** Timestamp of relay */ timestamp: number; } /** * Handler invoked when a relay message arrives for this pod. */ export type RelayHandler = (message: RelayMessage) => void | Promise; /** * Minimal Redis pub/sub client interface. * Requires a dedicated connection for subscribing (ioredis pattern). */ export interface RelayRedisClient { subscribe(channel: string): Promise; unsubscribe(channel: string): Promise; publish(channel: string, message: string): Promise; on(event: 'message', handler: (channel: string, message: string) => void): void; removeAllListeners(event: 'message'): void; removeListener(event: 'message', handler: (channel: string, message: string) => void): void; } export declare class NotificationRelay { private readonly subscriber; private readonly publisher; private readonly nodeId; private handler; private readonly channel; private readonly keyPrefix; constructor(subscriber: RelayRedisClient, publisher: RelayRedisClient, nodeId: string, config?: Partial); /** Start listening for relay messages on this pod's channel. */ subscribe(handler: RelayHandler): Promise; /** Stop listening and clean up. */ unsubscribe(): Promise; /** * Publish a notification to a target pod's channel. * Used when a notification targets a session not owned by this pod. */ publish(targetNodeId: string, sessionId: string, notification: RelayMessage['notification']): Promise; private onMessage; } //# sourceMappingURL=notification-relay.d.ts.map