import type { Intent, Decision, ControlAction, TrustLevel, TrustScore, ID } from '../common/types.js';
import type { EvaluationResult } from '../basis/types.js';
export * from './policy-engine.js';
export * from './constraint-evaluator.js';
export * from './escalation-rules.js';
export * from './decision-aggregator.js';
export * from './runtime-config.js';
import { PolicyEngine, type PolicyEngineOptions, type EnforcementPolicy } from './policy-engine.js';
import { ConstraintEvaluator, type ConstraintEvaluatorOptions, type Constraint, type StateProvider } from './constraint-evaluator.js';
import { EscalationRuleEngine, type EscalationEngineOptions, type EscalationRule } from './escalation-rules.js';
import { DecisionAggregator, type DecisionAggregatorOptions, type ConflictStrategy } from './decision-aggregator.js';
import { RuntimeConfig, type RuntimeConfigOptions, type EnforcementMode } from './runtime-config.js';
/**
 * Enforcement context combining intent and evaluation results
 */
export interface EnforcementContext {
    intent: Intent;
    evaluation: EvaluationResult;
    trustScore: TrustScore;
    trustLevel: TrustLevel;
}
/**
 * Legacy enforcement policy configuration
 * @deprecated Use EnforcementPolicy from policy-engine instead
 */
export interface LegacyEnforcementPolicy {
    defaultAction: ControlAction;
    requireMinTrustLevel?: TrustLevel;
    escalationRules?: LegacyEscalationRule[];
}
/**
 * Legacy escalation rule definition
 * @deprecated Use EscalationRule from escalation-rules instead
 */
export interface LegacyEscalationRule {
    condition: string;
    escalateTo: string;
    timeout: string;
}
/**
 * Options for the unified enforcement service
 */
export interface EnforcementServiceOptions {
    /** Policy engine options */
    policyEngine?: PolicyEngineOptions;
    /** Constraint evaluator options */
    constraintEvaluator?: ConstraintEvaluatorOptions;
    /** Escalation engine options */
    escalationEngine?: EscalationEngineOptions;
    /** Decision aggregator options */
    decisionAggregator?: DecisionAggregatorOptions;
    /** Runtime config options */
    runtimeConfig?: RuntimeConfigOptions;
    /** State provider for constraints */
    stateProvider?: StateProvider;
    /** Default conflict resolution strategy */
    conflictStrategy?: ConflictStrategy;
    /** Enable OpenTelemetry tracing */
    enableTracing?: boolean;
    /** Legacy policy (for backwards compatibility) */
    legacyPolicy?: LegacyEnforcementPolicy;
}
/**
 * Unified EnforcementService that orchestrates all enforcement components
 */
export declare class EnforcementService {
    private policyEngine;
    private constraintEvaluator;
    private escalationEngine;
    private decisionAggregator;
    private runtimeConfig;
    private legacyPolicy;
    private options;
    constructor(options?: EnforcementServiceOptions);
    /**
     * Make an enforcement decision using all components
     */
    decide(context: EnforcementContext): Promise<Decision>;
    /**
     * Decide with OpenTelemetry tracing
     */
    decideWithTracing(context: EnforcementContext): Promise<Decision>;
    /**
     * Evaluate legacy policy for backwards compatibility
     */
    private evaluateLegacyPolicy;
    /**
     * Map aggregated decision to constraint evaluation results
     */
    private mapConstraintResults;
    /**
     * Create a decision record
     */
    private createDecision;
    /**
     * Get the policy engine
     */
    getPolicyEngine(): PolicyEngine;
    /**
     * Get the constraint evaluator
     */
    getConstraintEvaluator(): ConstraintEvaluator;
    /**
     * Get the escalation engine
     */
    getEscalationEngine(): EscalationRuleEngine;
    /**
     * Get the decision aggregator
     */
    getDecisionAggregator(): DecisionAggregator;
    /**
     * Get the runtime config
     */
    getRuntimeConfig(): RuntimeConfig;
    /**
     * Add an enforcement policy
     */
    addPolicy(policy: EnforcementPolicy): void;
    /**
     * Add a constraint
     */
    addConstraint(constraint: Constraint): void;
    /**
     * Add an escalation rule
     */
    addEscalationRule(rule: EscalationRule): void;
    /**
     * Set enforcement mode
     */
    setEnforcementMode(mode: EnforcementMode): void;
    /**
     * Get enforcement mode
     */
    getEnforcementMode(): EnforcementMode;
    /**
     * Update legacy enforcement policy
     */
    setPolicy(policy: LegacyEnforcementPolicy): void;
    /**
     * Check if a feature flag is enabled
     */
    isFeatureEnabled(flagId: ID, context?: {
        entityId?: ID;
        tenantId?: ID;
    }): boolean;
    /**
     * Get service statistics
     */
    getStats(): {
        policyEngine: ReturnType<PolicyEngine['getStats']>;
        constraintEvaluator: ReturnType<ConstraintEvaluator['getStats']>;
        escalationEngine: ReturnType<EscalationRuleEngine['getStats']>;
        decisionAggregator: ReturnType<DecisionAggregator['getStats']>;
        runtimeConfig: ReturnType<RuntimeConfig['getStats']>;
    };
    /**
     * Clear all components
     */
    clear(): void;
}
/**
 * Create a new enforcement service instance
 */
export declare function createEnforcementService(options?: EnforcementServiceOptions): EnforcementService;
export type EnforcementPolicy_Legacy = LegacyEnforcementPolicy;
export type EscalationRule_Legacy = LegacyEscalationRule;
//# sourceMappingURL=index.d.ts.map