# File: src/noveler/presentation/mcp/repository_factories.py
# Purpose: Delegate MCP repository provisioning to application-layer factories
# Context: Bridges legacy presentation handlers to DDD-compliant application adapters

"""Forward MCP repository creation to application-layer factories."""

from pathlib import Path
from typing import TYPE_CHECKING

from noveler.application.adapters.cli_adapter_factory import CliAdapterFactory

if TYPE_CHECKING:
    from noveler.domain.repositories.episode_repository import EpisodeRepository
    from noveler.domain.repositories.plot_repository import PlotRepository
    from noveler.domain.repositories.yaml_prompt_repository import YamlPromptRepository


def create_yaml_prompt_repository(project_root: Path) -> "YamlPromptRepository | None":
    """Return a YAML prompt repository resolved via the application boundary."""

    return CliAdapterFactory.create_yaml_prompt_repository(project_root)


def create_episode_repository(project_root: Path) -> "EpisodeRepository | None":
    """Return an episode repository resolved via the application boundary."""

    return CliAdapterFactory.create_episode_repository(project_root)


def create_plot_repository(project_root: Path) -> "PlotRepository | None":
    """Return a plot repository resolved via the application boundary."""

    return CliAdapterFactory.create_plot_repository(project_root)
