"""AGT version gate — fail fast on unsupported agent-os-kernel versions."""

from __future__ import annotations

import agent_os

_MIN_VERSION = (3, 0, 0)
_MAX_VERSION = (4, 0, 0)

_raw = agent_os.__version__
_parts = tuple(int(p) for p in _raw.split(".")[:3])

if not (_MIN_VERSION <= _parts < _MAX_VERSION):
    raise RuntimeError(
        f"aria-agentkit requires agent-os-kernel >=3.0.0,<4.0.0 "
        f"(found {_raw}). Please upgrade or pin a compatible version."
    )

AGT_VERSION: tuple[int, int, int] = (_parts[0], _parts[1], _parts[2])
"""Parsed (major, minor, patch) of the detected agent-os-kernel."""
