Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
} from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { CompactClient, WarpGrepClient } from "@morphllm/morphsdk";
import { CompactClient } from "@morphllm/morphsdk/edge";
import { WarpGrepClient } from "@morphllm/morphsdk/tools/warp-grep/client";

// These are internal to the plugin but duplicated here for testing.
const EXISTING_CODE_MARKER = "// ... existing code ...";
Expand Down Expand Up @@ -118,6 +119,23 @@ describe("packaged tool-selection instructions", () => {
});
});

describe("MorphSDK loader compatibility", () => {
test("plugin source avoids MorphSDK aggregate runtime entrypoints", () => {
const content = readFileSync(join(import.meta.dir, "index.ts"), "utf-8");

expect(content).not.toMatch(/from\s+["']@morphllm\/morphsdk["']/);
expect(content).not.toMatch(
/from\s+["']@morphllm\/morphsdk\/tools\/warp-grep["']/,
);
expect(content).toContain('from "@morphllm/morphsdk/edge"');
expect(content).toContain(
'from "@morphllm/morphsdk/tools/warp-grep/client"',
);
expect(content).toContain("createLocalWarpGrepProvider(repoRoot)");
expect(content).not.toContain("LocalRipgrepProvider");
});
});

describe("normalizeCodeEditInput", () => {
test("returns plain code unchanged", () => {
const input = `${EXISTING_CODE_MARKER}\nfunction foo() { return 1 }\n${EXISTING_CODE_MARKER}`;
Expand Down
Loading
Loading