@noleemits/vision-builder-control-mcp 4.97.0 → 4.103.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/index.js +52 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -111,7 +111,7 @@ process.on('SIGINT', () => {
|
|
|
111
111
|
// CONFIG
|
|
112
112
|
// ================================================================
|
|
113
113
|
|
|
114
|
-
const VERSION = '4.
|
|
114
|
+
const VERSION = '4.103.1';
|
|
115
115
|
const MIN_PLUGIN_VERSION = '4.13.0'; // Minimum WP plugin version required by this MCP server
|
|
116
116
|
|
|
117
117
|
// ================================================================
|
|
@@ -3957,6 +3957,22 @@ function getToolDefinitions() {
|
|
|
3957
3957
|
required: ['page_id']
|
|
3958
3958
|
}
|
|
3959
3959
|
},
|
|
3960
|
+
{
|
|
3961
|
+
name: 'set_page_template',
|
|
3962
|
+
description: 'Set the WP page template for a post. Theme-agnostic solution for full-bleed ' +
|
|
3963
|
+
'landing pages — use "elementor_canvas" to kill theme chrome on any modern WP/Elementor ' +
|
|
3964
|
+
'site. Other slugs: "elementor_header_footer" (Elementor body + theme header/footer), ' +
|
|
3965
|
+
'"default" (theme default), "100-width.php" (Avada full-width), ' +
|
|
3966
|
+
'"blank-template.php" (Divi blank). Returns previous and new template slug.',
|
|
3967
|
+
inputSchema: {
|
|
3968
|
+
type: 'object',
|
|
3969
|
+
required: ['post_id', 'template'],
|
|
3970
|
+
properties: {
|
|
3971
|
+
post_id: { type: 'integer', description: 'Post or page ID.' },
|
|
3972
|
+
template: { type: 'string', description: 'Template slug, e.g. "elementor_canvas".' },
|
|
3973
|
+
},
|
|
3974
|
+
},
|
|
3975
|
+
},
|
|
3960
3976
|
// ── Class Registry ──
|
|
3961
3977
|
{
|
|
3962
3978
|
name: 'list_classes',
|
|
@@ -4011,12 +4027,13 @@ function getToolDefinitions() {
|
|
|
4011
4027
|
},
|
|
4012
4028
|
{
|
|
4013
4029
|
name: 'upsert_class',
|
|
4014
|
-
description: 'Define or update a site CSS class — stores its metadata AND CSS body in the NVBC class registry. NVBC renders the CSS page-scoped (only on pages that use the class); it is NOT written to the Elementor Kit. The class appears in list_classes with source=[site] and in the editor Browse picker. Optional apply_to: attach the class to element IDs on specific pages in the same call. Call again with the same name to update (css
|
|
4030
|
+
description: 'Define or update a site CSS class — stores its metadata AND CSS body in the NVBC class registry. NVBC renders the CSS page-scoped (only on pages that use the class); it is NOT written to the Elementor Kit. The class appears in list_classes with source=[site] and in the editor Browse picker. Optional apply_to: attach the class to element IDs on specific pages in the same call. Call again with the same name to update (css/rules are replaced). v4.76.0+. v4.92.0 adds scope (global vs page) and status (published vs draft). v4.97.0 adds specificity (auto|layout|utility) so layout/visual classes win against .elementor .e-con default styles instead of losing on specificity. v4.98.0 adds rules — the recommended way to author classes that need pseudo-elements, hover states, or any multi-rule structure (keeps the plugin the owner of all class CSS instead of forcing the user to drop ad-hoc CSS into Elementor).',
|
|
4015
4031
|
inputSchema: {
|
|
4016
4032
|
type: 'object',
|
|
4017
4033
|
properties: {
|
|
4018
4034
|
name: { type: 'string', description: 'CSS class name without leading dot. Lowercase, hyphens and underscores only. e.g. "ef-font-display"' },
|
|
4019
|
-
css: { type: 'string', description: 'CSS property declarations for the class body
|
|
4035
|
+
css: { type: 'string', description: 'Single-rule shorthand — CSS property declarations for the class body, no selector, no braces. Equivalent to rules["&"]. Use this only when the class is one bare rule; for anything with pseudo-elements, :hover/:focus/:active, or child selectors, use `rules` instead. e.g. "font-size: clamp(40px, 5vw, 72px); font-family: \'Cormorant Garamond\', serif;"' },
|
|
4036
|
+
rules: { type: 'object', additionalProperties: { type: 'string' }, description: 'v4.98.0+. Map of selector templates to declaration bodies (no braces). `&` in the selector is replaced with the resolved class selector — so this is the way to express pseudo-elements, hover/focus states, attribute states, and child/descendant selectors WITHOUT dropping raw CSS into Elementor. The specificity heuristic runs per-rule on each body, so decorative rules with backgrounds get the `.elementor` wrap automatically. Example for a hero with a gold accent strip and radial glow: {"&": "position: relative; overflow: hidden;", "&::before": "content: \\\"\\\"; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--nvbc-color-accent);", "&::after": "content: \\\"\\\"; position: absolute; inset: 0; background: radial-gradient(circle at 30% 30%, rgba(255,200,100,0.18), transparent 60%); pointer-events: none;", "&:hover": "transform: translateY(-2px);"}. If both `css` and `rules` are supplied, `css` is merged in as rules["&"] unless rules already has an explicit "&" key. For @media / @supports / container queries, use `css` with full rule syntax — `rules` is selector-keyed only.' },
|
|
4020
4037
|
description: { type: 'string', description: 'Human-readable description shown in list_classes output.' },
|
|
4021
4038
|
category: { type: 'string', enum: ['hero', 'cards', 'layout', 'grid', 'spacing', 'typography', 'decorative', 'utility'], description: 'Category for list_classes grouping. Default: "utility".' },
|
|
4022
4039
|
applies_to: { type: 'array', items: { type: 'string' }, description: 'Element types this class applies to. Default: ["any"].' },
|
|
@@ -4464,6 +4481,20 @@ async function handleToolCall(name, args) {
|
|
|
4464
4481
|
if (item.meta.post_placement_instructions) {
|
|
4465
4482
|
out += ` NOTE: ${item.meta.post_placement_instructions}\n`;
|
|
4466
4483
|
}
|
|
4484
|
+
const dp = item.meta?.design_properties;
|
|
4485
|
+
if (dp) {
|
|
4486
|
+
const tags = [
|
|
4487
|
+
dp.background,
|
|
4488
|
+
dp.columns ? `${dp.columns}-col` : null,
|
|
4489
|
+
dp.has_image ? 'has-image' : null,
|
|
4490
|
+
dp.has_cta ? `cta:${dp.has_cta}` : null,
|
|
4491
|
+
dp.theme,
|
|
4492
|
+
dp.tone,
|
|
4493
|
+
].filter(Boolean);
|
|
4494
|
+
if (tags.length) out += ` Tags: ${tags.join(' | ')}\n`;
|
|
4495
|
+
if (dp.best_for) out += ` Best for: ${dp.best_for}\n`;
|
|
4496
|
+
if (dp.not_for) out += ` Not for: ${dp.not_for}\n`;
|
|
4497
|
+
}
|
|
4467
4498
|
});
|
|
4468
4499
|
out += '\n';
|
|
4469
4500
|
});
|
|
@@ -7655,6 +7686,13 @@ async function handleToolCall(name, args) {
|
|
|
7655
7686
|
return ok(`Front page set to "${r.front_page_title}" (ID: ${r.front_page_id})${r.blog_page_id ? `\nBlog page: ${r.blog_page_id}` : ''}`);
|
|
7656
7687
|
}
|
|
7657
7688
|
|
|
7689
|
+
case 'set_page_template': {
|
|
7690
|
+
const r = await apiCall(`/pages/${args.post_id}/template`, 'POST', {
|
|
7691
|
+
template: args.template,
|
|
7692
|
+
});
|
|
7693
|
+
return ok(`Page ${r.post_id} template: ${r.previous_template} → ${r.template}`);
|
|
7694
|
+
}
|
|
7695
|
+
|
|
7658
7696
|
case 'list_class_snapshots': {
|
|
7659
7697
|
const r = await apiCall('/class-snapshots');
|
|
7660
7698
|
const snaps = r.snapshots || [];
|
|
@@ -7738,6 +7776,10 @@ async function handleToolCall(name, args) {
|
|
|
7738
7776
|
applies_to: args.applies_to || ['any'],
|
|
7739
7777
|
};
|
|
7740
7778
|
if (args.css) regBody.css = args.css;
|
|
7779
|
+
// v4.98.0 — structured rules map (preferred for pseudo-elements, :hover, child selectors).
|
|
7780
|
+
if (args.rules && typeof args.rules === 'object' && !Array.isArray(args.rules)) {
|
|
7781
|
+
regBody.rules = args.rules;
|
|
7782
|
+
}
|
|
7741
7783
|
// v4.92.0 — scope + status + scope_page_ids.
|
|
7742
7784
|
if (args.scope) regBody.scope = args.scope;
|
|
7743
7785
|
if (args.status) regBody.status = args.status;
|
|
@@ -7762,8 +7804,13 @@ async function handleToolCall(name, args) {
|
|
|
7762
7804
|
if (r.class?.status === 'draft') {
|
|
7763
7805
|
msg += `Status: DRAFT. The class is hidden from list_classes + the editor picker until you flip it to published.\n`;
|
|
7764
7806
|
}
|
|
7765
|
-
if (args.css) {
|
|
7766
|
-
|
|
7807
|
+
if (args.rules || args.css) {
|
|
7808
|
+
const ruleCount = args.rules ? Object.keys(args.rules).length : 0;
|
|
7809
|
+
if (ruleCount > 0) {
|
|
7810
|
+
msg += `CSS compiled from ${ruleCount} rule(s) (${Object.keys(args.rules).join(', ')}) and stored on the class — renders page-scoped (only on pages that use .${args.name}).\n`;
|
|
7811
|
+
} else {
|
|
7812
|
+
msg += `CSS stored on the class — renders page-scoped (only on pages that use .${args.name}).\n`;
|
|
7813
|
+
}
|
|
7767
7814
|
}
|
|
7768
7815
|
|
|
7769
7816
|
// 3. Attach to elements if apply_to provided
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noleemits/vision-builder-control-mcp",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.103.1",
|
|
4
4
|
"description": "Vision Builder Control MCP server - design token-driven page builder tools for WordPress/Elementor websites",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|