namespace Lumi.Companion.Abstractions;

public sealed record CompanionPluginHttpResponse(
    int StatusCode,
    string Body)
{
    public bool IsSuccessStatusCode => StatusCode is >= 200 and <= 299;
}

/// <summary>
/// A plugin-scoped view of the Companion shell's authenticated Lumi transport.
/// Plugins never receive, store, or refresh the paired device credential.
/// </summary>
public interface ICompanionPluginTransport
{
    Uri? LumiBaseUri { get; }
    bool IsAuthenticated { get; }
    Task<CompanionPluginHttpResponse> PostJsonAsync(
        string relativePath,
        object payload,
        CancellationToken cancellationToken = default);
}
