@diviops/mcp-server 0.2.12 → 0.2.13
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/dist/compatibility.d.ts +1 -1
- package/dist/compatibility.js +1 -1
- package/dist/index.js +16 -5
- package/package.json +1 -1
package/dist/compatibility.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version compatibility between MCP server and WP plugin.
|
|
3
3
|
*/
|
|
4
4
|
/** Minimum WP plugin version this server requires. */
|
|
5
|
-
export declare const MIN_PLUGIN_VERSION = "1.0.0-beta.
|
|
5
|
+
export declare const MIN_PLUGIN_VERSION = "1.0.0-beta.31";
|
|
6
6
|
/**
|
|
7
7
|
* Compare two semver-like version strings (supports pre-release tags).
|
|
8
8
|
*
|
package/dist/compatibility.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Version compatibility between MCP server and WP plugin.
|
|
3
3
|
*/
|
|
4
4
|
/** Minimum WP plugin version this server requires. */
|
|
5
|
-
export const MIN_PLUGIN_VERSION = '1.0.0-beta.
|
|
5
|
+
export const MIN_PLUGIN_VERSION = '1.0.0-beta.31';
|
|
6
6
|
/**
|
|
7
7
|
* Compare two semver-like version strings (supports pre-release tags).
|
|
8
8
|
*
|
package/dist/index.js
CHANGED
|
@@ -726,7 +726,7 @@ server.registerTool("diviops_preset_create", {
|
|
|
726
726
|
};
|
|
727
727
|
});
|
|
728
728
|
server.registerTool("diviops_preset_reassign", {
|
|
729
|
-
description: 'Reassign a preset UUID across page content.
|
|
729
|
+
description: 'Reassign a preset UUID across page content. Covers both module-level refs (`attrs.modulePreset[...]`) and attribute-level group-preset refs (`attrs.groupPreset.<slot>.presetId`), plus — for group presets — registry chain refs in other presets\' `attrs.groupPresets.<slot>.presetId`. The `scope` param controls which ref types are walked (default "both", auto-selects based on new_uuid\'s bucket). Cross-bucket swaps (module ↔ group) are rejected. For module-scope swaps, optionally strips inline attrs that duplicate the new preset\'s attrs (otherwise inline wins over preset); slot-scoped inline strip for group scope is not yet implemented and is skipped with an advisory. Defaults to dry-run — set mode="apply" to actually rewrite. Use this to consolidate repeated inline styling into a reusable preset after creating one with diviops_preset_create.',
|
|
730
730
|
inputSchema: {
|
|
731
731
|
old_uuid: z
|
|
732
732
|
.string()
|
|
@@ -742,15 +742,26 @@ server.registerTool("diviops_preset_reassign", {
|
|
|
742
742
|
.enum(["dry-run", "apply"])
|
|
743
743
|
.optional()
|
|
744
744
|
.default("dry-run")
|
|
745
|
-
.describe('"dry-run" (default) returns the diff without writing. "apply" rewrites page content.'),
|
|
745
|
+
.describe('"dry-run" (default) returns the diff without writing. "apply" rewrites page content (and registry chains for group-scope swaps).'),
|
|
746
746
|
strip_inline: z
|
|
747
747
|
.boolean()
|
|
748
748
|
.optional()
|
|
749
749
|
.default(true)
|
|
750
|
-
.describe("If true (default), strip inline attrs that deep-equal the new preset's attrs so the preset actually takes effect. Set false to swap UUIDs only."),
|
|
750
|
+
.describe("If true (default), strip inline attrs that deep-equal the new preset's attrs so the preset actually takes effect. Applies to module-scope swaps only; group-scope swaps currently skip strip with an advisory in the summary. Set false to swap UUIDs only."),
|
|
751
|
+
scope: z
|
|
752
|
+
.enum(["module", "group", "both"])
|
|
753
|
+
.optional()
|
|
754
|
+
.default("both")
|
|
755
|
+
.describe('"module" walks `attrs.modulePreset[...]` only. "group" walks `attrs.groupPreset.<slot>.presetId` plus registry chain refs (`attrs.groupPresets.<slot>.presetId` in other presets). "both" (default) auto-selects based on new_uuid\'s bucket — module/group identity is disjoint, so there is one valid walk per swap. An explicit "module" or "group" rejects if new_uuid is in the wrong bucket.'),
|
|
751
756
|
},
|
|
752
|
-
}, async ({ old_uuid, new_uuid, page_ids, mode, strip_inline }) => {
|
|
753
|
-
const body = {
|
|
757
|
+
}, async ({ old_uuid, new_uuid, page_ids, mode, strip_inline, scope }) => {
|
|
758
|
+
const body = {
|
|
759
|
+
old_uuid,
|
|
760
|
+
new_uuid,
|
|
761
|
+
mode,
|
|
762
|
+
strip_inline,
|
|
763
|
+
scope,
|
|
764
|
+
};
|
|
754
765
|
if (page_ids)
|
|
755
766
|
body.page_ids = page_ids;
|
|
756
767
|
const result = await wp.request("/preset-reassign", {
|