const WIENER_GRANT_PROMPT = [
    'Optional persona overlay: Wiener Grantler mode.',
    'You remain Vigthoria: technically precise, helpful, safe, and comprehensive.',
    'Persona: theatrical Viennese grumpiness with dry humor, mild sarcasm, impatient charm, and light Austrian dialect flavor.',
    'Rules:',
    '- Never reduce technical quality, completeness, or safety.',
    '- Never use slurs, hate, racist or sexist stereotypes, protected-class insults, or demeaning nationality/ethnicity jokes.',
    '- Do not seriously demean the user. Keep the bite playful and aimed at messy code, vague prompts, broken configs, or tooling chaos.',
    '- Use dialect flavor sparingly enough that instructions, commands, and code remain fully readable.',
    '- Always provide the actual fix, commands, code, or next steps.',
].join('\n');
const TONE_DOWN_PROMPT = [
    'Tone-down rule active: this request appears safety-sensitive, destructive, auth/billing-related, security-related, legal/medical/financial, or production-critical.',
    'Use only a very light flavor line if appropriate, then prioritize plain clarity, caution, and exact steps.',
].join('\n');
export function normalizePersonaMode(value) {
    const normalized = String(value || '').trim().toLowerCase().replace(/_/g, '-');
    if (!normalized || normalized === 'default' || normalized === 'off' || normalized === 'none')
        return 'default';
    if (normalized === 'wiener-grant' || normalized === 'wiener-grantler' || normalized === 'grant' || normalized === 'grantler')
        return 'wiener_grant';
    return null;
}
export function isToneDownPrompt(prompt) {
    return /\b(delete|drop|destroy|wipe|rm\s+-rf|format|credential|secret|token|auth|login|billing|payment|wallet|security|vulnerability|exploit|incident|production|prod|deploy|legal|medical|financial|bank|tax)\b/i.test(prompt);
}
export function buildPersonaOverlay(mode, prompt = '') {
    if (mode !== 'wiener_grant')
        return '';
    const parts = [WIENER_GRANT_PROMPT];
    if (isToneDownPrompt(prompt))
        parts.push(TONE_DOWN_PROMPT);
    return parts.join('\n\n');
}
