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:
can1357
2026-06-27 00:44:28 +02:00
parent 53af82d539
commit ae1650d689
93 changed files with 887 additions and 551 deletions
@@ -4,7 +4,7 @@ import * as os from "node:os";
import * as path from "node:path";
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
import { CursorExecHandlers } from "@oh-my-pi/pi-coding-agent/cursor";
import { SearchTool, type ToolSession } from "@oh-my-pi/pi-coding-agent/tools";
import { GrepTool, type ToolSession } from "@oh-my-pi/pi-coding-agent/tools";
function createTestSession(cwd: string, overrides: Partial<ToolSession> = {}): ToolSession {
return {
@@ -19,16 +19,16 @@ function createTestSession(cwd: string, overrides: Partial<ToolSession> = {}): T
describe("CursorExecHandlers.grep bridge", () => {
let cwd: string;
let searchTool: SearchTool;
let searchTool: GrepTool;
let handlers: CursorExecHandlers;
beforeEach(async () => {
cwd = await fs.mkdtemp(path.join(os.tmpdir(), "cursor-exec-test-"));
await Bun.write(path.join(cwd, "sample.txt"), "Hello World\nhello world\n");
searchTool = new SearchTool(createTestSession(cwd));
searchTool = new GrepTool(createTestSession(cwd));
handlers = new CursorExecHandlers({
cwd,
tools: new Map([["search", searchTool as any]]),
tools: new Map([["grep", searchTool as any]]),
});
});