1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! # shell-tunnel
//!
//! Ultra-lightweight remote shell gateway with a REST/WebSocket API.
//!
//! This crate provides a cross-platform API for programmatic interaction
//! with system shells. It supports both Windows (ConPTY) and Unix (PTY)
//! terminals through a unified interface.
//!
//! ## Features
//!
//! - **Cross-platform PTY**: Unified interface for Windows ConPTY and Unix PTY
//! - **Async I/O**: Non-blocking operations using tokio
//! - **Session Management**: Stateful shell sessions with lifecycle tracking
//! - **REST API**: HTTP endpoints for command execution
//! - **WebSocket**: Real-time streaming of command output
//! - **Lightweight**: Minimal dependencies, small binary size
//!
//! ## Quick Start
//!
//! ```no_run
//! use shell_tunnel::{NativePty, PtySize, SessionStore, SessionConfig};
//!
//! #[tokio::main]
//! async fn main() -> shell_tunnel::Result<()> {
//! // Initialize logging
//! shell_tunnel::logging::try_init().ok();
//!
//! // Create a session store
//! let store = SessionStore::new();
//!
//! // Create a new session
//! let session_id = store.create(SessionConfig::default())?;
//!
//! // Spawn a PTY
//! let pty = NativePty::new();
//! let handle = pty.spawn_default(PtySize::default())?;
//!
//! println!("Session {} created with PID {}", session_id, handle.pid);
//!
//! Ok(())
//! }
//! ```
//!
//! ## API Server
//!
//! ```no_run
//! use shell_tunnel::api::{ServerConfig, serve};
//!
//! #[tokio::main]
//! async fn main() -> shell_tunnel::Result<()> {
//! shell_tunnel::logging::try_init().ok();
//! let config = ServerConfig::new("127.0.0.1", 3000);
//! serve(config).await
//! }
//! ```
// Re-export commonly used types
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export API types
pub use ;
// Re-export security types
pub use ;
// Re-export reachability types
pub use ;
pub use ;
// Re-export CLI and config types
pub use ;
pub use ;