pub struct ResourceCatalog { /* private fields */ }Expand description
Immutable deterministic catalog discovered for one workspace.
Implementations§
Source§impl ResourceCatalog
impl ResourceCatalog
Sourcepub fn discover(
boundary: &Path,
workspace: &Path,
access: ProjectAccess,
global_skill_roots: &[PathBuf],
project_skill_roots: &[PathBuf],
global_prompt_root: Option<&Path>,
project_prompt_root: Option<&Path>,
) -> Result<Self, CodingError>
pub fn discover( boundary: &Path, workspace: &Path, access: ProjectAccess, global_skill_roots: &[PathBuf], project_skill_roots: &[PathBuf], global_prompt_root: Option<&Path>, project_prompt_root: Option<&Path>, ) -> Result<Self, CodingError>
Discovers global resources and project resources only when trusted.
§Errors
Rejects malformed, duplicate, oversized, or escaping resources.
Sourcepub fn add_explicit_context_files(
&mut self,
workspace: &WorkspaceRoot,
paths: &[String],
) -> Result<(), CodingError>
pub fn add_explicit_context_files( &mut self, workspace: &WorkspaceRoot, paths: &[String], ) -> Result<(), CodingError>
Adds explicit workspace-relative context files through the workspace capability.
§Errors
Rejects duplicate, escaping, non-UTF-8, oversized, changed, or unreadable files.
Sourcepub fn apply_settings(&mut self, context_files: bool, prompt_templates: bool)
pub fn apply_settings(&mut self, context_files: bool, prompt_templates: bool)
Applies resolved resource feature switches without re-reading any source.
Sourcepub fn context(&self) -> &[WorkspaceInstruction]
pub fn context(&self) -> &[WorkspaceInstruction]
Returns deterministic context instructions.
Sourcepub fn skills(&self) -> &[DiscoveredSkill]
pub fn skills(&self) -> &[DiscoveredSkill]
Returns discovered skills sorted by ID.
Sourcepub fn prompts(&self) -> &[PromptTemplate]
pub fn prompts(&self) -> &[PromptTemplate]
Returns prompt templates sorted by name.
Sourcepub fn diagnostics(&self) -> &[ResourceDiagnostic]
pub fn diagnostics(&self) -> &[ResourceDiagnostic]
Returns safe discovery diagnostics.
Sourcepub fn skill_metadata(&self) -> Vec<SkillMetadata>
pub fn skill_metadata(&self) -> Vec<SkillMetadata>
Projects skill metadata without loading skill bodies.
Sourcepub fn invoke_skill(&self, invocation: &str) -> Result<LoadedSkill, CodingError>
pub fn invoke_skill(&self, invocation: &str) -> Result<LoadedSkill, CodingError>
Trait Implementations§
Source§impl Clone for ResourceCatalog
impl Clone for ResourceCatalog
Auto Trait Implementations§
impl Freeze for ResourceCatalog
impl RefUnwindSafe for ResourceCatalog
impl Send for ResourceCatalog
impl Sync for ResourceCatalog
impl Unpin for ResourceCatalog
impl UnsafeUnpin for ResourceCatalog
impl UnwindSafe for ResourceCatalog
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