/**
 * Notification Watcher Service
 *
 * Polls the agent_runs and phase_timings tables to detect status
 * transitions, dispatching NotificationEvents via the NotificationService
 * (which handles settings filters, bus fan-out, and desktop dispatch).
 *
 * Maintains in-memory tracking of last-seen status per run to avoid
 * duplicate notifications. Polling starts/stops with start()/stop()
 * lifecycle methods.
 *
 * Design decision: Uses DB polling instead of IPC because the worker
 * process is spawned detached with IPC disconnected.
 */
import type { IAgentRunRepository } from '../../../application/ports/output/agents/agent-run-repository.interface.js';
import type { IPhaseTimingRepository } from '../../../application/ports/output/agents/phase-timing-repository.interface.js';
import type { IFeatureRepository } from '../../../application/ports/output/repositories/feature-repository.interface.js';
import type { INotificationService } from '../../../application/ports/output/services/notification-service.interface.js';
export declare class NotificationWatcherService {
    private readonly runRepository;
    private readonly phaseTimingRepository;
    private readonly featureRepository;
    private readonly notificationService;
    private readonly pollIntervalMs;
    private readonly trackedRuns;
    private readonly trackedFeatureLifecycles;
    private intervalId;
    private isBootstrapped;
    constructor(runRepository: IAgentRunRepository, phaseTimingRepository: IPhaseTimingRepository, featureRepository: IFeatureRepository, notificationService: INotificationService, pollIntervalMs?: number);
    isRunning(): boolean;
    start(): void;
    stop(): void;
    private poll;
    private processRuns;
    private emitStatusEvent;
    private checkPhaseCompletions;
    private checkFeatureLifecycles;
    private resolveFeatureIdentity;
}
/**
 * Initialize the notification watcher singleton.
 * Must be called once during web server startup.
 *
 * @throws Error if the watcher is already initialized
 */
export declare function initializeNotificationWatcher(runRepository: IAgentRunRepository, phaseTimingRepository: IPhaseTimingRepository, featureRepository: IFeatureRepository, notificationService: INotificationService, pollIntervalMs?: number): void;
/**
 * Get the notification watcher singleton.
 *
 * @returns The notification watcher service
 * @throws Error if the watcher hasn't been initialized yet
 */
export declare function getNotificationWatcher(): NotificationWatcherService;
/**
 * Check if the notification watcher has been initialized.
 */
export declare function hasNotificationWatcher(): boolean;
/**
 * Reset the notification watcher singleton (for testing purposes only).
 * Stops the watcher if running before resetting.
 *
 * @internal
 */
export declare function resetNotificationWatcher(): void;
//# sourceMappingURL=notification-watcher.service.d.ts.map