@diviops/mcp-server 1.5.27 → 1.5.28
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 +30 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2722,7 +2722,7 @@ registerPluginTool("diviops_variable_list", {
|
|
|
2722
2722
|
description: "List all design token variables from the Divi Variable Manager. Colors (gcid-*) come from et_global_data, numbers/strings/etc (gvid-*) from et_divi_global_variables. Filter by type or ID prefix. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; invalid `type` returns ok:false with code 'invalid_input'.",
|
|
2723
2723
|
inputSchema: {
|
|
2724
2724
|
type: z
|
|
2725
|
-
.enum(["colors", "numbers", "strings", "images", "links", "fonts"])
|
|
2725
|
+
.enum(["colors", "numbers", "strings", "images", "links", "fonts", "gradients"])
|
|
2726
2726
|
.optional()
|
|
2727
2727
|
.describe("Filter by variable type"),
|
|
2728
2728
|
prefix: z
|
|
@@ -2750,7 +2750,7 @@ registerPluginTool("diviops_variable_create", {
|
|
|
2750
2750
|
DRY_RUN_DESC_SUFFIX,
|
|
2751
2751
|
inputSchema: {
|
|
2752
2752
|
type: z
|
|
2753
|
-
.enum(["colors", "numbers", "strings", "images", "links", "fonts"])
|
|
2753
|
+
.enum(["colors", "numbers", "strings", "images", "links", "fonts", "gradients"])
|
|
2754
2754
|
.describe("Variable type"),
|
|
2755
2755
|
id: z
|
|
2756
2756
|
.string()
|
|
@@ -2762,7 +2762,25 @@ registerPluginTool("diviops_variable_create", {
|
|
|
2762
2762
|
value: z
|
|
2763
2763
|
.string()
|
|
2764
2764
|
.optional()
|
|
2765
|
-
.describe('Variable value (required unless using fluid min/max/targets for type=numbers): hex color for colors (e.g. "#3a7a6a"), CSS value for numbers (e.g. "clamp(30px, 8vw, 100px)" or "2rem")'),
|
|
2765
|
+
.describe('Variable value (required unless using fluid min/max/targets for type=numbers, OR the structured `gradient` object for type=gradients): hex color for colors (e.g. "#3a7a6a"), CSS value for numbers (e.g. "clamp(30px, 8vw, 100px)" or "2rem"), arbitrary text/URL for strings/links/images. For type=gradients do NOT pass a CSS gradient string here — it stores an unrenderable variable; use the `gradient` object instead (or pass a full $variable({"type":"gradient",…})$ token verbatim).'),
|
|
2766
|
+
gradient: z
|
|
2767
|
+
.object({
|
|
2768
|
+
stops: z
|
|
2769
|
+
.array(z.object({ position: z.union([z.string(), z.number()]), color: z.string() }))
|
|
2770
|
+
.min(2)
|
|
2771
|
+
.describe('Gradient color stops, min 2. position = unitless number 0–100 (string or number; PHP normalizes to string); color = hex or a $variable(gcid-…)$ token.'),
|
|
2772
|
+
type: z
|
|
2773
|
+
.enum(["linear", "circular", "elliptical", "conic"])
|
|
2774
|
+
.optional()
|
|
2775
|
+
.describe('Gradient type (default linear). circular/elliptical render as radial-gradient(circle|ellipse …); conic as conic-gradient. NOTE: the enum is circular/elliptical, NOT "radial".'),
|
|
2776
|
+
direction: z.string().optional().describe('CSS angle for linear/conic (default "180deg"), e.g. "90deg".'),
|
|
2777
|
+
directionRadial: z.string().optional().describe('Position keyword for circular/elliptical/conic (default "center"), e.g. "top left".'),
|
|
2778
|
+
length: z.string().optional().describe('Gradient length (default "100%").'),
|
|
2779
|
+
repeat: z.enum(["on", "off"]).optional().describe('Repeat the gradient (default "off").'),
|
|
2780
|
+
overlaysImage: z.enum(["on", "off"]).optional().describe('Place gradient above a background image (default "off").'),
|
|
2781
|
+
})
|
|
2782
|
+
.optional()
|
|
2783
|
+
.describe('Structured gradient settings for type="gradients" (5.7.4). The server serializes the canonical $variable({"type":"gradient",value:{name:"gradient",settings:{…}}})$ token that Divi resolves to a defined --gvid-* custom property. REQUIRED for a renderable gradient variable — a raw CSS-string `value` is rejected. Ignored for non-gradient types.'),
|
|
2766
2784
|
min: z
|
|
2767
2785
|
.string()
|
|
2768
2786
|
.optional()
|
|
@@ -2791,10 +2809,18 @@ registerPluginTool("diviops_variable_create", {
|
|
|
2791
2809
|
},
|
|
2792
2810
|
annotations: { idempotentHint: false },
|
|
2793
2811
|
_meta: { idempotent: "false" },
|
|
2794
|
-
}, async ({ type, id, label, value, min, max, targets, output_unit, root_font_size_px, dry_run, }) => {
|
|
2812
|
+
}, async ({ type, id, label, value, gradient, min, max, targets, output_unit, root_font_size_px, dry_run, }) => {
|
|
2813
|
+
// Structured gradient serialization is a plugin-side capability (#921).
|
|
2814
|
+
// Gate it so a new server + old plugin fails with a clear "update plugin"
|
|
2815
|
+
// error instead of the confusing "value must be scalar" the old callback
|
|
2816
|
+
// would emit for a gradient-without-value request.
|
|
2817
|
+
if (gradient !== undefined)
|
|
2818
|
+
requireCapability("variable_create_gradient");
|
|
2795
2819
|
const body = { type, label };
|
|
2796
2820
|
if (value !== undefined)
|
|
2797
2821
|
body.value = value;
|
|
2822
|
+
if (gradient !== undefined)
|
|
2823
|
+
body.gradient = gradient;
|
|
2798
2824
|
if (id)
|
|
2799
2825
|
body.id = id;
|
|
2800
2826
|
if (min !== undefined)
|