broker: sqlite-backed (survives hive-c0re restart)

This commit is contained in:
müde 2026-05-14 22:17:16 +02:00
parent af464e27f4
commit d220720f6a
6 changed files with 90 additions and 27 deletions

View file

@ -32,6 +32,9 @@ enum Cmd {
/// Flake reference for the agent base template.
#[arg(long, default_value = "/etc/hyperhive#agent-base")]
agent_flake: String,
/// Path to the sqlite message store.
#[arg(long, default_value = "/var/lib/hyperhive/broker.sqlite")]
db: PathBuf,
},
/// Spawn a new agent container (`hive-agent-<name>`).
Spawn { name: String },
@ -54,8 +57,8 @@ async fn main() -> Result<()> {
let cli = Cli::parse();
match cli.cmd {
Cmd::Serve { agent_flake } => {
let coord = Arc::new(Coordinator::new());
Cmd::Serve { agent_flake, db } => {
let coord = Arc::new(Coordinator::open(&db)?);
server::serve(&cli.socket, &agent_flake, coord).await
}
Cmd::Spawn { name } => {