MCPcopy Create free account
hub / github.com/AI45Lab/Code / list

Method list

core/src/store/file_store.rs:228–248  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

226 }
227
228 async fn list(&self) -> Result<Vec<String>> {
229 let mut session_ids = Vec::new();
230
231 let mut entries = fs::read_dir(&self.dir)
232 .await
233 .with_context(|| format!("Failed to read session directory: {}", self.dir.display()))?;
234
235 while let Some(entry) = entries.next_entry().await? {
236 let path = entry.path();
237
238 if path.extension().is_some_and(|ext| ext == "json") {
239 if let Some(stem) = path.file_stem() {
240 if let Some(id) = stem.to_str() {
241 session_ids.push(id.to_string());
242 }
243 }
244 }
245 }
246
247 Ok(session_ids)
248 }
249
250 async fn exists(&self, id: &str) -> Result<bool> {
251 let path = self.session_path(id);

Callers 2

test_file_store_listFunction · 0.45
test_memory_store_listFunction · 0.45

Calls 2

with_contextMethod · 0.80
pathMethod · 0.80

Tested by 2

test_file_store_listFunction · 0.36
test_memory_store_listFunction · 0.36