faux-studio 0.3.6 → 0.3.7
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 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11007,14 +11007,14 @@ async function isCdpAlive(port) {
|
|
|
11007
11007
|
try {
|
|
11008
11008
|
const controller = new AbortController();
|
|
11009
11009
|
const timeout = setTimeout(() => controller.abort(), 2e3);
|
|
11010
|
-
const res = await fetch(`http://127.0.0.1:${port}/json/
|
|
11010
|
+
const res = await fetch(`http://127.0.0.1:${port}/json/list`, {
|
|
11011
11011
|
signal: controller.signal
|
|
11012
11012
|
});
|
|
11013
11013
|
clearTimeout(timeout);
|
|
11014
11014
|
if (!res.ok) return { alive: false, isFigma: false };
|
|
11015
|
-
const
|
|
11016
|
-
const
|
|
11017
|
-
return { alive: true, isFigma
|
|
11015
|
+
const targets = await res.json();
|
|
11016
|
+
const isFigma = targets.some((t) => t.url?.startsWith("views://"));
|
|
11017
|
+
return { alive: true, isFigma };
|
|
11018
11018
|
} catch {
|
|
11019
11019
|
return { alive: false, isFigma: false };
|
|
11020
11020
|
}
|
|
@@ -11041,7 +11041,7 @@ async function listTargets(port) {
|
|
|
11041
11041
|
}
|
|
11042
11042
|
var FIGMA_DESIGN_URL_RE = /figma\.com\/(file|design)\//;
|
|
11043
11043
|
function findFigmaDesignTarget(targets) {
|
|
11044
|
-
return targets.find((t) => t.type === "page" && FIGMA_DESIGN_URL_RE.test(t.url)) || null;
|
|
11044
|
+
return targets.find((t) => t.type === "page" && FIGMA_DESIGN_URL_RE.test(t.url)) || targets.find((t) => t.type === "page" && t.url.startsWith("views://")) || null;
|
|
11045
11045
|
}
|
|
11046
11046
|
async function probeCdpPorts() {
|
|
11047
11047
|
for (const port of KNOWN_CDP_PORTS) {
|
|
@@ -11096,7 +11096,8 @@ async function launchFigmaWithCdp() {
|
|
|
11096
11096
|
}
|
|
11097
11097
|
function launchFigmaProcess(figmaPath, port) {
|
|
11098
11098
|
if (process.platform === "darwin") {
|
|
11099
|
-
|
|
11099
|
+
const binary = `${figmaPath}/Contents/MacOS/Figma`;
|
|
11100
|
+
spawn2(binary, [`--remote-debugging-port=${port}`], {
|
|
11100
11101
|
detached: true,
|
|
11101
11102
|
stdio: "ignore"
|
|
11102
11103
|
}).unref();
|
|
@@ -25566,7 +25567,7 @@ Resources provide quick read-only access to Figma state without tool calls:
|
|
|
25566
25567
|
- Create components for reusable UI patterns.`;
|
|
25567
25568
|
function createMcpServer(deps) {
|
|
25568
25569
|
const server2 = new Server(
|
|
25569
|
-
{ name: "faux-studio", version: "0.3.
|
|
25570
|
+
{ name: "faux-studio", version: "0.3.7" },
|
|
25570
25571
|
{
|
|
25571
25572
|
capabilities: { tools: { listChanged: true }, resources: {}, logging: {} },
|
|
25572
25573
|
instructions: INSTRUCTIONS
|