Skip to main content

agent_id_cli/
activity.rs

1use std::fmt;
2
3use chrono::{DateTime, Utc};
4use clap::ValueEnum;
5use serde::{Deserialize, Serialize};
6
7#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, ValueEnum)]
8#[serde(rename_all = "snake_case")]
9pub enum ActivityStateValue {
10    Working,
11    Idle,
12    Waiting,
13    Blocked,
14    Stopped,
15}
16
17impl fmt::Display for ActivityStateValue {
18    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
19        let value = match self {
20            Self::Working => "working",
21            Self::Idle => "idle",
22            Self::Waiting => "waiting",
23            Self::Blocked => "blocked",
24            Self::Stopped => "stopped",
25        };
26        formatter.write_str(value)
27    }
28}
29
30#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
31pub struct ActivityState {
32    pub value: ActivityStateValue,
33    pub updated_at: DateTime<Utc>,
34}