"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRedteamStrategiesCatalog = exports.getRedteamPluginsCatalog = void 0;
const plugins_1 = require("../../redteam/constants/plugins");
const strategies_1 = require("../../redteam/constants/strategies");
const metadata_1 = require("../../redteam/constants/metadata");
const securityConfigArgusUiCatalog_1 = require("../../redteam/constants/securityConfigArgusUiCatalog");
const remotePluginSet = new Set(plugins_1.REMOTE_ONLY_PLUGIN_IDS);
const remoteStrategySet = new Set(strategies_1.STRATEGIES_REQUIRING_REMOTE);
function describePlugin(id) {
    return (metadata_1.subCategoryDescriptions[id] ??
        '').trim();
}
function describeStrategy(id) {
    return (metadata_1.subCategoryDescriptions[id] ??
        '').trim();
}
/** GET /api/plugins/catalog — plugins shown in red team setup (risk categories ∩ catalog), + descriptions. */
const getRedteamPluginsCatalog = async (_req, res) => {
    const ids = (0, securityConfigArgusUiCatalog_1.getPluginIdsShownInSecurityConfigUi)();
    const data = ids.map((id) => ({
        id,
        description: describePlugin(id),
        remoteGenerationRecommended: remotePluginSet.has(id),
    }));
    res.json({ data });
};
exports.getRedteamPluginsCatalog = getRedteamPluginsCatalog;
/** GET /api/strategies/catalog — strategies shown in red team setup (STRATEGY_CATEGORIES ∩ catalog), + descriptions. */
const getRedteamStrategiesCatalog = async (_req, res) => {
    const ids = (0, securityConfigArgusUiCatalog_1.getStrategyIdsShownInSecurityConfigUi)();
    const data = ids.map((id) => ({
        id,
        description: describeStrategy(id),
        remoteGenerationRecommended: remoteStrategySet.has(id),
    }));
    res.json({ data });
};
exports.getRedteamStrategiesCatalog = getRedteamStrategiesCatalog;
//# sourceMappingURL=redteam-catalog.js.map