// engine/hooks/effort-configurator.ts — Effort level configuration for Claude Code tools (SPEC-265)
// ---------------------------------------------------------------------------
// Default rules
// ---------------------------------------------------------------------------
export const DEFAULT_EFFORT_RULES = [
    {
        pattern: 'list_specs|usage_stats|license_status',
        effort: 'low',
        reason: 'read-only queries',
    },
    {
        pattern: 'create_spec|update_status|validate',
        effort: 'medium',
        reason: 'standard operations',
    },
    {
        pattern: 'challenge_spec|red_team|check_readiness',
        effort: 'high',
        reason: 'analysis tasks',
    },
    {
        pattern: 'init_project|init_constitution|config_health',
        effort: 'max',
        reason: 'architectural decisions',
    },
];
// ---------------------------------------------------------------------------
// Public API
// ---------------------------------------------------------------------------
/**
 * Returns the effort level for a given tool name by matching against rules.
 * Uses the first matching rule. Falls back to 'medium' if no rule matches.
 */
export function getEffortForTool(toolName, rules = DEFAULT_EFFORT_RULES) {
    for (const rule of rules) {
        const regex = new RegExp(rule.pattern);
        if (regex.test(toolName)) {
            return rule.effort;
        }
    }
    return 'medium';
}
/**
 * Builds a Record<toolNamePattern, EffortLevel> suitable for Claude Code settings.json.
 * Keys are the raw pattern strings from the rules.
 */
export function buildEffortConfig(rules = DEFAULT_EFFORT_RULES) {
    const config = {};
    for (const rule of rules) {
        config[rule.pattern] = rule.effort;
    }
    return config;
}
//# sourceMappingURL=effort-configurator.js.map