- Updated `DisplaySyscall` to use `tokio::io::AsyncWriteExt` for asynchronous text output. - Refactored `FsSyscall` to read files asynchronously with offset and length handling. - Modified `MemorySyscall` to use `tokio::task::spawn_blocking` for database operations, allowing async access to SQLite. - Enhanced `NetworkSyscall` to utilize `reqwest` for HTTP requests, replacing the previous `curl` command execution. - Improved `ProcessSyscall` to manage subprocesses with async tasks for stdin, stdout, and stderr handling. - Updated `TimerSyscall` to simplify timer management. - Adjusted plugin implementations for better async support and error handling. - Added `tokio-stream` and `tracing-subscriber` dependencies to `Cargo.toml` for enhanced async stream handling and logging.
23 lines
517 B
Rust
23 lines
517 B
Rust
pub mod callback;
|
|
pub mod paths;
|
|
pub mod permission;
|
|
mod plugin;
|
|
mod server;
|
|
mod syscall;
|
|
|
|
use anyhow::Result;
|
|
use tracing_subscriber::EnvFilter;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
tracing_subscriber::fmt()
|
|
.with_env_filter(EnvFilter::from_default_env().add_directive("agentsd=info".parse()?))
|
|
.init();
|
|
|
|
tracing::info!("agentsd starting");
|
|
tracing::info!("data dir: {}", paths::data_dir().display());
|
|
|
|
let kernel = syscall::Kernel::new()?;
|
|
server::run(kernel).await
|
|
}
|