/** * NotifierService — multi-channel notification dispatcher. * * Routes email alerts to the appropriate channels based on urgency: * - Desktop notifications (native OS commands — zero npm deps) * - Sound alerts (via OS notification sound) * - MCP log level escalation (urgent→alert, high→warning, …) * - Webhook dispatch (HTTP POST to Slack/Discord/ntfy.sh/etc.) * * All channels are opt-in and disabled by default. */ import type { AlertsConfig } from '../types/index.js'; export type UrgencyLevel = 'urgent' | 'high' | 'normal' | 'low'; export interface AlertPayload { account: string; sender: { name?: string; address: string; }; subject: string; priority: UrgencyLevel; labels?: string[]; ruleName?: string; } export interface PlatformDiagnostics { platform: string; supported: boolean; desktopTool: { name: string; available: boolean; }; soundTool: { name: string; available: boolean; }; issues: string[]; setupInstructions: string[]; } export default class NotifierService { private config; private desktopCount; private desktopResetTimer; private static readonly MAX_DESKTOP_PER_MIN; constructor(config: AlertsConfig); stop(): void; /** Returns the current alerts configuration. */ getConfig(): AlertsConfig; /** Updates alert configuration at runtime (partial merge). */ updateConfig(partial: Partial): AlertsConfig; static checkPlatformSupport(): Promise; /** Test if a command-line tool exists on the system. */ private static commandExists; /** Send a test notification to verify platform setup. */ sendTestNotification(withSound?: boolean): Promise<{ success: boolean; message: string; }>; alert(payload: AlertPayload, forceDesktop?: boolean): Promise; /** * Caller-controlled desktop notification. Bypasses AlertsConfig gating — * callers with their own enable switch (verification catcher) decide for * themselves — but keeps text sanitization and the shared per-minute * desktop rate limit. Failure is non-fatal. */ notifyRaw(title: string, body: string, opts?: { sound?: boolean; }): Promise; private sendDesktopNotification; /** Route an already-sanitized notification to the platform tool. */ private static dispatchDesktop; private static execDarwin; private static execLinux; private static execWindows; private static execCommand; private sendWebhook; } //# sourceMappingURL=notifier.service.d.ts.map