"""OS family detection for desktop shell / screenshot dispatch."""

from __future__ import annotations

import platform
import sys


def os_family() -> str:
    """Return canonical family: linux | windows | macos."""
    sysname = platform.system().lower()
    if sysname == "darwin" or sys.platform == "darwin":
        return "macos"
    if sysname == "windows" or sys.platform == "win32":
        return "windows"
    if sysname == "linux" or sys.platform.startswith("linux"):
        return "linux"
    return sysname or "unknown"
