figma-relai 0.2.2 → 0.2.3
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-2AVINEFS.js → chunk-VQYNT7L4.js} +26 -4
- package/dist/chunk-VQYNT7L4.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/{manifest-H2YE7OBX.js → manifest-77WTPHLS.js} +2 -2
- package/package.json +2 -1
- package/dist/chunk-2AVINEFS.js.map +0 -1
- /package/dist/{manifest-H2YE7OBX.js.map → manifest-77WTPHLS.js.map} +0 -0
|
@@ -9,7 +9,7 @@ function createServer() {
|
|
|
9
9
|
return new McpServer(
|
|
10
10
|
{
|
|
11
11
|
name: "Relai",
|
|
12
|
-
version: "0.2.
|
|
12
|
+
version: "0.2.3"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
instructions: `
|
|
@@ -1756,6 +1756,18 @@ function register16(server, sendCommand) {
|
|
|
1756
1756
|
if (libraryFileUrl) {
|
|
1757
1757
|
data.libraryCatalog = await fetchLibraryCatalog(libraryFileUrl);
|
|
1758
1758
|
}
|
|
1759
|
+
const truncNotes = [];
|
|
1760
|
+
const components = data.components;
|
|
1761
|
+
for (const [group, entry] of Object.entries(components ?? {})) {
|
|
1762
|
+
if (entry?.truncated) {
|
|
1763
|
+
truncNotes.push(
|
|
1764
|
+
`components.${group}: showing ${entry.items?.length ?? 0}, ${entry.truncated} more hidden (usage-sorted \u2014 new/unused components are the ones cut)`
|
|
1765
|
+
);
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
if (truncNotes.length) {
|
|
1769
|
+
data.TRUNCATED = `${truncNotes.join("; ")}. Full component list: manage_components action:"list".`;
|
|
1770
|
+
}
|
|
1759
1771
|
return jsonResult(data);
|
|
1760
1772
|
} catch (error) {
|
|
1761
1773
|
return errorResult(error);
|
|
@@ -3170,12 +3182,22 @@ function register20(server, sendCommand) {
|
|
|
3170
3182
|
}
|
|
3171
3183
|
const bv = boundVars?.boundVariables || {};
|
|
3172
3184
|
const results = [];
|
|
3173
|
-
|
|
3185
|
+
let coverage;
|
|
3186
|
+
let coverageDetail = "";
|
|
3187
|
+
try {
|
|
3188
|
+
const audit = await sendCommand("audit_colors", { nodeId: targetId }, 6e4);
|
|
3189
|
+
if (typeof audit?.totalProperties !== "number") throw new Error("no audit");
|
|
3190
|
+
coverage = audit.totalProperties > 0 ? audit.boundCount / audit.totalProperties : 1;
|
|
3191
|
+
coverageDetail = ` (${audit.boundCount}/${audit.totalProperties} paint props across ${audit.scanned} nodes${audit.hiddenCount ? `, ${audit.hiddenCount} hidden unbound` : ""})`;
|
|
3192
|
+
} catch {
|
|
3193
|
+
coverage = calculateTokenCoverage(nodeInfo, bv);
|
|
3194
|
+
coverageDetail = " (shallow \u2014 old plugin build)";
|
|
3195
|
+
}
|
|
3174
3196
|
results.push({
|
|
3175
3197
|
rule: "token_coverage",
|
|
3176
3198
|
passed: coverage >= 0.8,
|
|
3177
3199
|
severity: coverage >= 0.5 ? "warning" : "error",
|
|
3178
|
-
message: `Token coverage: ${Math.round(coverage * 100)}
|
|
3200
|
+
message: `Token coverage: ${Math.round(coverage * 100)}%${coverageDetail} (target: 80%+)`,
|
|
3179
3201
|
nodeId: targetId,
|
|
3180
3202
|
fix: coverage < 0.8 ? { tool: "bind_tokens", reason: "Bind unbound properties to design tokens", args: { nodeId: targetId } } : void 0
|
|
3181
3203
|
});
|
|
@@ -3528,4 +3550,4 @@ export {
|
|
|
3528
3550
|
listToolCatalog,
|
|
3529
3551
|
registerPrompts
|
|
3530
3552
|
};
|
|
3531
|
-
//# sourceMappingURL=chunk-
|
|
3553
|
+
//# sourceMappingURL=chunk-VQYNT7L4.js.map
|