use crate::invocation::{SkillContext, SkillInput};
use crate::outcome::SkillOutcome;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SkillId(pub &'static str);

impl std::fmt::Display for SkillId {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}

pub trait Skill: Send + Sync {
    fn id(&self) -> SkillId;
    fn display_name(&self) -> &str;
    fn input_schema(&self) -> serde_json::Value;
    fn output_schema(&self) -> serde_json::Value;
    fn execute(&self, input: SkillInput, ctx: &SkillContext) -> anyhow::Result<SkillOutcome>;
}
