Add shared-scene 2D authoring, sprite animation and Rapier2D physics
CI / validate (push) Canceled after 0s
CI / validate (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { writeFile } from "node:fs/promises";
|
||||
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
||||
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
||||
import { createMcp, commandReference, scriptReference } from "../server/mcp.ts";
|
||||
import { ProjectStore } from "../engine/store.ts";
|
||||
import { emptyProject } from "../engine/schema.ts";
|
||||
// Enumerate the real registration schemas without opening ports or touching user projects.
|
||||
const unavailable = async () => {
|
||||
throw Error("Documentation generator cannot execute tools");
|
||||
};
|
||||
const server = createMcp({
|
||||
store: new ProjectStore(emptyProject()),
|
||||
status: () => ({}),
|
||||
save: unavailable,
|
||||
exportWeb: unavailable,
|
||||
importModel: unavailable,
|
||||
importImage: unavailable,
|
||||
runtime: unavailable,
|
||||
});
|
||||
const client = new Client({ name: "forma-reference", version: "1" }),
|
||||
[a, b] = InMemoryTransport.createLinkedPair();
|
||||
try {
|
||||
await server.connect(a);
|
||||
await client.connect(b);
|
||||
const tools = await client.listTools();
|
||||
for (const [name, data] of [
|
||||
["COMMANDS", commandReference],
|
||||
["SCRIPT_API", scriptReference],
|
||||
["MCP_TOOLS", tools],
|
||||
] as const)
|
||||
await writeFile(`docs/${name}.json`, JSON.stringify(data, null, 2) + "\n");
|
||||
} finally {
|
||||
await client.close();
|
||||
await server.close();
|
||||
}
|
||||
Reference in New Issue
Block a user