@diviops/mcp-server 1.5.76 → 1.5.78

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.
Files changed (3) hide show
  1. package/README.md +12 -2
  2. package/dist/index.js +30 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,17 @@ 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
- ## MCP 1.5.76 source candidate
11
+ ## MCP 1.5.78 release note
12
+
13
+ Pair with DiviOps Agent 1.5.52 for guarded canvas content replacement. Read the canvas post ID with `diviops_page_get` and reuse its `content_checksum` as `expected_checksum` on dry run and apply. The guard requires Agent support. A concurrent write can still occur after comparison.
14
+
15
+ Icon lookup searches bundled Divi and Font Awesome icons. For a Theme Builder edit, inspect the published templates that reference the layout ID and reuse the reviewed layout checksum on apply.
16
+
17
+ ## MCP 1.5.77 historical release note
18
+
19
+ Use `diviops_component_slot_preview` with DiviOps Agent 1.5.51 on Divi 5.19.1 to inspect a saved component Slot. Supply the page ID, shared definition ID, Slot ID and, when needed, the one-based instance index. The result identifies the owners of the shell and its ordered immediate children and includes checksums for both saved records. Reconnect the MCP client after updating to refresh its tool list.
20
+
21
+ ## MCP 1.5.76 historical release note
12
22
 
13
23
  Adds optional `expected_checksum` to module and Theme Builder layout updates.
14
24
  Pair with Free Agent **1.5.50** and reconnect to refresh capability evidence.
@@ -549,7 +559,7 @@ The skill enforces the Divi block format, the design system, and the response co
549
559
 
550
560
  ## Tools at a glance
551
561
 
552
- The server exposes **101 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
562
+ The server exposes **102 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
553
563
 
554
564
  | Category | Use case | Tool prefixes |
555
565
  |----------|----------|---------------|
package/dist/index.js CHANGED
@@ -1245,7 +1245,7 @@ registerPluginTool("diviops_global_font_delete", {
1245
1245
  return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_global_font_delete") }] };
1246
1246
  });
1247
1247
  registerPluginTool("diviops_meta_find_icon", {
1248
- description: "Search for icons by keyword. Returns matching icons with unicode, type (fa/divi), and weight. Use the returned unicode/type/weight in Blurb icon or Icon module attributes. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
1248
+ description: "Search bundled Divi and Font Awesome icons by keyword. Uploaded icons and private collections are excluded. Returns matching icons with unicode, type (fa/divi), and weight. Use the returned unicode/type/weight in Blurb icon or Icon module attributes. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
1249
1249
  inputSchema: {
1250
1250
  query: z
1251
1251
  .string()
@@ -1422,6 +1422,23 @@ registerPluginTool("diviops_custom_css_restore", {
1422
1422
  const result = await wp.requestEnveloped("/custom-css/restore", { method: "POST", body: { snapshot_id, expected_checksum, dry_run: dry_run ?? true }, signal: context?.signal });
1423
1423
  return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_custom_css_restore") }] };
1424
1424
  });
1425
+ registerPluginTool("diviops_component_slot_preview", {
1426
+ description: "Inspect one saved Divi component Slot. Returns its shell and child sources, ordered child modules, and checksums for the page and Divi Library definition. Provide the exact slotId and select an instance_index when the page references the definition more than once.",
1427
+ inputSchema: {
1428
+ page_id: z.number().int().positive(),
1429
+ definition_id: z.number().int().positive(),
1430
+ slot_id: z.string().min(1),
1431
+ instance_index: z.number().int().positive().optional().describe("One-based occurrence of this definition on the page, in document order."),
1432
+ },
1433
+ annotations: { readOnlyHint: true, idempotentHint: true },
1434
+ _meta: { idempotent: "true" },
1435
+ }, async ({ page_id, definition_id, slot_id, instance_index }, context) => {
1436
+ const params = { definition_id: String(definition_id), slot_id };
1437
+ if (instance_index !== undefined)
1438
+ params.instance_index = String(instance_index);
1439
+ const result = await wp.requestEnveloped(`/component/slot-preview/${page_id}`, { params, signal: context?.signal });
1440
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_component_slot_preview") }] };
1441
+ });
1425
1442
  registerPluginTool("diviops_page_settings_get", {
1426
1443
  description: "Read ordinary WordPress page background settings: stored values/presence, native defaults and a settings_checksum. These are not computed browser colors. Requires edit permission. No Theme Builder layout or global Theme Options access.",
1427
1444
  inputSchema: { page_id: z.number().int().positive() },
@@ -2867,7 +2884,7 @@ registerPluginTool("diviops_tb_layout_update", {
2867
2884
  DRY_RUN_DESC_SUFFIX,
2868
2885
  inputSchema: {
2869
2886
  layout_id: z.number().describe("Layout post ID to update"),
2870
- expected_checksum: z.string().length(71).regex(/^sha256:[a-f0-9]{64}$/).optional().describe("Optional exact owning post_content checksum from diviops_page_get with the layout ID. Checked on preview/apply; drift is refused. Optimistic comparison, not an atomic lock. Omit for legacy writes."),
2887
+ expected_checksum: z.string().length(71).regex(/^sha256:[a-f0-9]{64}$/).optional().describe("Optional guard for the layout post_content. Page through diviops_tb_template_list to see which published templates reference the target header, body or footer layout ID. Read that ID with diviops_page_get and pass its reviewed content_checksum as expected_checksum on both dry run and apply. Drift is refused. The check covers layout content only and does not lock the record."),
2871
2888
  content: z.string().describe("New block markup content"),
2872
2889
  dry_run: DRY_RUN_FIELD,
2873
2890
  backup: BACKUP_FIELD,
@@ -3193,6 +3210,7 @@ registerPluginTool("diviops_canvas_update", {
3193
3210
  .string()
3194
3211
  .optional()
3195
3212
  .describe("New block markup (replaces entire content)"),
3213
+ expected_checksum: z.string().length(71).regex(/^sha256:[a-f0-9]{64}$/).optional().describe("For content replacement, read the canvas post ID with diviops_page_get and reuse its content_checksum on dry run and apply. Checks saved content bytes only. Concurrent writes after the comparison are possible."),
3196
3214
  title: z.string().optional().describe("New canvas title"),
3197
3215
  append_to_main: z
3198
3216
  .enum(["above", "below", ""])
@@ -3203,13 +3221,20 @@ registerPluginTool("diviops_canvas_update", {
3203
3221
  },
3204
3222
  annotations: { idempotentHint: false },
3205
3223
  _meta: { idempotent: "conditional" },
3206
- }, async ({ canvas_post_id, content, title, append_to_main, z_index, dry_run }) => {
3224
+ }, async ({ canvas_post_id, content, title, append_to_main, z_index, dry_run, expected_checksum }) => {
3225
+ const capability = "canvas_update_expected_checksum";
3226
+ if (expected_checksum !== undefined && (handshakeState.kind !== "ok" || handshakeState.capabilities[capability] !== true)) {
3227
+ const version = handshakeState.kind === "ok" ? handshakeState.pluginVersion : undefined;
3228
+ return missingCapabilityEnvelope(new MissingCapabilityError(capability, version), "diviops_canvas_update", { serverVersion: SERVER_VERSION });
3229
+ }
3207
3230
  const isolationGate = writerIsolationErrorResult("diviops_canvas_update", {
3208
3231
  content,
3209
3232
  });
3210
3233
  if (isolationGate)
3211
3234
  return isolationGate;
3212
3235
  const body = {};
3236
+ if (expected_checksum !== undefined)
3237
+ body.expected_checksum = expected_checksum;
3213
3238
  if (content !== undefined)
3214
3239
  body.content = content;
3215
3240
  if (title !== undefined)
@@ -3220,7 +3245,8 @@ registerPluginTool("diviops_canvas_update", {
3220
3245
  body.z_index = z_index;
3221
3246
  if (dry_run)
3222
3247
  body.dry_run = true;
3223
- const result = await authoringWrite(`/canvas/update/${canvas_post_id}`, "POST", body, "canvas_update", dry_run === true);
3248
+ const route = expected_checksum === undefined ? "update" : "update-reviewed";
3249
+ const result = await authoringWrite(`/canvas/${route}/${canvas_post_id}`, "POST", body, "canvas_update", dry_run === true);
3224
3250
  return {
3225
3251
  content: [
3226
3252
  { type: "text", text: serializeEnvelope(result, "diviops_canvas_update") },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.76",
3
+ "version": "1.5.78",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",