@mp3wizard/figma-console-mcp 1.23.1 → 1.25.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/README.md +1 -1
- package/dist/cloudflare/core/version-tools.js +151 -7
- package/dist/cloudflare/core/websocket-server.js +72 -0
- package/dist/cloudflare/index.js +3 -3
- package/dist/core/diff/diff-engine.d.ts +14 -0
- package/dist/core/diff/diff-engine.d.ts.map +1 -1
- package/dist/core/diff/diff-engine.js.map +1 -1
- package/dist/core/version-tools.d.ts +30 -1
- package/dist/core/version-tools.d.ts.map +1 -1
- package/dist/core/version-tools.js +151 -7
- package/dist/core/version-tools.js.map +1 -1
- package/dist/core/websocket-server.d.ts +43 -0
- package/dist/core/websocket-server.d.ts.map +1 -1
- package/dist/core/websocket-server.js +72 -0
- package/dist/core/websocket-server.js.map +1 -1
- package/dist/local.d.ts.map +1 -1
- package/dist/local.js +8 -0
- package/dist/local.js.map +1 -1
- package/figma-desktop-bridge/code.js +49 -1
- package/figma-desktop-bridge/ui.html +13 -0
- package/package.json +3 -22
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// Plugin version — sent in FILE_INFO for server-side version compatibility checks.
|
|
8
8
|
// The server compares this against its own version to detect stale cached plugins.
|
|
9
|
-
var PLUGIN_VERSION = '1.
|
|
9
|
+
var PLUGIN_VERSION = '1.25.0'; // Kept in sync with package.json by scripts/release.sh — see issue #62.
|
|
10
10
|
|
|
11
11
|
console.log('🌉 [Desktop Bridge] Plugin loaded (v' + PLUGIN_VERSION + ')');
|
|
12
12
|
|
|
@@ -6299,6 +6299,12 @@ figma.loadAllPagesAsync().then(function() {
|
|
|
6299
6299
|
var hasNodeChanges = false;
|
|
6300
6300
|
var changedNodeIds = [];
|
|
6301
6301
|
|
|
6302
|
+
// v1.25.0: also collect metadata-only changes (descriptions, annotations).
|
|
6303
|
+
// These are properties that the REST API DOESN'T expose in version snapshots,
|
|
6304
|
+
// so figma_diff_versions can't see them through REST alone. Forwarding them
|
|
6305
|
+
// via the Plugin API + WebSocket is the only way to make them diff-visible.
|
|
6306
|
+
var metadataChanges = [];
|
|
6307
|
+
|
|
6302
6308
|
for (var i = 0; i < event.documentChanges.length; i++) {
|
|
6303
6309
|
var change = event.documentChanges[i];
|
|
6304
6310
|
if (change.type === 'STYLE_CREATE' || change.type === 'STYLE_DELETE' || change.type === 'STYLE_PROPERTY_CHANGE') {
|
|
@@ -6309,6 +6315,48 @@ figma.loadAllPagesAsync().then(function() {
|
|
|
6309
6315
|
changedNodeIds.push(change.id);
|
|
6310
6316
|
}
|
|
6311
6317
|
}
|
|
6318
|
+
|
|
6319
|
+
// Metadata change detection. PROPERTY_CHANGE includes a `properties` array
|
|
6320
|
+
// listing which fields changed; we only snapshot the new value for the
|
|
6321
|
+
// two fields Figma's REST never returns: `description` and `annotations`.
|
|
6322
|
+
if (change.type === 'PROPERTY_CHANGE' && change.node && Array.isArray(change.properties)) {
|
|
6323
|
+
for (var p = 0; p < change.properties.length; p++) {
|
|
6324
|
+
var prop = change.properties[p];
|
|
6325
|
+
if (prop === 'description' || prop === 'descriptionMarkdown' || prop === 'annotations') {
|
|
6326
|
+
try {
|
|
6327
|
+
var newValue = change.node[prop];
|
|
6328
|
+
// Serialize annotations to plain JSON-safe form
|
|
6329
|
+
if (prop === 'annotations' && Array.isArray(newValue)) {
|
|
6330
|
+
newValue = newValue.map(function(a) {
|
|
6331
|
+
return {
|
|
6332
|
+
label: a.label || null,
|
|
6333
|
+
labelMarkdown: a.labelMarkdown || null,
|
|
6334
|
+
categoryId: a.categoryId || null,
|
|
6335
|
+
properties: a.properties || []
|
|
6336
|
+
};
|
|
6337
|
+
});
|
|
6338
|
+
}
|
|
6339
|
+
metadataChanges.push({
|
|
6340
|
+
node_id: change.node.id,
|
|
6341
|
+
node_name: change.node.name || null,
|
|
6342
|
+
node_type: change.node.type || null,
|
|
6343
|
+
field: prop === 'descriptionMarkdown' ? 'description' : prop,
|
|
6344
|
+
new_value: newValue,
|
|
6345
|
+
timestamp: Date.now()
|
|
6346
|
+
});
|
|
6347
|
+
} catch (e) {
|
|
6348
|
+
// Some property reads can throw on detached / deleted nodes
|
|
6349
|
+
}
|
|
6350
|
+
}
|
|
6351
|
+
}
|
|
6352
|
+
}
|
|
6353
|
+
}
|
|
6354
|
+
|
|
6355
|
+
if (metadataChanges.length > 0) {
|
|
6356
|
+
figma.ui.postMessage({
|
|
6357
|
+
type: 'METADATA_CHANGE',
|
|
6358
|
+
data: { changes: metadataChanges }
|
|
6359
|
+
});
|
|
6312
6360
|
}
|
|
6313
6361
|
|
|
6314
6362
|
if (hasStyleChanges || hasNodeChanges) {
|
|
@@ -1043,6 +1043,14 @@
|
|
|
1043
1043
|
}
|
|
1044
1044
|
};
|
|
1045
1045
|
|
|
1046
|
+
// v1.25.0: forward METADATA_CHANGE events (description/annotation edits)
|
|
1047
|
+
// so figma_diff_versions can surface them despite Figma REST not exposing them.
|
|
1048
|
+
window.__wsForwardMetadataChange = function(data) {
|
|
1049
|
+
if (wsConnected) {
|
|
1050
|
+
broadcastToAll({ type: 'METADATA_CHANGE', data: data });
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1046
1054
|
// Forward CONSOLE_CAPTURE events to all servers for console monitoring
|
|
1047
1055
|
window.__wsForwardConsoleCapture = function(data) {
|
|
1048
1056
|
if (wsConnected) {
|
|
@@ -1472,6 +1480,11 @@
|
|
|
1472
1480
|
if (window.__wsForwardDocumentChange) window.__wsForwardDocumentChange(msg.data);
|
|
1473
1481
|
break;
|
|
1474
1482
|
|
|
1483
|
+
// v1.25.0: metadata change events (description/annotation edits via Plugin API)
|
|
1484
|
+
case 'METADATA_CHANGE':
|
|
1485
|
+
if (window.__wsForwardMetadataChange) window.__wsForwardMetadataChange(msg.data);
|
|
1486
|
+
break;
|
|
1487
|
+
|
|
1475
1488
|
// Console capture events (for console monitoring via WebSocket)
|
|
1476
1489
|
case 'CONSOLE_CAPTURE':
|
|
1477
1490
|
if (window.__wsForwardConsoleCapture) window.__wsForwardConsoleCapture(msg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mp3wizard/figma-console-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.1",
|
|
4
4
|
"description": "MCP server for accessing Figma plugin console logs and screenshots via Cloudflare Workers or local mode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/local.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"pino": "^9.5.0",
|
|
66
66
|
"pino-pretty": "^13.0.0",
|
|
67
67
|
"puppeteer-core": "^23.11.1",
|
|
68
|
-
"uuid": "
|
|
68
|
+
"uuid": "^11.0.3",
|
|
69
69
|
"ws": "^8.19.0",
|
|
70
70
|
"zod": "^3.25.76"
|
|
71
71
|
},
|
|
@@ -81,28 +81,9 @@
|
|
|
81
81
|
"ts-jest": "^29.2.5",
|
|
82
82
|
"tsx": "^4.19.2",
|
|
83
83
|
"typescript": "5.9.3",
|
|
84
|
-
"vite": "
|
|
84
|
+
"vite": "^6.0.0",
|
|
85
85
|
"vite-plugin-singlefile": "^2.0.0",
|
|
86
86
|
"wrangler": "^4.42.0",
|
|
87
87
|
"zod-to-json-schema": "^3.25.1"
|
|
88
|
-
},
|
|
89
|
-
"overrides": {
|
|
90
|
-
"path-to-regexp": ">=8.4.1",
|
|
91
|
-
"miniflare": {
|
|
92
|
-
"undici": ">=7.24.0"
|
|
93
|
-
},
|
|
94
|
-
"handlebars": ">=4.7.9",
|
|
95
|
-
"brace-expansion": ">=1.1.13",
|
|
96
|
-
"lodash": ">=4.18.0",
|
|
97
|
-
"picomatch": ">=4.0.4",
|
|
98
|
-
"hono": ">=4.12.18",
|
|
99
|
-
"@hono/node-server": ">=1.19.13",
|
|
100
|
-
"basic-ftp": ">=5.3.0",
|
|
101
|
-
"postcss": ">=8.5.10",
|
|
102
|
-
"fast-uri": ">=3.1.2",
|
|
103
|
-
"ip-address": ">=10.1.1",
|
|
104
|
-
"vite": {
|
|
105
|
-
"picomatch": ">=4.0.4"
|
|
106
|
-
}
|
|
107
88
|
}
|
|
108
89
|
}
|