"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addIterativeJailbreaks = addIterativeJailbreaks;
function addIterativeJailbreaks(testCases, injectVar, strategy = 'iterative', config) {
    const providerName = strategy === 'iterative'
        ? 'trusys:redteam:iterative'
        : strategy === 'iterative:tree'
            ? 'trusys:redteam:iterative:tree'
            : 'trusys:redteam:iterative:meta';
    return testCases.map((testCase) => {
        const originalText = String(testCase.vars[injectVar]);
        const metricSuffix = strategy === 'iterative'
            ? 'Iterative'
            : strategy === 'iterative:tree'
                ? 'IterativeTree'
                : 'IterativeMeta';
        const strategyId = strategy === 'iterative'
            ? 'jailbreak'
            : strategy === 'iterative:tree'
                ? 'jailbreak:tree'
                : 'jailbreak:meta';
        return {
            ...testCase,
            provider: {
                id: providerName,
                config: {
                    injectVar,
                    ...config,
                },
            },
            assert: testCase.assert?.map((assertion) => ({
                ...assertion,
                metric: `${assertion.metric}/${metricSuffix}`,
            })),
            metadata: {
                ...testCase.metadata,
                strategyId,
                originalText,
            },
        };
    });
}
//# sourceMappingURL=iterative.js.map