import manifestJson from "./builtin-run-command-manifest.json" with { type: "json" };
export const BUILTIN_RUN_COMMAND_MANIFEST = manifestJson;
const defaultTemplateByCommand = (() => {
    const m = new Map();
    for (const row of BUILTIN_RUN_COMMAND_MANIFEST) {
        const id = row.defaultResponseTemplateId?.trim();
        if (id) {
            m.set(row.name, id);
        }
    }
    return m;
})();
/** Default response template id for a command (manifest layer), if declared. */
export function getBuiltinCommandDefaultTemplateId(commandName) {
    return defaultTemplateByCommand.get(commandName);
}
/** Manifest row for one shipped `workspace-kit run` command, if declared. */
export function getBuiltinRunCommandManifestRow(commandName) {
    return BUILTIN_RUN_COMMAND_MANIFEST.find((row) => row.name === commandName);
}
/** Instruction catalog entries for one module — use in `WorkflowModule.registration.instructions.entries`. */
export function builtinInstructionEntriesForModule(moduleId) {
    return BUILTIN_RUN_COMMAND_MANIFEST.filter((r) => r.moduleId === moduleId).map((r) => {
        const e = {
            name: r.name,
            file: r.file,
            description: r.description
        };
        if (r.requiresPeers?.length) {
            e.requiresPeers = [...r.requiresPeers];
        }
        return e;
    });
}
