(payload: dict, root: Path)
| 96 | |
| 97 | |
| 98 | def extract_paths(payload: dict, root: Path) -> list[str]: |
| 99 | tool_input = payload.get("tool_input", {}) or {} |
| 100 | paths: list[str] = [] |
| 101 | for key in ("file_path", "path"): |
| 102 | if tool_input.get(key): |
| 103 | paths.append(normalize(str(tool_input[key]), root)) |
| 104 | return sorted(set(paths)) |
| 105 | |
| 106 | |
| 107 | def is_test(path: str) -> bool: |