Watch
0
0
Fork
You've already forked hyperhive
0

swarm: an agent's open todos, mirrored to the queue and served by the controller

This commit is contained in:
iris 2026-11-16 00:28:54 +01:00 • committed by mara
commit b239500f88
2 changed files with 478 additions and 6 deletions

View file

@ -0,0 +1,18 @@
//! The connection side of the agent todo list KV bucket: opening it. The
//! bucket's name, key and value are `swarm_wire::agent_todos`.
/// Open the bucket, creating it if nothing has yet. `history: 1`: the swarm
/// wants each agent's current todos, not the lists it had before.
#[cfg(feature = "kv")]
pub async fn open_or_create(
client: &async_nats::Client,
) -> Result<async_nats::jetstream::kv::Store, crate::Error> {
let js = async_nats::jetstream::new(client.clone());
crate::kv::open_or_create(
&js,
swarm_wire::agent_todos::BUCKET,
"agent-todos",
"The open todos each agent holds, as its harness last published them".to_owned(),
)
.await
}

View file

@ -218,6 +218,10 @@ pub mod subagent_status;
/// key and value are `swarm_wire::agent_commands`; opening the bucket needs `kv`.
pub mod agent_commands;
/// Opening the bucket each agent's harness publishes its open todos into. The name,
/// key and value are `swarm_wire::agent_todos`; opening the bucket needs `kv`.
pub mod agent_todos;
/// Opening the bucket agent icons are published into: one key per agent, with
/// no hive in it, unlike [`agent_status`]. The name, media type and subject,
/// and why the placement stays out of the key, are in `swarm_wire::agent_icon`.