/** * Schedule Notifications * * Notification system for scheduled update events. * Supports terminal, desktop, and webhook channels. * * @since v1.51.3 */ /** * Structural summary of an update run, consumed by * {@link ScheduleNotifier.createEventFromResult}. * * Replaces the QueueProcessResult import from the deleted UpdateQueue * (Phase 4.1 — dead daemon/executor/queue subsystem). Shaped so an * auto-update workflow result can be adapted onto it when the notifier is * wired into the real run path (roadmap 4.5). */ export interface UpdateRunSummary { /** Total plugins considered */ total: number; /** Successfully updated */ succeeded: number; /** Failed updates */ failed: number; /** Skipped updates */ skipped: number; /** Per-plugin outcomes */ updates: Array<{ pluginName: string; currentVersion: string; targetVersion: string; /** 'completed' maps to success; anything else (with no error) maps to skipped */ status: string; error?: string; }>; } /** * Notification event types */ export type NotificationEventType = 'update_started' | 'update_completed' | 'update_failed'; /** * Plugin update status in notification */ export interface NotificationPluginStatus { name: string; oldVersion: string; newVersion: string; status: 'success' | 'failed' | 'skipped'; error?: string; } /** * Notification event payload */ export interface NotificationEvent { type: NotificationEventType; timestamp: string; server?: string; plugins: NotificationPluginStatus[]; summary: { total: number; successful: number; failed: number; skipped: number; }; backupPath?: string; error?: string; } /** * Notification channel types */ export type NotificationChannel = 'terminal' | 'desktop' | 'webhook'; /** * Notification configuration */ export interface NotificationConfig { /** Whether notifications are enabled */ enabled: boolean; /** Channels to send notifications to */ channels: NotificationChannel[]; /** Webhook URL for Discord/Slack notifications */ webhookUrl?: string; /** Path to store terminal notifications for next session */ notificationStorePath?: string; } /** * Stored notification for terminal display */ export interface StoredNotification { id: string; event: NotificationEvent; read: boolean; createdAt: string; } /** * Default notification configuration */ export declare const DEFAULT_NOTIFICATION_CONFIG: NotificationConfig; /** * Schedule Notifier * * Sends notifications through configured channels. */ export declare class ScheduleNotifier { private config; constructor(config?: Partial); /** * Update configuration */ updateConfig(config: Partial): void; /** * Get current configuration */ getConfig(): NotificationConfig; /** * Send notification for an event */ notify(event: NotificationEvent): Promise<{ success: boolean; errors: string[]; }>; /** * Create notification event from execution result */ createEventFromResult(result: UpdateRunSummary, type: NotificationEventType, options?: { server?: string; backupPath?: string; error?: string; }): NotificationEvent; /** * Send terminal notification (stored for next session) */ private sendTerminalNotification; /** * Send desktop notification * Uses execFile with argument arrays to prevent command injection */ private sendDesktopNotification; /** * Redact webhook URL for logging (hides auth tokens) */ private redactWebhookUrl; /** * Send webhook notification (Discord/Slack compatible) */ private sendWebhookNotification; /** * Create Discord-compatible webhook payload */ private createWebhookPayload; /** * Get notification title based on event type */ private getNotificationTitle; /** * Get notification message based on event */ private getNotificationMessage; /** * Get notification description for webhook */ private getNotificationDescription; /** * Get notification color for webhook (Discord format) */ private getNotificationColor; /** * Get unread terminal notifications */ getUnreadNotifications(): Promise; /** * Mark notifications as read */ markAsRead(ids: string[]): Promise; /** * Clear all notifications */ clearNotifications(): Promise; } /** * Get the singleton notifier instance */ export declare function getScheduleNotifier(): ScheduleNotifier | null; /** * Initialize the schedule notifier */ export declare function initScheduleNotifier(config?: Partial): ScheduleNotifier; /** * Reset the singleton (for testing) */ export declare function resetScheduleNotifier(): void; //# sourceMappingURL=notifications.d.ts.map