MCPcopy Index your code
hub / github.com/AI45Lab/Code / with_skills_from_dir

Method with_skills_from_dir

core/src/agent_api/session_options.rs:235–248  ·  view source on GitHub ↗

Load skills from a directory (eager — scans immediately into a registry).

(mut self, dir: impl AsRef<std::path::Path>)

Source from the content-addressed store, hash-verified

233
234 /// Load skills from a directory (eager — scans immediately into a registry).
235 pub fn with_skills_from_dir(mut self, dir: impl AsRef<std::path::Path>) -> Self {
236 let registry = self
237 .skill_registry
238 .unwrap_or_else(|| Arc::new(crate::skills::SkillRegistry::new()));
239 if let Err(e) = registry.load_from_dir(&dir) {
240 tracing::warn!(
241 dir = %dir.as_ref().display(),
242 error = %e,
243 "Failed to load skills from directory — continuing without them"
244 );
245 }
246 self.skill_registry = Some(registry);
247 self
248 }
249
250 /// Set a custom memory store
251 pub fn with_memory(mut self, store: Arc<dyn MemoryStore>) -> Self {

Callers 4

sessionMethod · 0.80
mainFunction · 0.80

Calls 1

load_from_dirMethod · 0.45

Tested by 1

mainFunction · 0.64