@diviops/mcp-server 1.5.57 → 1.5.59

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 CHANGED
@@ -8,7 +8,37 @@ 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.57 candidate release note
11
+ ## 1.5.59 release note
12
+
13
+ Adds two default WP-CLI reads: `option pluck <option> <key-path>...` for a nested
14
+ option value, and `term meta get <term-id> <key>` for a term-meta field. Existing
15
+ write permissions are unchanged. Restart the MCP client connection after updating
16
+ to refresh the effective command list.
17
+
18
+ Public builder companion 1.4.11 corrects admin-label examples to use
19
+ `module.meta.adminLabel.desktop.value`. Updating npm does not update independently
20
+ installed skills or instructions already read by an agent. Free remains 1.5.30;
21
+ dependencies and compatibility floors are unchanged.
22
+
23
+ ## Previous 1.5.58 release note
24
+
25
+ With Free 1.5.30, module preset create/update accepts `group_presets` for native
26
+ root composition, and inspection exposes stored links. The supplied map replaces
27
+ the entire root map; omission preserves links and `{}` clears them. Slot/group
28
+ buckets and existing references are validated, including dry-run. Composition
29
+ requires `preset_composition_v1`; older or unverified plugins refuse it before
30
+ dispatch. Keep `groupPresets` out of `attrs`. Update both components and restart
31
+ the MCP client connection to refresh capabilities.
32
+
33
+ Public builder companion 1.4.10 and Free validation warnings ask for explicit
34
+ heading levels according to document hierarchy, without changing typography or
35
+ warning detection. Updating npm or WordPress does not update independently
36
+ installed skills or instructions already read by an agent.
37
+
38
+ Free 1.5.30, MCP 1.5.58 and public builder 1.4.10 were delivered together.
39
+ Dependencies and compatibility floors were unchanged.
40
+
41
+ ## Previous 1.5.57 candidate release note
12
42
 
13
43
  Forwards `diviops_module_update` request cancellation to HTTP dispatch and pending
14
44
  response-body reads. This does not establish the cause or resolution of the
@@ -397,6 +427,27 @@ When the gates are not satisfied, the tools simply don't appear on the MCP surfa
397
427
 
398
428
  See [server-reference.md](../docs/server-reference.md) for per-tool descriptions.
399
429
 
430
+ ## Native preset composition
431
+
432
+ `diviops_preset_create` and `diviops_preset_update` accept optional `group_presets`
433
+ for **module presets only**, stored as native root `groupPresets`, never in attrs:
434
+
435
+ ```json
436
+ {"group_presets":{"title.decoration.font":{"presetId":["existing-font-id"],"groupName":"divi/font"}}}
437
+ ```
438
+
439
+ Omit it to preserve existing links; `{}` replaces them with an empty map. Each
440
+ native slot binding requires a nonempty string-array `presetId` and `groupName`,
441
+ with optional nonnegative integer `segmentBoundary`. Slot/group compatibility
442
+ and target existence in that group bucket are checked before writing, also in
443
+ dry-run. No defaults or IDs are substituted. `attrs.groupPresets` rejects with
444
+ a corrective hint. New composition calls require `preset_composition_v1`;
445
+ older/unverified plugins refuse before dispatch, while omitted-link calls keep
446
+ their existing behavior. Reconnect after updating a supported plugin.
447
+ `diviops_preset_inspect` exposes the outgoing root map without resolving inherited
448
+ styles or broadening its partial consumer coverage. Preview writes nothing and
449
+ allocates no UUID; native Builder/rendering qualification remains separate.
450
+
400
451
  ## Bundled CLI — `diviops-preset`
401
452
 
402
453
  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)
@@ -3149,7 +3182,7 @@ registerPluginTool("diviops_canvas_delete", {
3149
3182
  });
3150
3183
  // ── WP-CLI ──────────────────────────────────────────────────────────
3151
3184
  registerLocalTool("diviops_meta_wp_cli", {
3152
- description: "Run a WP-CLI command on the WordPress site. Requires WP_PATH env var (LOCAL_SITE_ID auto-detected from Local by Flywheel), or WP_CLI_CMD for containerized wrappers. Commands validated against a safety allowlist. Default tier covers read ops across options/posts/post-types/taxonomies/users/info/core/db, non-destructive writes (post/term create+update, post meta read/write, cache/rewrite/transient flush, `plugin update` from authenticated sources), ACF/SCF schema ops (`acf export/import/field-group list/get` plus SCF 6.8.4+ `scf json {status,sync,import,export}` and the `acf json …` aliases), and WXR export. Extended tier (requires DIVIOPS_WP_CLI_ALLOW env var) adds destructive or bulk-modifying ops: option update, post/post meta/term delete, search-replace, import, plugin activate/deactivate, eval-file. Filesystem-touching commands (`wp export`, `acf export/import`, `scf|acf json export/import`) are additionally constrained: path arguments must resolve under a safe root (defaults to `<WP_PATH>/.diviops-tmp/`, overridable via DIVIOPS_WP_CLI_SAFE_FS_ROOT, disable via DIVIOPS_WP_CLI_UNSAFE_FS=1); `wp export` and `scf json export` require an explicit `--dir=<path>` (or `--stdout`). In WP_CLI_CMD wrapper mode, DIVIOPS_WP_CLI_SAFE_FS_ROOT is required for FS-sensitive commands. Prefer the typed `diviops_scf_*` wrappers for SCF round-trips — they're easier to invoke and accept the same safe-root scoping. Use --format=json for structured output. Full allowlist + tier rationale + filesystem semantics in the MCP server README. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Success payload: { stdout: string, stderr: string, exit_code: 0 }. Four failure modes converge on 'meta_wp_cli.command_failed' with error.data = { exit_code: number | null, stdout: string, stderr: string }: (a) numeric exit_code — wp-cli ran and exited non-zero; stdout/stderr are raw streams verbatim. (b) exit_code=null and message starts with 'wp-cli command terminated:' — execFile launched the child but it was killed (timeout or signal); stdout/stderr carry whatever streamed before the kill. (c) exit_code=null and message starts with 'wp-cli could not spawn:' — the OS refused to start the child (ENOENT/EACCES/EPERM); child never ran, stdout/stderr are empty. (d) exit_code=null and message is the rejection reason — pre-execution rejection by the allowlist / FS validator; rejection reason synthesized into error.data.stderr because the child never ran. A missing wp-cli configuration surfaces as 'meta_wp_cli.not_configured'. stdout is always passed through as a string (no server-side JSON parse) — pass --format=json and parse on the caller side when you want structured output.",
3185
+ description: "Run a WP-CLI command on the WordPress site. Requires WP_PATH env var (LOCAL_SITE_ID auto-detected from Local by Flywheel), or WP_CLI_CMD for containerized wrappers. Commands validated against a safety allowlist. Default tier covers read ops across options/posts/post-types/taxonomies/users/info/core/db (including targeted `option pluck` and `term meta get` reads), non-destructive writes (post/term create+update, post meta read/write, cache/rewrite/transient flush, `plugin update` from authenticated sources), ACF/SCF schema ops (`acf export/import/field-group list/get` plus SCF 6.8.4+ `scf json {status,sync,import,export}` and the `acf json …` aliases), and WXR export. Extended tier (requires DIVIOPS_WP_CLI_ALLOW env var) adds destructive or bulk-modifying ops: option update, post/post meta/term delete, search-replace, import, plugin activate/deactivate, eval-file. Filesystem-touching commands (`wp export`, `acf export/import`, `scf|acf json export/import`) are additionally constrained: path arguments must resolve under a safe root (defaults to `<WP_PATH>/.diviops-tmp/`, overridable via DIVIOPS_WP_CLI_SAFE_FS_ROOT, disable via DIVIOPS_WP_CLI_UNSAFE_FS=1); `wp export` and `scf json export` require an explicit `--dir=<path>` (or `--stdout`). In WP_CLI_CMD wrapper mode, DIVIOPS_WP_CLI_SAFE_FS_ROOT is required for FS-sensitive commands. Prefer the typed `diviops_scf_*` wrappers for SCF round-trips — they're easier to invoke and accept the same safe-root scoping. Use --format=json for structured output. Full allowlist + tier rationale + filesystem semantics in the MCP server README. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Success payload: { stdout: string, stderr: string, exit_code: 0 }. Four failure modes converge on 'meta_wp_cli.command_failed' with error.data = { exit_code: number | null, stdout: string, stderr: string }: (a) numeric exit_code — wp-cli ran and exited non-zero; stdout/stderr are raw streams verbatim. (b) exit_code=null and message starts with 'wp-cli command terminated:' — execFile launched the child but it was killed (timeout or signal); stdout/stderr carry whatever streamed before the kill. (c) exit_code=null and message starts with 'wp-cli could not spawn:' — the OS refused to start the child (ENOENT/EACCES/EPERM); child never ran, stdout/stderr are empty. (d) exit_code=null and message is the rejection reason — pre-execution rejection by the allowlist / FS validator; rejection reason synthesized into error.data.stderr because the child never ran. A missing wp-cli configuration surfaces as 'meta_wp_cli.not_configured'. stdout is always passed through as a string (no server-side JSON parse) — pass --format=json and parse on the caller side when you want structured output.",
3153
3186
  inputSchema: {
3154
3187
  command: z
3155
3188
  .string()
package/dist/wp-cli.js CHANGED
@@ -17,6 +17,7 @@ import { resolveSafeFsRoot, fsValidationDisabled, ensureSafeFsRoot, matchFsSensi
17
17
  const DEFAULT_COMMANDS = [
18
18
  // Options (read-only)
19
19
  'option get',
20
+ 'option pluck',
20
21
  'option list',
21
22
  // Posts (read + create/update)
22
23
  'post list',
@@ -36,6 +37,7 @@ const DEFAULT_COMMANDS = [
36
37
  // Taxonomies (read + non-destructive write)
37
38
  'taxonomy list',
38
39
  'term list',
40
+ 'term meta get',
39
41
  'term create',
40
42
  'term update',
41
43
  // ACF / SCF (schema ops — idempotent dev-time workflow)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.57",
3
+ "version": "1.5.59",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",