feat(core): rename grep_search include parameter to include_pattern (#20328)

This commit is contained in:
Sandy Tao
2026-02-25 20:16:21 -08:00
committed by GitHub
parent d128fb0f7b
commit 39938000a9
12 changed files with 78 additions and 69 deletions
+9 -9
View File
@@ -103,7 +103,7 @@ export interface RipGrepToolParams {
/**
* File pattern to include in the search (e.g. "*.js", "*.{ts,tsx}")
*/
include?: string;
include_pattern?: string;
/**
* Optional: A regular expression pattern to exclude from the search results.
@@ -246,7 +246,7 @@ class GrepToolInvocation extends BaseToolInvocation<
allMatches = await this.performRipgrepSearch({
pattern: this.params.pattern,
path: searchDirAbs,
include: this.params.include,
include_pattern: this.params.include_pattern,
exclude_pattern: this.params.exclude_pattern,
case_sensitive: this.params.case_sensitive,
fixed_strings: this.params.fixed_strings,
@@ -329,7 +329,7 @@ class GrepToolInvocation extends BaseToolInvocation<
pattern: this.params.pattern,
path: uniqueFiles,
basePath: searchDirAbs,
include: this.params.include,
include_pattern: this.params.include_pattern,
exclude_pattern: this.params.exclude_pattern,
case_sensitive: this.params.case_sensitive,
fixed_strings: this.params.fixed_strings,
@@ -360,7 +360,7 @@ class GrepToolInvocation extends BaseToolInvocation<
pattern: string;
path: string | string[];
basePath?: string;
include?: string;
include_pattern?: string;
exclude_pattern?: string;
case_sensitive?: boolean;
fixed_strings?: boolean;
@@ -376,7 +376,7 @@ class GrepToolInvocation extends BaseToolInvocation<
pattern,
path,
basePath,
include,
include_pattern,
exclude_pattern,
case_sensitive,
fixed_strings,
@@ -419,8 +419,8 @@ class GrepToolInvocation extends BaseToolInvocation<
rgArgs.push('--max-count', max_matches_per_file.toString());
}
if (include) {
rgArgs.push('--glob', include);
if (include_pattern) {
rgArgs.push('--glob', include_pattern);
}
if (!no_ignore) {
@@ -543,8 +543,8 @@ class GrepToolInvocation extends BaseToolInvocation<
*/
getDescription(): string {
let description = `'${this.params.pattern}'`;
if (this.params.include) {
description += ` in ${this.params.include}`;
if (this.params.include_pattern) {
description += ` in ${this.params.include_pattern}`;
}
const pathParam = this.params.dir_path || '.';
const resolvedPath = path.resolve(this.config.getTargetDir(), pathParam);