namespace ClaudeDo.Data.Models;

/// <summary>
/// The reasoning-effort levels the claude CLI accepts for <c>--effort</c>.
/// </summary>
public static class EffortRegistry
{
    public static readonly IReadOnlyList<string> Levels = new[] { "low", "medium", "high", "xhigh", "max" };

    public const string DefaultLevel = "high";

    /// <summary>
    /// Validate an effort level from external input. Null/blank → null (don't pass --effort).
    /// Returns the canonical lowercase level; throws on an unknown value.
    /// </summary>
    public static string? NormalizeLevel(string? effort)
    {
        var e = effort?.Trim();
        if (string.IsNullOrEmpty(e)) return null;
        foreach (var level in Levels)
            if (string.Equals(level, e, StringComparison.OrdinalIgnoreCase))
                return level;
        throw new ArgumentException($"Unknown effort '{effort}'. Allowed: {string.Join(", ", Levels)}.");
    }
}
