bricks-builder-mcp 3.12.2 → 3.12.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/package.json +1 -1
- package/server.js +22 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "bricks-builder-mcp",
|
|
4
|
-
"version": "3.12.
|
|
4
|
+
"version": "3.12.4",
|
|
5
5
|
"description": "Serveur MCP pour piloter Bricks Builder (WordPress) depuis Claude/Codex — édition de pages, gestion d'éléments, audit technique, audit design visuel, upload optimisé WebP. Communauté Discord : https://discord.gg/rX22zHRzH",
|
|
6
6
|
"homepage": "https://discord.gg/rX22zHRzH",
|
|
7
7
|
"main": "server.js",
|
package/server.js
CHANGED
|
@@ -830,7 +830,7 @@ mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
830
830
|
},
|
|
831
831
|
{
|
|
832
832
|
name: "get_element_schema",
|
|
833
|
-
description: "Découvre les éléments Bricks disponibles et leurs contrôles natifs
|
|
833
|
+
description: "Découvre les éléments Bricks disponibles et leurs contrôles natifs. Sans `element`, retourne le catalogue compact. Avec `element` (ex: button, image, form), retourne les contrôles/settings runtime si disponibles, sinon tente le schema officiel Bricks Academy en fallback + les settings hérités communs si includeInherited=true.",
|
|
834
834
|
inputSchema: {
|
|
835
835
|
type: "object",
|
|
836
836
|
properties: {
|
|
@@ -853,6 +853,11 @@ mcpServer.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
853
853
|
},
|
|
854
854
|
},
|
|
855
855
|
},
|
|
856
|
+
{
|
|
857
|
+
name: "get_filter_schema",
|
|
858
|
+
description: "Retourne le schema métier des Query Filters Bricks : état d'activation des query filters, éléments filter-*, clés de liaison (filterQueryId, filterSource, filterTaxonomy, etc.) et workflow recommandé.",
|
|
859
|
+
inputSchema: { type: "object", properties: {} },
|
|
860
|
+
},
|
|
856
861
|
{
|
|
857
862
|
name: "update_global_styles",
|
|
858
863
|
description: "Met à jour les settings globaux Bricks via fusion récursive. Utile pour appliquer une typo de site ou une convention CSS partout d'un coup. Seuls les champs fournis sont modifiés.",
|
|
@@ -1716,6 +1721,11 @@ mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
1716
1721
|
});
|
|
1717
1722
|
break;
|
|
1718
1723
|
|
|
1724
|
+
case "get_filter_schema":
|
|
1725
|
+
console.error(`[LOG] Exécution: get_filter_schema`);
|
|
1726
|
+
result = await callWordPressAPI("/get-filter-schema", "GET");
|
|
1727
|
+
break;
|
|
1728
|
+
|
|
1719
1729
|
case "update_global_styles":
|
|
1720
1730
|
console.error(`[LOG] Exécution: update_global_styles`);
|
|
1721
1731
|
result = await callWordPressAPI("/update-global-styles", "POST", {
|
|
@@ -2087,17 +2097,26 @@ mcpServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
2087
2097
|
const allBrxe = Array.from(el.querySelectorAll('[id^="brxe-"], [class*="brxe-"]'));
|
|
2088
2098
|
const emptyContainers = [];
|
|
2089
2099
|
const MIN_AREA = 2500;
|
|
2100
|
+
const MEDIA_TAGS = new Set(['IMG', 'PICTURE', 'SVG', 'VIDEO', 'IFRAME', 'CANVAS', 'AUDIO', 'OBJECT', 'EMBED']);
|
|
2101
|
+
const INTERACTIVE_TAGS = new Set(['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA']);
|
|
2090
2102
|
allBrxe.forEach(b => {
|
|
2103
|
+
// Bricks 2.3 peut rendre l'élément Image directement en <img class="brxe-image">.
|
|
2104
|
+
// Dans ce cas l'élément EST le média, pas un wrapper vide.
|
|
2105
|
+
if (MEDIA_TAGS.has(b.tagName) || INTERACTIVE_TAGS.has(b.tagName)) return;
|
|
2091
2106
|
const brect = b.getBoundingClientRect();
|
|
2092
2107
|
if (brect.width < 50 || brect.height < 50) return;
|
|
2093
2108
|
const area = brect.width * brect.height;
|
|
2094
2109
|
if (area < MIN_AREA) return;
|
|
2095
2110
|
const hasText = (b.textContent || '').trim().length > 0;
|
|
2096
|
-
const hasMedia = b.querySelector('img, picture, svg, video, iframe') !== null;
|
|
2111
|
+
const hasMedia = b.querySelector('img, picture, svg, video, iframe, canvas, audio, object, embed') !== null;
|
|
2097
2112
|
const hasInteractive = b.querySelector('a, button, input, select, textarea') !== null;
|
|
2098
2113
|
const bcs = getComputedStyle(b);
|
|
2099
2114
|
const hasBgImg = bcs.backgroundImage && bcs.backgroundImage !== 'none';
|
|
2100
|
-
|
|
2115
|
+
const hasChildBgImg = !hasBgImg && Array.from(b.children).some(c => {
|
|
2116
|
+
const ccs = getComputedStyle(c);
|
|
2117
|
+
return ccs.backgroundImage && ccs.backgroundImage !== 'none';
|
|
2118
|
+
});
|
|
2119
|
+
if (!hasText && !hasMedia && !hasInteractive && !hasBgImg && !hasChildBgImg) {
|
|
2101
2120
|
emptyContainers.push({
|
|
2102
2121
|
id: b.id || '',
|
|
2103
2122
|
classes: Array.from(b.classList).filter(c => c.startsWith('brxe-')),
|