/**
 * Risk Scan Scheduler
 *
 * Runs the SupplyRiskDetector on a configurable interval (default: 15 min).
 * Persists alerts, generates recommendations, and optionally auto-executes
 * critical actions when auto_action is enabled.
 */
import type { InventorySnapshot, DemandSignal, FacilityCapacity, DetectedRisk } from './detector.js';
import type { RiskThresholds } from './thresholds.js';
import type { Recommendation } from './recommender.js';
export interface PersistedAlert {
    readonly id: string;
    readonly risk: DetectedRisk;
    readonly status: 'open' | 'resolved';
    readonly created_at: string;
    readonly resolved_at?: string;
    readonly resolved_by?: string;
    readonly resolution_notes?: string;
}
/** Adapter for fetching live inventory/demand data and persisting results. */
export interface RiskDataAdapter {
    /** Return current inventory across all facilities. */
    getInventorySnapshots(): Promise<readonly InventorySnapshot[]>;
    /** Return demand signals (average daily usage per facility+SKU). */
    getDemandSignals(): Promise<readonly DemandSignal[]>;
    /** Return facility capacity metadata. */
    getFacilityCapacities(): Promise<readonly FacilityCapacity[]>;
    /** Persist a new alert row. */
    persistAlert(alert: PersistedAlert): Promise<void>;
    /** Execute a recommendation (create transfer or procurement order). */
    executeRecommendation(rec: Recommendation): Promise<{
        success: boolean;
        order_id?: string;
    }>;
}
export interface ScanResult {
    readonly scan_id: string;
    readonly timestamp: string;
    readonly risks_detected: number;
    readonly recommendations_generated: number;
    readonly auto_executed: number;
    readonly alerts: readonly PersistedAlert[];
    readonly recommendations: readonly Recommendation[];
}
export declare class RiskScanScheduler {
    private readonly thresholds;
    private readonly adapter;
    private timer;
    private readonly detector;
    private readonly recommender;
    private lastScan;
    /** In-memory alert store (production would use DB). */
    private readonly alerts;
    /** In-memory recommendation store. */
    private readonly recommendations;
    constructor(thresholds: RiskThresholds, adapter: RiskDataAdapter, capacities?: readonly FacilityCapacity[]);
    /** Start the periodic scan. Default interval: 15 minutes. */
    start(intervalMs?: number): void;
    stop(): void;
    get isRunning(): boolean;
    get lastScanResult(): ScanResult | null;
    /** Trigger an immediate scan (also called by the POST /risk/scan endpoint). */
    runScan(): Promise<ScanResult>;
    getAlerts(filter?: {
        status?: 'open' | 'resolved';
        facility_id?: string;
        sku?: string;
    }): PersistedAlert[];
    resolveAlert(alertId: string, resolvedBy: string, notes?: string): PersistedAlert | null;
    getRecommendations(filter?: {
        status?: 'pending' | 'executed' | 'dismissed';
    }): Recommendation[];
    executeRecommendation(recId: string): Promise<{
        success: boolean;
        order_id?: string;
    } | null>;
}
//# sourceMappingURL=scheduler.d.ts.map