/**
 * Daemon Lifecycle
 *
 * Manages ordered startup/shutdown of daemon services:
 * - Server, scheduler, channels, observer
 * - Health check polling
 * - Service registry
 */
import { EventEmitter } from 'events';
import type { ServiceStatus } from './daemon-manager.js';
export interface DaemonService {
    name: string;
    start(): Promise<void>;
    stop(): Promise<void>;
    isRunning(): boolean;
    getStatus(): ServiceStatus;
}
export interface LifecycleConfig {
    /** Health check polling interval (ms) */
    healthCheckIntervalMs: number;
    /** Shutdown timeout per service (ms) */
    shutdownTimeoutMs: number;
}
export declare class DaemonLifecycle extends EventEmitter {
    private config;
    private services;
    private startOrder;
    private healthTimer;
    private running;
    constructor(config?: Partial<LifecycleConfig>);
    /**
     * Register a service for lifecycle management
     */
    registerService(service: DaemonService): void;
    /**
     * Auto-register observer service if triggers exist
     */
    autoRegisterObserver(): Promise<void>;
    /**
     * Start all registered services in order
     */
    startAll(): Promise<void>;
    /**
     * Stop all services in reverse order
     */
    stopAll(): Promise<void>;
    /**
     * Run health check on all services
     */
    private runHealthCheck;
    /**
     * Get status of all services
     */
    getAllStatus(): ServiceStatus[];
    /**
     * Check if lifecycle is running
     */
    isRunning(): boolean;
    /**
     * Get registered service names
     */
    getServiceNames(): string[];
}
export declare function getDaemonLifecycle(config?: Partial<LifecycleConfig>): DaemonLifecycle;
export declare function resetDaemonLifecycle(): void;
