"""STUB — CP-2 Phase 8 (2026-04-26): legacy ModelClient implementations
were migrated to execution/providers/. This file is retained ONLY to keep
get_client(), GenerationResult, _download_video, AND the legacy class
names reachable for code paths not yet ported (execute_multi_shot,
calibrate_models.py, archive scripts, AND the Production Console at
recoil/pipeline/editors/review_server.py).

Spec-review edit #11 (locked 2026-04-25) — the Production Console at
recoil/pipeline/editors/review_server.py imports GoogleGenaiClient,
KlingClient, FalAiKlingClient directly by class name (lines 7284, 7297,
7310). Same pattern in pipeline/api/routes/generation.py (lines 2232,
2243, 2254). STUB without re-export breaks the Production Console
(port 8430) on import.

DO NOT add new code here. Add to execution/providers/ + execution/lib/.

Once execute_multi_shot is provider-routed (CP-3 or CP-4) AND
review_server.py + generation.py no longer import the legacy class
names, delete this file entirely along with recoil/pipeline/lib/api_client.py
(the 7-line proxy).

Rollback tag: pre-api-client-deletion (df86dc9a).
"""

from recoil.execution.types import GenerationResult  # re-export for legacy callers
from recoil.execution.lib.http_helpers import _download_video  # re-export

# Spec-review edit #11 — re-export legacy class names for review_server.py +
# generation.py routes. These adapters live in providers/ now; the legacy
# class names are exposed there as backwards-compat shims that delegate to
# the adapters via VideoModelClient.
from recoil.execution.providers.google import GoogleGenaiClient  # noqa: F401
from recoil.execution.providers.kling import KlingClient, FalAiKlingClient  # noqa: F401


def get_client(model_id: str, tier_override: str | None = None):
    """Legacy factory — returns a VideoModelClient bound to model_id.

    Pre-CP-2 callers expected one of GoogleGenaiClient / KlingClient /
    FalAiKlingClient / SeedDanceClient / WanClient back, dispatched by
    model api_pattern. Post-CP-2 the canonical path is the provider
    adapter registry behind VideoModelClient — one client class for
    every model.

    Tier is passed via constructor (NOT env var — see Phase 4 edit #7
    thread-safety note: ProductionLoop's ThreadPoolExecutor mutates env
    vars per worker which races invalidate env-var tier selection).
    """
    from recoil.execution.video_model_client import VideoModelClient

    return VideoModelClient(model_id=model_id, tier=tier_override or "standard_720p")


__all__ = [
    "get_client",
    "GenerationResult",
    "_download_video",
    "GoogleGenaiClient",
    "KlingClient",
    "FalAiKlingClient",
]
