1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Core types for the Oxios kernel.
//!
//! Defines agent identity, status, and metadata.
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
/// Unique identifier for an agent instance.
pub type AgentId = uuid::Uuid;
/// Current status of an agent instance.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum AgentStatus {
/// Agent is being initialized.
Starting,
/// Agent is actively executing tasks.
Running,
/// Agent is alive but not currently working.
Idle,
/// Agent has been stopped.
Stopped,
/// Agent has encountered an error.
Failed,
}
impl std::fmt::Display for AgentStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
AgentStatus::Starting => write!(f, "starting"),
AgentStatus::Running => write!(f, "running"),
AgentStatus::Idle => write!(f, "idle"),
AgentStatus::Stopped => write!(f, "stopped"),
AgentStatus::Failed => write!(f, "failed"),
}
}
}
/// Metadata about an agent instance.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentInfo {
/// Unique identifier for this agent.
pub id: AgentId,
/// Human-readable name of the agent.
pub name: String,
/// Current status of the agent.
pub status: AgentStatus,
/// Timestamp when the agent was created.
pub created_at: DateTime<Utc>,
/// The seed this agent was forked from, if any.
pub seed_id: Option<uuid::Uuid>,
}