POC: vscode-free @cline/sdk driver with unit test (Feature #2)
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>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
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");
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user