/**
 * Allowlisted config key groupings for bounded `explain-config` facet output.
 * Facet ids match the first path segment of registered keys in `config-metadata`.
 */
import { listConfigMetadata } from "./config-metadata.js";
export const CONFIG_FACET_IDS = [
    "tasks",
    "planning",
    "improvement",
    "kit",
    "modules",
    "plugins",
    "policy",
    "agentPresentation",
    "responseTemplates",
    "agentBehavior"
];
const FACET_SET = new Set(CONFIG_FACET_IDS);
export function isConfigFacetId(raw) {
    return FACET_SET.has(raw);
}
/** Sorted dotted paths for this facet (subset of the config registry). */
export function listKeysForConfigFacet(facet) {
    if (!isConfigFacetId(facet)) {
        return null;
    }
    const prefix = `${facet}.`;
    return listConfigMetadata({ exposure: "all" })
        .filter((m) => m.key.startsWith(prefix))
        .map((m) => m.key)
        .sort();
}
