/// Errors produced by the chat-v1 session management layer.
#[derive(Debug, thiserror::Error)]
pub enum ChatV1Error {
    /// Reserved for callers that wrap ChatManager and need to surface wallet
    /// lock state without coupling to host-wallet directly.
    #[allow(dead_code)]
    #[error("wallet not unlocked")]
    WalletNotUnlocked,
    #[error("no open conversation with peer {0}")]
    NoOpenConversation(String),
    /// Reserved for future input-validation path when account IDs are parsed
    /// from user-facing strings rather than resolved from the chain.
    #[allow(dead_code)]
    #[error("invalid account ID: {0}")]
    InvalidAccountId(String),
    #[error("invalid P-256 public key")]
    InvalidP256PublicKey,
    #[error("statement submit failed: {0}")]
    StatementSubmitFailed(String),
    #[error("subscribe failed: {0}")]
    SubscribeFailed(String),
    #[error("malformed statement: {0}")]
    MalformedStatement(String),
    #[error("message too long: {size} bytes (max {max})")]
    MessageTooLong { size: usize, max: usize },
    /// Reserved for when AES-GCM encryption is wired into send_message;
    /// currently the session key is managed by the caller's sign closure.
    #[allow(dead_code)]
    #[error("encryption failed: {0}")]
    EncryptionFailed(String),
    #[error("decryption failed: {0}")]
    DecryptionFailed(String),
    /// Reserved for request-deduplication guard when concurrent open-session
    /// calls to the same peer are detected.
    #[allow(dead_code)]
    #[error("request already pending for peer {0}")]
    RequestPending(String),
    #[error("peer key resolution failed: {0}")]
    PeerKeyResolutionFailed(String),
    #[error("signature verification failed: {0}")]
    SignatureVerificationFailed(String),
}
