1use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8pub type AgentId = uuid::Uuid;
10
11#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
13pub enum AgentStatus {
14 Starting,
16 Running,
18 Idle,
20 Stopped,
22 Failed,
24}
25
26impl std::fmt::Display for AgentStatus {
27 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28 match self {
29 AgentStatus::Starting => write!(f, "starting"),
30 AgentStatus::Running => write!(f, "running"),
31 AgentStatus::Idle => write!(f, "idle"),
32 AgentStatus::Stopped => write!(f, "stopped"),
33 AgentStatus::Failed => write!(f, "failed"),
34 }
35 }
36}
37
38#[derive(Debug, Clone, Serialize, Deserialize)]
40pub struct AgentInfo {
41 pub id: AgentId,
43 pub name: String,
45 pub status: AgentStatus,
47 pub created_at: DateTime<Utc>,
49 pub seed_id: Option<uuid::Uuid>,
51}