use std::io;
use thiserror::Error;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Error, Debug)]
pub enum Error {
#[error("Terminal I/O error: {0}")]
Io(#[from] io::Error),
#[error("Event processing error: {0}")]
EventProcessing(String),
#[error("UI rendering error: {0}")]
Rendering(String),
#[error("Channel error: {0}")]
Channel(String),
#[error("Invalid UI state: {0}")]
InvalidState(String),
#[error("Model selection error: {0}")]
ModelSelection(String),
#[error("Notification error: {0}")]
Notification(String),
#[error("Command processing error: {0}")]
CommandProcessing(String),
#[error("Operation timed out: {0}")]
Timeout(String),
#[error("{0}")]
Generic(String),
#[error("Configuration error: {0}")]
Config(String),
#[error("Authentication error: {0}")]
Auth(String),
#[error("gRPC error: {0}")]
Grpc(#[from] Box<steer_grpc::GrpcError>),
#[error("TUI command parsing error: {0}")]
TuiCommandParsing(#[from] crate::tui::commands::TuiCommandError),
}
impl From<steer_grpc::GrpcError> for Error {
fn from(err: steer_grpc::GrpcError) -> Self {
Error::Grpc(Box::new(err))
}
}