feat: streamline agent integration and MCP routing

This commit is contained in:
N0zoM1z0
2026-07-20 17:11:06 +08:00
parent 0810486f63
commit 3e3d45856e
151 changed files with 2642 additions and 663 deletions
+53 -1
View File
@@ -142,6 +142,16 @@ describe("server and catalog identity", () => {
try {
await server.connect(serverTransport);
await client.connect(clientTransport);
const instructions = client.getInstructions();
expect(instructions?.length).toBeLessThanOrEqual(512);
expect(instructions).toContain(
"ASAR/JavaScript -> analyze_javascript_application",
);
expect(instructions).toContain(
"native binary/database -> open_binary, then binary_overview",
);
expect(instructions).toContain("Never repeat identical analysis");
expect(instructions).toContain("cite Evidence IDs");
const resource = await client.readResource({
uri: "rea://server/identity",
});
@@ -158,7 +168,10 @@ describe("server and catalog identity", () => {
});
const status = await client.callTool({
name: "binary_session",
arguments: { expected_package_version: "1.2.0" },
arguments: {
detail: "full",
expected_package_version: "1.2.0",
},
});
expect(status.structuredContent).toMatchObject({
result: {
@@ -196,6 +209,45 @@ describe("server and catalog identity", () => {
},
},
});
const summary = await client.callTool({
name: "binary_session",
arguments: { expected_package_version: "1.2.0" },
});
expect(summary.structuredContent).toMatchObject({
result: {
view: "summary",
open: false,
target: null,
alignment: { state: "mcp_server_restart_required" },
recommended_actions: expect.any(Array),
},
});
expect(JSON.stringify(summary.structuredContent)).not.toContain(
"tool_availability",
);
const capabilities = await client.callTool({
name: "binary_session",
arguments: {
detail: "capabilities",
capability_family: "browser-provider",
cursor: 0,
limit: 1,
},
});
expect(capabilities.structuredContent).toMatchObject({
result: {
view: "capabilities",
capability_family: "browser-provider",
capabilities: {
items: [expect.objectContaining({ surface: "browser-provider" })],
cursor: 0,
limit: 1,
total: expect.any(Number),
next_cursor: expect.any(Number),
has_more: true,
},
},
});
await client.callTool({ name: "close_binary", arguments: {} });
await expect.poll(() => toolListChanges).toBeGreaterThan(0);
} finally {