mirror of
https://github.com/morluto/rea
synced 2026-10-28 23:11:11 -04:00
11d38cbc00
Verify retained hierarchy limits and summary identity through the production artifact-only composition and real MCP SDK, alongside compiled CLI controls. Deep-provider selection is a separate lane. Co-authored-by: Aliciawque <166712943+Aliciawque@users.noreply.github.com>
26 lines
965 B
TypeScript
26 lines
965 B
TypeScript
import type { Client } from "@modelcontextprotocol/client";
|
|
import { expect, type OnTestFinishedHandler } from "vitest";
|
|
|
|
import { createArtifactBinarySession } from "../../../src/composition/binary.js";
|
|
import { createServer } from "../../../src/server/createServer.js";
|
|
import type { TestMcp } from "./mcpFixture.js";
|
|
|
|
/** Open a static artifact target in the production artifact-only MCP composition. */
|
|
export const openArtifactTarget = async (
|
|
mcp: TestMcp,
|
|
onTestFinished: (handler: OnTestFinishedHandler) => void,
|
|
path: string,
|
|
): Promise<Client> => {
|
|
const session = await createArtifactBinarySession(process.env);
|
|
onTestFinished(async () => {
|
|
await session.close();
|
|
});
|
|
const client = await mcp.connect(createServer({ kind: "session", session }));
|
|
const opened = await client.callTool({
|
|
name: "open_binary",
|
|
arguments: { path },
|
|
});
|
|
expect(opened.isError, JSON.stringify(opened.content)).not.toBe(true);
|
|
return client;
|
|
};
|