import { wrongnessContextForRoute } from './wrongness-retrieval.js';
export async function activeAvoidanceRules(root, opts = {}) {
    const context = await wrongnessContextForRoute(root, opts);
    return context.active_avoidance_rules || [];
}
export function renderAvoidanceRules(rules = []) {
    const rows = Array.isArray(rules) ? rules : [];
    if (!rows.length)
        return 'No active avoidance rules.';
    return rows.map((rule) => {
        const row = rule && typeof rule === 'object' && !Array.isArray(rule) ? rule : {};
        return `- ${String(row.id || 'avoidance-rule')}: ${String(row.text || '').trim()}`;
    }).join('\n');
}
//# sourceMappingURL=avoidance-rules.js.map