pub struct DisclosureController { /* private fields */ }Expand description
渐进式披露控制器
支持多个 skills 目录按优先级搜索(workspace > builtin > standard)
Implementations§
Source§impl DisclosureController
impl DisclosureController
Sourcepub fn with_search_dirs(search_dirs: Vec<PathBuf>) -> Self
pub fn with_search_dirs(search_dirs: Vec<PathBuf>) -> Self
Sourcepub fn find_builtin_skills() -> Option<PathBuf>
pub fn find_builtin_skills() -> Option<PathBuf>
查找内置 skills 目录
按以下顺序查找:
- CARGO_MANIFEST_DIR/skills(开发时)
- 可执行文件父目录/skills(已安装)
- /usr/local/lib/mofa/skills(标准安装路径)
Sourcepub fn scan_metadata(&mut self) -> Result<usize>
pub fn scan_metadata(&mut self) -> Result<usize>
扫描并加载所有 Skills 的元数据(第1层)
按优先级从多个目录扫描,先找到的优先
Sourcepub fn get_all_metadata(&self) -> Vec<SkillMetadata>
pub fn get_all_metadata(&self) -> Vec<SkillMetadata>
第1层:获取所有 Skills 的元数据(用于系统提示)
Sourcepub fn build_system_prompt(&self) -> String
pub fn build_system_prompt(&self) -> String
构建系统提示(仅包含元数据)
Sourcepub fn get_skill_path(&self, name: &str) -> Option<PathBuf>
pub fn get_skill_path(&self, name: &str) -> Option<PathBuf>
获取 Skill 目录路径
Sourcepub fn get_always_skills(&self) -> Vec<String>
pub fn get_always_skills(&self) -> Vec<String>
获取标记为 always 的技能名称列表
Sourcepub fn check_requirements(&self, name: &str) -> RequirementCheck
pub fn check_requirements(&self, name: &str) -> RequirementCheck
检查技能依赖是否满足
Sourcepub fn get_install_instructions(&self, name: &str) -> Option<String>
pub fn get_install_instructions(&self, name: &str) -> Option<String>
获取技能的安装指令
Sourcepub fn get_missing_requirements_description(&self, name: &str) -> String
pub fn get_missing_requirements_description(&self, name: &str) -> String
获取缺失依赖的描述字符串
Trait Implementations§
Source§impl Clone for DisclosureController
impl Clone for DisclosureController
Source§fn clone(&self) -> DisclosureController
fn clone(&self) -> DisclosureController
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DisclosureController
impl RefUnwindSafe for DisclosureController
impl Send for DisclosureController
impl Sync for DisclosureController
impl Unpin for DisclosureController
impl UnsafeUnpin for DisclosureController
impl UnwindSafe for DisclosureController
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more