refactor: rename search tool for clarity and consistency

- Updated the tool name from "search" to "search_files" across multiple files to better reflect its functionality.
- Adjusted related documentation and descriptions to ensure clarity in usage and expected behavior.
- Enhanced the toolset definitions and mappings to incorporate the new naming convention, improving overall consistency in the codebase.
This commit is contained in:
teknium1
2026-02-20 02:43:57 -08:00
parent ba8b80a163
commit f9eb5edb96
6 changed files with 31 additions and 29 deletions

View File

@@ -40,7 +40,7 @@ SANDBOX_ALLOWED_TOOLS = frozenset([
"web_extract",
"read_file",
"write_file",
"search",
"search_files",
"patch",
"terminal",
])
@@ -88,8 +88,8 @@ _TOOL_STUBS = {
'"""Write content to a file (always overwrites). Returns dict with status."""',
'{"path": path, "content": content}',
),
"search": (
"search",
"search_files": (
"search_files",
'pattern: str, target: str = "content", path: str = ".", file_glob: str = None, limit: int = 50',
'"""Search file contents (target="content") or find files (target="files"). Returns dict with "matches"."""',
'{"pattern": pattern, "target": target, "path": path, "file_glob": file_glob, "limit": limit}',
@@ -553,7 +553,7 @@ EXECUTE_CODE_SCHEMA = {
" Lines are 1-indexed. Returns {\"content\": \"...\", \"total_lines\": N}\n"
" write_file(path: str, content: str) -> dict\n"
" Always overwrites the entire file.\n"
" search(pattern: str, target=\"content\", path=\".\", file_glob=None, limit=50) -> dict\n"
" search_files(pattern: str, target=\"content\", path=\".\", file_glob=None, limit=50) -> dict\n"
" target: \"content\" (grep) or \"files\" (find). Returns {\"matches\": [...]}\n"
" patch(path: str, old_string: str, new_string: str, replace_all: bool = False) -> dict\n"
" Replaces old_string with new_string in the file.\n"