@diviops/mcp-server 1.5.62 → 1.5.64

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,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.62 release note
11
+ ## 1.5.64 release note
12
+
13
+ Adds `diviops_page_settings_get` and `diviops_page_settings_update` with Free
14
+ Agent 1.5.37. Read and update page-wide Content Area and Section backgrounds on ordinary Divi pages. Supports previews, literal colors, transparency and clearing to native defaults, with checksum checks and preservation of unrelated page data. Explicit per-section backgrounds remain intact.
15
+
16
+ Verified on WordPress 7.1, PHP 8.3 and Divi 5.13.1, including native settings
17
+ save/reopen and frontend rendering. Public builder and compatibility floors are unchanged.
18
+
19
+ ## Previous 1.5.63 release note
20
+
21
+ With Free Agent 1.5.36, runtime schema discovery accepts registered third-party
22
+ Divi modules and routes their namespaced identifiers without dropping the
23
+ namespace. The Free plugin also supports their module read/update/move and
24
+ Theme Builder block insertion. Native short identifiers remain supported;
25
+ unrelated WordPress blocks are refused and the native schema dump is unchanged.
26
+
27
+ Update both components for the complete correction. Native checks covered
28
+ FluentCart Store Logo, not every extension or version. Public builder remains
29
+ 1.4.11. Dependencies and compatibility floors are unchanged.
30
+
31
+ ## Previous 1.5.62 release note
12
32
 
13
33
  With Free Agent 1.5.34, empty header/footer inputs on template creation link the
14
34
  active enabled default's existing layouts and preserve region enabled states.
@@ -412,7 +432,7 @@ The skill enforces the Divi block format, the design system, and the response co
412
432
 
413
433
  ## Tools at a glance
414
434
 
415
- The server exposes **95 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).
435
+ The server exposes **97 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).
416
436
 
417
437
  | Category | Use case | Tool prefixes |
418
438
  |----------|----------|---------------|
package/dist/index.js CHANGED
@@ -827,7 +827,7 @@ registerPluginTool("diviops_menu_location_assign", {
827
827
  };
828
828
  });
829
829
  registerPluginTool("diviops_schema_list_modules", {
830
- description: "List all available Divi modules (block types) with their names, titles, and categories. Use this to discover what modules can be used in layouts. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
830
+ description: "List registered native Divi and Divi-registered custom modules (block types) with their names, titles, and categories. Use this to discover what modules can be used in layouts. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
831
831
  annotations: { idempotentHint: true },
832
832
  _meta: { idempotent: "true" },
833
833
  }, async () => {
@@ -839,17 +839,17 @@ registerPluginTool("diviops_schema_list_modules", {
839
839
  };
840
840
  });
841
841
  registerPluginTool("diviops_schema_get_module", {
842
- description: "Get the attribute schema for a Divi module. Default mode 'single' returns one module's schema (optimized, ~70% smaller; pass raw: true for full). Mode 'dump_all' snapshots every Divi module in one call and includes a `schema_version` hash over the canonical *PresetAttrsMap.php files — build-time entry point for the skill regen pipeline; ignores `module_name` and `raw`. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
842
+ description: "Get the registered attribute schema for a native or Divi-registered custom module. Extension registration does not guarantee complete metadata or native rendering compatibility. Default mode 'single' returns one module's schema (optimized, ~70% smaller; pass raw: true for full). Mode 'dump_all' snapshots native Divi modules only in one call and includes a `schema_version` hash over the canonical *PresetAttrsMap.php files — build-time entry point for the skill regen pipeline; ignores `module_name` and `raw`. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.",
843
843
  inputSchema: {
844
844
  mode: z
845
845
  .enum(["single", "dump_all"])
846
846
  .optional()
847
847
  .default("single")
848
- .describe("'single' (default): return one module's schema. 'dump_all': return every module keyed by name plus schema_version + divi_version."),
848
+ .describe("'single' (default): return one module's schema. 'dump_all': return native Divi modules keyed by name plus schema_version + divi_version."),
849
849
  module_name: z
850
850
  .string()
851
851
  .optional()
852
- .describe('Module name, e.g. "text", "image", "accordion", or full "divi/text". Required when mode="single"; ignored when mode="dump_all".'),
852
+ .describe('Module name, e.g. "text", "image", "accordion", full "divi/text", or a registered extension such as "difl/faq". Required when mode="single"; ignored when mode="dump_all".'),
853
853
  raw: z
854
854
  .boolean()
855
855
  .optional()
@@ -877,19 +877,20 @@ registerPluginTool("diviops_schema_get_module", {
877
877
  content: [{ type: "text", text: serializeEnvelope(result, "diviops_schema_get_module") }],
878
878
  };
879
879
  }
880
- if (!module_name) {
880
+ const route = module_name ? schemaModuleRoute(module_name) : null;
881
+ if (!route) {
881
882
  const failure = {
882
883
  ok: false,
883
884
  error: {
884
885
  code: ErrorCodes.INVALID_INPUT,
885
- message: "module_name is required when mode='single'",
886
+ message: "mode='single' requires a module slug or namespace/module name; dump-all is reserved for mode='dump_all'",
886
887
  },
887
888
  };
888
889
  return {
889
890
  content: [{ type: "text", text: serializeEnvelope(failure, "diviops_schema_get_module") }],
890
891
  };
891
892
  }
892
- const result = await wp.requestEnveloped(schemaModuleRoute(module_name));
893
+ const result = await wp.requestEnveloped(route);
893
894
  const projected = envelopeMap(result, (data) => raw ? data : optimizeSchema(data));
894
895
  return {
895
896
  content: [
@@ -1362,6 +1363,32 @@ registerPluginTool("diviops_page_update_content", {
1362
1363
  pageContentCandidates.cancel(reservation.data.content_ref);
1363
1364
  }
1364
1365
  });
1366
+ registerPluginTool("diviops_page_settings_get", {
1367
+ 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.",
1368
+ inputSchema: { page_id: z.number().int().positive() },
1369
+ annotations: { readOnlyHint: true },
1370
+ _meta: { idempotent: "true" },
1371
+ }, async ({ page_id }) => {
1372
+ const result = await wp.requestEnveloped(`/page/settings/${page_id}`);
1373
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_page_settings_get") }] };
1374
+ });
1375
+ registerPluginTool("diviops_page_settings_update", {
1376
+ description: "Set/clear Content Area and Section backgrounds on ordinary WordPress pages. Read settings first and pass settings_checksum as expected_checksum. Omission preserves; null deletes the override; empty strings are rejected. Colors: #RGB/#RRGGBB, bounded rgb()/rgba(), or transparent. Existing dynamic values are preserved when omitted but new dynamic values are unsupported. Explicit defaults may be normalized away by native Divi save. Refuses native background drafts. Applies post-scoped CSS/dynamic-assets cache refresh, without canvas-reference cleanup; no-op does not flush. If cache_refresh_failed reports settings_applied, read state and retry cache flush, not the write. Optimistic checksum is not an editor lock." + DRY_RUN_DESC_SUFFIX,
1377
+ inputSchema: {
1378
+ page_id: z.number().int().positive(),
1379
+ expected_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
1380
+ settings: z.object({ content_area_background: z.string().nullable().optional(), section_background: z.string().nullable().optional() }).strict().refine(value => Object.keys(value).length > 0, "Provide at least one background field"),
1381
+ dry_run: DRY_RUN_FIELD,
1382
+ },
1383
+ annotations: { idempotentHint: false },
1384
+ _meta: { idempotent: "false" },
1385
+ }, async ({ page_id, expected_checksum, settings, dry_run }) => {
1386
+ const result = await wp.requestEnveloped(`/page/settings/${page_id}`, {
1387
+ method: "POST",
1388
+ body: { expected_checksum, settings, dry_run: dry_run ?? false },
1389
+ });
1390
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_page_settings_update") }] };
1391
+ });
1365
1392
  registerPluginTool("diviops_page_update_meta", {
1366
1393
  description: "Update page/post metadata fields without touching post_content. Supports title, slug, parent, and menu_order; use diviops_page_update_status for status changes. Slug input must already be in sanitized WordPress post_name form. When a published post's slug changes, preserve_old_slug defaults to true and records the previous slug in _wp_old_slug so WordPress old-slug redirects can work. Returns readback fields after apply. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing page_id or invalid parent returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403), invalid/empty slug or malformed field values return 'invalid_input' with `error.data` documenting the field and sanitized slug where relevant." +
1367
1394
  DRY_RUN_DESC_SUFFIX,
@@ -2801,7 +2828,7 @@ registerPluginTool("diviops_tb_layout_update", {
2801
2828
  };
2802
2829
  });
2803
2830
  registerPluginTool("diviops_tb_layout_block_insert", {
2804
- description: "Insert one or more serialized Divi blocks into an existing Theme Builder layout without replacing the whole layout. Target a unique parent with `parent_selector` (for example `divi/group[adminLabel=\"Legal Col\"]`, or `divi/group` only when it is unique) or an explicit zero-based `parent_path` from the parsed block tree such as `0.1.2`. `position=append|prepend` inserts as children of the target block; `position=before|after` inserts beside the target within its parent. Ambiguous selectors return ok:false with code 'invalid_input'; missing targets return 'not_found'. The route parses and validates the inserted blocks, rejects malformed serialization (literal pseudo-escapes such as bare `u003c` are allowed in native Code content strings), validates the final serialized layout before saving, and returns a no-op when the exact requested block sequence already exists at the insertion point." +
2831
+ description: "Insert one or more serialized Divi blocks into an existing Theme Builder layout without replacing the whole layout. Target a unique parent with `parent_selector` (for example `divi/group[adminLabel=\"Legal Col\"]`, or `divi/group` only when it is unique) or an explicit zero-based `parent_path` from the parsed block tree such as `0.1.2`. `position=append|prepend` inserts as children of the target block; `position=before|after` inserts beside the target within its parent. Ambiguous selectors return ok:false with code 'invalid_input'; missing targets return 'not_found'. Inserted named blocks and the target must be native Divi modules or custom modules registered through Divi; unrelated stored siblings are preserved. This registration check does not validate extension-specific attribute schemas or child-container rules. The route parses and validates the inserted blocks, rejects malformed serialization (literal pseudo-escapes such as bare `u003c` are allowed in native Code content strings), validates the final serialized layout before saving, and returns a no-op when the exact requested block sequence already exists at the insertion point." +
2805
2832
  DRY_RUN_DESC_SUFFIX,
2806
2833
  inputSchema: {
2807
2834
  layout_id: z.number().int().describe("Theme Builder layout post ID to mutate"),
@@ -1,2 +1,2 @@
1
1
  export declare function normalizeSchemaModuleName(moduleName: string): string;
2
- export declare function schemaModuleRoute(moduleName: string): string;
2
+ export declare function schemaModuleRoute(moduleName: string): string | null;
@@ -3,5 +3,12 @@ export function normalizeSchemaModuleName(moduleName) {
3
3
  return trimmed.startsWith("divi/") ? trimmed.slice("divi/".length) : trimmed;
4
4
  }
5
5
  export function schemaModuleRoute(moduleName) {
6
- return `/schema/module/${encodeURIComponent(normalizeSchemaModuleName(moduleName))}`;
6
+ const name = moduleName.trim();
7
+ if (!/^[a-zA-Z0-9_-]+(?:\/[a-zA-Z0-9_-]+)?$/.test(name))
8
+ return null;
9
+ const normalized = normalizeSchemaModuleName(name);
10
+ // This literal route is reserved for the build-time dump, never a single module.
11
+ if (normalized.toLowerCase() === "dump-all")
12
+ return null;
13
+ return `/schema/module/${normalized}`;
7
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.62",
3
+ "version": "1.5.64",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",