Repository navigation
feat: add first-class grep tool - #1542
Merged
Merged
Conversation
Adds OpenSpec change first-class-grep-tool covering a dedicated grep tool, its registration in src/tools/index.js, and removal of the redundant search action from the file tool.
Adds the grep tool implementation for the first-class-grep-tool OpenSpec change: a dedicated grep tool at src/tools/grep/index.js that reuses the file tool's grepImpl/nativeSearch logic, registered across all four registration points (TOOL_PERMISSIONS, TOOL_CLASSIFICATIONS, ORCHESTRATOR_TOOLS, TOOLS). Removes the redundant search action from the file tool so grep is the single grep entry point. Patches deepagents' BUILTIN_TOOL_NAMES to drop grep, which is excluded via excludedTools, so the custom grep tool name no longer collides with the library's built-in (unused) grep tool.
# Conflicts: # coverage.txt
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implements the
first-class-grep-toolOpenSpec change (issue #1540). Adds a dedicatedgreptool for literal regex search across files, registers it across all four registration points insrc/tools/index.js(TOOL_PERMISSIONS,TOOL_CLASSIFICATIONS,ORCHESTRATOR_TOOLS,TOOLS), and removes the redundantsearchaction from thefiletool sogrepis the single grep entry point.The
greptool reuses the existinggrepImpl/nativeSearchlogic from thefiletool (DRY) rather than duplicating search code. A postinstall patch (scripts/patch-deepagents-grep.mjs) dropsgrepfrom deepagents'BUILTIN_TOOL_NAMES— the library's owngrepis excluded viaexcludedTools, so the customgreptool name no longer collides with an unused built-in.Type of Change
Testing
tests/unit/tools/grep.test.js— schema validation (pattern required; path/maxResults optional), matches found, no matches, native fallback, path validation against the sandbox allowlist.tests/unit/tools/file.test.js— updated to removesearchaction references.tests/unit/tool_index.test.js— addedgrepto the expected tools list.tests/integration/tools/file.test.js— updated the search test to usegrepImpl.Coverage
Checklist
npm run lintpassesCloses #1540