use async_trait::async_trait;
use crate::context::{InvestigationContext, NextAction};
use crate::registry::{KernelError, ToolRegistry};
pub type SkillId = String;
#[derive(Debug, Clone, Default)]
pub struct SkillOutcome {
pub confidence_delta: f32,
pub next_actions: Vec<NextAction>,
}
impl SkillOutcome {
pub fn noop() -> Self {
Self::default()
}
pub fn with_delta(mut self, d: f32) -> Self {
self.confidence_delta = d;
self
}
pub fn with_next(mut self, a: NextAction) -> Self {
self.next_actions.push(a);
self
}
}
#[async_trait]
pub trait Skill: Send + Sync {
fn id(&self) -> &str;
fn description(&self) -> &str {
""
}
fn applies(&self, _ctx: &InvestigationContext) -> bool {
true
}
async fn execute(
&self,
ctx: &mut InvestigationContext,
tools: &ToolRegistry,
) -> Result<SkillOutcome, KernelError>;
}