ai-agent 0.13.4

Idiomatic agent sdk inspired by the claude code source leak
Documentation
// Source: /data/home/swei/claudecode/openclaudecode/src/commands/plugin/plugin.tsx
use std::collections::HashMap;

#[derive(Debug, Clone, PartialEq)]
pub enum PluginState {
    Enabled,
    Disabled,
    Loading,
    Error(String),
}

pub struct Plugin {
    pub id: String,
    pub name: String,
    pub version: String,
    pub state: PluginState,
    pub config: HashMap<String, String>,
}

impl Plugin {
    pub fn new(id: &str, name: &str, version: &str) -> Self {
        Self {
            id: id.to_string(),
            name: name.to_string(),
            version: version.to_string(),
            state: PluginState::Disabled,
            config: HashMap::new(),
        }
    }

    pub fn enable(&mut self) {
        self.state = PluginState::Enabled;
    }

    pub fn disable(&mut self) {
        self.state = PluginState::Disabled;
    }

    pub fn is_enabled(&self) -> bool {
        self.state == PluginState::Enabled
    }
}