from __future__ import annotations

from collections.abc import Callable
from dataclasses import dataclass, field

AssetValidator = Callable[[str], str | None]


@dataclass(frozen=True)
class Asset:
    relative_path: str
    content: str
    executable: bool = False
    validators: tuple[AssetValidator, ...] = field(default_factory=tuple)


@dataclass(frozen=True)
class Profile:
    name: str
    description: str
    assets: tuple[Asset, ...]


@dataclass(frozen=True)
class Pack:
    name: str
    role: str
    description: str
    assets: tuple[Asset, ...]


@dataclass(frozen=True)
class ValidationIssue:
    relative_path: str
    reason: str
