/**
 * Centralised lifecycle registry for the server's long-running schedulers.
 *
 * Audit item #6 (v0.5.6): before this registry, each scheduler
 * (CuratorScheduler, SelfLearningHeartbeat, TriggerScheduler,
 * AutomationScheduler, uploads-auto-prune, OTLP exporter) was wired
 * independently in `server.ts` with its own `configureX` / `stopX` pair.
 * There was no single place to enumerate what was running, stop everything
 * for shutdown, or audit which subsystems were active.
 *
 * `SchedulerRegistry` is deliberately small: register a `ManagedScheduler`,
 * stop a specific one by name, stop all in reverse-registration order,
 * enumerate current status. It does NOT subscribe to the KillSwitch — the
 * existing semantic is that schedulers stay running but their per-tick guard
 * (`isKillSwitchActive()`) makes them no-op while the switch is engaged.
 * That preserves the current behaviour where releasing the switch resumes
 * scheduled work without a reconfiguration.
 */
export interface ManagedScheduler {
    /** Stable identifier used for lookup and stop ordering. */
    readonly name: string;
    /** Stop the scheduler. May be sync or async; errors are swallowed and reported. */
    stop(): void | Promise<void>;
    /** Optional liveness probe used by `list()`. Defaults to `true` if omitted. */
    isRunning?(): boolean;
}
export interface SchedulerStatus {
    name: string;
    running: boolean;
}
export interface SchedulerStopResult {
    name: string;
    ok: boolean;
    error?: string;
}
export declare class SchedulerRegistry {
    private entries;
    /**
     * Register (or replace) a scheduler. Replacing an existing entry by name
     * stops the previous instance first to avoid leaking timers when a
     * scheduler is reconfigured (curator, heartbeat, etc.).
     */
    register(scheduler: ManagedScheduler): void;
    /**
     * Unregister a scheduler by name without stopping it. Returns true if the
     * entry existed. Callers that want shutdown semantics should `stop()` first.
     */
    unregister(name: string): boolean;
    /** Stop a single scheduler by name. No-op if not registered. */
    stop(name: string): Promise<SchedulerStopResult | null>;
    /**
     * Stop every registered scheduler in reverse-registration order so that
     * subsystems registered later (typically higher-level orchestrators) get a
     * chance to shut down before their dependencies disappear.
     *
     * Each stop is awaited but failures are isolated — one scheduler crashing
     * during shutdown must not prevent the others from being stopped.
     */
    stopAll(): Promise<SchedulerStopResult[]>;
    /** Enumerate currently-registered schedulers with their liveness probe. */
    list(): SchedulerStatus[];
    /** Test/diagnostic helper: drop all registrations without stopping. */
    clear(): void;
    private runStop;
}
//# sourceMappingURL=schedulerRegistry.d.ts.map