This commit is contained in:
müde 2026-05-14 22:38:07 +02:00
parent 17092961a2
commit 4a73340150
3 changed files with 12 additions and 7 deletions

View file

@ -52,8 +52,7 @@ async fn main() -> Result<()> {
check(&resp)
}
Cmd::Recv => {
let resp: AgentResponse =
client::request(&cli.socket, &AgentRequest::Recv).await?;
let resp: AgentResponse = client::request(&cli.socket, &AgentRequest::Recv).await?;
render(&resp)?;
check(&resp)
}

View file

@ -38,8 +38,7 @@ impl Coordinator {
std::fs::create_dir_all(&agent_dir)
.with_context(|| format!("create agent dir {}", agent_dir.display()))?;
let socket_path = Self::socket_path(name);
let socket =
agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?;
let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?;
self.agents.lock().unwrap().insert(name.to_owned(), socket);
Ok(agent_dir)
}

View file

@ -108,12 +108,19 @@ pub const MANAGER_AGENT: &str = "manager";
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "cmd", rename_all = "snake_case")]
pub enum ManagerRequest {
Send { to: String, body: String },
Send {
to: String,
body: String,
},
Recv,
/// Spawn a sub-agent. Phase 5 will gate this on user approval.
Spawn { name: String },
Spawn {
name: String,
},
/// Stop a sub-agent (graceful).
Kill { name: String },
Kill {
name: String,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]