"""能力面 Plane 常量与 Pack（P1–P14 基线 + P15+ 扩展）。"""

from __future__ import annotations

from dataclasses import dataclass, field
from typing import Literal

PlaneId = Literal[
    "P1",
    "P2",
    "P3",
    "P4",
    "P5",
    "P6",
    "P7",
    "P8",
    "P9",
    "P10",
    "P11",
    "P12",
    "P13",
    "P14",
    "P15",
    "P16",
]

PLANE_IDS: tuple[str, ...] = (
    "P1",
    "P2",
    "P3",
    "P4",
    "P5",
    "P6",
    "P7",
    "P8",
    "P9",
    "P10",
    "P11",
    "P12",
    "P13",
    "P14",
    "P15",
    "P16",
)

Regime = Literal["companion", "work", "hybrid", "education"]

DEFAULT_COMPANION_PLANES: frozenset[str] = frozenset({"P1", "P2", "P3", "P6", "P7", "P9", "P13", "P10"})
DEFAULT_WORK_PLANES: frozenset[str] = frozenset({"P1", "P2", "P3", "P6", "P7", "P9", "P12", "P13", "P10"})
DEFAULT_HYBRID_PLANES: frozenset[str] = frozenset({"P1", "P2", "P3", "P6", "P7", "P9", "P12", "P13", "P10"})
DEFAULT_EDUCATION_PLANES: frozenset[str] = frozenset({"P1", "P2", "P3", "P6", "P7", "P9", "P13", "P10"})


@dataclass(frozen=True)
class PlanePack:
    regime: Regime
    active: frozenset[str] = field(default_factory=lambda: DEFAULT_COMPANION_PLANES)
    skip: frozenset[str] = frozenset()

    def is_active(self, plane: str) -> bool:
        if plane in self.skip:
            return False
        return plane in self.active
