"""Meeting input loading helpers."""

from __future__ import annotations

from pathlib import Path

from core.models import MeetingInput
from core.serialization import load_data


def load_meeting_input(path: Path) -> MeetingInput:
    """Load a meeting input file into a typed model."""

    if not path.exists():
        raise FileNotFoundError(path)
    if path.suffix.lower() not in {".json", ".yaml", ".yml"}:
        raise ValueError(f"unsupported meeting input format: {path.suffix}")

    return MeetingInput.model_validate(load_data(path))
