import { type FrontMcpLogger } from '../common'; import { type NotificationService } from '../notification/notification.service'; /** * Metadata accompanying a channel notification. * * `source` is the channel name and is required — it drives subscription * enforcement, so a missing source would let any caller bypass per-channel * isolation. Encoded as a TypeScript requirement so callers can't omit it * by accident; the runtime check remains as a defense-in-depth assertion. */ export interface ChannelNotificationMeta { source: string; [key: string]: string; } /** * Service responsible for sending channel notifications to subscribed Claude Code sessions. * * **Session-scoped delivery:** Notifications are ONLY sent to sessions that: * 1. Have `experimental: { 'claude/channel': {} }` in client capabilities * 2. Are subscribed to the specific channel via `subscribeChannel()` * * This prevents data leaking between sessions — each session only receives * notifications from channels it has explicitly subscribed to. */ export declare class ChannelNotificationService { private readonly notificationService; private readonly logger; private readonly defaultMeta; constructor(notificationService: NotificationService, logger: FrontMcpLogger, defaultMeta?: Record); /** * Send a channel notification to all sessions subscribed to this channel. * Only sends to sessions that both support channels AND are subscribed to * the specific channel name. * * @param content - The notification content * @param meta - Metadata (must include `source` for the channel name) */ sendToSubscribedSessions(content: string, meta: ChannelNotificationMeta): void; /** * @deprecated Use sendToSubscribedSessions instead. This method now delegates to * subscription-aware delivery. */ sendToAllCapableSessions(content: string, meta: ChannelNotificationMeta): void; /** * Send a channel notification to a specific session (if it supports channels * and is subscribed to the channel). * * @param sessionId - The target session * @param content - The notification content * @param meta - Metadata key-value pairs * @returns true if the notification was sent */ sendToSession(sessionId: string, content: string, meta: ChannelNotificationMeta): boolean; /** * Send a channel notification with the given channel name as source. * Only sends to sessions subscribed to this specific channel. * * @param channelName - The channel name (becomes the `source` attribute) * @param content - The notification content * @param additionalMeta - Additional metadata to include */ send(channelName: string, content: string, additionalMeta?: Record): void; } //# sourceMappingURL=channel-notification.service.d.ts.map