faux-studio 0.3.11 → 0.3.12
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 +1 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11152,7 +11152,6 @@ async function ensureFigma() {
|
|
|
11152
11152
|
}
|
|
11153
11153
|
|
|
11154
11154
|
// src/plugin-ws.ts
|
|
11155
|
-
import { execSync as execSync2 } from "child_process";
|
|
11156
11155
|
import { randomUUID } from "crypto";
|
|
11157
11156
|
import { writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
11158
11157
|
import { join as join4 } from "path";
|
|
@@ -11192,8 +11191,6 @@ var PluginWsServer = class {
|
|
|
11192
11191
|
// Server Lifecycle
|
|
11193
11192
|
// -------------------------------------------------------------------------
|
|
11194
11193
|
async start() {
|
|
11195
|
-
this.killStaleInstances();
|
|
11196
|
-
await new Promise((r) => setTimeout(r, 300));
|
|
11197
11194
|
for (let port = DEFAULT_PORT; port < DEFAULT_PORT + PORT_RANGE; port++) {
|
|
11198
11195
|
try {
|
|
11199
11196
|
await this.listen(port);
|
|
@@ -11209,35 +11206,6 @@ var PluginWsServer = class {
|
|
|
11209
11206
|
`No available port in range ${DEFAULT_PORT}-${DEFAULT_PORT + PORT_RANGE - 1}. Another faux-studio instance may be running.`
|
|
11210
11207
|
);
|
|
11211
11208
|
}
|
|
11212
|
-
/**
|
|
11213
|
-
* Kill any node processes listening on our port range that are running
|
|
11214
|
-
* faux-studio. Uses OS-level detection — works regardless of the old
|
|
11215
|
-
* instance's version or protocol support.
|
|
11216
|
-
*/
|
|
11217
|
-
killStaleInstances() {
|
|
11218
|
-
const myPid = process.pid;
|
|
11219
|
-
for (let port = DEFAULT_PORT; port < DEFAULT_PORT + PORT_RANGE; port++) {
|
|
11220
|
-
try {
|
|
11221
|
-
let pid;
|
|
11222
|
-
if (process.platform === "win32") {
|
|
11223
|
-
const output = execSync2(
|
|
11224
|
-
`netstat -ano | findstr "LISTENING" | findstr ":${port} "`,
|
|
11225
|
-
{ encoding: "utf-8" }
|
|
11226
|
-
);
|
|
11227
|
-
pid = output.trim().split(/\s+/).pop();
|
|
11228
|
-
} else {
|
|
11229
|
-
pid = execSync2(`lsof -iTCP:${port} -sTCP:LISTEN -t`, { encoding: "utf-8" }).trim().split("\n")[0];
|
|
11230
|
-
}
|
|
11231
|
-
if (!pid || Number(pid) === myPid) continue;
|
|
11232
|
-
const cmd = process.platform === "win32" ? execSync2(`wmic process where "ProcessId=${pid}" get CommandLine /format:list`, { encoding: "utf-8" }) : execSync2(`ps -p ${pid} -o command=`, { encoding: "utf-8" });
|
|
11233
|
-
if (cmd.includes("faux-studio")) {
|
|
11234
|
-
log(`Killing stale faux-studio on port ${port} (pid ${pid})`);
|
|
11235
|
-
process.kill(Number(pid), "SIGTERM");
|
|
11236
|
-
}
|
|
11237
|
-
} catch {
|
|
11238
|
-
}
|
|
11239
|
-
}
|
|
11240
|
-
}
|
|
11241
11209
|
listen(port) {
|
|
11242
11210
|
return new Promise((resolve, reject) => {
|
|
11243
11211
|
const wss = new import_websocket_server.default({ port, host: "127.0.0.1" });
|
|
@@ -25602,7 +25570,7 @@ Resources provide quick read-only access to Figma state without tool calls:
|
|
|
25602
25570
|
- Create components for reusable UI patterns.`;
|
|
25603
25571
|
function createMcpServer(deps) {
|
|
25604
25572
|
const server2 = new Server(
|
|
25605
|
-
{ name: "faux-studio", version: "0.3.
|
|
25573
|
+
{ name: "faux-studio", version: "0.3.12" },
|
|
25606
25574
|
{
|
|
25607
25575
|
capabilities: { tools: { listChanged: true }, resources: {}, logging: {} },
|
|
25608
25576
|
instructions: INSTRUCTIONS
|