@diviops/mcp-server 1.5.32 → 1.5.33
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 +6 -5
- package/dist/index.js +206 -8
- package/dist/wp-cli.d.ts +10 -0
- package/dist/wp-cli.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ DiviOps fits multiple WordPress workflows where AI-driven authoring + management
|
|
|
16
16
|
- **SCF setup + management** — provision Secure Custom Fields field groups, sync schemas, export/import field group definitions; SCF data model becomes a tool surface, not an admin-UI flow.
|
|
17
17
|
- **CPT + post population** — register custom post types via wp-cli passthrough; bulk-populate posts and pages across any post type, not just Divi-built ones.
|
|
18
18
|
- **Data model reasoning** — schema introspection across Divi modules + SCF field groups + post meta; ask Claude what fields a post type carries, what attributes a module accepts, what tokens are defined.
|
|
19
|
-
- **WordPress site auditing** — preset audits, design-token usage scans, orphan detection (presets, variables, dangling references); broader site surveys via wp-cli (`wp option list`, `wp post list --format=json`, `wp user list`).
|
|
19
|
+
- **WordPress site auditing** — preset audits, design-token usage scans, orphan detection (presets, variables, dangling references); broader site surveys via wp-cli (`wp option list`, `wp post list --format=json`, `wp post term list <id> <taxonomy> --format=json`, `wp user list`).
|
|
20
20
|
- **Hybrid sites (Divi + custom PHP)** — Divi authors the marketing pages; custom PHP templates handle dynamic ones (CPT listings, single-post views, member portals); design tokens harmonized across both surfaces via CSS custom properties driven from the Divi variable system.
|
|
21
21
|
|
|
22
22
|
## Quick start
|
|
@@ -25,9 +25,9 @@ Three steps to your first tool call.
|
|
|
25
25
|
|
|
26
26
|
### 1. Install the WordPress plugin
|
|
27
27
|
|
|
28
|
-
Download and activate the **DiviOps Agent** plugin
|
|
28
|
+
Download and activate the **DiviOps Agent** plugin from WordPress.org once it is listed there. For pre-listing test packages or a manual fallback install, use the [direct zip](https://github.com/oaris-dev/diviops/raw/main/diviops-agent.zip) or browse the [public distribution repo](https://github.com/oaris-dev/diviops). Requires Divi 5.1+ on WordPress 6.5+.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
The npm MCP server updates through npm. WordPress.org installs of the Free plugin update through the normal WordPress plugin update flow. For pre-listing test packages or a manual fallback install, replace `diviops-agent.zip` through **WP Admin → Plugins → Add New → Upload Plugin** and choose **Replace current with uploaded**.
|
|
31
31
|
|
|
32
32
|
### 2. Create an Application Password
|
|
33
33
|
|
|
@@ -83,13 +83,14 @@ The skill enforces the Divi block format, the design system, and the response co
|
|
|
83
83
|
|
|
84
84
|
## Tools at a glance
|
|
85
85
|
|
|
86
|
-
The server exposes **
|
|
86
|
+
The server exposes **85 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).
|
|
87
87
|
|
|
88
88
|
| Category | Use case | Tool prefixes |
|
|
89
89
|
|----------|----------|---------------|
|
|
90
90
|
| Page authoring | Create, edit, restructure pages | `page_*`, `section_*`, `module_*` |
|
|
91
91
|
| Design system | Manage colors, fonts, variables, presets | `variable_*`, `global_color_*`, `global_font_*`, `preset_*` |
|
|
92
92
|
| Library + templates | Reusable layouts + Theme Builder | `library_*`, `template_*`, `tb_*` |
|
|
93
|
+
| WordPress menus | Author reusable nav menus and theme-location assignments | `menu_*` |
|
|
93
94
|
| Schema introspection | Module attribute discovery | `schema_*` |
|
|
94
95
|
| Canvas / off-canvas | Popups, modals, menus | `canvas_*` |
|
|
95
96
|
| SCF integration | Secure Custom Fields sync | `scf_*` |
|
|
@@ -283,7 +284,7 @@ Every write tool accepts `dry_run: boolean` (default `false`). When `true`, the
|
|
|
283
284
|
}
|
|
284
285
|
```
|
|
285
286
|
|
|
286
|
-
`meta_wp_cli` and `scf_import` do not accept `dry_run` (raw passthrough / upstream gap respectively). For bulk preview-then-commit flows (preset reassign, preset cleanup), see [safety-patterns.md](../docs/safety-patterns.md).
|
|
287
|
+
`meta_wp_cli` and `scf_import` do not accept `dry_run` (raw passthrough / upstream gap respectively). `scf_sync` passes `dry_run` through to upstream `wp scf json sync --dry-run`, so its preview is the upstream plain-text summary rather than a plugin-built `data.plan`. For bulk preview-then-commit flows (preset reassign, preset cleanup), see [safety-patterns.md](../docs/safety-patterns.md).
|
|
287
288
|
|
|
288
289
|
### `_meta.idempotent` markers
|
|
289
290
|
|
package/dist/index.js
CHANGED
|
@@ -523,6 +523,146 @@ registerPluginTool("diviops_module_get", {
|
|
|
523
523
|
],
|
|
524
524
|
};
|
|
525
525
|
});
|
|
526
|
+
registerPluginTool("diviops_menu_list", {
|
|
527
|
+
description: "List WordPress nav menus, registered theme locations, and current location assignments. Free/core, read-only. Requires the WordPress user to have edit_theme_options. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { menus[], count, registered_locations, assigned_locations }.",
|
|
528
|
+
annotations: { idempotentHint: true },
|
|
529
|
+
_meta: { idempotent: "true" },
|
|
530
|
+
}, async () => {
|
|
531
|
+
const result = await wp.requestEnveloped("/menu/list");
|
|
532
|
+
return {
|
|
533
|
+
content: [
|
|
534
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_list") },
|
|
535
|
+
],
|
|
536
|
+
};
|
|
537
|
+
});
|
|
538
|
+
registerPluginTool("diviops_menu_get", {
|
|
539
|
+
description: "Fetch one WordPress nav menu with normalized flat items and a nested item tree. Free/core, read-only. Requires edit_theme_options. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing menu_id returns not_found.",
|
|
540
|
+
inputSchema: {
|
|
541
|
+
menu_id: z.number().int().positive().describe("WordPress nav menu term ID"),
|
|
542
|
+
},
|
|
543
|
+
annotations: { idempotentHint: true },
|
|
544
|
+
_meta: { idempotent: "true" },
|
|
545
|
+
}, async ({ menu_id }) => {
|
|
546
|
+
const result = await wp.requestEnveloped(`/menu/get/${menu_id}`);
|
|
547
|
+
return {
|
|
548
|
+
content: [
|
|
549
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_get") },
|
|
550
|
+
],
|
|
551
|
+
};
|
|
552
|
+
});
|
|
553
|
+
registerPluginTool("diviops_menu_create", {
|
|
554
|
+
description: "Create a WordPress nav menu by name, optionally with a requested slug. Free/core single-site menu authoring primitive. Requires edit_theme_options. Existing same-name or same-slug menus return ok:true with noop:true instead of creating duplicates. Does not assign the menu to a location; follow with diviops_menu_location_assign. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }." +
|
|
555
|
+
DRY_RUN_DESC_SUFFIX,
|
|
556
|
+
inputSchema: {
|
|
557
|
+
name: z.string().min(1).describe("Menu display name, e.g. Primary"),
|
|
558
|
+
slug: z.string().optional().describe("Optional sanitized menu slug. Omit to let WordPress derive it."),
|
|
559
|
+
dry_run: DRY_RUN_FIELD,
|
|
560
|
+
},
|
|
561
|
+
annotations: { idempotentHint: true },
|
|
562
|
+
_meta: { idempotent: "true" },
|
|
563
|
+
}, async ({ name, slug, dry_run }) => {
|
|
564
|
+
const body = { name };
|
|
565
|
+
if (slug !== undefined)
|
|
566
|
+
body.slug = slug;
|
|
567
|
+
if (dry_run)
|
|
568
|
+
body.dry_run = true;
|
|
569
|
+
const result = await wp.requestEnveloped("/menu/create", {
|
|
570
|
+
method: "POST",
|
|
571
|
+
body,
|
|
572
|
+
});
|
|
573
|
+
return {
|
|
574
|
+
content: [
|
|
575
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_create") },
|
|
576
|
+
],
|
|
577
|
+
};
|
|
578
|
+
});
|
|
579
|
+
registerPluginTool("diviops_menu_item_add_page", {
|
|
580
|
+
description: "Append a readable published page to an existing WordPress nav menu. Free/core single-site menu authoring primitive. Requires edit_theme_options plus read access to the page. Validates menu, page status/visibility, and optional parent menu item. Existing same page under the same parent returns noop:true; a different existing label returns conflict because item-update/reorder are deferred. No delete, reorder, or broad reconcile path. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }." +
|
|
581
|
+
DRY_RUN_DESC_SUFFIX,
|
|
582
|
+
inputSchema: {
|
|
583
|
+
menu_id: z.number().int().positive().describe("WordPress nav menu term ID"),
|
|
584
|
+
page_id: z.number().int().positive().describe("Published page ID to add"),
|
|
585
|
+
label: z.string().optional().describe("Optional menu label. Defaults to the page title."),
|
|
586
|
+
parent_item_id: z.number().int().min(0).optional().default(0).describe("Optional parent menu item ID from diviops_menu_get; 0 for top level."),
|
|
587
|
+
dry_run: DRY_RUN_FIELD,
|
|
588
|
+
},
|
|
589
|
+
annotations: { idempotentHint: true },
|
|
590
|
+
_meta: { idempotent: "true" },
|
|
591
|
+
}, async ({ menu_id, page_id, label, parent_item_id, dry_run }) => {
|
|
592
|
+
const body = {
|
|
593
|
+
menu_id,
|
|
594
|
+
page_id,
|
|
595
|
+
parent_item_id: parent_item_id ?? 0,
|
|
596
|
+
};
|
|
597
|
+
if (label !== undefined)
|
|
598
|
+
body.label = label;
|
|
599
|
+
if (dry_run)
|
|
600
|
+
body.dry_run = true;
|
|
601
|
+
const result = await wp.requestEnveloped("/menu/item/add-page", {
|
|
602
|
+
method: "POST",
|
|
603
|
+
body,
|
|
604
|
+
});
|
|
605
|
+
return {
|
|
606
|
+
content: [
|
|
607
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_item_add_page") },
|
|
608
|
+
],
|
|
609
|
+
};
|
|
610
|
+
});
|
|
611
|
+
registerPluginTool("diviops_menu_item_add_custom", {
|
|
612
|
+
description: "Append a custom URL item to an existing WordPress nav menu. Free/core single-site menu authoring primitive. Requires edit_theme_options. URL validation allows only http, https, root-relative paths, same-page hashes, mailto, and tel; protocol-relative/javascript/data URLs are rejected. Existing same URL under the same parent with the same label returns noop:true. No delete, reorder, or broad reconcile path. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }." +
|
|
613
|
+
DRY_RUN_DESC_SUFFIX,
|
|
614
|
+
inputSchema: {
|
|
615
|
+
menu_id: z.number().int().positive().describe("WordPress nav menu term ID"),
|
|
616
|
+
label: z.string().min(1).describe("Menu item label"),
|
|
617
|
+
url: z.string().min(1).describe("Allowed URL: http(s), root-relative path, #hash, mailto, or tel"),
|
|
618
|
+
parent_item_id: z.number().int().min(0).optional().default(0).describe("Optional parent menu item ID from diviops_menu_get; 0 for top level."),
|
|
619
|
+
dry_run: DRY_RUN_FIELD,
|
|
620
|
+
},
|
|
621
|
+
annotations: { idempotentHint: true },
|
|
622
|
+
_meta: { idempotent: "true" },
|
|
623
|
+
}, async ({ menu_id, label, url, parent_item_id, dry_run }) => {
|
|
624
|
+
const body = {
|
|
625
|
+
menu_id,
|
|
626
|
+
label,
|
|
627
|
+
url,
|
|
628
|
+
parent_item_id: parent_item_id ?? 0,
|
|
629
|
+
};
|
|
630
|
+
if (dry_run)
|
|
631
|
+
body.dry_run = true;
|
|
632
|
+
const result = await wp.requestEnveloped("/menu/item/add-custom", {
|
|
633
|
+
method: "POST",
|
|
634
|
+
body,
|
|
635
|
+
});
|
|
636
|
+
return {
|
|
637
|
+
content: [
|
|
638
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_item_add_custom") },
|
|
639
|
+
],
|
|
640
|
+
};
|
|
641
|
+
});
|
|
642
|
+
registerPluginTool("diviops_menu_location_assign", {
|
|
643
|
+
description: "Assign an existing WordPress nav menu to a registered theme location discovered from the current theme. Free/core single-site menu authoring primitive. Requires edit_theme_options. Rejects arbitrary location strings; call diviops_menu_list first and use data.registered_locations keys. Reassigning the same menu/location returns noop:true. No location removal path in this MVP. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }." +
|
|
644
|
+
DRY_RUN_DESC_SUFFIX,
|
|
645
|
+
inputSchema: {
|
|
646
|
+
menu_id: z.number().int().positive().describe("WordPress nav menu term ID"),
|
|
647
|
+
location: z.string().min(1).describe("Registered theme location key from diviops_menu_list"),
|
|
648
|
+
dry_run: DRY_RUN_FIELD,
|
|
649
|
+
},
|
|
650
|
+
annotations: { idempotentHint: true },
|
|
651
|
+
_meta: { idempotent: "true" },
|
|
652
|
+
}, async ({ menu_id, location, dry_run }) => {
|
|
653
|
+
const body = { menu_id, location };
|
|
654
|
+
if (dry_run)
|
|
655
|
+
body.dry_run = true;
|
|
656
|
+
const result = await wp.requestEnveloped("/menu/location/assign", {
|
|
657
|
+
method: "POST",
|
|
658
|
+
body,
|
|
659
|
+
});
|
|
660
|
+
return {
|
|
661
|
+
content: [
|
|
662
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_menu_location_assign") },
|
|
663
|
+
],
|
|
664
|
+
};
|
|
665
|
+
});
|
|
526
666
|
registerPluginTool("diviops_schema_list_modules", {
|
|
527
667
|
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? } }.",
|
|
528
668
|
annotations: { idempotentHint: true },
|
|
@@ -985,6 +1125,64 @@ registerPluginTool("diviops_page_update_content", {
|
|
|
985
1125
|
],
|
|
986
1126
|
};
|
|
987
1127
|
});
|
|
1128
|
+
registerPluginTool("diviops_page_update_meta", {
|
|
1129
|
+
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." +
|
|
1130
|
+
DRY_RUN_DESC_SUFFIX,
|
|
1131
|
+
inputSchema: {
|
|
1132
|
+
page_id: z.number().int().describe("WordPress post/page ID to update"),
|
|
1133
|
+
title: z
|
|
1134
|
+
.string()
|
|
1135
|
+
.optional()
|
|
1136
|
+
.describe("New post_title. Omit to leave unchanged."),
|
|
1137
|
+
slug: z
|
|
1138
|
+
.string()
|
|
1139
|
+
.optional()
|
|
1140
|
+
.describe("New post_name. Must already be sanitized, e.g. 'legal-notice'."),
|
|
1141
|
+
parent: z
|
|
1142
|
+
.number()
|
|
1143
|
+
.int()
|
|
1144
|
+
.min(0)
|
|
1145
|
+
.optional()
|
|
1146
|
+
.describe("New post_parent. Use 0 for no parent."),
|
|
1147
|
+
menu_order: z
|
|
1148
|
+
.number()
|
|
1149
|
+
.int()
|
|
1150
|
+
.min(0)
|
|
1151
|
+
.optional()
|
|
1152
|
+
.describe("New menu_order value."),
|
|
1153
|
+
preserve_old_slug: z
|
|
1154
|
+
.boolean()
|
|
1155
|
+
.optional()
|
|
1156
|
+
.default(true)
|
|
1157
|
+
.describe("When true, record the previous slug in _wp_old_slug for published posts when slug changes."),
|
|
1158
|
+
dry_run: DRY_RUN_FIELD,
|
|
1159
|
+
},
|
|
1160
|
+
annotations: { idempotentHint: true },
|
|
1161
|
+
_meta: { idempotent: "true" },
|
|
1162
|
+
}, async ({ page_id, title, slug, parent, menu_order, preserve_old_slug, dry_run }) => {
|
|
1163
|
+
const body = {
|
|
1164
|
+
preserve_old_slug: preserve_old_slug ?? true,
|
|
1165
|
+
};
|
|
1166
|
+
if (title !== undefined)
|
|
1167
|
+
body.title = title;
|
|
1168
|
+
if (slug !== undefined)
|
|
1169
|
+
body.slug = slug;
|
|
1170
|
+
if (parent !== undefined)
|
|
1171
|
+
body.parent = parent;
|
|
1172
|
+
if (menu_order !== undefined)
|
|
1173
|
+
body.menu_order = menu_order;
|
|
1174
|
+
if (dry_run)
|
|
1175
|
+
body.dry_run = true;
|
|
1176
|
+
const result = await wp.requestEnveloped(`/page/update-meta/${page_id}`, {
|
|
1177
|
+
method: "POST",
|
|
1178
|
+
body,
|
|
1179
|
+
});
|
|
1180
|
+
return {
|
|
1181
|
+
content: [
|
|
1182
|
+
{ type: "text", text: serializeEnvelope(result, "diviops_page_update_meta") },
|
|
1183
|
+
],
|
|
1184
|
+
};
|
|
1185
|
+
});
|
|
988
1186
|
registerPluginTool("diviops_render_preview", {
|
|
989
1187
|
description: "Render Divi block markup to HTML. Accepts EITHER inline `content` (string of block markup) OR `page_id` (loads `post_content` from the DB, requires edit_post capability on the page — useful for previewing shipped pages without round-tripping the markup blob). Provide exactly one. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { rendered_html: string }. Errors map to `invalid_input` (neither/both supplied, or invalid page_id), `forbidden` (caller lacks edit_post on the page), `not_found` (page_id does not exist), or `divi_error` (parser/render exception, with truncated message and full detail in `error.data.detail`).",
|
|
990
1188
|
inputSchema: {
|
|
@@ -1226,7 +1424,7 @@ registerPluginTool("diviops_section_get", {
|
|
|
1226
1424
|
};
|
|
1227
1425
|
});
|
|
1228
1426
|
registerPluginTool("diviops_module_update", {
|
|
1229
|
-
description: 'Update specific attributes of a module. Target by auto_index (e.g. "text:5"), admin label, or text content. Uses dot notation for attribute paths. Example: {"content.decoration.headingFont.h2.font.desktop.value.color": "#ff0000"}. For paths whose key segments contain literal dots — notably Composable Settings preset slots like groupPreset["title.decoration.spacing"] — escape the inner dots with `\\.` to keep the segment intact: {"groupPreset.title\\\\.decoration\\\\.spacing.presetId": ["uuid"]}. Priority: auto_index > label > match_text. Use occurrence with label when duplicates exist. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing module returns code "not_found" with error.data = { target_kind: "module", target_mode, target_value, page_id }, non-array attrs returns code "invalid_input" with error.data.field = "attrs", malformed Divi block markup surfaces code "divi_error" (HTTP 500).' +
|
|
1427
|
+
description: 'Update specific attributes of a module. Target by auto_index (e.g. "text:5"), admin label, or text content. Uses dot notation for attribute paths. Example: {"content.decoration.headingFont.h2.font.desktop.value.color": "#ff0000"}. For paths whose key segments contain literal dots — notably Composable Settings preset slots like groupPreset["title.decoration.spacing"] — escape the inner dots with `\\.` to keep the segment intact: {"groupPreset.title\\\\.decoration\\\\.spacing.presetId": ["uuid"]}. Priority: auto_index > label > match_text. Use occurrence with label when duplicates exist. match_text is a convenience selector: for generic or repeated visible text, prefer auto_index from diviops_page_get_layout/module_get. Content-slot mismatches such as writing a heading `title.innerContent` path into a matched divi/text block are rejected with invalid_input instead of silently storing never-rendered attrs. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing module returns code "not_found" with error.data = { target_kind: "module", target_mode, target_value, page_id }, non-array attrs returns code "invalid_input" with error.data.field = "attrs", malformed Divi block markup surfaces code "divi_error" (HTTP 500).' +
|
|
1230
1428
|
DRY_RUN_DESC_SUFFIX,
|
|
1231
1429
|
inputSchema: {
|
|
1232
1430
|
page_id: z.number().describe("WordPress post/page ID"),
|
|
@@ -1487,7 +1685,7 @@ registerPluginTool("diviops_page_create", {
|
|
|
1487
1685
|
};
|
|
1488
1686
|
});
|
|
1489
1687
|
registerPluginTool("diviops_page_trash", {
|
|
1490
|
-
description: "Trash or permanently delete a page/post. Defaults to trash (reversible via WP Admin → Trash). Pass force=true to permanently delete (wp_delete_post — irreversible). Idempotent: trashing an already-trashed post returns ok:true with `data.already_trashed = true` (repeat-safe semantics for AI-agent retries). Pass dry_run=true to preview without mutating. Replaces wp-cli `post delete --force=0|1` routing for AI-agent callers (typed input, deterministic envelope). Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', delete-permission failures return 'forbidden' (HTTP 403).
|
|
1688
|
+
description: "Trash or permanently delete a page/post. Defaults to trash (reversible via WP Admin → Trash). Pass force=true to permanently delete (wp_delete_post — irreversible). Idempotent: trashing an already-trashed post returns ok:true with `data.already_trashed = true` (repeat-safe semantics for AI-agent retries). Pass dry_run=true to preview the standard `data.plan = { summary, changes[] }` without mutating. Replaces wp-cli `post delete --force=0|1` routing for AI-agent callers (typed input, deterministic envelope). Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', delete-permission failures return 'forbidden' (HTTP 403).",
|
|
1491
1689
|
inputSchema: {
|
|
1492
1690
|
post_id: z.number().int().describe("WordPress post/page ID"),
|
|
1493
1691
|
force: z
|
|
@@ -1518,7 +1716,7 @@ registerPluginTool("diviops_page_trash", {
|
|
|
1518
1716
|
};
|
|
1519
1717
|
});
|
|
1520
1718
|
registerPluginTool("diviops_page_update_status", {
|
|
1521
|
-
description: "Update a page's post_status. Valid statuses: publish, draft, private, pending, future. status='future' requires date_gmt (ISO 8601 UTC, must be in the future) — server writes both post_date_gmt and the site-tz post_date so WP's scheduler picks it up. status='publish' on a previously-scheduled post clears the future date so it publishes immediately. Idempotent: same-status update returns ok:true with `data.noop = true`. Pass dry_run=true to preview. Replaces wp-cli `post update --post_status=...` routing. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403); status enum violations and date_gmt validation failures return 'invalid_input' with `error.data` documenting the field.
|
|
1719
|
+
description: "Update a page's post_status. Valid statuses: publish, draft, private, pending, future. status='future' requires date_gmt (ISO 8601 UTC, must be in the future) — server writes both post_date_gmt and the site-tz post_date so WP's scheduler picks it up. status='publish' on a previously-scheduled post clears the future date so it publishes immediately. Idempotent: same-status update returns ok:true with `data.noop = true`. Pass dry_run=true to preview the standard `data.plan = { summary, changes[] }` without mutating. Replaces wp-cli `post update --post_status=...` routing. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403); status enum violations and date_gmt validation failures return 'invalid_input' with `error.data` documenting the field.",
|
|
1522
1720
|
inputSchema: {
|
|
1523
1721
|
post_id: z.number().int().describe("WordPress post/page ID"),
|
|
1524
1722
|
status: z
|
|
@@ -1579,7 +1777,7 @@ registerPluginTool("diviops_preset_audit_storage", {
|
|
|
1579
1777
|
};
|
|
1580
1778
|
});
|
|
1581
1779
|
registerPluginTool("diviops_preset_cleanup", {
|
|
1582
|
-
description: 'Clean up presets. Default: remove spam presets. Optional: dedup=true to also remove duplicates, action="rename_strip_prefix" with prefix to strip a name prefix, or action="remove_orphans" with scope="spam"|"all" to remove unreferenced presets. Use dry_run: true (default) to preview
|
|
1780
|
+
description: 'Clean up presets. Default: remove spam presets. Optional: dedup=true to also remove duplicates, action="rename_strip_prefix" with prefix to strip a name prefix, or action="remove_orphans" with scope="spam"|"all" to remove unreferenced presets. Use dry_run: true (default) to preview the standard `data.plan = { summary, changes[] }` without mutating; legacy removed/renamed/deduped summary arrays are preserved as sibling metadata. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }.',
|
|
1583
1781
|
inputSchema: {
|
|
1584
1782
|
dry_run: z
|
|
1585
1783
|
.boolean()
|
|
@@ -3104,7 +3302,7 @@ registerLocalTool("diviops_template_get", {
|
|
|
3104
3302
|
});
|
|
3105
3303
|
// ── Variable Manager CRUD ─────────────────────────────────────────────
|
|
3106
3304
|
registerPluginTool("diviops_variable_list", {
|
|
3107
|
-
description: "List all design token variables from the Divi Variable Manager. Colors (gcid-*) come from et_global_data, numbers/strings/etc (gvid-*) from et_divi_global_variables. Filter by type or ID prefix. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; invalid `type` returns ok:false with code 'invalid_input'.",
|
|
3305
|
+
description: "List all design token variables from the Divi Variable Manager. Colors (gcid-*) come from et_global_data, numbers/strings/etc (gvid-*) from et_divi_global_variables. Filter by type or stored ID prefix. The `prefix` parameter does not match labels; for semantic names such as `oa-*` labels on UUID-backed Divi variables, list by type and filter returned labels client-side. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; invalid `type` returns ok:false with code 'invalid_input'.",
|
|
3108
3306
|
inputSchema: {
|
|
3109
3307
|
type: z
|
|
3110
3308
|
.enum(["colors", "numbers", "strings", "images", "links", "fonts", "gradients"])
|
|
@@ -3113,7 +3311,7 @@ registerPluginTool("diviops_variable_list", {
|
|
|
3113
3311
|
prefix: z
|
|
3114
3312
|
.string()
|
|
3115
3313
|
.optional()
|
|
3116
|
-
.describe('Filter by ID prefix
|
|
3314
|
+
.describe('Filter by stored ID prefix only. Does not match labels; for semantic names such as "oa-*" labels, list by type and filter returned labels client-side.'),
|
|
3117
3315
|
},
|
|
3118
3316
|
annotations: { idempotentHint: true },
|
|
3119
3317
|
_meta: { idempotent: "true" },
|
|
@@ -3361,7 +3559,7 @@ registerPluginTool("diviops_variable_create_fluid_system", {
|
|
|
3361
3559
|
.boolean()
|
|
3362
3560
|
.optional()
|
|
3363
3561
|
.default(false)
|
|
3364
|
-
.describe("Preview the
|
|
3562
|
+
.describe("Preview the standard dry-run plan without persisting. The response also preserves `created`/`skipped` diagnostics so callers can audit IDs and clamp() values before committing."),
|
|
3365
3563
|
overwrite: z
|
|
3366
3564
|
.boolean()
|
|
3367
3565
|
.optional()
|
|
@@ -3975,7 +4173,7 @@ function registerProTools() {
|
|
|
3975
4173
|
// no license activation flow, no update-ZIP / readme / banner config.
|
|
3976
4174
|
// diviops_fc_variation_list — POST /diviops/v1/pro/fluentcart/products/{id}/variations
|
|
3977
4175
|
registerProTool("diviops_fc_variation_list", {
|
|
3978
|
-
description: "List FluentCart Pro variations for a product (Pro tier; V3; requires FluentCart Pro installed + activated). Read-only. Returns every variation row attached to the product with its subscription shape (payment_type, other_info.repeat_interval/times/trial_days/manage_setup_fee) and a license-settings projection when ProductMeta.license_settings is configured. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { product_id, variation_type, default_variation_id, variations: VariationRow[], variations_count }. Each VariationRow carries { id, post_id, variation_title, sku, payment_type, item_price, compare_price, fulfillment_type, stock_status, manage_stock, available, other_info: { ...all stored keys... }, license: { activation_limit, validity: { unit, value } } | null }. Unit convention: item_price and compare_price are stored cents (e.g. 1900 = $19.00). compare_price is null when FCP stores the no-compare sentinel 0; sku is null when the column is SQL NULL OR an empty string. license is null when the product has no license_settings; otherwise activation_limit is null/'' (unset), 0 (unlimited per FluentCart Pro License::getActivationLimit), or a positive integer (max activations). validity.unit is one of: lifetime/day/week/month/year. Error codes: invalid_input (400) when id is not a positive integer; not_found (404) when the product does not exist; fluentcart.module_inactive (412); fluentcart.query_failed (500). Idempotency: read-only.",
|
|
4176
|
+
description: "List FluentCart Pro variations for a product (Pro tier; V3; requires FluentCart Pro installed + activated). Read-only. Returns every variation row attached to the product with its subscription shape (payment_type, other_info.repeat_interval/times/trial_days/manage_setup_fee) and a license-settings projection when ProductMeta.license_settings is configured. For FluentCart 1.5 advanced_variations products, also resolves attribute relation metadata into VariationRow.attributes[] while preserving raw other_info.variant term IDs; each attribute row carries { group_id, group_title, group_slug, group_type, term_id, term_title, term_slug, term_settings }. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { product_id, variation_type, default_variation_id, variations: VariationRow[], variations_count }. Each VariationRow carries { id, post_id, variation_title, sku, payment_type, item_price, compare_price, fulfillment_type, stock_status, manage_stock, available, other_info: { ...all stored keys... }, attributes?: AttributeRow[], license: { activation_limit, validity: { unit, value } } | null }. Unit convention: item_price and compare_price are stored cents (e.g. 1900 = $19.00). compare_price is null when FCP stores the no-compare sentinel 0; sku is null when the column is SQL NULL OR an empty string. license is null when the product has no license_settings; otherwise activation_limit is null/'' (unset), 0 (unlimited per FluentCart Pro License::getActivationLimit), or a positive integer (max activations). validity.unit is one of: lifetime/day/week/month/year. Advanced Variations authoring remains out of scope; write tools still refuse non-simple shapes with fluentcart.unsupported_product_shape. Error codes: invalid_input (400) when id is not a positive integer; not_found (404) when the product does not exist; fluentcart.module_inactive (412); fluentcart.query_failed (500). Idempotency: read-only.",
|
|
3979
4177
|
inputSchema: {
|
|
3980
4178
|
product_id: z
|
|
3981
4179
|
.number()
|
package/dist/wp-cli.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ interface WpCliConfig {
|
|
|
13
13
|
/** Custom WP-CLI command prefix for containerized environments (e.g. "ddev wp"). */
|
|
14
14
|
wpCliCmd?: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Validate a parsed command against the allowlist.
|
|
18
|
+
* Checks the first 1-3 args against allowed command prefixes (supports
|
|
19
|
+
* 2-word commands like "post list" and 3-word like "post meta get").
|
|
20
|
+
*/
|
|
21
|
+
declare function isCommandAllowed(args: string[]): {
|
|
22
|
+
allowed: boolean;
|
|
23
|
+
reason?: string;
|
|
24
|
+
};
|
|
16
25
|
/**
|
|
17
26
|
* Parse a command string into an array of arguments.
|
|
18
27
|
* Handles quoted strings (single and double quotes).
|
|
@@ -20,6 +29,7 @@ interface WpCliConfig {
|
|
|
20
29
|
declare function parseCommand(command: string): string[];
|
|
21
30
|
declare function normalizeWpCliPathArgs(args: string[], wpPath: string): string[];
|
|
22
31
|
export declare const __wpCliTesting: {
|
|
32
|
+
isCommandAllowed: typeof isCommandAllowed;
|
|
23
33
|
parseCommand: typeof parseCommand;
|
|
24
34
|
normalizeWpCliPathArgs: typeof normalizeWpCliPathArgs;
|
|
25
35
|
};
|
package/dist/wp-cli.js
CHANGED
|
@@ -27,6 +27,9 @@ const DEFAULT_COMMANDS = [
|
|
|
27
27
|
'post meta list',
|
|
28
28
|
'post meta set',
|
|
29
29
|
'post meta update',
|
|
30
|
+
// Taxonomy assignments (read-only). Assignment writes (`post term add/set/remove`)
|
|
31
|
+
// stay unsupported until a concrete workflow justifies a typed or extended path.
|
|
32
|
+
'post term list',
|
|
30
33
|
// Post types (read-only)
|
|
31
34
|
'post-type list',
|
|
32
35
|
'post-type get',
|
|
@@ -312,6 +315,7 @@ function normalizeWpCliPathArgs(args, wpPath) {
|
|
|
312
315
|
return args;
|
|
313
316
|
}
|
|
314
317
|
export const __wpCliTesting = {
|
|
318
|
+
isCommandAllowed,
|
|
315
319
|
parseCommand,
|
|
316
320
|
normalizeWpCliPathArgs,
|
|
317
321
|
};
|