fmt
This commit is contained in:
parent
17092961a2
commit
4a73340150
3 changed files with 12 additions and 7 deletions
|
|
@ -52,8 +52,7 @@ async fn main() -> Result<()> {
|
||||||
check(&resp)
|
check(&resp)
|
||||||
}
|
}
|
||||||
Cmd::Recv => {
|
Cmd::Recv => {
|
||||||
let resp: AgentResponse =
|
let resp: AgentResponse = client::request(&cli.socket, &AgentRequest::Recv).await?;
|
||||||
client::request(&cli.socket, &AgentRequest::Recv).await?;
|
|
||||||
render(&resp)?;
|
render(&resp)?;
|
||||||
check(&resp)
|
check(&resp)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,7 @@ impl Coordinator {
|
||||||
std::fs::create_dir_all(&agent_dir)
|
std::fs::create_dir_all(&agent_dir)
|
||||||
.with_context(|| format!("create agent dir {}", agent_dir.display()))?;
|
.with_context(|| format!("create agent dir {}", agent_dir.display()))?;
|
||||||
let socket_path = Self::socket_path(name);
|
let socket_path = Self::socket_path(name);
|
||||||
let socket =
|
let socket = agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?;
|
||||||
agent_server::start(name.to_owned(), socket_path, self.broker.clone()).await?;
|
|
||||||
self.agents.lock().unwrap().insert(name.to_owned(), socket);
|
self.agents.lock().unwrap().insert(name.to_owned(), socket);
|
||||||
Ok(agent_dir)
|
Ok(agent_dir)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,12 +108,19 @@ pub const MANAGER_AGENT: &str = "manager";
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(tag = "cmd", rename_all = "snake_case")]
|
#[serde(tag = "cmd", rename_all = "snake_case")]
|
||||||
pub enum ManagerRequest {
|
pub enum ManagerRequest {
|
||||||
Send { to: String, body: String },
|
Send {
|
||||||
|
to: String,
|
||||||
|
body: String,
|
||||||
|
},
|
||||||
Recv,
|
Recv,
|
||||||
/// Spawn a sub-agent. Phase 5 will gate this on user approval.
|
/// Spawn a sub-agent. Phase 5 will gate this on user approval.
|
||||||
Spawn { name: String },
|
Spawn {
|
||||||
|
name: String,
|
||||||
|
},
|
||||||
/// Stop a sub-agent (graceful).
|
/// Stop a sub-agent (graceful).
|
||||||
Kill { name: String },
|
Kill {
|
||||||
|
name: String,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue