"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.STRATEGY_PRESETS = exports.PRESET_IDS = void 0;
exports.seedStrategiesPresets = seedStrategiesPresets;
const uuid_1 = require("uuid");
const index_1 = require("../index");
const tables_1 = require("../tables");
exports.PRESET_IDS = {
    QUICK: 'quick',
    MEDIUM: 'medium',
    LARGE: 'large',
};
exports.STRATEGY_PRESETS = {
    [exports.PRESET_IDS.QUICK]: {
        name: 'Quick',
        description: 'Use to verify that your configuration is correct.',
        strategies: ['basic'],
    },
    [exports.PRESET_IDS.MEDIUM]: {
        name: 'Medium',
        description: 'Recommended strategies for moderate coverage',
        strategies: ['basic', 'jailbreak', 'jailbreak:composite', 'jailbreak:likert'],
        options: {
            multiTurn: {
                label: 'My target application is conversational (multi-turn)',
                strategies: ['goat'],
            },
        },
    },
    [exports.PRESET_IDS.LARGE]: {
        name: 'Large',
        description: 'A larger set of strategies for a more comprehensive redteam.',
        strategies: [
            'basic',
            'jailbreak',
            'jailbreak:tree',
            'jailbreak:composite',
            'jailbreak:likert',
        ],
        options: {
            multiTurn: {
                label: 'My target supports multi-turn',
                strategies: ['goat', 'crescendo'],
            },
        },
    },
};
async function seedStrategiesPresets() {
    try {
        const db = await (0, index_1.getDb)();
        // Clear existing presets so we always have the canonical set
        await db.delete(tables_1.strategyPresetsTable);
        for (const [_, preset] of Object.entries(exports.STRATEGY_PRESETS)) {
            await db.insert(tables_1.strategyPresetsTable).values({
                id: (0, uuid_1.v4)(),
                name: preset.name,
                description: preset.description,
                strategies: Array.from(preset.strategies),
                options: preset.options || null,
            });
        }
        console.log('Strategies Presets seeded successfully');
    }
    catch (error) {
        console.error('Failed to seed strategies presets:', error);
        throw error;
    }
}
//# sourceMappingURL=strategiesPresets.js.map