pub struct SkillService { /* private fields */ }Implementations§
Source§impl SkillService
impl SkillService
pub fn new(store: Arc<dyn Store>) -> Self
Sourcepub async fn create_skill(
&self,
name: String,
purpose: String,
version: String,
input_schema: Value,
output_schema: Value,
steps: Vec<String>,
required_tools: Vec<String>,
required_permissions: Vec<Permission>,
cost_profile: SkillCostProfile,
) -> Result<Skill, SkillError>
pub async fn create_skill( &self, name: String, purpose: String, version: String, input_schema: Value, output_schema: Value, steps: Vec<String>, required_tools: Vec<String>, required_permissions: Vec<Permission>, cost_profile: SkillCostProfile, ) -> Result<Skill, SkillError>
Create a new skill in Candidate state.
Sourcepub async fn transition_state(
&self,
id: &SkillId,
to: SkillState,
) -> Result<Skill, SkillError>
pub async fn transition_state( &self, id: &SkillId, to: SkillState, ) -> Result<Skill, SkillError>
Transition a skill through its lifecycle states.
Valid transitions: Candidate -> Scanning Scanning -> Testing | Rejected Testing -> Review | Failed Review -> Approved | Rejected Approved -> Staged Staged -> Active (requires signature) Active -> Deprecated | Quarantined Deprecated -> Retired | Active Quarantined -> Scanning | Retired
Sourcepub async fn sign_skill(
&self,
id: &SkillId,
signature: String,
) -> Result<Skill, SkillError>
pub async fn sign_skill( &self, id: &SkillId, signature: String, ) -> Result<Skill, SkillError>
Sign a skill so it can be activated.
Sourcepub async fn create_version(
&self,
skill_id: &SkillId,
version: String,
previous_version: Option<String>,
change_log: String,
) -> Result<SkillVersion, SkillError>
pub async fn create_version( &self, skill_id: &SkillId, version: String, previous_version: Option<String>, change_log: String, ) -> Result<SkillVersion, SkillError>
Record a new version entry for this skill.
pub async fn get_skill(&self, id: &SkillId) -> Result<Option<Skill>, SkillError>
pub async fn list_skills( &self, state_filter: Option<SkillState>, ) -> Result<Vec<Skill>, SkillError>
pub async fn list_by_required_tool( &self, tool_name: &str, ) -> Result<Vec<Skill>, SkillError>
pub async fn count_by_state(&self) -> Result<HashMap<String, usize>, SkillError>
Auto Trait Implementations§
impl !RefUnwindSafe for SkillService
impl !UnwindSafe for SkillService
impl Freeze for SkillService
impl Send for SkillService
impl Sync for SkillService
impl Unpin for SkillService
impl UnsafeUnpin for SkillService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more