figma-relai 0.1.3 → 0.1.4
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/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ function createServer() {
|
|
|
14
14
|
return new McpServer(
|
|
15
15
|
{
|
|
16
16
|
name: "Relai",
|
|
17
|
-
version: "0.1.
|
|
17
|
+
version: "0.1.4"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
instructions: `
|
|
@@ -358,7 +358,7 @@ var FigmaConnection = class {
|
|
|
358
358
|
);
|
|
359
359
|
}
|
|
360
360
|
throw new Error(
|
|
361
|
-
`Multiple Figma plugins are connected
|
|
361
|
+
`Multiple Figma plugins are connected: ${withPlugin.map((r) => r.fileName ? `"${r.fileName}" (room ${r.room})` : `room ${r.room}`).join(", ")}. Call join_room with the room of the file you want to control.`
|
|
362
362
|
);
|
|
363
363
|
}
|
|
364
364
|
// Send a command to Figma plugin via the relay
|
|
@@ -583,10 +583,13 @@ var RelayCore = class {
|
|
|
583
583
|
const rooms = [];
|
|
584
584
|
for (const [room, peers] of this.rooms) {
|
|
585
585
|
if (peers.size === 0) continue;
|
|
586
|
+
const pluginPeer = [...peers.values()].find((p) => p.role === "plugin");
|
|
587
|
+
const fileName = typeof pluginPeer?.meta?.fileName === "string" ? pluginPeer.meta.fileName : void 0;
|
|
586
588
|
rooms.push({
|
|
587
589
|
room,
|
|
588
|
-
hasPlugin:
|
|
589
|
-
agentCount: [...peers.values()].filter((p) => p.role === "agent").length
|
|
590
|
+
hasPlugin: pluginPeer !== void 0,
|
|
591
|
+
agentCount: [...peers.values()].filter((p) => p.role === "agent").length,
|
|
592
|
+
...fileName ? { fileName } : {}
|
|
590
593
|
});
|
|
591
594
|
}
|
|
592
595
|
this.send(ws, { type: "list_rooms_result", id: data.id, rooms });
|
|
@@ -3461,7 +3464,7 @@ function getSessionLog() {
|
|
|
3461
3464
|
}
|
|
3462
3465
|
|
|
3463
3466
|
// src/index.ts
|
|
3464
|
-
var VERSION = "0.1.
|
|
3467
|
+
var VERSION = "0.1.4";
|
|
3465
3468
|
var args = process.argv.slice(2);
|
|
3466
3469
|
var serverArg = args.find((arg) => arg.startsWith("--server="));
|
|
3467
3470
|
var serverUrl = serverArg ? serverArg.split("=")[1] : "localhost";
|