use thiserror::Error;
#[derive(Error, Debug)]
pub enum HostError {
#[error("Failed to spawn SSH: {0}")]
SshSpawn(String),
#[error("SSH connection failed: {0}")]
ConnectionFailed(String),
#[error("SSH authentication failed. Ensure your key is loaded: ssh-add {}", .key_hint.as_deref().unwrap_or("~/.ssh/id_rsa"))]
AuthFailed { key_hint: Option<String> },
#[error("Host not found: {0}")]
NotFound(String),
#[error("Host already exists: {0}")]
AlreadyExists(String),
#[error("Failed to allocate local port: {0}")]
PortAllocation(String),
#[error("Failed to load hosts file: {0}")]
LoadFailed(String),
#[error("Failed to save hosts file: {0}")]
SaveFailed(String),
#[error("Invalid host configuration: {0}")]
InvalidConfig(String),
#[error("SSH tunnel connection timed out after {0} attempts")]
TunnelTimeout(u32),
#[error("Docker not available on remote host: {0}")]
RemoteDockerUnavailable(String),
#[error("Failed to read SSH config: {0}")]
SshConfigRead(String),
#[error("Failed to write SSH config: {0}")]
SshConfigWrite(String),
}