figma-relai 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-EBP7POOP.js +3516 -0
- package/dist/chunk-EBP7POOP.js.map +1 -0
- package/dist/chunk-XBWGSCRZ.js +33 -0
- package/dist/chunk-XBWGSCRZ.js.map +1 -0
- package/dist/docs-S7VJ2PPR.js +60 -0
- package/dist/docs-S7VJ2PPR.js.map +1 -0
- package/dist/doctor-ZN2PKAPH.js +138 -0
- package/dist/doctor-ZN2PKAPH.js.map +1 -0
- package/dist/index.js +84 -3100
- package/dist/index.js.map +1 -1
- package/dist/manifest-CFCCUJEV.js +55 -0
- package/dist/manifest-CFCCUJEV.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
FIGMA_COMMANDS,
|
|
4
|
+
PITFALLS,
|
|
5
|
+
createServer,
|
|
6
|
+
listToolCatalog,
|
|
7
|
+
registerAllTools,
|
|
8
|
+
registerEventsTool,
|
|
9
|
+
registerPrompts,
|
|
10
|
+
registerRoomTool
|
|
11
|
+
} from "./chunk-EBP7POOP.js";
|
|
12
|
+
import "./chunk-2H7UOFLK.js";
|
|
13
|
+
|
|
14
|
+
// src/cli/manifest.ts
|
|
15
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
16
|
+
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
|
|
17
|
+
async function buildManifest(version) {
|
|
18
|
+
const server = createServer();
|
|
19
|
+
registerRoomTool(server, async () => {
|
|
20
|
+
throw new Error("manifest introspection \u2014 no relay");
|
|
21
|
+
});
|
|
22
|
+
registerEventsTool(server, () => [], () => []);
|
|
23
|
+
registerPrompts(server);
|
|
24
|
+
registerAllTools(server, async () => {
|
|
25
|
+
throw new Error("manifest introspection \u2014 no plugin connection");
|
|
26
|
+
});
|
|
27
|
+
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
28
|
+
const client = new Client({ name: "relai-manifest", version });
|
|
29
|
+
await Promise.all([client.connect(clientTransport), server.connect(serverTransport)]);
|
|
30
|
+
const categories = new Map(listToolCatalog().map((t) => [t.name, t.category]));
|
|
31
|
+
const tools = (await client.listTools()).tools.map((t) => ({
|
|
32
|
+
name: t.name,
|
|
33
|
+
category: categories.get(t.name) ?? "other",
|
|
34
|
+
description: t.description ?? "",
|
|
35
|
+
inputSchema: t.inputSchema
|
|
36
|
+
})).sort((a, b) => a.category.localeCompare(b.category) || a.name.localeCompare(b.name));
|
|
37
|
+
const prompts = (await client.listPrompts()).prompts.map((p) => ({
|
|
38
|
+
name: p.name,
|
|
39
|
+
description: p.description ?? ""
|
|
40
|
+
}));
|
|
41
|
+
await client.close();
|
|
42
|
+
await server.close();
|
|
43
|
+
return {
|
|
44
|
+
name: "figma-relai",
|
|
45
|
+
version,
|
|
46
|
+
tools,
|
|
47
|
+
prompts,
|
|
48
|
+
pluginCommands: FIGMA_COMMANDS,
|
|
49
|
+
pitfalls: PITFALLS
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
buildManifest
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=manifest-CFCCUJEV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/manifest.ts"],"sourcesContent":["import { Client } from \"@modelcontextprotocol/sdk/client/index.js\";\nimport { InMemoryTransport } from \"@modelcontextprotocol/sdk/inMemory.js\";\nimport { FIGMA_COMMANDS, PITFALLS } from \"@figma-relai/shared\";\nimport { createServer } from \"../server.js\";\nimport {\n registerAllTools,\n registerRoomTool,\n registerEventsTool,\n listToolCatalog,\n} from \"../tools/index.js\";\nimport { registerPrompts } from \"../prompts.js\";\n\n// The authoritative, machine-readable contract — in the Astryx sense.\n// Nothing here is hand-written: tools and their JSON schemas come from a real\n// in-process MCP handshake (exactly what agents receive from tools/list),\n// categories from the registration table, commands and pitfalls from their\n// runtime registries. It cannot drift from behavior by construction.\n\nexport interface Manifest {\n name: string;\n version: string;\n tools: Array<{\n name: string;\n category: string;\n description: string;\n inputSchema: unknown;\n }>;\n prompts: Array<{ name: string; description: string }>;\n pluginCommands: readonly string[];\n pitfalls: typeof PITFALLS;\n}\n\nexport async function buildManifest(version: string): Promise<Manifest> {\n const server = createServer();\n registerRoomTool(server, async () => {\n throw new Error(\"manifest introspection — no relay\");\n });\n registerEventsTool(server, () => [], () => []);\n registerPrompts(server);\n registerAllTools(server, async () => {\n throw new Error(\"manifest introspection — no plugin connection\");\n });\n\n const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();\n const client = new Client({ name: \"relai-manifest\", version });\n await Promise.all([client.connect(clientTransport), server.connect(serverTransport)]);\n\n const categories = new Map(listToolCatalog().map((t) => [t.name, t.category]));\n const tools = (await client.listTools()).tools\n .map((t) => ({\n name: t.name,\n category: categories.get(t.name) ?? \"other\",\n description: t.description ?? \"\",\n inputSchema: t.inputSchema,\n }))\n .sort((a, b) => a.category.localeCompare(b.category) || a.name.localeCompare(b.name));\n const prompts = (await client.listPrompts()).prompts.map((p) => ({\n name: p.name,\n description: p.description ?? \"\",\n }));\n\n await client.close();\n await server.close();\n\n return {\n name: \"figma-relai\",\n version,\n tools,\n prompts,\n pluginCommands: FIGMA_COMMANDS,\n pitfalls: PITFALLS,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,yBAAyB;AA+BlC,eAAsB,cAAc,SAAoC;AACtE,QAAM,SAAS,aAAa;AAC5B,mBAAiB,QAAQ,YAAY;AACnC,UAAM,IAAI,MAAM,wCAAmC;AAAA,EACrD,CAAC;AACD,qBAAmB,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAC7C,kBAAgB,MAAM;AACt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ist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "bun run scripts/inject-pitfalls.ts && tsup",
|
|
10
|
+
"build": "bun run scripts/inject-pitfalls.ts && tsup && node dist/index.js manifest > ../../docs/manifest.json",
|
|
11
11
|
"dev": "tsup --watch"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|