use std::collections::HashMap;
use std::sync::Arc;
use agent_base::{PlanItem, Tool};
use serde::Serialize;
pub mod apply_tool;
pub mod detail_tool;
pub mod prompter;
pub mod registry;
#[cfg(feature = "prompt_skill")]
pub mod prompt_skill;
#[cfg(feature = "yaml_skill")]
pub mod yaml_skill;
pub use apply_tool::ApplySkillTool;
pub use detail_tool::SkillDetailTool;
pub use prompter::{FullDetailPrompter, LazySkillPrompter};
pub use registry::{SkillRegistry, SkillSummary};
#[derive(Debug, Clone, Serialize)]
pub enum SkillParamType {
String,
Number,
HostRef,
}
#[derive(Debug, Clone, Serialize)]
pub struct SkillParam {
pub name: String,
pub description: String,
pub param_type: SkillParamType,
pub required: bool,
pub default: Option<String>,
}
pub trait Skill: Send + Sync {
fn name(&self) -> &'static str;
fn brief_description(&self) -> String;
fn detailed_description(&self) -> String;
fn tools(&self) -> Vec<Arc<dyn Tool>>;
fn plan_steps(&self, _params: &HashMap<String, String>) -> Option<Vec<PlanItem>> {
None
}
fn parameters(&self) -> &[SkillParam] {
&[]
}
fn version(&self) -> &'static str {
"0.1.0"
}
fn tags(&self) -> &[&'static str] {
&[]
}
fn author(&self) -> &'static str {
""
}
fn category(&self) -> &'static str {
""
}
}
pub trait SkillPrompter: Send + Sync {
fn build_prompt(&self, skills: &[Arc<dyn Skill>], detail_tool_name: &str) -> String;
}