ae1650d689
- 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.
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { getThemeByName } from "@oh-my-pi/pi-coding-agent/modes/theme/theme";
|
|
import { sanitizeText } from "@oh-my-pi/pi-utils";
|
|
import { globToolRenderer } from "../../src/tools/glob";
|
|
|
|
describe("globToolRenderer", () => {
|
|
it("indents inline glob output and avoids accent-colored success headers", async () => {
|
|
const theme = await getThemeByName("dark");
|
|
expect(theme).toBeDefined();
|
|
const uiTheme = theme!;
|
|
const result = {
|
|
content: [{ type: "text", text: "" }],
|
|
details: {
|
|
fileCount: 2,
|
|
files: ["src/a.ts", "src/b.ts"],
|
|
},
|
|
};
|
|
|
|
const renderedLines = globToolRenderer
|
|
.renderResult(result as never, { expanded: true, isPartial: false }, uiTheme, { paths: "src/**/*.ts" })
|
|
.render(240);
|
|
const plainLines = sanitizeText(renderedLines.join("\n")).split("\n");
|
|
|
|
expect(plainLines.every(line => line.startsWith(" "))).toBe(true);
|
|
expect(renderedLines[0]).not.toContain(uiTheme.fg("accent", uiTheme.symbol("icon.search")));
|
|
expect(renderedLines[0]).not.toContain(uiTheme.fg("accent", "Find"));
|
|
});
|
|
});
|