(self, params: dict[str, Any])
| 38 | } |
| 39 | |
| 40 | def execute(self, params: dict[str, Any]) -> ToolResult: |
| 41 | pattern = params["pattern"] |
| 42 | search_path = Path(params.get("path", ".")).expanduser().resolve() |
| 43 | include = params.get("include") |
| 44 | |
| 45 | if shutil.which("rg"): |
| 46 | return self._rg_search(pattern, search_path, include) |
| 47 | return self._python_search(pattern, search_path, include) |
| 48 | |
| 49 | def _rg_search(self, pattern: str, path: Path, include: str | None) -> ToolResult: |
| 50 | cmd = ["rg", "--no-heading", "--line-number", "--max-count", str(MAX_MATCHES), pattern, str(path)] |
nothing calls this directly
no test coverage detected