"""Configuration loading utilities.

This module provides functions for loading and parsing YAML configuration files.
"""

from __future__ import annotations
from pathlib import Path
from typing import Any, Dict
import yaml


def load_yaml(path: str | Path) -> Dict[str, Any]:
    """Load and parse a YAML configuration file.

    Args:
        path: Path to YAML file (string or Path object).

    Returns:
        Dictionary containing parsed YAML contents.

    Raises:
        FileNotFoundError: If the file does not exist.
        yaml.YAMLError: If the file contains invalid YAML.
    """
    with open(path, "r", encoding="utf-8") as f:
        return yaml.safe_load(f)
