/**
 * teams command — print the known Sanity owner-team slugs.
 *
 * The discovery surface every run-provenance remediation message points at
 * ("See the known Sanity teams: npx @sanity/ailf teams"). Lists the seed
 * slugs in `KNOWN_OWNER_TEAMS` so a user setting `owner.team` /
 * `AILF_OWNER_TEAM` can pick a canonical one.
 *
 * External teams are never blocked: any well-formed lowercase slug is
 * accepted for non-`official` runs. Only `official` runs (the canonical
 * scored series) must name a slug from this list.
 *
 * Usage:
 *   npx @sanity/ailf teams          # print the known slugs
 *   npx @sanity/ailf teams --json   # print as a JSON array
 */
import { KNOWN_OWNER_TEAMS } from "../_vendor/ailf-shared/index.js";
import { Command } from "commander";
export function createTeamsCommand() {
    return new Command("teams")
        .description("List the known Sanity owner-team slugs for run provenance")
        .option("--json", "Output the slugs as a JSON array")
        .action((opts) => {
        if (opts.json) {
            process.stdout.write(JSON.stringify([...KNOWN_OWNER_TEAMS], null, 2) + "\n");
            return;
        }
        const lines = [
            "Known Sanity owner teams:",
            "",
            ...KNOWN_OWNER_TEAMS.map((team) => `  • ${team}`),
            "",
            "Attribute a run to one of these via:",
            "  owner.team in .ailf/ailf.config.ts",
            "  AILF_OWNER_TEAM=<slug>",
            "",
            "External team? Any lowercase slug works for non-official runs",
            "(e.g. acme-docs). Official runs must name a known team above.",
        ];
        console.log(lines.join("\n"));
    });
}
