pub struct SkillExecutor { /* private fields */ }Expand description
Skill executor using IndexRegistry for progressive disclosure.
Skills are stored as lightweight indices (metadata only). Full content is loaded on-demand only when the skill is executed.
Implementations§
Source§impl SkillExecutor
impl SkillExecutor
Sourcepub fn new(registry: IndexRegistry<SkillIndex>) -> Self
pub fn new(registry: IndexRegistry<SkillIndex>) -> Self
Create a new executor with an IndexRegistry.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create an executor with an empty registry.
Sourcepub fn with_callback(self, callback: SkillExecutionCallback) -> Self
pub fn with_callback(self, callback: SkillExecutionCallback) -> Self
Set execution callback.
Sourcepub fn with_callback_timeout(self, timeout: Duration) -> Self
pub fn with_callback_timeout(self, timeout: Duration) -> Self
Set callback timeout.
Sourcepub fn with_mode(self, mode: ExecutionMode) -> Self
pub fn with_mode(self, mode: ExecutionMode) -> Self
Set execution mode.
Sourcepub fn registry(&self) -> &IndexRegistry<SkillIndex>
pub fn registry(&self) -> &IndexRegistry<SkillIndex>
Get the skill registry.
Sourcepub fn registry_mut(&mut self) -> &mut IndexRegistry<SkillIndex>
pub fn registry_mut(&mut self) -> &mut IndexRegistry<SkillIndex>
Get mutable access to the registry.
Sourcepub fn into_registry(self) -> IndexRegistry<SkillIndex>
pub fn into_registry(self) -> IndexRegistry<SkillIndex>
Consume the executor and return the registry.
Sourcepub async fn execute(&self, name: &str, args: Option<&str>) -> SkillResult
pub async fn execute(&self, name: &str, args: Option<&str>) -> SkillResult
Execute a skill by name.
This triggers lazy loading of the skill content.
Sourcepub async fn execute_by_trigger(&self, input: &str) -> Option<SkillResult>
pub async fn execute_by_trigger(&self, input: &str) -> Option<SkillResult>
Execute by trigger matching.
Sourcepub fn list_skills(&self) -> Vec<&str>
pub fn list_skills(&self) -> Vec<&str>
List all skill names.
Sourcepub fn get_skill(&self, name: &str) -> Option<&SkillIndex>
pub fn get_skill(&self, name: &str) -> Option<&SkillIndex>
Get a skill by name.
Sourcepub fn get_by_trigger(&self, input: &str) -> Option<&SkillIndex>
pub fn get_by_trigger(&self, input: &str) -> Option<&SkillIndex>
Find skill by trigger match.
Sourcepub fn build_summary(&self) -> String
pub fn build_summary(&self) -> String
Build summary for system prompt.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SkillExecutor
impl !RefUnwindSafe for SkillExecutor
impl Send for SkillExecutor
impl Sync for SkillExecutor
impl Unpin for SkillExecutor
impl !UnwindSafe for SkillExecutor
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.