@diviops/mcp-server 1.5.57 → 1.5.58
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 +42 -1
- package/dist/index.js +38 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,27 @@ The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Codex,
|
|
|
8
8
|
Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## 1.5.
|
|
11
|
+
## 1.5.58 candidate release note
|
|
12
|
+
|
|
13
|
+
With Free 1.5.30, module preset create/update accepts `group_presets` for native
|
|
14
|
+
root composition, and inspection exposes stored links. The supplied map replaces
|
|
15
|
+
the entire root map; omission preserves links and `{}` clears them. Slot/group
|
|
16
|
+
buckets and existing references are validated, including dry-run. Composition
|
|
17
|
+
requires `preset_composition_v1`; older or unverified plugins refuse it before
|
|
18
|
+
dispatch. Keep `groupPresets` out of `attrs`. Update both components and restart
|
|
19
|
+
the MCP client connection to refresh capabilities.
|
|
20
|
+
|
|
21
|
+
Public builder companion 1.4.10 and Free validation warnings ask for explicit
|
|
22
|
+
heading levels according to document hierarchy, without changing typography or
|
|
23
|
+
warning detection. Updating npm or WordPress does not update independently
|
|
24
|
+
installed skills or instructions already read by an agent.
|
|
25
|
+
|
|
26
|
+
These source candidate versions are not yet published. The delivered baseline
|
|
27
|
+
is Free 1.5.29 / MCP 1.5.57 / builder 1.4.9. Dependencies and compatibility floors
|
|
28
|
+
are unchanged. Package qualification and publication remain separate from
|
|
29
|
+
source acceptance.
|
|
30
|
+
|
|
31
|
+
## Previous 1.5.57 candidate release note
|
|
12
32
|
|
|
13
33
|
Forwards `diviops_module_update` request cancellation to HTTP dispatch and pending
|
|
14
34
|
response-body reads. This does not establish the cause or resolution of the
|
|
@@ -397,6 +417,27 @@ When the gates are not satisfied, the tools simply don't appear on the MCP surfa
|
|
|
397
417
|
|
|
398
418
|
See [server-reference.md](../docs/server-reference.md) for per-tool descriptions.
|
|
399
419
|
|
|
420
|
+
## Native preset composition
|
|
421
|
+
|
|
422
|
+
`diviops_preset_create` and `diviops_preset_update` accept optional `group_presets`
|
|
423
|
+
for **module presets only**, stored as native root `groupPresets`, never in attrs:
|
|
424
|
+
|
|
425
|
+
```json
|
|
426
|
+
{"group_presets":{"title.decoration.font":{"presetId":["existing-font-id"],"groupName":"divi/font"}}}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Omit it to preserve existing links; `{}` replaces them with an empty map. Each
|
|
430
|
+
native slot binding requires a nonempty string-array `presetId` and `groupName`,
|
|
431
|
+
with optional nonnegative integer `segmentBoundary`. Slot/group compatibility
|
|
432
|
+
and target existence in that group bucket are checked before writing, also in
|
|
433
|
+
dry-run. No defaults or IDs are substituted. `attrs.groupPresets` rejects with
|
|
434
|
+
a corrective hint. New composition calls require `preset_composition_v1`;
|
|
435
|
+
older/unverified plugins refuse before dispatch, while omitted-link calls keep
|
|
436
|
+
their existing behavior. Reconnect after updating a supported plugin.
|
|
437
|
+
`diviops_preset_inspect` exposes the outgoing root map without resolving inherited
|
|
438
|
+
styles or broadening its partial consumer coverage. Preview writes nothing and
|
|
439
|
+
allocates no UUID; native Builder/rendering qualification remains separate.
|
|
440
|
+
|
|
400
441
|
## Bundled CLI — `diviops-preset`
|
|
401
442
|
|
|
402
443
|
The package also ships a standalone command-line preset emitter, `diviops-preset`,
|
package/dist/index.js
CHANGED
|
@@ -2067,7 +2067,7 @@ registerPluginTool("diviops_preset_audit_storage", {
|
|
|
2067
2067
|
};
|
|
2068
2068
|
});
|
|
2069
2069
|
registerPluginTool("diviops_preset_inspect", {
|
|
2070
|
-
description: "Inspect one Divi 5 preset UUID without writing. Returns bucket/type/module/group coordinates, attrs/styleAttrs/renderAttrs, storage path and provenance, block plus preset-chain reference counts with sample consumers, explicit partial coverage, and direct variable_references.ids to join with diviops_variable_list (absent IDs remain unresolved). Includes geometry-scope warnings for layout/position/sizing/transform attrs and a warning for nested D5 or legacy _ng duplicates. Zero references is not deletion approval; stored definitions are not computed styles. This is intentionally narrower than diviops_preset_audit and has no repair mode. Missing UUID returns not_found.",
|
|
2070
|
+
description: "Inspect one Divi 5 preset UUID without writing. Returns bucket/type/module/group coordinates, attrs/styleAttrs/renderAttrs, outgoing root groupPresets map (empty object when absent), storage path and provenance, block plus preset-chain reference counts with sample consumers, explicit partial coverage, and direct variable_references.ids to join with diviops_variable_list (absent IDs remain unresolved). Includes geometry-scope warnings for layout/position/sizing/transform attrs and a warning for nested D5 or legacy _ng duplicates. Zero references is not deletion approval; stored definitions are not computed styles. This is intentionally narrower than diviops_preset_audit and has no repair mode. Missing UUID returns not_found.",
|
|
2071
2071
|
inputSchema: {
|
|
2072
2072
|
preset_id: z.string().min(1).describe("Preset UUID to inspect."),
|
|
2073
2073
|
},
|
|
@@ -2221,11 +2221,33 @@ registerPluginTool("diviops_preset_cleanup", {
|
|
|
2221
2221
|
],
|
|
2222
2222
|
};
|
|
2223
2223
|
});
|
|
2224
|
+
// Vendor GlobalPresetController: root groupPresets is a native slot map, not attrs.
|
|
2225
|
+
const PRESET_COMPOSITION_FIELD = z.record(z.string().min(1), z.strictObject({
|
|
2226
|
+
presetId: z.array(z.string().min(1)).min(1),
|
|
2227
|
+
groupName: z.string().min(1),
|
|
2228
|
+
segmentBoundary: z.number().int().nonnegative().optional(),
|
|
2229
|
+
})).optional().describe("Module presets only. Native root groupPresets slot map: { 'title.decoration.font': { presetId: ['existing-id'], groupName: 'divi/font', segmentBoundary?: 0 } }. Existing IDs must belong to the slot's group bucket. Replaces the entire root map; omitted preserves, {} clears. Never put groupPresets in attrs. Requires preset_composition_v1.");
|
|
2230
|
+
const PRESET_COMPOSITION_DESC = " Optional group_presets replaces the native root groupPresets map on module presets only; omission preserves links and {} clears. Slot/group buckets and existing references are validated before writes, including dry-run. attrs.groupPresets is rejected; use group_presets instead. Requires preset_composition_v1; older or unverified plugins refuse composition before dispatch.";
|
|
2231
|
+
function presetCompositionErrorResult(tool, attrs, groupPresets, type) {
|
|
2232
|
+
if (attrs && Object.hasOwn(attrs, "groupPresets")) {
|
|
2233
|
+
return { content: [{ type: "text", text: serializeEnvelope({ ok: false, error: { code: "invalid_input", message: "attrs.groupPresets is misplaced; native module preset composition lives at the preset root.", hint: "Remove attrs.groupPresets and supply top-level group_presets on a module preset instead.", data: { path: "attrs.groupPresets" } } }, tool) }] };
|
|
2234
|
+
}
|
|
2235
|
+
if (groupPresets === undefined)
|
|
2236
|
+
return null;
|
|
2237
|
+
if (type === "group") {
|
|
2238
|
+
return { content: [{ type: "text", text: serializeEnvelope({ ok: false, error: { code: "invalid_input", message: "group_presets is supported on module presets only." } }, tool) }] };
|
|
2239
|
+
}
|
|
2240
|
+
if (handshakeState.kind !== "ok" || handshakeState.capabilities.preset_composition_v1 !== true) {
|
|
2241
|
+
return missingCapabilityEnvelope(new MissingCapabilityError("preset_composition_v1", handshakeState.kind === "ok" ? handshakeState.pluginVersion : undefined), tool, { serverVersion: SERVER_VERSION });
|
|
2242
|
+
}
|
|
2243
|
+
return null;
|
|
2244
|
+
}
|
|
2224
2245
|
registerPluginTool("diviops_preset_update", {
|
|
2225
2246
|
description: "Update a specific preset by ID. Can rename, replace its style attributes, and/or change its stack priority. Note: Divi serves frontend CSS from a per-post static cache at wp-content/et-cache/{post_id}/ that wp cache flush does NOT invalidate — if you're verifying a preset change on the rendered frontend, delete that dir for affected pages to force regeneration. Server-side preset state updates immediately; only the pre-rendered CSS file is stale. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing preset_id returns code 'not_found' with a hint to diviops_preset_audit." +
|
|
2226
|
-
DRY_RUN_DESC_SUFFIX,
|
|
2247
|
+
DRY_RUN_DESC_SUFFIX + PRESET_COMPOSITION_DESC,
|
|
2227
2248
|
inputSchema: {
|
|
2228
2249
|
preset_id: z.string().describe("Preset ID (UUID or short ID)"),
|
|
2250
|
+
group_presets: PRESET_COMPOSITION_FIELD,
|
|
2229
2251
|
name: z.string().optional().describe("New display name for the preset"),
|
|
2230
2252
|
attrs: z
|
|
2231
2253
|
.record(z.string(), z.any())
|
|
@@ -2240,7 +2262,10 @@ registerPluginTool("diviops_preset_update", {
|
|
|
2240
2262
|
},
|
|
2241
2263
|
annotations: { idempotentHint: false },
|
|
2242
2264
|
_meta: { idempotent: "conditional" },
|
|
2243
|
-
}, async ({ preset_id, name, attrs, priority, dry_run }) => {
|
|
2265
|
+
}, async ({ preset_id, name, attrs, group_presets, priority, dry_run }) => {
|
|
2266
|
+
const compositionGate = presetCompositionErrorResult("diviops_preset_update", attrs, group_presets);
|
|
2267
|
+
if (compositionGate)
|
|
2268
|
+
return compositionGate;
|
|
2244
2269
|
const isolationGate = writerIsolationErrorResult("diviops_preset_update", {
|
|
2245
2270
|
attrs,
|
|
2246
2271
|
});
|
|
@@ -2251,6 +2276,8 @@ registerPluginTool("diviops_preset_update", {
|
|
|
2251
2276
|
body.name = name;
|
|
2252
2277
|
if (attrs)
|
|
2253
2278
|
body.attrs = attrs;
|
|
2279
|
+
if (group_presets !== undefined)
|
|
2280
|
+
body.group_presets = group_presets;
|
|
2254
2281
|
if (typeof priority === "number")
|
|
2255
2282
|
body.priority = priority;
|
|
2256
2283
|
if (dry_run)
|
|
@@ -2307,9 +2334,10 @@ registerPluginTool("diviops_preset_delete", {
|
|
|
2307
2334
|
});
|
|
2308
2335
|
registerPluginTool("diviops_preset_create", {
|
|
2309
2336
|
description: 'Create a new preset in the Divi 5 registry. For module presets, supply module_name (e.g. "divi/column", "divi/button", "divi/section"), name, and attrs. For group (attribute-level) presets, set type="group" and supply group_name ("divi/font", "divi/button", etc.), group_id ("designTitleText", "button", etc.), and optionally primary_attr_name.' +
|
|
2310
|
-
DRY_RUN_DESC_SUFFIX +
|
|
2337
|
+
DRY_RUN_DESC_SUFFIX + PRESET_COMPOSITION_DESC +
|
|
2311
2338
|
" NOTE: dry_run plan does not pre-allocate the UUID — that's generated at apply time. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Per-bucket name uniqueness check: a name collision in the same `(bucket, bucket_key)` returns code 'conflict' (HTTP 409) with `error.data = { existing_preset_id, bucket, bucket_key, name }` so callers can branch on reuse / rename / preset_update. Bucket coordinates are the natural addressing scope: a 'Hero Title' font preset and a 'Hero Title' button preset coexist (different buckets), but two 'Hero Title' presets under `group/divi/font` collide. Input-shape rejections (missing module_name/name/attrs, type outside [module,group], group preset without group_name/group_id) return code 'invalid_input' with structured `error.data` documenting the failed field.",
|
|
2312
2339
|
inputSchema: {
|
|
2340
|
+
group_presets: PRESET_COMPOSITION_FIELD,
|
|
2313
2341
|
module_name: z
|
|
2314
2342
|
.string()
|
|
2315
2343
|
.describe('Divi module slug (e.g. "divi/column", "divi/button", "divi/section"). For group presets, this is still required and describes the module the preset originated from.'),
|
|
@@ -2347,7 +2375,10 @@ registerPluginTool("diviops_preset_create", {
|
|
|
2347
2375
|
},
|
|
2348
2376
|
annotations: { idempotentHint: false },
|
|
2349
2377
|
_meta: { idempotent: "conditional" },
|
|
2350
|
-
}, async ({ module_name, name, attrs, type, group_name, group_id, primary_attr_name, make_default, priority, dry_run }) => {
|
|
2378
|
+
}, async ({ module_name, name, attrs, group_presets, type, group_name, group_id, primary_attr_name, make_default, priority, dry_run }) => {
|
|
2379
|
+
const compositionGate = presetCompositionErrorResult("diviops_preset_create", attrs, group_presets, type);
|
|
2380
|
+
if (compositionGate)
|
|
2381
|
+
return compositionGate;
|
|
2351
2382
|
if (type === "group" && (!group_name || !group_id)) {
|
|
2352
2383
|
throw new Error('type="group" requires both group_name and group_id. Example: group_name="divi/font", group_id="designTitleText".');
|
|
2353
2384
|
}
|
|
@@ -2357,6 +2388,8 @@ registerPluginTool("diviops_preset_create", {
|
|
|
2357
2388
|
if (isolationGate)
|
|
2358
2389
|
return isolationGate;
|
|
2359
2390
|
const body = { module_name, name, attrs, type };
|
|
2391
|
+
if (group_presets !== undefined)
|
|
2392
|
+
body.group_presets = group_presets;
|
|
2360
2393
|
if (group_name)
|
|
2361
2394
|
body.group_name = group_name;
|
|
2362
2395
|
if (group_id)
|