pub mod backend;
pub mod models;
pub mod pool;
pub mod shell;
mod traits;

/// Public API entry point for `sshr`.
///
/// External projects should import public types and traits from `sshr::ssh::*`.
/// Directly depending on internal submodule paths is not recommended.
///
/// Recommended usage:
///
/// - Command execution: `ExecService`
/// - PTY terminal: `PtyService`
/// - File operations: `FileService`
/// - Default implementations: `RusshTool`, `RusshTerminalService`
///
/// Minimal example:
///
/// ```ignore
/// use sshr::ssh::{ExecService, ExecRequest, RusshTool, SshConfig, AuthMethod, HostKeyPolicy};
///
/// let cfg = SshConfig {
///     host: "127.0.0.1".to_string(),
///     port: 22,
///     user: "root".to_string(),
///     auth: AuthMethod::Password { password: "secret".to_string() },
///     timeout_ms: 8_000,
///     host_key_policy: HostKeyPolicy::Strict,
///     known_hosts_path: None,
/// };
///
/// let tool = RusshTool::new();
/// let result = tool.exec(cfg, ExecRequest::new("uname -a")).await?;
/// println!("{}", result.stdout_string());
/// # Ok::<(), anyhow::Error>(())
/// ```
// ========== Core traits ==========
pub use traits::{ExecService, FileService, PtyService};

// ========== Implementations ==========
pub use backend::russh::{RusshTerminalService, RusshTool};
pub use pool::{ConnectionPool, PoolConfig, Session};

// ========== Configuration ==========
pub use models::{AuthMethod, HostKeyPolicy, SshConfig};

// ========== Types ==========
pub use models::{
    ExecRequest, ExecResult, FileEntry, PtyOpenRequest, ReadFileRequest, SystemProfile,
    WriteFileRequest,
};
pub use models::{SessionEvent, SessionId};
pub use shell::SystemType;
