/**
 * Project type hierarchy - child types include their parent types
 */
export const PROJECT_TYPE_HIERARCHY = {
    expo: "typescript",
    nestjs: "typescript",
    cdk: "typescript",
    "harper-fabric": "typescript",
    phaser: "typescript",
    "npm-package": "typescript",
    typescript: undefined,
    rails: undefined,
};
/**
 * Canonical order for processing project types (parents before children)
 */
export const PROJECT_TYPE_ORDER = [
    "typescript",
    "npm-package",
    "harper-fabric",
    "phaser",
    "expo",
    "nestjs",
    "cdk",
    "rails",
];
/**
 * All available copy strategies in processing order
 */
export const COPY_STRATEGIES = [
    "copy-overwrite",
    "copy-contents",
    "create-only",
    "merge",
    "tagged-merge",
    "package-lisa",
];
/**
 * All valid harness values, in canonical order
 */
export const HARNESS_VALUES = [
    "claude",
    "codex",
    "cursor",
    "agy",
    "copilot",
    "opencode",
    "fleet",
];
/**
 * Input aliases accepted on the CLI and in `.lisa.config.json`, each mapping to
 * a canonical {@link Harness}. `all` is a friendly synonym for `fleet`.
 */
export const HARNESS_ALIASES = {
    all: "fleet",
};
/**
 * Every string a user may supply for a harness: the canonical values plus the
 * accepted aliases. Used to build help text and validation error messages so
 * `all` is advertised alongside `fleet`.
 */
export const ACCEPTED_HARNESS_INPUTS = [
    ...HARNESS_VALUES,
    ...Object.keys(HARNESS_ALIASES),
];
/**
 * Retired harness values that Lisa no longer accepts verbatim but silently
 * migrates to a canonical {@link Harness} rather than hard-failing the apply.
 *
 * `both` predates the multi-agent fleet: it was the "Claude + Codex" value
 * removed in c0978c9f. Projects that still carry it in `.lisa.config.json`
 * (e.g. from a pre-fleet install) would otherwise fail every `lisa apply` with
 * an "Invalid harness" error. It is intentionally NOT advertised in
 * {@link ACCEPTED_HARNESS_INPUTS} — it is a migration target, not a valid input.
 */
export const LEGACY_HARNESS_ALIASES = {
    both: "fleet",
};
/**
 * Whether a configured harness should emit artifacts for a given agent.
 *
 * Centralizes the dispatch-inclusion rule so the four `process<Agent>Emit`
 * guards stay consistent: a `"fleet"` harness includes every agent, and any
 * single-agent harness matches only itself. (A prior copy-paste left `"fleet"`
 * out of the Codex guard, so fleet installs silently skipped Codex — this
 * predicate prevents that class of bug.)
 * @param harness - The configured/CLI-resolved harness value.
 * @param agent - The emit agent whose dispatch is being gated.
 * @returns True when the harness should run that agent's emit path.
 */
export function harnessIncludesAgent(harness, agent) {
    if (harness === "fleet")
        return true;
    return harness === agent;
}
/**
 * Default harness when none is configured (backward compatibility — existing
 * host projects predate Codex support and have always emitted .claude/ artifacts)
 */
export const DEFAULT_HARNESS = "claude";
/**
 * Whether a non-interactive apply may replace this managed file.
 * @param relativePath - Repo-relative path of the managed file
 * @param refresh - The resolved --refresh-templates selection, if any
 * @returns True when the operator opted this path in
 */
export function mayRefreshTemplate(relativePath, refresh) {
    if (refresh === undefined)
        return false;
    if (refresh.mode === "all")
        return true;
    // Normalise so `scripts/lisa-hooks`, `scripts/lisa-hooks/`, and an exact file
    // path all behave the way the flag reads.
    const target = relativePath.replaceAll("\\", "/");
    return refresh.paths.some(raw => {
        const scope = stripTrailingSlashes(raw.replaceAll("\\", "/"));
        return scope === target || target.startsWith(`${scope}/`);
    });
}
/**
 * Drop trailing slashes so `scripts/lisa-hooks/` and `scripts/lisa-hooks` are
 * one scope.
 *
 * Written as a loop rather than a `/\/+$/` replace: that pattern is
 * super-linear on a pathological input, and a scope string comes straight from
 * the command line.
 * @param value - Normalised, forward-slashed path
 * @returns The path without any trailing slashes
 */
function stripTrailingSlashes(value) {
    return value.endsWith("/") ? stripTrailingSlashes(value.slice(0, -1)) : value;
}
/**
 * Create initial operation counters with all values at zero
 * @returns Operation counters initialized to zero
 */
export function createInitialCounters() {
    return {
        copied: 0,
        skipped: 0,
        stale: 0,
        hostAhead: 0,
        overwritten: 0,
        appended: 0,
        merged: 0,
        deleted: 0,
        ignored: 0,
        migrationsApplied: 0,
        migrationsSkipped: 0,
    };
}
//# sourceMappingURL=config.js.map