mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 11:43:20 +00:00
* refactor(mcp): bind analysis settings tools through the shared binding table and count bespoke registrations * refactor(mcp): bind inspect_analysis_view through the shared binding table (#11514) * refactor(javascript): bind JavaScript source analysis in composition (#11467) * refactor(mcp): bind inspect_analysis_view through the shared binding table * ci(guards): count typed tool registrations and name each registration owner with its reason * refactor(mcp): bind session-derived comparison tools through a derived binding kind on the shared table (#11547)
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import {
|
|
TOOL_REGISTRATION_OWNERS,
|
|
toolRegistrationCount,
|
|
} from "../../scripts/verify/tool-registration-guard.mjs";
|
|
|
|
it.each([
|
|
["a plain registration", "server.registerTool(contract.name, options, run);"],
|
|
[
|
|
"a typed registration",
|
|
"server.registerTool<typeof output, typeof input>(name, options, run);",
|
|
],
|
|
["a spaced typed registration", "super.registerTool <Out, In> (name, o, r);"],
|
|
[
|
|
"a multi-line registration",
|
|
"server\n .registerTool(\n contract.name,\n options,\n run,\n );",
|
|
],
|
|
])("counts %s", (_name, content) => {
|
|
expect(toolRegistrationCount(content)).toBe(1);
|
|
});
|
|
|
|
it.each([
|
|
["a declaration", "override registerTool<Out, In>(name: string) {}"],
|
|
["a mention in text", 'const name = "registerTool";'],
|
|
["another method", "server.registerTools(bindings);"],
|
|
])("ignores %s", (_name, content) => {
|
|
expect(toolRegistrationCount(content)).toBe(0);
|
|
});
|
|
|
|
it("states why each owner may register tools", () => {
|
|
for (const reason of TOOL_REGISTRATION_OWNERS.values())
|
|
expect(reason).not.toBe("");
|
|
});
|