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

Method repo_root_hints

atomic-agent/src/hooks/agy.rs:368–387  ·  view source on GitHub ↗
(&self, event: &TurnEvent)

Source from the content-addressed store, hash-verified

366 }
367
368 fn repo_root_hints(&self, event: &TurnEvent) -> Option<Vec<PathBuf>> {
369 // Antigravity executes plugin hooks with the plugin directory as the
370 // working directory, so the process cwd is useless for finding the
371 // repository. Every hook payload carries the mounted workspaces.
372 let paths = event
373 .raw_json
374 .as_ref()?
375 .get("workspacePaths")?
376 .as_array()?
377 .iter()
378 .filter_map(Value::as_str)
379 .map(PathBuf::from)
380 .collect::<Vec<_>>();
381
382 if paths.is_empty() {
383 None
384 } else {
385 Some(paths)
386 }
387 }
388}
389
390// Raw JSON Normalization

Callers 2

runMethod · 0.45

Calls 4

as_refMethod · 0.80
getMethod · 0.65
iterMethod · 0.45
is_emptyMethod · 0.45