# Copyright (c) 2026 MergeGuide, Inc. All rights reserved.
# SPDX-License-Identifier: Proprietary
"""MergeGuide Policy Engine - Core evaluation logic."""

from .evaluator import PolicyEngine, PolicyInput, PolicyOutput
from .parser import DiffParser, FileParser, parse_diff
from .reporter import Reporter, ReportFormat
from .rules import Rule, RuleResult, RuleType

__all__ = [
    "PolicyEngine",
    "PolicyInput",
    "PolicyOutput",
    "DiffParser",
    "FileParser",
    "parse_diff",
    "Reporter",
    "ReportFormat",
    "Rule",
    "RuleResult",
    "RuleType",
]

# Semgrep integration (optional - requires `pip install mergeguide[semgrep]`)
try:
    from .semgrep import (  # noqa: F401
        SemgrepFinding,
        SemgrepResult,
        SemgrepScanner,
        create_scanner,
        is_semgrep_available,
        map_finding_to_violation,
    )

    __all__.extend(
        [
            "SemgrepScanner",
            "SemgrepFinding",
            "SemgrepResult",
            "create_scanner",
            "is_semgrep_available",
            "map_finding_to_violation",
        ]
    )
    SEMGREP_AVAILABLE = True
except ImportError:
    SEMGREP_AVAILABLE = False

    def is_semgrep_available() -> bool:  # type: ignore[misc]
        """Stub when semgrep module is not importable."""
        return False
