/** * CLI Notification Helpers (Phase 4 roadmap 4.5, assignment E1) * * Wires the fully-built-but-previously-unwired ScheduleNotifier * (terminal / desktop / Discord-compatible webhook — audit cli-headless F10) * into the headless run paths: * * - `pluginator auto-update` completion (updated/staged/manual/failed counts) * - `pluginator promote --apply` results (manual promotion events) * - `pluginator promote --quarantine` events * - the scheduled-promotion step inside auto-update (the promotion engine * already calls getScheduleNotifier() — it just returned null until * something initialized the singleton; initNotifierFromScheduleConfig is * that something) * * Configuration persists in ScheduleConfig.notifications (schedule-state.json, * set via `pluginator schedule --webhook ` / `--notify on|off`). * Notification failure NEVER fails the run — notifyBestEffort swallows and * logs. * * @since v2.12.7 */ import { type NotificationEvent, type ScheduleNotifier } from './core/schedule/notifications.js'; import type { AutoUpdateSummary } from './workflows/auto-update.js'; /** Stored-notification file for the terminal channel (read by the TUI later) */ export declare function defaultNotificationStorePath(): string; /** * Initialize the ScheduleNotifier singleton from the persisted * ScheduleConfig.notifications block. Safe to call unconditionally at the * start of any headless command — when no notification settings exist the * notifier is initialized disabled and every notify() is a no-op. */ export declare function initNotifierFromScheduleConfig(scheduleStatePath?: string): Promise; /** * Send through the singleton notifier, swallowing every failure (a 3am cron * run must complete its work even when Discord is down). Returns whether the * notification was attempted-and-succeeded — callers never branch on it. */ export declare function notifyBestEffort(event: NotificationEvent): Promise; /** * Map an auto-update run summary onto the notifier's event shape (pure — * unit-tested payload contract). * * - updated + staged → 'success' rows (staged rows carry an explanatory * note in `error` — the field doubles as a per-plugin annotation in the * Discord embed; counts treat staged as successful) * - manualRequired → 'skipped' rows with the pending-download reason * - failed → 'failed' rows * - noSource plugins appear in the skipped COUNT (not as rows — a 30-plugin * no-source list would drown the embed) */ export declare function buildAutoUpdateNotificationEvent(summary: AutoUpdateSummary, server: string): NotificationEvent; /** Minimal slice of PromoteResult the event builder needs (avoids a core/promotion type dependency in tests) */ export interface PromotionNotificationInput { promoted: string[]; failed: Array<{ name: string; error: string; }>; skipped: Array<{ name: string; reason: string; }>; refused?: string; backupPath?: string; dryRun: boolean; } /** * Map a manual `promote --apply` result onto the notifier's event shape * (pure). Dry runs are never notified — callers must not pass them. */ export declare function buildPromotionNotificationEvent(result: PromotionNotificationInput): NotificationEvent; /** * Map a quarantine action onto the notifier's event shape (pure). */ export declare function buildQuarantineNotificationEvent(pluginName: string, version: string, reason: string): NotificationEvent; //# sourceMappingURL=cli-notify-helpers.d.ts.map