// Mirrors of voicecat.h's enums. Keep these in lockstep with core/include/voicecat.h —
// values are append-only per the C ABI's house rule, so it's safe to add new members at the
// end here too, but never renumber/remove existing ones.
namespace VoiceCat.Interop;

public enum VcResult
{
    Ok = 0,
    NotImplemented = 1,
    InvalidArg = 2,
    NotConnected = 3,
    Already = 4,
    AuthFailed = 5,
    PermissionDenied = 6,
    Timeout = 7,
    Io = 8,
    Protocol = 9,
    Crypto = 10,
    Audio = 11,
    Internal = 12,
}

public enum VcLogLevel
{
    Trace = 0,
    Debug = 1,
    Info = 2,
    Warn = 3,
    Error = 4,
    Off = 5,
}

public enum VcConnectionState
{
    Disconnected = 0,
    Connecting = 1,
    TlsHandshake = 2,
    Authenticating = 3,
    Connected = 4,
    /// <summary>M4: handshake succeeded, waiting on vc_confirm_server_identity().</summary>
    VerifyingIdentity = 5,
}

public enum VcTextScope
{
    Channel = 0,
    Private = 1,
    Server = 2,
}

public enum VcDeviceKind
{
    Input = 0,
    Output = 1,
}

public enum VcStreamKind
{
    Mic = 0,
    /// <summary>System/desktop audio (WASAPI loopback on Windows).</summary>
    ScreenAudio = 1,
    AuxDevice = 2,
}

/// <summary>Send-side input gate (docs/voice.md §11).</summary>
public enum VcInputMode
{
    VoiceActivation = 0,
    PushToTalk = 1,
    AlwaysOn = 2, // transmit unconditionally, no VAD gate
}

public enum VcEventType
{
    ConnectionState = 0,
    AuthResult = 1,
    ChannelList = 2,
    UserJoined = 3,
    UserLeft = 4,
    UserUpdated = 5,
    TextMessage = 6,
    StreamStarted = 7,
    StreamStopped = 8,
    TalkState = 9,
    Error = 10,
    Disconnected = 11,
    /// <summary>M4: reply to VoiceCatClient.JoinChannelAsync's underlying vc_join_channel.</summary>
    JoinResult = 12,
    /// <summary>M4: the TOFU server-identity gate — see VcTofuStatus.</summary>
    ServerIdentity = 13,
    /// <summary>M5: async result for moderation/admin/channel operations.</summary>
    GenericResult = 14,
    /// <summary>M5: reply to VoiceCatClient.RequestAccountList — call ListAccounts() to read.</summary>
    AccountList = 15,
}

/// <summary>
/// TOFU server-identity classification. Pins the TLS leaf certificate's own SHA-256
/// fingerprint (real, verifiable from the handshake) — NOT the declared Ed25519 identity
/// fingerprint from ServerHello, which is informational/display-only (see
/// VoiceCatClient.GetServerIdentityDisplay and docs/security.md §1.1).
/// </summary>
public enum VcTofuStatus
{
    FirstConnect = 0,
    Matched = 1,
    Mismatch = 2,
}
