hyperhive/hive-bash-mcp/src/main.rs
damocles e86160820a feat(#1106): split bash mcp into hive-bash-daemon + hive-bash-mcp bridge
- new hive-bash-mcp crate: daemon (subprocess runner, wake signals) +
  stdio bridge (mcp tools). mirrors hive-matrix-mcp architecture
- hive-ag3nt: remove bash_runner.rs and bash_run/bash_status mcp tools;
  get_loose_ends uses hive_bash_mcp:🏃:active_tasks() via crate dep
- harness-base.nix: add hive-bash-daemon systemd service + auto-inject
  bash extraMcpServer into every agent (socket: /run/hive-bash/socket)
2026-06-03 18:06:59 +02:00

32 lines
1.1 KiB
Rust

//! `hive-bash-daemon` binary — long-running per-agent bash task runner.
//! Spawns `sh -c` subprocesses, monitors completion, writes task state
//! files, and fires hyperhive wake signals. 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 wake_socket = hive_bash_mcp::paths::hyperhive_socket();
tracing::info!(
socket = %socket_path.display(),
wake = %wake_socket.display(),
"hive-bash-daemon starting"
);
// Start the background runner loop — scans for pending tasks and
// spawns them, sends wake signals on completion.
hive_bash_mcp::runner::spawn_loop(wake_socket);
// Serve the unix socket forever.
hive_bash_mcp::socket::serve(&socket_path).await
}