/**
 * Alerting Rules and Thresholds
 *
 * Defines alerting rules, thresholds, and notification interfaces
 * for Agent Anchor observability.
 *
 * @packageDocumentation
 */
export type AlertSeverity = 'critical' | 'warning' | 'info';
export type AlertState = 'firing' | 'resolved' | 'pending';
export interface AlertRule {
    /** Unique rule identifier */
    id: string;
    /** Human-readable name */
    name: string;
    /** Description of what this rule monitors */
    description: string;
    /** Alert severity */
    severity: AlertSeverity;
    /** Metric query or condition */
    condition: AlertCondition;
    /** Duration before firing (seconds) */
    forSeconds: number;
    /** Labels to attach to alerts */
    labels: Record<string, string>;
    /** Annotations with additional context */
    annotations: Record<string, string>;
    /** Is this rule enabled */
    enabled: boolean;
}
export interface AlertCondition {
    /** Type of condition */
    type: 'threshold' | 'rate' | 'absence' | 'comparison';
    /** Metric name */
    metric: string;
    /** Operator for comparison */
    operator: '>' | '<' | '>=' | '<=' | '==' | '!=';
    /** Threshold value */
    value: number;
    /** Aggregation window (for rate conditions) */
    windowSeconds?: number;
    /** Labels to filter by */
    labels?: Record<string, string>;
}
export interface Alert {
    /** Alert rule ID */
    ruleId: string;
    /** Alert state */
    state: AlertState;
    /** When the alert started firing */
    firedAt?: string;
    /** When the alert was resolved */
    resolvedAt?: string;
    /** Current value that triggered the alert */
    value: number;
    /** Labels from rule + instance */
    labels: Record<string, string>;
    /** Annotations from rule */
    annotations: Record<string, string>;
    /** Alert fingerprint for deduplication */
    fingerprint: string;
}
export interface AlertNotification {
    alert: Alert;
    rule: AlertRule;
    timestamp: string;
}
export type AlertHandler = (notification: AlertNotification) => Promise<void>;
export declare const DEFAULT_ALERT_RULES: AlertRule[];
export declare class AlertManager {
    private rules;
    private activeAlerts;
    private handlers;
    private evaluationInterval;
    constructor();
    /**
     * Add a custom alert rule
     */
    addRule(rule: AlertRule): void;
    /**
     * Remove an alert rule
     */
    removeRule(ruleId: string): void;
    /**
     * Enable/disable a rule
     */
    setRuleEnabled(ruleId: string, enabled: boolean): void;
    /**
     * Register an alert handler
     */
    onAlert(handler: AlertHandler): void;
    /**
     * Get all rules
     */
    getRules(): AlertRule[];
    /**
     * Get active alerts
     */
    getActiveAlerts(): Alert[];
    /**
     * Generate alert fingerprint for deduplication
     */
    private generateFingerprint;
    /**
     * Fire an alert
     */
    fireAlert(ruleId: string, value: number, instanceLabels?: Record<string, string>): Promise<void>;
    /**
     * Resolve an alert
     */
    resolveAlert(ruleId: string, instanceLabels?: Record<string, string>): Promise<void>;
    /**
     * Notify all handlers
     */
    private notifyHandlers;
    /**
     * Get alert summary
     */
    getSummary(): {
        total: number;
        firing: number;
        pending: number;
        bySeverity: Record<AlertSeverity, number>;
    };
}
export declare function createAlertManager(): AlertManager;
export declare function getAlertManager(): AlertManager;
/**
 * Logging handler - logs all alerts
 */
export declare const loggingAlertHandler: AlertHandler;
/**
 * Webhook handler factory
 */
export declare function createWebhookAlertHandler(webhookUrl: string): AlertHandler;
//# sourceMappingURL=alerts.d.ts.map