use super::agent::AgentKind;
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct AgentUsageSnapshot {
pub rows: Vec<AgentUsageRow>,
}
impl AgentUsageSnapshot {
#[must_use]
pub fn new(rows: Vec<AgentUsageRow>) -> Self {
Self { rows }
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AgentUsageRow {
pub kind: AgentKind,
pub status: AgentUsageStatus,
}
impl AgentUsageRow {
#[must_use]
pub fn new(kind: AgentKind, status: AgentUsageStatus) -> Self {
Self { kind, status }
}
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum AgentUsageStatus {
Available(AgentUsageDetails),
MissingCli,
Unavailable { message: String },
NotImplemented { message: String },
Error { message: String },
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AgentUsageDetails {
pub plan: Option<String>,
pub rate_limits: Vec<AgentRateLimit>,
pub reached_type: Option<String>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct AgentRateLimit {
pub label: String,
pub used_percent: Option<String>,
pub resets_at_unix_seconds: Option<i64>,
pub window_duration_mins: Option<u64>,
}