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