33bff2b130
fetchSdkSummary() dynamic-imports the ESM-only SDK and returns its build version + builtin tool catalog (pure, key-free). Kept vscode-free so it is unit-testable in Node; test asserts a semver version and the read_files tool. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 lines
596 B
TypeScript
16 lines
596 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { fetchSdkSummary } from "../src/cline";
|
|
|
|
describe("fetchSdkSummary", () => {
|
|
it("loads @cline/sdk and returns its version and builtin tool catalog", async () => {
|
|
const summary = await fetchSdkSummary();
|
|
expect(summary.version).toMatch(/^\d+\.\d+\.\d+/);
|
|
expect(summary.tools.length).toBeGreaterThan(0);
|
|
expect(summary.tools.map((t) => t.id)).toContain("read_files");
|
|
for (const tool of summary.tools) {
|
|
expect(typeof tool.id).toBe("string");
|
|
expect(typeof tool.description).toBe("string");
|
|
}
|
|
});
|
|
});
|