@diviops/mcp-server 1.5.75 → 1.5.77

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 +15 -1
  2. package/dist/index.js +31 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,21 @@ 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.75 source candidate
11
+ ## MCP 1.5.77 release note
12
+
13
+ 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.
14
+
15
+ ## MCP 1.5.76 historical release note
16
+
17
+ Adds optional `expected_checksum` to module and Theme Builder layout updates.
18
+ Pair with Free Agent **1.5.50** and reconnect to refresh capability evidence.
19
+ MCP refuses guarded requests before dispatch when the required Agent capability
20
+ is absent. Omitting the checksum retains the legacy contract. This is optimistic compare-before-write, not an
21
+ atomic lock. A concurrent edit after the final comparison can still race.
22
+ Existing permissions, validation, backup, recovery and client qualification
23
+ limits remain unchanged. Publication and installation are separate steps.
24
+
25
+ ## MCP 1.5.75 historical release note
12
26
 
13
27
  Adds explicit tool hints for seven existing onboarding tools. Block validation,
14
28
  page and layout reads, variable listing and preset auditing are marked read-only.
package/dist/index.js CHANGED
@@ -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() },
@@ -1773,6 +1790,7 @@ registerPluginTool("diviops_module_update", {
1773
1790
  DRY_RUN_DESC_SUFFIX,
1774
1791
  inputSchema: {
1775
1792
  page_id: z.number().describe("WordPress post/page ID"),
1793
+ expected_checksum: z.string().length(71).regex(/^sha256:[a-f0-9]{64}$/).optional().describe("Optional exact owning post_content checksum from diviops_page_get. Checked on preview/apply; drift is refused. Optimistic comparison, not an atomic lock. Omit for legacy writes."),
1776
1794
  label: z
1777
1795
  .string()
1778
1796
  .optional()
@@ -1801,7 +1819,10 @@ registerPluginTool("diviops_module_update", {
1801
1819
  annotations: { idempotentHint: false },
1802
1820
  _meta: { idempotent: "conditional" },
1803
1821
  }, async (args, context) => {
1804
- const { page_id, label, match_text, auto_index, occurrence, attrs, dry_run, backup } = args;
1822
+ const { page_id, label, match_text, auto_index, occurrence, attrs, dry_run, backup, expected_checksum } = args;
1823
+ const checksumGate = conditionalCapabilityError("diviops_module_update", "module_update_expected_checksum", expected_checksum !== undefined, "Update the Agent to support guarded writes; do not drop expected_checksum to bypass this refusal.");
1824
+ if (checksumGate)
1825
+ return checksumGate;
1805
1826
  const backupGate = backupCapabilityError("diviops_module_update", backup);
1806
1827
  if (backupGate)
1807
1828
  return backupGate;
@@ -1811,6 +1832,8 @@ registerPluginTool("diviops_module_update", {
1811
1832
  if (isolationGate)
1812
1833
  return isolationGate;
1813
1834
  const body = { attrs };
1835
+ if (expected_checksum !== undefined)
1836
+ body.expected_checksum = expected_checksum;
1814
1837
  if (auto_index)
1815
1838
  body.auto_index = auto_index;
1816
1839
  if (label)
@@ -2861,13 +2884,17 @@ registerPluginTool("diviops_tb_layout_update", {
2861
2884
  DRY_RUN_DESC_SUFFIX,
2862
2885
  inputSchema: {
2863
2886
  layout_id: z.number().describe("Layout post ID to update"),
2887
+ 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."),
2864
2888
  content: z.string().describe("New block markup content"),
2865
2889
  dry_run: DRY_RUN_FIELD,
2866
2890
  backup: BACKUP_FIELD,
2867
2891
  },
2868
2892
  annotations: { idempotentHint: false },
2869
2893
  _meta: { idempotent: "conditional" },
2870
- }, async ({ layout_id, content, dry_run, backup }) => {
2894
+ }, async ({ layout_id, content, dry_run, backup, expected_checksum }) => {
2895
+ const checksumGate = conditionalCapabilityError("diviops_tb_layout_update", "tb_layout_update_expected_checksum", expected_checksum !== undefined, "Update the Agent to support guarded writes; do not drop expected_checksum to bypass this refusal.");
2896
+ if (checksumGate)
2897
+ return checksumGate;
2871
2898
  const backupGate = backupCapabilityError("diviops_tb_layout_update", backup);
2872
2899
  if (backupGate)
2873
2900
  return backupGate;
@@ -2875,6 +2902,8 @@ registerPluginTool("diviops_tb_layout_update", {
2875
2902
  if (isolationGate)
2876
2903
  return isolationGate;
2877
2904
  const body = { content };
2905
+ if (expected_checksum !== undefined)
2906
+ body.expected_checksum = expected_checksum;
2878
2907
  if (dry_run)
2879
2908
  body.dry_run = true;
2880
2909
  if (backup)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.75",
3
+ "version": "1.5.77",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",