"""Task modules - lazy loading to avoid Celery dependency at import time."""

from __future__ import annotations


def __getattr__(name: str):
    """Lazy import task functions to avoid loading Celery at module import time."""
    if name == "classify_asset":
        from .classification import classify_asset

        return classify_asset
    elif name == "generate_video":
        from .generation import generate_video

        return generate_video
    elif name == "healthcheck":
        from .health import healthcheck

        return healthcheck
    elif name == "ingest_asset":
        from .ingest import ingest_asset

        return ingest_asset
    elif name == "extract_voice_task":
        from .voice_extraction import extract_voice_task

        return extract_voice_task
    elif name == "compose_video":
        from .compose_video import compose_video

        return compose_video
    elif name == "extract_background_task":
        from .voice_extraction import extract_background_task

        return extract_background_task
    elif name == "process_voice_clone":
        from .voice_clone import process_voice_clone

        return process_voice_clone
    elif name == "process_tts_synthesis":
        from .tts_synthesis import process_tts_synthesis

        return process_tts_synthesis
    elif name == "process_tts_segment_synthesis":
        from .tts_synthesis import process_tts_segment_synthesis

        return process_tts_segment_synthesis
    elif name == "run_ai_recommend":
        from .ai_tasks import run_ai_recommend

        return run_ai_recommend
    elif name == "run_generate_cover":
        from .ai_tasks import run_generate_cover

        return run_generate_cover
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")


__all__ = [
    "classify_asset",
    "compose_video",
    "generate_video",
    "healthcheck",
    "ingest_asset",
    "extract_voice_task",
    "extract_background_task",
    "process_voice_clone",
    "process_tts_synthesis",
    "process_tts_segment_synthesis",
    "run_ai_recommend",
    "run_generate_cover",
]
