#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgentKind {
Agent,
Interactive,
Hybrid,
}
impl AgentKind {
pub fn is_agent(&self) -> bool {
matches!(self, Self::Agent)
}
pub fn is_interactive(&self) -> bool {
matches!(self, Self::Interactive)
}
pub fn is_hybrid(&self) -> bool {
matches!(self, Self::Hybrid)
}
}
impl std::fmt::Display for AgentKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Agent => write!(f, "agent"),
Self::Interactive => write!(f, "interactive"),
Self::Hybrid => write!(f, "hybrid"),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DetectedAgent {
pub id: &'static str,
pub name: &'static str,
pub kind: AgentKind,
}
impl DetectedAgent {
pub fn is_agent(&self) -> bool {
self.kind.is_agent()
}
pub fn is_interactive(&self) -> bool {
self.kind.is_interactive()
}
pub fn is_hybrid(&self) -> bool {
self.kind.is_hybrid()
}
}
impl std::fmt::Display for DetectedAgent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{} ({})", self.name, self.kind)
}
}