/**
 * install/cli-to-install-root.mjs — shared host-cli → install-root mapping.
 *
 * Extracted so both the install pipeline (which targets runtimes by their
 * `id`) and the router (which discovers skills under the install root of
 * whichever host CLI is detected) share a single source of truth. Keeps the
 * scan surface and the install surface from drifting.
 *
 * The mapping is driven entirely by RUNTIMES[i].cliId — do not add ad-hoc
 * aliases here. When a new runtime lands, give its descriptor a cliId and
 * the lookups below work automatically.
 *
 * `null` is returned for:
 *   - `'unknown'` — deterministic branches (init/status/help) don't need a
 *     mapping; the router falls back to the framework-scoped dev default
 *     defined in getTrustedSkillSources().
 */
import { RUNTIMES } from './runtime-detect.mjs';
/**
 * Look up the install-root (e.g. `.claude`, `.codex`, `.github/copilot`) for
 * the runtime whose CLI is currently at the prompt.
 *
 * @param {string} cli  the `cli` string `detectHost()` returned
 * @returns {string|null}  project-relative install root, or null when the
 *   CLI has no mapped install target.
 */
export function cliToInstallRoot(cli) {
    if (typeof cli !== 'string' || cli === '' || cli === 'unknown')
        return null;
    const runtime = RUNTIMES.find((r) => r.cliId === cli);
    return runtime?.installRoot ?? null;
}
/**
 * Inverse lookup: for a host cli, return the full runtime descriptor. Useful
 * for callers that need more than just the install root (e.g. markers).
 *
 * @param {string} cli
 * @returns {import('./runtime-detect.mjs').RuntimeDescriptor|null}
 */
export function runtimeForCli(cli) {
    if (typeof cli !== 'string' || cli === '' || cli === 'unknown')
        return null;
    return RUNTIMES.find((r) => r.cliId === cli) ?? null;
}
//# sourceMappingURL=cli-to-install-root.mjs.map