feat(tools): use installed ripgrep for native file search (#5948)
* feat(tools): expose installed ripgrep through exec * refactor(tools): launch ripgrep with native argument vectors * refactor(tools): reuse the fresh exec parameter schema * fix(tools): select search backend in loader and display rg arguments * fix(ui): simplify rg previews and localize search completion * docs: simplify ripgrep configuration note * docs: keep ripgrep note on one line
This commit is contained in:
1 parent
b8893aba56
commit
e0b8efa0be
33 files changed
+514
-204
No files matched your search
@@ -54,6 +54,7 @@ function toolLabel(
|
||||
return phase === "end" ? "Delegated" : phase === "error" ? "Delegation failed" : "Delegating"
|
||||
}
|
||||
if (name === "web_search") return "Search web"
|
||||
if (name === "rg") return phase === "end" ? "Searched files" : phase === "error" ? "Search failed" : "Searching files"
|
||||
if (name === "web_fetch") return "Fetch"
|
||||
return name
|
||||
}
|
||||
@@ -72,6 +73,11 @@ function toolDetail(
|
||||
}
|
||||
if (/^(?:spawn|spawn_agent)$/u.test(name)) return compact(args.label ?? args.task, 56)
|
||||
if (name === "web_search") return compact(args.query ?? args.q)
|
||||
if (name === "rg" && Array.isArray(args.args)) {
|
||||
return compact(args.args.map((arg) =>
|
||||
typeof arg === "string" && arg && !/[\s"']/u.test(arg) ? arg : JSON.stringify(arg),
|
||||
).join(" "))
|
||||
}
|
||||
if (name === "web_fetch") return compact(args.url)
|
||||
if (/session/u.test(name)) return compact(args.session_key ?? args.chat_id ?? args.query)
|
||||
if (Object.keys(args).length) return compact(args)
|
||||
|
||||
Reference in new issue
Block a user