"""Public API for codeflash-core: AI client, models, telemetry, and exceptions."""

from __future__ import annotations

from importlib.metadata import version as _get_version

try:
    __version__: str = _get_version("codeflash-core")
except Exception:  # noqa: BLE001
    __version__ = "0.0.0"

from ._capabilities import (
    REQUIRED_CAPABILITIES,
    CompareResultsFn,
    DiscoverFn,
    ExtractContextFn,
    NormalizeFn,
    ParseResultsFn,
    ReplaceCodeFn,
    RunTestsFn,
    validate_capabilities,
)
from ._client import AIClient
from ._configuration import LanguageConfiguration
from ._git import check_and_push_branch, get_repo_owner_and_name
from ._model import (
    BenchmarkDetail,
    Candidate,
    FileDiffContent,
    OptimizationRequest,
    OptimizationReviewResult,
    PrComment,
    humanize_runtime,
)
from ._pipeline import (
    CandidateForest,
    CandidateNode,
    EvaluationContext,
    create_rank_dictionary,
    dedup_candidates,
    diff_length,
    filter_refined_candidates,
    performance_gain,
    select_best,
)
from ._platform import PlatformClient, parse_repo_owner_and_name
from ._plugin import LanguagePlugin
from ._state import LanguageState
from ._telemetry import init_telemetry, ph
from .exceptions import (
    AIServiceConnectionError,
    AIServiceError,
    InvalidAPIKeyError,
)

__all__ = [
    "REQUIRED_CAPABILITIES",
    "AIClient",
    "AIServiceConnectionError",
    "AIServiceError",
    "BenchmarkDetail",
    "Candidate",
    "CandidateForest",
    "CandidateNode",
    "CompareResultsFn",
    "DiscoverFn",
    "EvaluationContext",
    "ExtractContextFn",
    "FileDiffContent",
    "InvalidAPIKeyError",
    "LanguageConfiguration",
    "LanguagePlugin",
    "LanguageState",
    "NormalizeFn",
    "OptimizationRequest",
    "OptimizationReviewResult",
    "ParseResultsFn",
    "PlatformClient",
    "PrComment",
    "ReplaceCodeFn",
    "RunTestsFn",
    "__version__",
    "check_and_push_branch",
    "create_rank_dictionary",
    "dedup_candidates",
    "diff_length",
    "filter_refined_candidates",
    "get_repo_owner_and_name",
    "humanize_runtime",
    "init_telemetry",
    "parse_repo_owner_and_name",
    "performance_gain",
    "ph",
    "select_best",
    "validate_capabilities",
]
