// src/engine/elicitation/option-builder.ts
// SPEC-624: Builds InteractiveOption lists from project DNA instead of hardcoded arrays.
import { t } from '../../i18n/index.js';
const DNA_PROVIDERS = ['stripe', 'paypal', 'paddle', 'braintree', 'adyen'];
function capitalize(s) {
    return s.charAt(0).toUpperCase() + s.slice(1);
}
/** Payment provider options — puts DNA-detected provider first when found. */
export function buildPaymentProviderOptions(knowledge) {
    const stack = knowledge?.stack ?? [];
    const services = (knowledge?.externalServices ?? []).map((s) => s.toLowerCase());
    const detected = DNA_PROVIDERS.filter((p) => stack.some((s) => s.toLowerCase().includes(p)) || services.some((s) => s.includes(p)));
    const [firstProvider, ...restProviders] = detected;
    if (firstProvider !== undefined) {
        const firstLabel = `${capitalize(firstProvider)} (Recommended)`;
        const rest = restProviders.slice(0, 2).map((p) => ({
            label: capitalize(p),
            description: t(`questions.payment.${p}Desc`),
        }));
        return [
            { label: firstLabel, description: t(`questions.payment.${firstProvider}Desc`) },
            ...rest,
            { label: t('questions.payment.other'), description: t('questions.payment.otherDesc') },
        ].slice(0, 4);
    }
    return [
        { label: t('questions.payment.stripe'), description: t('questions.payment.stripeDesc') },
        { label: t('questions.payment.paypal'), description: t('questions.payment.paypalDesc') },
        { label: t('questions.payment.paddle'), description: t('questions.payment.paddleDesc') },
        { label: t('questions.payment.other'), description: t('questions.payment.otherDesc') },
    ];
}
export function buildBillingModelOptions() {
    return [
        { label: t('questions.payment.oneTime'), description: t('questions.payment.oneTimeDesc') },
        { label: t('questions.payment.recurring'), description: t('questions.payment.recurringDesc') },
        {
            label: t('questions.payment.usageBased'),
            description: t('questions.payment.usageBasedDesc'),
        },
        { label: t('questions.payment.freemium'), description: t('questions.payment.freemiumDesc') },
    ];
}
export function buildTargetOptions() {
    return [
        { label: t('questions.target.frontend'), description: t('questions.target.frontendDesc') },
        { label: t('questions.target.backend'), description: t('questions.target.backendDesc') },
        { label: t('questions.target.fullstack'), description: t('questions.target.fullstackDesc') },
        { label: t('questions.target.infra'), description: t('questions.target.infraDesc') },
    ];
}
export function buildScopeOptions() {
    return [
        { label: t('questions.scope.feature'), description: t('questions.scope.featureDesc') },
        { label: t('questions.scope.crossModule'), description: t('questions.scope.crossModuleDesc') },
        { label: t('questions.scope.trivial'), description: t('questions.scope.trivialDesc') },
        {
            label: t('questions.scope.architectural'),
            description: t('questions.scope.architecturalDesc'),
        },
    ];
}
export function buildDatabaseOptions() {
    return [
        { label: t('questions.database.none'), description: t('questions.database.noneDesc') },
        { label: t('questions.database.schema'), description: t('questions.database.schemaDesc') },
        { label: t('questions.database.rls'), description: t('questions.database.rlsDesc') },
        { label: t('questions.database.rpc'), description: t('questions.database.rpcDesc') },
    ];
}
export function buildUiTypeOptions() {
    return [
        {
            label: t('questions.uiType.newComponent'),
            description: t('questions.uiType.newComponentDesc'),
        },
        { label: t('questions.uiType.modify'), description: t('questions.uiType.modifyDesc') },
        {
            label: t('questions.uiType.serverAction'),
            description: t('questions.uiType.serverActionDesc'),
        },
        { label: t('questions.uiType.noUi'), description: t('questions.uiType.noUiDesc') },
    ];
}
//# sourceMappingURL=option-builder.js.map