@diviops/mcp-server 1.5.59 → 1.5.61

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,31 @@ 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.59 release note
11
+ ## 1.5.61 release note
12
+
13
+ With Free Agent 1.5.31, Theme Builder template trash and permanent deletion
14
+ preserve layouts referenced by another template. Preview excludes them from
15
+ destructive changes, and both preview and apply report `preserved_layouts`.
16
+ Failed reference checks stop before changes. Unshared cleanup is unchanged.
17
+
18
+ Update the Free plugin to receive the protection; this MCP update supplies
19
+ matching tool guidance. Public builder remains 1.4.11. Dependencies and
20
+ compatibility floors are unchanged.
21
+
22
+ ## Previous 1.5.60 release note
23
+
24
+ When WP-CLI is configured, `diviops_meta_info` now includes `wp_cli.ignored`:
25
+ the unique, trimmed entries from `DIVIOPS_WP_CLI_ALLOW` that were not recognized
26
+ at startup. Clients can inspect these alongside `allowed` and `extendable`
27
+ even when startup warnings are hidden. Command permissions and matching are
28
+ unchanged. Restart the MCP server after changing the environment configuration.
29
+
30
+ The MCP SDK dependency now requires v1.31.0 or later within v1, incorporating
31
+ its OAuth client credential-routing fix. This package uses the SDK server/stdio
32
+ path. Free remains 1.5.30, public builder remains 1.4.11, and compatibility floors
33
+ are unchanged.
34
+
35
+ ## Previous 1.5.59 release note
12
36
 
13
37
  Adds two default WP-CLI reads: `option pluck <option> <key-path>...` for a nested
14
38
  option value, and `term meta get <term-id> <key>` for a term-meta field. Existing
package/dist/index.js CHANGED
@@ -2896,7 +2896,7 @@ registerPluginTool("diviops_tb_template_create", {
2896
2896
  };
2897
2897
  });
2898
2898
  registerPluginTool("diviops_tb_template_trash", {
2899
- description: "Trash (or permanently delete) a Theme Builder template AND its linked header/body/footer layouts AND scrub the `_et_template` meta refs on the Theme Builder master post. Closes the orphan-meta gap left by `diviops_page_trash` / wp-cli `post delete` on linked layouts: the typed wrapper does the cleanup atomically. Defaults to trash (reversible via WP Admin → Trash). Pass `force=true` to permanently delete (wp_delete_post — irreversible, one-shot: a repeat call after a successful force-delete returns 'not_found' because the template post is gone from the DB). Idempotency applies to the default trash mode only: a repeat call after a successful trash-mode cleanup returns ok:true with `data.already_trashed = true` (mirrors `diviops_page_trash`). If a prior trash-mode call partially succeeded (some layouts already trashed, master meta still carries refs), the next call detects already-trashed targets via pre-state checks, skips the no-op WP destructor calls (which would otherwise return false), and still runs the meta scrub — `data.linked_layouts[].skipped` and `data.template_skipped` flag the targets that were already at the end-state. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing template_id returns 'not_found' (HTTP 404), delete-permission failures return 'forbidden' (HTTP 403); per-step trash/delete/meta-scrub failures return the namespaced 'tb_template.command_failed' (HTTP 500) with `error.data.failed_step` ∈ { 'layout_destroy', 'template_destroy', 'meta_scrub' } plus `template_id` and `force`." +
2899
+ description: "Trash (or permanently delete) a Theme Builder template AND its unshared linked header/body/footer layouts AND scrub the `_et_template` meta refs on the Theme Builder master post. Closes the orphan-meta gap left by `diviops_page_trash` / wp-cli `post delete` on linked layouts: the typed wrapper performs ordered cleanup. Layouts referenced by another template (including disabled, trashed, library or orphan templates) are preserved in both modes and reported in data.preserved_layouts; previews exclude them from destructive changes. A failed reference check aborts before mutations. Defaults to trash (reversible via WP Admin → Trash). Pass `force=true` to permanently delete (wp_delete_post — irreversible, one-shot: a repeat call after a successful force-delete returns 'not_found' because the template post is gone from the DB). Idempotency applies to the default trash mode only: a repeat call after a successful trash-mode cleanup returns ok:true with `data.already_trashed = true` (mirrors `diviops_page_trash`). If a prior trash-mode call partially succeeded (some layouts already trashed, master meta still carries refs), the next call detects already-trashed targets via pre-state checks, skips the no-op WP destructor calls (which would otherwise return false), and still runs the meta scrub — `data.linked_layouts[].skipped` and `data.template_skipped` flag the targets that were already at the end-state. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing template_id returns 'not_found' (HTTP 404), delete-permission failures return 'forbidden' (HTTP 403); per-step trash/delete/meta-scrub failures return the namespaced 'tb_template.command_failed' (HTTP 500) with `error.data.failed_step` ∈ { 'layout_references', 'layout_destroy', 'template_destroy', 'meta_scrub' } plus `template_id` and `force`." +
2900
2900
  DRY_RUN_DESC_SUFFIX,
2901
2901
  inputSchema: {
2902
2902
  template_id: z
package/dist/wp-cli.d.ts CHANGED
@@ -68,10 +68,11 @@ export declare function createWpCli(config: WpCliConfig): {
68
68
  exitCode: number | null;
69
69
  failureKind?: "rejected" | "spawn_failed" | "killed" | "exited";
70
70
  }>;
71
- /** Return the list of allowed commands and available extensions. */
71
+ /** Return startup permissions and ignored opt-ins for meta_info diagnostics. */
72
72
  getAllowedCommands(): {
73
73
  allowed: string[];
74
74
  extendable: string[];
75
+ ignored: string[];
75
76
  };
76
77
  };
77
78
  export {};
package/dist/wp-cli.js CHANGED
@@ -127,28 +127,31 @@ const EXTENDED_COMMANDS = [
127
127
  function buildAllowlist() {
128
128
  const extra = process.env.DIVIOPS_WP_CLI_ALLOW?.trim();
129
129
  if (!extra)
130
- return DEFAULT_COMMANDS;
130
+ return { allowed: DEFAULT_COMMANDS, ignored: [] };
131
131
  // Wildcard sentinel — convenience for trusted local-dev environments. Grants
132
132
  // every entry in EXTENDED_COMMANDS but does NOT unlock anything beyond it
133
133
  // (notably: `db query` stays out — see #361 Chunk B). Always emits a startup
134
134
  // warning so the broad grant is never silent.
135
135
  if (extra === '*' || extra === 'all') {
136
136
  console.warn(`[diviops] DIVIOPS_WP_CLI_ALLOW="${extra}" — granting ALL ${EXTENDED_COMMANDS.length} extended commands. Intended for trusted local-dev only.`);
137
- return [...DEFAULT_COMMANDS, ...EXTENDED_COMMANDS];
137
+ return { allowed: [...DEFAULT_COMMANDS, ...EXTENDED_COMMANDS], ignored: [] };
138
138
  }
139
139
  const requested = extra.split(',').map((s) => s.trim()).filter(Boolean);
140
140
  const granted = new Set(DEFAULT_COMMANDS);
141
+ const ignored = new Set();
141
142
  for (const cmd of requested) {
142
143
  if (EXTENDED_COMMANDS.includes(cmd)) {
143
144
  granted.add(cmd);
144
145
  }
145
146
  else if (!granted.has(cmd)) {
147
+ ignored.add(cmd);
146
148
  console.warn(`[diviops] Ignoring unknown WP-CLI allow entry: "${cmd}"`);
147
149
  }
148
150
  }
149
- return [...granted];
151
+ return { allowed: [...granted], ignored: [...ignored] };
150
152
  }
151
- const ALLOWED_COMMANDS = buildAllowlist();
153
+ // Diagnostics and permissions describe the same startup configuration.
154
+ const { allowed: ALLOWED_COMMANDS, ignored: IGNORED_COMMANDS } = buildAllowlist();
152
155
  /**
153
156
  * Validate a parsed command against the allowlist.
154
157
  * Checks the first 1-3 args against allowed command prefixes (supports
@@ -591,10 +594,11 @@ export function createWpCli(config) {
591
594
  async runArgs(args) {
592
595
  return runArgv(args);
593
596
  },
594
- /** Return the list of allowed commands and available extensions. */
597
+ /** Return startup permissions and ignored opt-ins for meta_info diagnostics. */
595
598
  getAllowedCommands() {
596
599
  return {
597
600
  allowed: [...ALLOWED_COMMANDS],
601
+ ignored: [...IGNORED_COMMANDS],
598
602
  extendable: EXTENDED_COMMANDS.filter((c) => !ALLOWED_COMMANDS.includes(c)),
599
603
  };
600
604
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.59",
3
+ "version": "1.5.61",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@hono/node-server": "2.1.0",
64
- "@modelcontextprotocol/sdk": "^1.30.0",
64
+ "@modelcontextprotocol/sdk": "^1.31.0",
65
65
  "body-parser": "2.3.0",
66
66
  "fast-uri": "3.1.8",
67
67
  "hono": "4.13.7",