from __future__ import annotations

from importlib import import_module

__all__ = [
    "CodeExcerpt",
    "CodeExplainRetrieverV2",
    "CodeGraphRepository",
    "EvidenceItem",
    "ExplainIntent",
    "ExplainIntentBuilder",
    "ExplainPack",
    "LayeredRetrievalGateway",
    "PromptBudgeter",
    "TracePath",
]


def __getattr__(name: str):
    module_map = {
        "CodeExcerpt": "app.modules.agent.runtime.steps.explain.models",
        "EvidenceItem": "app.modules.agent.runtime.steps.explain.models",
        "ExplainIntent": "app.modules.agent.runtime.steps.explain.models",
        "ExplainPack": "app.modules.agent.runtime.steps.explain.models",
        "TracePath": "app.modules.agent.runtime.steps.explain.models",
        "ExplainIntentBuilder": "app.modules.agent.runtime.steps.explain.intent_builder",
        "PromptBudgeter": "app.modules.agent.runtime.steps.explain.budgeter",
        "LayeredRetrievalGateway": "app.modules.agent.runtime.steps.explain.layered_gateway",
        "CodeGraphRepository": "app.modules.agent.runtime.steps.explain.graph_repository",
        "CodeExplainRetrieverV2": "app.modules.agent.runtime.steps.explain.retriever_v2",
    }
    module_name = module_map.get(name)
    if module_name is None:
        raise AttributeError(name)
    module = import_module(module_name)
    return getattr(module, name)
