"""Skill system for Beaver.

顶层包保持 lazy export，避免只导入 catalog/loader 时顺带拉起
SkillAssembler -> provider -> litellm 这条重依赖链。
"""

from __future__ import annotations

from typing import Any

__all__ = [
    "SkillAssembler",
    "SkillAssemblyResult",
    "SkillEmbeddingRetriever",
    "SkillRecord",
    "SkillsLoader",
]


def __getattr__(name: str) -> Any:
    if name in {"SkillAssembler", "SkillAssemblyResult", "SkillEmbeddingRetriever"}:
        from .assembler import SkillAssembler, SkillAssemblyResult, SkillEmbeddingRetriever

        return {
            "SkillAssembler": SkillAssembler,
            "SkillAssemblyResult": SkillAssemblyResult,
            "SkillEmbeddingRetriever": SkillEmbeddingRetriever,
        }[name]
    if name in {"SkillRecord", "SkillsLoader"}:
        from .catalog import SkillRecord, SkillsLoader

        return {
            "SkillRecord": SkillRecord,
            "SkillsLoader": SkillsLoader,
        }[name]
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
