namespace ClaudeDo.Worker.Usage.TokenTracker.Interfaces;

public interface ITokenTrackerClient
{
    /// <summary>Checks whether the CLI and a usable Node runtime are present. Never throws.</summary>
    Task<TokenTrackerProbe> ProbeAsync(CancellationToken ct = default);

    /// <summary>Runs the sessions export. Never throws — a failure comes back as
    /// <see cref="TokenTrackerRunResult.Ok"/> false plus an error message.</summary>
    Task<TokenTrackerRunResult> ExportAsync(DateOnly from, DateOnly to, CancellationToken ct = default);

    /// <summary>Runs <c>npm i -g tokentracker-cli</c>, reporting each output line.</summary>
    Task<TokenTrackerRunResult> InstallAsync(IProgress<string>? output = null, CancellationToken ct = default);

    /// <summary>Makes sure the local dashboard server is up and returns its URL. Idempotent — a
    /// server this worker already started is reused instead of spawning a second one.</summary>
    Task<TokenTrackerDashboard> StartDashboardAsync(CancellationToken ct = default);
}
