/**
 * NotificationService — broadcasts notifications to all connected clients.
 *
 * Sends a WS "notification" event that each client handles according to
 * its platform:
 *   - Electron desktop → native toast via desktop:notify IPC
 *   - Web browser → Notification API (with permission)
 *   - Android/Capacitor → local notification plugin
 *
 * Notifications are fire-and-forget; the gateway doesn't track delivery.
 * All supervision happens in real-time via connected clients.
 */
export class NotificationService {
    ws;
    constructor(ws) {
        this.ws = ws;
    }
    /**
     * Send a notification to all connected clients.
     */
    send(notification) {
        const payload = {
            ...notification,
            timestamp: new Date().toISOString(),
        };
        this.ws.broadcastAll({
            type: "notification",
            sessionId: "",
            timestamp: payload.timestamp,
            payload,
        });
    }
    /** Shorthand for info-level notifications */
    info(title, body, link) {
        this.send({ id: `notif-${Date.now()}`, title, body, level: "info", link });
    }
    /** Shorthand for success-level notifications */
    success(title, body, link) {
        this.send({ id: `notif-${Date.now()}`, title, body, level: "success", link });
    }
    /** Shorthand for warning-level notifications */
    warning(title, body, link) {
        this.send({ id: `notif-${Date.now()}`, title, body, level: "warning", link });
    }
    /** Shorthand for error-level notifications */
    error(title, body, link) {
        this.send({ id: `notif-${Date.now()}`, title, body, level: "error", link });
    }
}
//# sourceMappingURL=notifications.js.map