| 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 |