use async_trait::async_trait;
use std::fmt::Debug;
use crate::error::SkillError;
use crate::types::context::ExecutionContext;
use crate::types::filter::{PreflightWarning, SkillFilter};
use crate::types::output::{SkillOutput, SkillSummary};
use crate::types::skill::{Skill, UpsertResult};
#[async_trait]
pub trait SkillRegistry: Send + Sync + Debug {
async fn register(&self, skill: Skill) -> Result<UpsertResult, SkillError>;
async fn unregister(&self, id: &str) -> Result<(), SkillError>;
async fn get(&self, id: &str) -> Result<Option<Skill>, SkillError>;
async fn list(&self, filter: &SkillFilter) -> Result<Vec<SkillSummary>, SkillError>;
async fn search(&self, query: &str) -> Result<Vec<SkillSummary>, SkillError>;
async fn enable(&self, id: &str, enabled: bool) -> Result<(), SkillError>;
async fn count(&self) -> Result<usize, SkillError>;
}
#[async_trait]
pub trait SkillRuntime: Send + Sync + Debug {
async fn execute(
&self,
skill_id: &str,
input: &str,
context: &ExecutionContext,
) -> Result<SkillOutput, SkillError>;
async fn execute_tool(&self, tool_name: &str, args: serde_json::Value)
-> Result<serde_json::Value, SkillError>;
async fn validate_permissions(
&self,
skill: &Skill,
context: &ExecutionContext,
) -> Result<(), SkillError>;
async fn preflight_check(&self, skill: &Skill) -> Result<Vec<PreflightWarning>, SkillError>;
}