mirror of
https://github.com/morluto/rea.git
synced 2026-11-12 17:59:08 +00:00
* feat(setup): support Cline as a client * test(setup): cover Cline doctor and uninstall ownership * docs(setup): document Cline support * test(setup): verify Cline against an installed client * test(setup): include Cline in the exhaustive client detection list * docs(setup): note that a hand-written rea entry blocks Cline setup * fix(setup): isolate Cline verification and await MCP discovery * fix(verification): own and isolate Cline discovery * fix(setup): preserve native Cline transport settings --------- Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
62 lines
2.0 KiB
TypeScript
62 lines
2.0 KiB
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { supportedClients } from "../../../src/application/SupportedClients.js";
|
|
|
|
const cline = (home: string, platform: NodeJS.Platform, env = {}) => {
|
|
const client = supportedClients(home, platform, env).find(
|
|
({ name }) => name === "cline",
|
|
);
|
|
expect(client, "cline must be a supported client").toBeDefined();
|
|
return client!;
|
|
};
|
|
|
|
it("resolves Cline's POSIX configuration and marker paths", () => {
|
|
const client = cline("/home/x", "linux");
|
|
expect(client.configPath).toBe(
|
|
"/home/x/.cline/data/settings/cline_mcp_settings.json",
|
|
);
|
|
expect(client.markerPath).toBe("/home/x/.cline/data/settings");
|
|
});
|
|
|
|
it("resolves Cline's Windows configuration path", () => {
|
|
const client = cline("C:\\Users\\x", "win32");
|
|
expect(client.configPath).toBe(
|
|
"C:\\Users\\x\\.cline\\data\\settings\\cline_mcp_settings.json",
|
|
);
|
|
});
|
|
|
|
it("prefers CLINE_MCP_SETTINGS_PATH over the default location", () => {
|
|
const client = cline("/home/x", "linux", {
|
|
CLINE_MCP_SETTINGS_PATH: "/custom/settings.json",
|
|
});
|
|
expect(client.configPath).toBe("/custom/settings.json");
|
|
});
|
|
|
|
it.each([
|
|
{
|
|
env: {
|
|
CLINE_MCP_SETTINGS_PATH: " ",
|
|
CLINE_DATA_DIR: " /selected/data ",
|
|
CLINE_DIR: "/ignored",
|
|
},
|
|
expected: "/selected/data/settings/cline_mcp_settings.json",
|
|
},
|
|
{
|
|
env: { CLINE_DATA_DIR: " ", CLINE_DIR: " /selected/root " },
|
|
expected: "/selected/root/data/settings/cline_mcp_settings.json",
|
|
},
|
|
])("uses the native CLI override precedence for setup", ({ env, expected }) => {
|
|
const client = cline("/home/x", "linux", env);
|
|
expect(client.configPath).toBe(expected);
|
|
expect(client.markerPath).toBe(expected.slice(0, expected.lastIndexOf("/")));
|
|
expect(client.registrationProfile.connection).toEqual({ kind: "cline" });
|
|
});
|
|
|
|
it("keeps an unresolved native home unavailable to setup", () => {
|
|
const client = cline("C:\\fallback", "win32", { USERPROFILE: " " });
|
|
expect(client.configPathError).toContain(
|
|
"Cannot determine Cline CLI's system home",
|
|
);
|
|
expect(client.configPath).toBe("");
|
|
});
|