Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-bash-mcp/src/main.rs

33 lines
1.2 KiB
Rust

//! `hive-bash-daemon` binary — long-running per-agent bash task runner.
//! Spawns `sh -c` subprocesses, monitors completion, writes task state
//! files, and surfaces task state to the agent as todos on the harness's
//! in-agent socket. Listens on a unix socket for tool-call requests from
//! the `hive-bash-mcp` stdio bridge.
use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(
tracing_subscriber::EnvFilter::try_from_env("RUST_LOG")
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
.init();
let socket_path = hive_bash_mcp::paths::daemon_socket();
let todo_socket = hive_bash_mcp::paths::agent_socket();
tracing::info!(
socket = %socket_path.display(),
todo = %todo_socket.display(),
"hive-bash-daemon starting"
);
// Start the background runner loop — scans for pending tasks and
// spawns them, pushing todos to the harness on task transitions.
hive_bash_mcp::runner::spawn_loop(todo_socket);
// Serve the unix socket forever.
hive_bash_mcp::socket::serve(&socket_path).await
}