"""PyFortis — config-driven risk engine for trading systems."""

from __future__ import annotations

try:
    from importlib.metadata import version as _version

    __version__ = _version("pyfortis")
except Exception:
    __version__ = "0.0.0"

from pyfortis._types import (
    BreachAction,
    BreachRecord,
    CircuitBreakerSpec,
    CircuitBreakerType,
    EscalationPolicy,
    Exposure,
    GateResult,
    GateVerdict,
    LimitCheckResult,
    LimitScope,
    LimitSpec,
    LimitType,
    MetricResult,
    MetricSpec,
    MetricType,
    Order,
    OrderType,
    Position,
    Severity,
    Side,
    VaRMethod,
)
from pyfortis.errors import (
    CalculatorNotFoundError,
    CircuitBreakerTrippedError,
    ConfigurationError,
    HandlerNotFoundError,
    LimitBreachError,
    OrderRejectedError,
    RiskError,
    RiskPolicy,
    StalePositionError,
    ValidatorNotFoundError,
)
from pyfortis.gate import RiskEngine
from pyfortis.monitor import RiskMonitor
from pyfortis.orchestrator import RiskOrchestrator

__all__ = [
    # Engine
    "RiskEngine",
    "RiskMonitor",
    "RiskOrchestrator",
    # Types - Enums
    "BreachAction",
    "CircuitBreakerType",
    "GateVerdict",
    "LimitScope",
    "LimitType",
    "MetricType",
    "OrderType",
    "Severity",
    "Side",
    "VaRMethod",
    # Types - Value objects
    "Exposure",
    "Order",
    "Position",
    # Types - Config specs
    "CircuitBreakerSpec",
    "EscalationPolicy",
    "LimitSpec",
    "MetricSpec",
    # Types - Results
    "BreachRecord",
    "GateResult",
    "LimitCheckResult",
    "MetricResult",
    # Errors
    "CalculatorNotFoundError",
    "CircuitBreakerTrippedError",
    "ConfigurationError",
    "HandlerNotFoundError",
    "LimitBreachError",
    "OrderRejectedError",
    "RiskError",
    "RiskPolicy",
    "StalePositionError",
    "ValidatorNotFoundError",
]
