Documentation
¶
Overview ¶
Package greptool implements the Grep tool — searches file contents using ripgrep. Mirrors src/tools/GrepTool/GrepTool.ts.
M2 scope: files_with_matches mode (default), content mode, count mode; -i case-insensitive; -n line numbers; -B/-A/-C context lines; glob filter; type filter; head_limit/offset pagination; VCS dir exclusion (.git/.svn/.hg). Permissions integration lands in M5.
ripgrep (rg) must be on PATH.
Index ¶
Constants ¶
const DefaultHeadLimit = 250
DefaultHeadLimit matches the real tool: 250 lines when unspecified.
const MaxColumns = 500
MaxColumns prevents base64/minified content from cluttering output.
Variables ¶
var VCSDirectories = []string{".git", ".svn", ".hg", ".bzr", ".jj", ".sl"}
VCSDirectories are excluded from every search to avoid noise.
Functions ¶
This section is empty.
Types ¶
type Tool ¶
type Tool struct{}
Tool implements the Grep tool.
func (*Tool) Description ¶
Description is the prompt text the model sees.
func (*Tool) InputSchema ¶
func (*Tool) InputSchema() json.RawMessage
InputSchema is the JSON Schema sent to the model.
func (*Tool) IsConcurrencySafe ¶
func (*Tool) IsConcurrencySafe(json.RawMessage) bool
IsConcurrencySafe: grep is safe to run concurrently.
func (*Tool) IsReadOnly ¶
func (*Tool) IsReadOnly(json.RawMessage) bool
IsReadOnly: grep only reads the filesystem.