MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / repo_root_hints

Method repo_root_hints

atomic-agent/src/hooks/grok.rs:274–294  ·  view source on GitHub ↗
(&self, event: &TurnEvent)

Source from the content-addressed store, hash-verified

272 }
273
274 fn repo_root_hints(&self, event: &TurnEvent) -> Option<Vec<PathBuf>> {
275 let raw = event.raw_json.as_ref()?;
276 let mut paths = Vec::new();
277 for key in ["workspaceRoot", "workspace_root", "cwd"] {
278 if let Some(p) = raw
279 .get(key)
280 .and_then(Value::as_str)
281 .filter(|s| !s.is_empty())
282 {
283 let path = PathBuf::from(p);
284 if !paths.contains(&path) {
285 paths.push(path);
286 }
287 }
288 }
289 if paths.is_empty() {
290 None
291 } else {
292 Some(paths)
293 }
294 }
295}
296
297// Normalization helpers

Callers 1

Calls 5

as_refMethod · 0.80
getMethod · 0.65
is_emptyMethod · 0.45
containsMethod · 0.45
pushMethod · 0.45

Tested by 1