refactor: renamed search and find tools to grep and glob
- Renamed the `find` and `search` tools to `glob` and `grep` respectively across the codebase to improve command clarity. - Implemented full-stack support for the renamed tools, including CLI arguments, system prompts, SDK exports, and tool registration. - Added automated migration logic in `settings` to transform legacy `find` and `search` configuration keys to their new equivalents. - Updated the `collab-web` renderer registry to ensure backwards compatibility with legacy tool outputs.
This commit is contained in:
@@ -82,8 +82,8 @@ describe("formatSessionDumpText tool parameters", () => {
|
||||
messages: [],
|
||||
tools: [
|
||||
{
|
||||
name: "find",
|
||||
description: "Finds files.",
|
||||
name: "glob",
|
||||
description: "Globs files.",
|
||||
parameters: findSchema,
|
||||
examples: [{ call: { paths: ["src/**/*.ts"] } }],
|
||||
},
|
||||
@@ -92,7 +92,7 @@ describe("formatSessionDumpText tool parameters", () => {
|
||||
|
||||
expect(out).toContain("## Available Tools");
|
||||
expect(out).toContain("<examples>");
|
||||
expect(out).toContain('<invoke name="find">');
|
||||
expect(out).toContain('<invoke name="glob">');
|
||||
});
|
||||
|
||||
it("omits the Available Tools section if inlineToolDescriptors is true", () => {
|
||||
|
||||
@@ -106,7 +106,7 @@ describe("formatSessionHistoryMarkdown", () => {
|
||||
{
|
||||
role: "toolResult",
|
||||
toolCallId: "tc-orphan",
|
||||
toolName: "search",
|
||||
toolName: "grep",
|
||||
content: [{ type: "text", text: "one match" }],
|
||||
isError: false,
|
||||
timestamp: 1,
|
||||
@@ -122,8 +122,8 @@ describe("formatSessionHistoryMarkdown", () => {
|
||||
content: [
|
||||
{
|
||||
type: "toolCall",
|
||||
id: "tc-find",
|
||||
name: "find",
|
||||
id: "tc-glob",
|
||||
name: "glob",
|
||||
arguments: { paths: ["packages/coding-agent/src/**/*.ts"] },
|
||||
},
|
||||
],
|
||||
@@ -131,8 +131,8 @@ describe("formatSessionHistoryMarkdown", () => {
|
||||
},
|
||||
{
|
||||
role: "toolResult",
|
||||
toolCallId: "tc-find",
|
||||
toolName: "find",
|
||||
toolCallId: "tc-glob",
|
||||
toolName: "glob",
|
||||
content: [{ type: "text", text: "session-history-format.ts" }],
|
||||
isError: false,
|
||||
timestamp: 2,
|
||||
@@ -150,8 +150,8 @@ describe("formatSessionHistoryMarkdown", () => {
|
||||
content: [
|
||||
{
|
||||
type: "toolCall",
|
||||
id: "tc-search",
|
||||
name: "search",
|
||||
id: "tc-grep",
|
||||
name: "grep",
|
||||
arguments: { pattern: "PRIMARY_ARG_KEYS", paths: ["packages/coding-agent/src/session"] },
|
||||
},
|
||||
],
|
||||
@@ -159,8 +159,8 @@ describe("formatSessionHistoryMarkdown", () => {
|
||||
},
|
||||
{
|
||||
role: "toolResult",
|
||||
toolCallId: "tc-search",
|
||||
toolName: "search",
|
||||
toolCallId: "tc-grep",
|
||||
toolName: "grep",
|
||||
content: [{ type: "text", text: "timed out" }],
|
||||
isError: true,
|
||||
timestamp: 2,
|
||||
|
||||
Reference in New Issue
Block a user