@sema-agent/core 1.449.0 → 1.450.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tools/fs/index.js
CHANGED
|
@@ -1028,7 +1028,7 @@ export function makeGrepTool(env, rootCanonical, additionalRoots) {
|
|
|
1028
1028
|
'- Filter with `glob` (e.g. "**/*.tsx") or `type` (e.g. "js", "py", "rust").\n' +
|
|
1029
1029
|
'- `output_mode`: "content" (matching lines), "files_with_matches" (paths only, default), or "count".\n' +
|
|
1030
1030
|
"- `multiline: true` for patterns that span lines.\n" +
|
|
1031
|
-
"- Uses ripgrep when available (respects .gitignore, skips binary
|
|
1031
|
+
"- Uses ripgrep when available (respects .gitignore, skips binary files and VCS directories), otherwise a JS fallback that skips node_modules/build/… and parses .gitignore. Hidden files/directories ARE searched.\n" +
|
|
1032
1032
|
"- Use Agent tool for open-ended searches requiring multiple rounds",
|
|
1033
1033
|
parameters: Type.Object({
|
|
1034
1034
|
pattern: Type.String({ description: "The regular expression pattern to search for in file contents" }),
|
package/dist/tools/fs/search.js
CHANGED
|
@@ -5,10 +5,11 @@ const WALK_MAX_DEPTH = 32;
|
|
|
5
5
|
const GREP_DEFAULT_CAP = 250;
|
|
6
6
|
const FILE_MAX_BYTES = 5 * 1024 * 1024;
|
|
7
7
|
export const DEFAULT_IGNORE_DIRS = new Set([
|
|
8
|
-
"node_modules", ".git", ".hg", ".svn", "
|
|
9
|
-
".next", ".nuxt", ".gradle", ".idea", ".vscode", "Pods", ".venv", "venv",
|
|
10
|
-
".pytest_cache", "coverage", ".turbo", ".cache", "vendor",
|
|
8
|
+
"node_modules", ".git", ".hg", ".svn", ".bzr", ".jj", ".sl", "build", "dist", "out", "target",
|
|
9
|
+
".dart_tool", ".pub-cache", ".next", ".nuxt", ".gradle", ".idea", ".vscode", "Pods", ".venv", "venv",
|
|
10
|
+
"__pycache__", ".mypy_cache", ".pytest_cache", "coverage", ".turbo", ".cache", "vendor",
|
|
11
11
|
]);
|
|
12
|
+
const VCS_DIRS = [".git", ".svn", ".hg", ".bzr", ".jj", ".sl"];
|
|
12
13
|
const TYPE_GLOBS = {
|
|
13
14
|
js: "*.{js,jsx,mjs,cjs}",
|
|
14
15
|
ts: "*.{ts,tsx,mts,cts}",
|
|
@@ -152,8 +153,6 @@ export async function buildIgnore(env, root, signal) {
|
|
|
152
153
|
const base = basename(rel);
|
|
153
154
|
if (isDir && DEFAULT_IGNORE_DIRS.has(base))
|
|
154
155
|
return true;
|
|
155
|
-
if (base.startsWith(".") && base !== ".")
|
|
156
|
-
return true;
|
|
157
156
|
if (gi && gi(rel, isDir))
|
|
158
157
|
return true;
|
|
159
158
|
return false;
|
|
@@ -945,7 +944,9 @@ async function jsGrepFallback(env, root, p, signal, reason) {
|
|
|
945
944
|
}
|
|
946
945
|
export async function rgGrepDetailed(env, root, p, signal) {
|
|
947
946
|
const mode = p.output_mode ?? "files_with_matches";
|
|
948
|
-
const flags = ["--no-messages", "--no-require-git"];
|
|
947
|
+
const flags = ["--no-messages", "--no-require-git", "--hidden"];
|
|
948
|
+
for (const d of VCS_DIRS)
|
|
949
|
+
flags.push("--glob", `!${d}`);
|
|
949
950
|
flags.push("--max-columns", "500", "--max-columns-preview");
|
|
950
951
|
if (p.ignore_case)
|
|
951
952
|
flags.push("-i");
|