using Microsoft.AspNetCore.Http;

namespace ClaudeDo.Worker.Planning;

public sealed class PlanningMcpContextAccessor
{
    private readonly IHttpContextAccessor _http;

    public PlanningMcpContextAccessor(IHttpContextAccessor http) => _http = http;

    public PlanningMcpContext Current =>
        (_http.HttpContext?.Items["PlanningContext"] as PlanningMcpContext)
        ?? throw new InvalidOperationException("No planning context on request.");
}
