manager events: Spawned/Rebuilt/Killed/Destroyed + start button

This commit is contained in:
müde 2026-05-15 17:38:41 +02:00
parent 06ea0cf283
commit 37c6504462
9 changed files with 165 additions and 70 deletions

View file

@ -196,8 +196,8 @@ pub const SYSTEM_SENDER: &str = "system";
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "event", rename_all = "snake_case")]
pub enum HelperEvent {
/// An approval was approved or denied; if approved, the rebuild has
/// already run (status = Approved on success, Failed on error).
/// An approval was approved/denied/failed; if approved, the underlying
/// action (rebuild or spawn) has already run by the time this lands.
ApprovalResolved {
id: i64,
agent: String,
@ -206,6 +206,28 @@ pub enum HelperEvent {
#[serde(default, skip_serializing_if = "Option::is_none")]
note: Option<String>,
},
/// A new container was spawned (post-approval or via the admin CLI
/// bypass path). `ok=false` means the spawn failed.
Spawned {
agent: String,
ok: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
note: Option<String>,
},
/// A container was rebuilt (auto-update on flake rev change, or a
/// manual rebuild from CLI/dashboard).
Rebuilt {
agent: String,
ok: bool,
#[serde(default, skip_serializing_if = "Option::is_none")]
note: Option<String>,
},
/// A sub-agent's container was stopped (the systemd unit is down;
/// persistent state is unchanged).
Killed { agent: String },
/// A sub-agent's container was torn down (container removed; state
/// dirs preserved per `destroy` semantics).
Destroyed { agent: String },
}
/// Requests on the manager socket. Manager has the agent surface (send/recv)