// wedge — pure platform classification for the installer.
//
// The installer's existing `isLinux()` checks (26 sites in index.ts) collapse
// process.platform into a boolean and treat every non-Linux value as "skip
// silently." Follow-up tasks 838/839/840 widen that to an explicit ternary
// (linux | darwin | unsupported) so unsupported targets refuse loudly with a
// log line operators can grep, instead of completing in a non-functional state.
//
// This module ships dead until those follow-ups land. Pure logic with no I/O —
// caller injects process.platform so tests pass arbitrary fixtures without
// touching the host's actual platform.
/**
 * Classify a Node process.platform value into the ternary the installer cares
 * about. Anything not in { linux, darwin } returns "unsupported"; the caller
 * decides whether to refuse the install or no-op.
 */
export function detectPlatform(nodePlatform) {
    if (nodePlatform === "linux")
        return "linux";
    if (nodePlatform === "darwin")
        return "darwin";
    return "unsupported";
}
/**
 * Narrow a Node process.platform to a SupportedPlatform or throw with the
 * literal refusal message follow-up tasks log + grep on. Use this at install
 * pre-flight where continuing on an unsupported OS would silently complete a
 * broken install.
 */
export function requireSupportedPlatform(nodePlatform) {
    const detected = detectPlatform(nodePlatform);
    if (detected === "unsupported") {
        throw new Error(`[create-maxy] platform=${nodePlatform} — refusing: only linux and darwin are supported`);
    }
    return detected;
}
