@diviops/mcp-server 1.5.78 → 1.5.80

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
@@ -1,421 +1,26 @@
1
1
  # DiviOps MCP Server
2
2
 
3
- **An AI harness for WordPress site authoring — Divi-native today, WordPress-wide by design.**
3
+ DiviOps connects an MCP client on your computer to the DiviOps Agent plugin on a WordPress site you manage. You can list pages, inspect presets and edit native Divi modules.
4
4
 
5
- The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Codex, Claude Desktop, and other MCP clients a typed control layer over WordPress site state, dispatching to the DiviOps Agent plugin for Divi 5 page authoring, SCF and CPT data models, design tokens, presets, library and Theme Builder templates, site audits, and safe WP-CLI passthrough. Pairs with the `diviops-divi-5` skill so the agent applies Divi's block format and design rules correctly.
5
+ Choose a connection guide for [Claude Code](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#claude-code), [Codex CLI (terminal)](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#codex) or [Claude Desktop](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#claude-desktop-json).
6
6
 
7
- ```
8
- Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
9
- ```
10
-
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
22
-
23
- Adds optional `expected_checksum` to module and Theme Builder layout updates.
24
- Pair with Free Agent **1.5.50** and reconnect to refresh capability evidence.
25
- MCP refuses guarded requests before dispatch when the required Agent capability
26
- is absent. Omitting the checksum retains the legacy contract. This is optimistic compare-before-write, not an
27
- atomic lock. A concurrent edit after the final comparison can still race.
28
- Existing permissions, validation, backup, recovery and client qualification
29
- limits remain unchanged. Publication and installation are separate steps.
30
-
31
- ## MCP 1.5.75 historical release note
32
-
33
- Adds explicit tool hints for seven existing onboarding tools. Block validation,
34
- page and layout reads, variable listing and preset auditing are marked read-only.
35
- Page creation is additive but mutating, including when publishing is requested;
36
- trash is destructive, including permanent deletion. Existing idempotency hints,
37
- inputs, handlers and capability checks are unchanged. Dry-run inputs do not
38
- reclassify a write tool as read-only.
39
-
40
- Hints describe tool behavior; they do not grant permission or guarantee that a
41
- client will run without approval. No tool is added and no provider version gate
42
- is changed. The planned onboarding bundle pairs this candidate with Free Agent
43
- **1.5.48** and public builder companion **1.4.14**, without introducing a shared
44
- version floor. Reconnect after a supported MCP update to refresh its tool catalog.
45
-
46
- Packaging and client verification remain separate from publication. Earlier
47
- Codex verification used MCP 1.5.74 with explicit tool permissions; it does not
48
- qualify this candidate or default client approval behavior.
49
-
50
- ## MCP 1.5.74 historical release note
51
-
52
- Adds the Free `diviops_seo_storage_inspect` tool for four literal Rank Math
53
- storage keys on one editable page. Pair with Free Agent **1.5.47**, then
54
- restart/reconnect the MCP client to refresh startup capability evidence.
55
- An older Free Agent returns `capability_missing` without a storage request;
56
- reconnecting an older MCP binary does not add the new tool.
57
-
58
- Inspection is permission-checked and bounded. Missing and empty values remain
59
- distinct; serialized values remain untrusted text, not computed SEO, inherited
60
- defaults, a write plan or evidence that an interrupted write is safe to retry.
61
- Existing semantic reads, previews, writes and recovery retain their exact-version
62
- gates. No automatic fallback, override or global version-floor change is added.
63
- SCF and TSF behavior is unchanged; Pro is optional and unchanged.
64
-
65
- The merged inspector passed bounded native checks with Rank Math 1.0.280 on
66
- WordPress 7.1, PHP 8.3.35 and Divi 5.13.1. That feature result does not qualify
67
- arbitrary future versions. Feature verification, exact-package qualification
68
- and publication are separate evidence.
69
-
70
- ## MCP 1.5.73 historical release note
71
-
72
- Aligned Rank Math and SCF tool descriptions with the reviewed exact version sets.
73
- Free 1.5.45 improved provider diagnostics; Pro 1.0.19-beta extended its reviewed
74
- Rank Math controller support. Those releases added no MCP tools or schemas.
75
- Compatibility remains capability-based; component labels alone do not establish
76
- installed support.
77
-
78
- ## 1.5.72 historical release note
79
-
80
- Adds five capability-gated Pro SEO text workflow tools: plan, advance, status/report, recovery plan and recover. Existing Free SEO tools gain bounded operation correlation and exact outcome lookup. Pair with Free 1.5.43 and Pro 1.0.18-beta for the complete reviewed workflow; availability follows capabilities, not a shared version floor.
81
-
82
- Each advance affects at most one explicit page. After an interrupted request, read status before deciding whether to advance again; do not automatically retry. Single-page authoring and recovery remain Free. Restart or reconnect the MCP client after supported component updates to refresh discovery. Candidate packaging and publication remain separate.
83
-
84
- ## 1.5.68 release note — named site-wide CSS blocks
85
-
86
- With Free Agent 1.5.39, `diviops_custom_css_get`, `diviops_custom_css_upsert`
87
- and `diviops_custom_css_restore` read, preview, update and restore named blocks
88
- in the active theme's native Custom CSS. Writes default to preview and require
89
- an explicit apply with a fresh checksum. Unrelated CSS and theme options are
90
- preserved; writes retain a seven-day recovery snapshot.
91
-
92
- Initialize or reconcile storage through **Divi > Theme Options > General >
93
- Custom CSS**, save visibly, then read again before applying. Missing or divergent
94
- native storage is refused. A Customizer save can leave Divi's legacy mirror out
95
- of sync; the tools do not repair it automatically. CSS support is a bounded
96
- subset, and changing themes requires a fresh read. Check state after a cancelled
97
- or failed write before retrying; use the CSS-specific restore tool for recovery.
98
-
99
- Native editing, frontend rendering, recovery and child-theme isolation were
100
- verified on WordPress 7.1, PHP 8.3 and Divi 5.13.1. Update both components and
101
- restart the MCP server.
102
-
103
- ## 1.5.67 release note — WP-CLI term metadata and assignments
104
-
105
- `term meta list <term-id> --format=json` is available as a default read alongside
106
- `term meta get`. Term-meta `set`/`update` and post-term `add`/`set`/`remove` require
107
- individual opt-ins through `DIVIOPS_WP_CLI_ALLOW`; they remain denied by default.
108
- For example, `DIVIOPS_WP_CLI_ALLOW="term meta update,post term add"` enables only
109
- those additional commands. Restart the MCP server after changing configuration.
110
- Existing `*`/`all` configurations acquire the expanded extended set on update.
111
-
112
- WP-CLI passthrough has no `dry_run`, checksum protection or automatic rollback.
113
- Read current values before writing and check state before retrying a timed-out
114
- write. See [WP-CLI security](../docs/wp-cli-security.md) for command tiers.
115
-
116
- ## 1.5.66 release note
117
-
118
- Cancellation now reaches pending HTTP requests for page listing, variable listing
119
- and creation, cache flushing, and Theme Builder template trash or preview.
120
- Cancelling a dispatched write does not prove that WordPress stopped or rolled it
121
- back; check the resulting state before retrying. This correction does not
122
- establish the cause of the separately reported four-minute client timeouts.
123
-
124
- WP-CLI rejection messages now identify the full opt-in command, such as
125
- `post meta delete`. Existing permissions and opt-in guidance are preserved.
126
-
127
- Update and restart the MCP server. These corrections require no Free Agent update;
128
- Free Agent remains 1.5.38 and public builder remains 1.4.11.
129
-
130
- ## Previous 1.5.65 release note
131
-
132
- Variable scans now report incompatible legacy non-color IDs, whether they are defined, and their known page/preset references. Scan coverage and truncation are explicit. Existing orphan and unused classifications are unchanged. Native page-usage detection is not proof of successful frontend rendering.
133
-
134
- Existing mixed-case or underscore IDs still need reviewed replacement variables and reference updates. No variable is renamed or deleted automatically; zero known references does not establish that deletion is safe.
135
-
136
- Pair with Free Agent 1.5.38. Public builder remains 1.4.11.
137
-
138
- ## Previous 1.5.64 release note
139
-
140
- Adds `diviops_page_settings_get` and `diviops_page_settings_update` with Free
141
- 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.
142
-
143
- Verified on WordPress 7.1, PHP 8.3 and Divi 5.13.1, including native settings
144
- save/reopen and frontend rendering. Public builder and compatibility floors are unchanged.
145
-
146
- ## Previous 1.5.63 release note
147
-
148
- With Free Agent 1.5.36, runtime schema discovery accepts registered third-party
149
- Divi modules and routes their namespaced identifiers without dropping the
150
- namespace. The Free plugin also supports their module read/update/move and
151
- Theme Builder block insertion. Native short identifiers remain supported;
152
- unrelated WordPress blocks are refused and the native schema dump is unchanged.
153
-
154
- Update both components for the complete correction. Native checks covered
155
- FluentCart Store Logo, not every extension or version. Public builder remains
156
- 1.4.11. Dependencies and compatibility floors are unchanged.
157
-
158
- ## Previous 1.5.62 release note
7
+ ## Quick start
159
8
 
160
- With Free Agent 1.5.34, empty header/footer inputs on template creation link the
161
- active enabled default's existing layouts and preserve region enabled states.
162
- Preview and apply report resolved sources and IDs. Without an enabled default,
163
- the result explicitly reports native-theme fallback; invalid inheritance is
164
- refused before changes. Existing templates are not automatically repaired.
9
+ 1. On a WordPress 6.5+ site running Divi 5.1+, activate the free [DiviOps Agent plugin](https://wordpress.org/plugins/diviops-agent/). A [manual plugin ZIP](https://github.com/oaris-dev/diviops/raw/main/diviops-agent.zip) is also available.
10
+ 2. In **Users → Profile → Application Passwords**, create a password for your WordPress editor account. Use HTTPS for a remote site.
11
+ 3. On the computer running your client, use Node.js 22+ and configure the stdio command below. Set `WP_URL`, `WP_USER` and `WP_APP_PASSWORD` in the client’s private configuration as shown in its connection guide.
165
12
 
166
- Links are resolved at creation, not automatically rebound when the default
167
- layout ID is replaced. Update the Free plugin to receive the fix; this MCP
168
- update supplies matching tool guidance. Public builder remains 1.4.11.
169
- Dependencies and compatibility floors are unchanged.
13
+ ```sh
14
+ npx -y --package @diviops/mcp-server diviops-mcp
15
+ ```
170
16
 
171
- ## Previous 1.5.61 release note
17
+ 4. Confirm `WP_URL` points to your intended site and reconnect the client. Ask **“Use `diviops_page_list` to list up to five pages with their IDs and titles.”** A successful read returns the pages your account can inspect. The list can be empty.
172
18
 
173
- With Free Agent 1.5.31, Theme Builder template trash and permanent deletion
174
- preserve layouts referenced by another template. Preview excludes them from
175
- destructive changes, and both preview and apply report `preserved_layouts`.
176
- Failed reference checks stop before changes. Unshared cleanup is unchanged.
19
+ Before your first write, follow the [connection check](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#step-5-test-connection) and confirm the target URL matches the site you intend to edit. If you use a known page to check the site, compare its full permalink.
177
20
 
178
- Update the Free plugin to receive the protection; this MCP update supplies
179
- matching tool guidance. Public builder remains 1.4.11. Dependencies and
180
- compatibility floors are unchanged.
21
+ For native page authoring, load the separate `diviops-divi-5` skill in your client, then verify your first draft on a staging or disposable site. [First-run native Divi verification](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#first-run-native-divi-verification)
181
22
 
182
- ## Previous 1.5.60 release note
183
-
184
- When WP-CLI is configured, `diviops_meta_info` now includes `wp_cli.ignored`:
185
- the unique, trimmed entries from `DIVIOPS_WP_CLI_ALLOW` that were not recognized
186
- at startup. Clients can inspect these alongside `allowed` and `extendable`
187
- even when startup warnings are hidden. Command permissions and matching are
188
- unchanged. Restart the MCP server after changing the environment configuration.
189
-
190
- The MCP SDK dependency now requires v1.31.0 or later within v1, incorporating
191
- its OAuth client credential-routing fix. This package uses the SDK server/stdio
192
- path. Free remains 1.5.30, public builder remains 1.4.11, and compatibility floors
193
- are unchanged.
194
-
195
- ## Previous 1.5.59 release note
196
-
197
- Adds two default WP-CLI reads: `option pluck <option> <key-path>...` for a nested
198
- option value, and `term meta get <term-id> <key>` for a term-meta field. Existing
199
- write permissions are unchanged. Restart the MCP client connection after updating
200
- to refresh the effective command list.
201
-
202
- Public builder companion 1.4.11 corrects admin-label examples to use
203
- `module.meta.adminLabel.desktop.value`. Updating npm does not update independently
204
- installed skills or instructions already read by an agent. Free remains 1.5.30;
205
- dependencies and compatibility floors are unchanged.
206
-
207
- ## Previous 1.5.58 release note
208
-
209
- With Free 1.5.30, module preset create/update accepts `group_presets` for native
210
- root composition, and inspection exposes stored links. The supplied map replaces
211
- the entire root map; omission preserves links and `{}` clears them. Slot/group
212
- buckets and existing references are validated, including dry-run. Composition
213
- requires `preset_composition_v1`; older or unverified plugins refuse it before
214
- dispatch. Keep `groupPresets` out of `attrs`. Update both components and restart
215
- the MCP client connection to refresh capabilities.
216
-
217
- Public builder companion 1.4.10 and Free validation warnings ask for explicit
218
- heading levels according to document hierarchy, without changing typography or
219
- warning detection. Updating npm or WordPress does not update independently
220
- installed skills or instructions already read by an agent.
221
-
222
- Free 1.5.30, MCP 1.5.58 and public builder 1.4.10 were delivered together.
223
- Dependencies and compatibility floors were unchanged.
224
-
225
- ## Previous 1.5.57 candidate release note
226
-
227
- Forwards `diviops_module_update` request cancellation to HTTP dispatch and pending
228
- response-body reads. This does not establish the cause or resolution of the
229
- reported four-minute hang. After dispatch, the WordPress write outcome remains
230
- unknown: cancellation does not verify no changes, a stopped write or rollback.
231
- Do not automatically retry; inspect readback and existing rollback evidence
232
- before deciding any later action.
233
-
234
- Corrects WP-CLI rejection hints to match actual extended opt-in commands.
235
- Command permissions, allowlists and opt-in requirements are unchanged.
236
-
237
- Separately prepared Free 1.5.29 generates lowercase IDs for new non-color design
238
- variables and refuses invalid supplied IDs without silently renaming them.
239
- Existing IDs and references are not migrated or repaired. Additional module-write
240
- regression coverage is tests only, not a new serialization fix.
241
-
242
- Delivered baseline: Free 1.5.28, MCP 1.5.56 and public builder companion 1.4.9.
243
- Builder content is unchanged, so its version remains 1.4.9. This is source review,
244
- not exact-package qualification, runtime acceptance or publication. A narrow
245
- dependency correction pins `proxy-addr` to patched `2.0.8` after the original
246
- qualification audit failed. Tool schemas, compatibility floors, Pro, Design
247
- Library, paid skills, primer and launcher remain unchanged. Fresh package
248
- qualification and hosted validation are authorized but pending; merge remains
249
- gated on corrected-head review and all applicable checks.
250
-
251
- ## Previous 1.5.56 candidate release note
252
-
253
- Aligns shipped setup documentation and attribute-reference citations with the
254
- renamed `diviops-divi-5` skill. Updates three pinned production dependencies to
255
- address reported advisories: `fast-uri` 3.1.8, `hono` 4.13.7 and `ip-address`
256
- 10.7.1. No DiviOps tool implementation, schema or compatibility-floor change
257
- is included. Dependency advisories do not establish exploitability in DiviOps.
258
-
259
- Separately prepared Free 1.5.28 corrects explicit-index targeting of canonical
260
- empty native Text modules and marks incomplete Inspector consumer reads as
261
- unavailable. These plugin corrections do not require a new MCP capability or
262
- raise the minimum MCP version.
263
-
264
- Public builder companion 1.4.9 preserves existing Free/Pro guidance boundaries
265
- and carries the renamed skill and preset typography ownership guidance. The
266
- marketplace plugin identifier remains `divi-5-builder`; it is not the skill name.
267
- Existing SCF/FluentCart guidance may still link to the old skill directory.
268
- Keep that working installation until matching companion guidance is available,
269
- or use an explicitly reviewed link-only migration. Do not leave two discoverable
270
- builder copies or overwrite local edits. Updating npm or WordPress does not
271
- update independently installed skills or refresh already-read instructions.
272
-
273
- This is source preparation, not exact-package qualification, runtime acceptance
274
- or public delivery. Pro, Design Library and paid-skill delivery remain separate.
275
-
276
- ## Previous 1.5.55 candidate release note
277
-
278
- With Free 1.5.27, preset deletion supports real dry-run previews and guarded
279
- `preset_ids` exact-set apply through `preset_delete_exact_v1`. Review the preview
280
- and pass its registry checksum on apply; bounded reference checks run again.
281
- Defaults, references and incomplete evidence refuse even with force. Legacy
282
- single-ID deletion retains its default-only guard, without reference checks.
283
- MCP refuses new safety parameters on old or capability-unverified handlers.
284
- These checks are point-in-time, not a transaction or automatic rollback.
285
-
286
- Native Code content strings may contain literal pseudo-escapes; shared validation
287
- and write serialization checks still require valid JSON and block delimiters.
288
- Free 1.5.27 also fixes uncached reads/readback of valid empty page content.
289
-
290
- `diviops_page_update_content` can retain a successful reviewed dry-run using
291
- `retain_content:true`; apply with `content_ref` instead of resending `content`,
292
- keeping the same target, expected checksum and backup intent. References are
293
- memory-only, MCP-process-local and one-use, expire five minutes from reservation,
294
- and are limited to eight candidates, 2 MiB each and 8 MiB total. They are consumed
295
- before apply checks/dispatch, even on failed or uncertain apply: inspect the
296
- target and review a new dry-run instead of automatically retrying. Existing write
297
- checks still run. Retention is not approval, a backup, cross-client isolation or
298
- a reduction in content sent from MCP to WordPress. Direct-content calls remain.
299
-
300
- Public builder companion 1.4.8 carries exact-ID deletion and retained-content
301
- guidance, stable native FAQ wrapper sizing, and source-qualified Divi 5.13.1
302
- generated guidance. Dependencies and compatibility floors are unchanged.
303
- This is source preparation only: local source evidence does not qualify these
304
- packages or establish that staging has the fixes. Package validation, runtime
305
- adoption and publication require separate authorization.
306
-
307
- ## Previous 1.5.54 candidate release note
308
-
309
- Adds optional `bounded:true` to `diviops_page_get` for UTF-8-safe raw content
310
- chunks of at most 4096 bytes, with a full-page checksum and byte-offset
311
- continuation. Start at offset zero, then pass each `next_offset` and the initial
312
- `expected_checksum` until `complete:true`. Content drift refuses continuation;
313
- discard collected chunks and restart. Free 1.5.26 supplies the precise
314
- `page_get_bounded_utf8_v1` capability; unsupported older plugins are refused
315
- before any page fetch, without an unbounded fallback. Reconnect after supported
316
- plugin updates to refresh the capability handshake.
317
-
318
- Default reads, authentication, permissions, writes, dependencies and global
319
- compatibility floors are unchanged. Each chunk request still reads and hashes
320
- the full upstream content. Bounded responses are not memory-bounded streaming,
321
- a snapshot service or a universal client-delivery guarantee. This is source
322
- candidate preparation, not new-package qualification or publication.
323
-
324
- Independent public builder companion 1.4.7 carries three pending references:
325
- targeted inspection and checksum-bound continuation in `tools.md`, a native CTA
326
- preset-ownership example in `presets.md`, and opt-in native image-reveal guidance
327
- in `design-effects.md`. The image-reveal runtime is already delivered separately
328
- in Design Library 1.0.0-beta.24; this preparation does not re-release Design.
329
-
330
- ## Previous 1.5.53 candidate release note
331
-
332
- The only MCP change is an inspector tool-description clarification: direct variable
333
- references and partial coverage are now explicit. No new tools or input-schema,
334
- runtime, dependency or compatibility-floor changes are included. This is source
335
- candidate preparation, not package validation or publication.
336
-
337
- Independent builder companion 1.4.6 carries already-merged guidance for native
338
- megamenu authoring, explicit local override/null semantics and implicit group defaults.
339
-
340
- ## Previous 1.5.52 candidate release note
341
-
342
- Adds `diviops_scf_text_value_update` for basic Free authoring of one existing
343
- applicable top-level SCF 6.9.4 text field. It previews by default, requires exact
344
- expected text, validates the field and verifies persisted value/reference after
345
- one provider update. Free 1.5.23 supplies the capability-gated REST handler;
346
- older plugins refuse before dispatch. No Pro or WP-CLI dependency is added.
347
- Existing Divi bindings/design are not authored by this operation. Expected-state
348
- checks are not atomic CAS, SCF snapshot rollback or full native-form equivalence.
349
-
350
- SCF member 1.2 carries the writer's scope, failure handling and bounded local MCP
351
- proof, distinct from historical native-editor evidence. That proof used temporary
352
- Free 1.5.22/MCP 1.5.51, not this candidate pair. The feature remains a source
353
- candidate until separately validated and published; restart MCP after supported
354
- updates to refresh capabilities. No dependencies or global compatibility floors change.
355
-
356
- Builder companion 1.4.5 carries the accepted Divi 5.13 source-derived schema
357
- references, Contact Form Show Labels and Map-height ownership guidance, and
358
- preset custom-ID precedence: use classes in reusable presets and unique
359
- module-local custom-ID rows, not the separate CSS-ID field as an override.
360
- It also carries native-portability guidance for importer/file handoffs, explicit
361
- preset references versus effective defaults, empty-array resets and saved-state
362
- readback. These are bounded guidance changes, not automatic preset repair,
363
- cross-version import fidelity or blanket native-save compatibility. The builder
364
- package version is independent of the SCF member version.
365
-
366
- ## Previous 1.5.51 candidate release note
367
-
368
- Adds `diviops_managed_recovery_plan_check` and
369
- `diviops_managed_recovery_restore_apply` for an opt-in, reviewed one-site
370
- recovery workflow. Plan and apply dry-run do not capture or restore; confirmed
371
- apply delegates to the shared Free protection service. An exact completed
372
- request replay returns the prior result without another restore, capture or
373
- audit append. Inspect the separate recovery, readback and audit evidence rather
374
- than inferring success from request completion.
375
-
376
- The two tools require the active Pro managed-recovery target and
377
- `managed_recovery_plan_v1`. Older compatible Free/Pro pairs retain the existing
378
- policy, retention and audit tools; basic snapshot inspection and guarded undo
379
- remain Free. Restart MCP after supported updates to refresh its capability
380
- handshake. No dependency, transport, global version floor or restore UI change
381
- is included. Candidate validation and publication are still separate steps.
382
-
383
- ## Previous 1.5.50 candidate release note
384
-
385
- Clarifies that the existing status tool targets standard WordPress Posts and
386
- Pages, not custom post types or attachments. Free Agent 1.5.20 corrects the
387
- endpoint's rejection of standard Posts while preserving edit and applicable
388
- publish permissions before dry-run plans and no-op responses. Existing request
389
- shapes and scheduling rules are unchanged; no Pro update is required.
390
-
391
- ## Previous 1.5.49 candidate release note
392
-
393
- - Adds bounded staff-body source/target evidence and preflight, plus guarded Pro
394
- apply dispatch to one existing isolated target body. Target records supply
395
- their own title, portrait, biography and plain-text role; records, fields and
396
- assignments are not created or changed. General body migration and arbitrary
397
- CPT/field mapping remain unsupported.
398
- - Forwards an optional create-only product `slug` independently of SKU when Pro
399
- advertises `fluentcart_product_create_slug`. Omission retains the existing
400
- create workflow. Dry-run reports intent without reserving a URL; read stored
401
- `product.slug` after creation and later publication. Changed product titles
402
- still regenerate slugs; no slug update, URL preservation or redirects are added.
403
-
404
- Selected source metadata is MCP `1.5.49`, Free `1.5.18`, Pro `1.0.14-beta` and
405
- FluentCart skill `0.14`. Staff-body evidence requires Free's
406
- `cross_env_staff_body_evidence`; apply also requires Pro's
407
- `cross_env_staff_body_apply` and existing Pro/module gates. Component versions
408
- remain independent: Free's minimum MCP requirement and Pro's existing Free
409
- floor are unchanged. Restart MCP after supported updates to refresh capabilities.
410
-
411
- This is source-only candidate preparation, not publication or packaged proof.
412
- The prior bounded staff-body technical proof passed, but user visual acceptance
413
- remains pending; no Visual Builder save or executed rollback was tested. That
414
- proof does not qualify FluentCart creation or live WordPress slug collisions.
415
- New-package inventories, build, production-only startup and runtime qualification
416
- remain separate validation work. SCF `1.1`, builder, Free primer, Design and
417
- launcher are unchanged; modern health remains default-disabled and repository-only,
418
- and the setup prototype remains uninstalled and unqualified.
23
+ The published end-to-end authoring check covers one run with Codex CLI 0.160.1, MCP server 1.5.74, a manually installed skill and explicit tool permissions. [Client verification details](https://github.com/oaris-dev/diviops/releases/tag/v1.5.91)
419
24
 
420
25
  ## Use cases
421
26
 
@@ -446,102 +51,6 @@ predate that experiment and did not require browser attestation or receipts.
446
51
  Source behavior is not a claim that current npm, WordPress.org or manually
447
52
  installed packages include the migration.
448
53
 
449
- ## Quick start
450
-
451
- The first three steps prove connectivity. Native Divi authoring additionally
452
- requires the client-side skill and first-run verification in steps 4 and 5.
453
-
454
- ### 1. Install the WordPress plugin
455
-
456
- 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+.
457
-
458
- 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**.
459
-
460
- ### 2. Create an Application Password
461
-
462
- In **WP Admin → Users → Your Profile → Application Passwords**:
463
- - Enter a name (e.g. "MCP Server")
464
- - Click "Add New Application Password"
465
- - Copy the generated password and strip the spaces
466
-
467
- ### 3. Register the MCP server
468
-
469
- The successor server line requires Node.js 22 or newer. Upgrade Node before
470
- selecting `@diviops/mcp-server@1.5.40` or a later release. Operators who must
471
- remain on Node 18 can pin the previously shipped compatible server explicitly:
472
-
473
- ```bash
474
- npx -y --package=@diviops/mcp-server@1.5.39 diviops-mcp
475
- ```
476
-
477
- That pin affects only the MCP server. Free and Pro WordPress plugin versions
478
- use independent version series and remain compatible through the advertised
479
- per-capability handshake. Direct npm/stdio and MCP v1 remain supported on the
480
- Node 22 successor; MCP v2 fixtures and the launcher sidecar are not published.
481
-
482
- Claude Code:
483
-
484
- ```bash
485
- claude mcp add diviops-mcp \
486
- --env WP_URL=http://your-site.local \
487
- --env WP_USER=your-wp-username \
488
- --env WP_APP_PASSWORD=xxxxXXXXxxxxXXXXxxxxXXXX \
489
- -- npx -y --package @diviops/mcp-server diviops-mcp
490
- ```
491
-
492
- Codex `~/.codex/config.toml`:
493
-
494
- ```toml
495
- [mcp_servers.diviops-mcp]
496
- command = "npx"
497
- args = ["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]
498
-
499
- [mcp_servers.diviops-mcp.env]
500
- WP_URL = "http://your-site.local"
501
- WP_USER = "your-wp-username"
502
- WP_APP_PASSWORD = "xxxxXXXXxxxxXXXXxxxxXXXX"
503
- ```
504
-
505
- Then ask your AI client: **"List the pages on my site."** It calls
506
- `diviops_page_list` and renders the result. This proves the plugin and MCP transport;
507
- it does not prove that the client has loaded Divi authoring knowledge.
508
-
509
- For Claude Desktop JSON, use `"command": "npx"` with args `["-y", "--package", "@diviops/mcp-server", "diviops-mcp"]`. The package also ships `diviops-preset`, so the explicit package/bin form is required; shorthand package invocation cannot reliably infer which bin to run.
510
-
511
- The public npm package exposes exactly three supported CLIs:
512
- `diviops-mcp`, `diviops-preset`, and `diviops-cross-env-preflight`. The
513
- launcher-managed MCP sidecar is a separate future artifact identity; it is not
514
- a public npm bin or part of the npm tarball. Repository launcher development
515
- builds and supplies that private entrypoint explicitly. This boundary does not
516
- change direct npm/stdio support.
517
-
518
- For a deeper walkthrough (containerized environments, WP-CLI configuration, troubleshooting installation), see [setup-guide.md](../docs/setup-guide.md).
519
-
520
- ### 4. Load the `diviops-divi-5` skill
521
-
522
- Install it for Claude Code by running
523
- `claude plugin marketplace add oaris-dev/diviops` and then
524
- `claude plugin install divi-5-builder@diviops`, or copy the distribution's
525
- `skills/*` into the supported skill directory for Codex/manual setups. WordPress
526
- and npm updates do not update manual skill copies. Avoid simultaneous
527
- plugin-managed and stale manual copies, then restart the client and confirm
528
- `diviops-divi-5` is visible. The plugin package keeps its historical
529
- `divi-5-builder` identifier for update continuity; that is not the skill name.
530
- For an existing installation, use the
531
- [selected-root replacement procedure](../docs/setup-guide.md) before copying:
532
- inventory both `divi-5-builder` and `diviops-divi-5` roots, preserve local edits
533
- and rollback outside discovery roots, and retire only the confirmed old copy.
534
- Unknown ownership or modified copies require review; do not add a discoverable
535
- old-name alias. Disk freshness alone does not establish loaded-session freshness.
536
-
537
- ### 5. Prove native module authoring
538
-
539
- Run the disposable, fail-closed
540
- [native Divi verification](../docs/setup-guide.md#first-run-native-divi-verification).
541
- Stop if the skill or required tools are unavailable. Do not accept page-sized HTML,
542
- Code modules, iframe layouts, or structural HTML in text/container fields as a
543
- fallback for editable native Divi modules.
544
-
545
54
  ## Example workflow
546
55
 
547
56
  > **You:** Create a hero section on a new page called "Spring Launch" with a heading, subheading, and a CTA button. Use my brand colors.
@@ -791,7 +300,13 @@ Workflow:
791
300
  1. Call `diviops_cross_env_source_export_get` on the source site and save the
792
301
  returned `data` object as `source.json`.
793
302
  2. Call `diviops_cross_env_target_context_get` on the target site and save the
794
- returned `data` object as `target.json`.
303
+ returned `data` object as `target.json`. An absent menu ID or empty desktop value in a header
304
+ or footer uses the destination's primary menu location. For explicit menu IDs,
305
+ pass the names from `source.json`'s `menus` as `source_menu_names`. Review the
306
+ source and destination term IDs and match method. If a name has zero or
307
+ multiple matches, inspect the menus, repeat the source export with explicit
308
+ `menu_targets` (for example `{"2":3}`), and pass those destination IDs as
309
+ `target_menu_ids` when collecting fresh target context.
795
310
  3. Run `diviops-cross-env-preflight --source source.json --target target.json --dry-run --contract layout-v1`
796
311
  for `diviops_cross_env_layout_apply`. Omit the contract flag (or select
797
312
  `header-v1`) only for the compatibility header apply tool.
@@ -999,6 +514,26 @@ Common quick fixes — full reference in [troubleshooting.md](../docs/troublesho
999
514
  - Divi 5 theme active
1000
515
  - DiviOps Agent WordPress plugin installed and active
1001
516
 
517
+ ## Release history
518
+
519
+ - For published server versions, run `npm view @diviops/mcp-server versions --json`. [npm registry metadata](https://registry.npmjs.org/@diviops%2fmcp-server)
520
+ - For plugin and skill updates shipped alongside the server, see the [public distribution releases](https://github.com/oaris-dev/diviops/releases).
521
+ - The [archive through MCP 1.5.77](https://github.com/oaris-dev/diviops/blob/v1.5.95/diviops-server/README.md#mcp-1577-release-note) preserves the original version notes and their qualification limits. The 1.5.67 note refers to the [WP-CLI command tiers](https://github.com/oaris-dev/diviops/blob/main/SETUP.md#wp-cli-security).
522
+
523
+ ### MCP 1.5.80 release note
524
+
525
+ Pair with Agent Pro 1.0.20-beta to review navigation menus when transferring an existing Theme Builder header or footer between sites. The plan matches explicit menus by a unique name or a destination you select. It identifies menus that follow the destination’s primary theme location. Apply refuses an explicit selection when either side cannot verify the reviewed mapping.
526
+
527
+ ### MCP 1.5.79 release note
528
+
529
+ The package page now opens with client setup guides and a first connection check that lists up to five page IDs and titles. Existing installations need no configuration change.
530
+
531
+ ### MCP 1.5.78 release note
532
+
533
+ 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.
534
+
535
+ 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.
536
+
1002
537
  ## License
1003
538
 
1004
539
  MIT
@@ -1,3 +1,4 @@
1
+ import { type MenuMapping, type MenuSource, type MenuTarget } from "./menus.js";
1
2
  export type CrossEnvObjectKind = "tb_header_layout";
2
3
  export type CrossEnvVerdict = "safe_dry_run" | "operator_action_required" | "refused";
3
4
  export interface SourceAttachmentInventoryItem {
@@ -7,7 +8,7 @@ export interface SourceAttachmentInventoryItem {
7
8
  filename?: string;
8
9
  mime?: string;
9
10
  }
10
- export interface SourceLayoutPayload {
11
+ export interface SourceLayoutPayload extends MenuSource {
11
12
  origin: string;
12
13
  object_kind: CrossEnvObjectKind | string;
13
14
  object_id?: number | string;
@@ -33,7 +34,7 @@ export interface Sha256Checksum {
33
34
  computed: string;
34
35
  input?: string;
35
36
  }
36
- export interface TargetLayoutContext {
37
+ export interface TargetLayoutContext extends MenuTarget {
37
38
  origin: string;
38
39
  destination_kind: CrossEnvObjectKind | string;
39
40
  destination_id?: number | string;
@@ -129,6 +130,7 @@ export interface CrossEnvHeaderPreflightReport {
129
130
  off_canvas: OffCanvasReference[];
130
131
  };
131
132
  rewrite_plan: {
133
+ menus?: MenuMapping[];
132
134
  url_rewrites: Array<{
133
135
  from: string;
134
136
  to: string;
@@ -153,7 +155,7 @@ export interface CrossEnvHeaderPreflightReport {
153
155
  operator_actions: PreflightIssue[];
154
156
  notes: string[];
155
157
  confirmation_binding: {
156
- schema: "diviops.cross_env.header_preflight.confirmation_binding.v1";
158
+ schema: "diviops.cross_env.header_preflight.confirmation_binding.v1" | "diviops.cross_env.header_preflight.confirmation_binding.v2";
157
159
  algorithm: "sha256";
158
160
  fingerprint: string;
159
161
  input: Record<string, unknown>;
@@ -1,3 +1,4 @@
1
+ import { PRIMARY_MENU_NOTE, planMenus } from "./menus.js";
1
2
  import { createHash } from "node:crypto";
2
3
  const SUPPORTED_KIND = "tb_header_layout";
3
4
  const UPLOADS_PREFIX = "/wp-content/uploads/";
@@ -638,7 +639,7 @@ function buildConfirmationBinding(report) {
638
639
  }
639
640
  : {}),
640
641
  };
641
- const schema = "diviops.cross_env.header_preflight.confirmation_binding.v1";
642
+ const schema = report.rewrite_plan.menus ? "diviops.cross_env.header_preflight.confirmation_binding.v2" : "diviops.cross_env.header_preflight.confirmation_binding.v1";
642
643
  const fingerprint = sha256(canonicalJson({ schema, input }));
643
644
  return {
644
645
  schema,
@@ -814,6 +815,8 @@ export function preflightCrossEnvHeaderSync(input) {
814
815
  const missingAttachmentRemaps = attachments
815
816
  .filter((attachment) => attachment.status !== "proven_remap")
816
817
  .map((attachment) => attachment.source_id);
818
+ const menus = planMenus(input.source, input.target);
819
+ blockers.push(...menus.blockers);
817
820
  const verdict = blockers.length > 0
818
821
  ? "refused"
819
822
  : operatorActions.length > 0
@@ -854,6 +857,7 @@ export function preflightCrossEnvHeaderSync(input) {
854
857
  off_canvas: offCanvas,
855
858
  },
856
859
  rewrite_plan: {
860
+ ...(menus.mappings.length || menus.blockers.length ? { menus: menus.mappings } : {}),
857
861
  url_rewrites: urlRewrites,
858
862
  attachment_replacements: attachmentReplacements,
859
863
  third_party_urls_kept: urls
@@ -865,6 +869,7 @@ export function preflightCrossEnvHeaderSync(input) {
865
869
  blockers,
866
870
  operator_actions: operatorActions,
867
871
  notes: [
872
+ ...(menus.refs.some(ref => ref.selection === "primary_location") ? [PRIMARY_MENU_NOTE] : []),
868
873
  "Preflight only: no WordPress write/apply path exists in this slice.",
869
874
  "The rewrite plan is descriptive and does not mutate markup.",
870
875
  "Fail-closed behavior is intentional for missing attachment remaps, missing gcid definitions, and off-canvas wiring.",
@@ -1,3 +1,4 @@
1
+ import { type MenuMapping } from "./menus.js";
1
2
  import { type CrossEnvVerdict, type GcidReference, type ModulePresetReference, type OffCanvasReference, type PreflightIssue, type Sha256Checksum, type SourceLayoutPayload, type TargetLayoutContext, type AttachmentReference, type UrlOccurrence } from "./header-preflight.js";
2
3
  export declare const THEME_BUILDER_LAYOUT_KIND_POST_TYPES: {
3
4
  readonly tb_header_layout: "et_header_layout";
@@ -61,6 +62,7 @@ export interface CrossEnvThemeBuilderLayoutPreflightReport {
61
62
  rewrite_scope: "same_origin_wp_uploads_only";
62
63
  };
63
64
  rewrite_plan: {
65
+ menus?: MenuMapping[];
64
66
  url_rewrites: Array<{
65
67
  from: string;
66
68
  to: string;
@@ -85,7 +87,7 @@ export interface CrossEnvThemeBuilderLayoutPreflightReport {
85
87
  operator_actions: PreflightIssue[];
86
88
  notes: string[];
87
89
  confirmation_binding: {
88
- schema: "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v1";
90
+ schema: "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v1" | "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v2";
89
91
  algorithm: "sha256";
90
92
  fingerprint: string;
91
93
  input: Record<string, unknown>;
@@ -1,4 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
+ import { PRIMARY_MENU_NOTE } from "./menus.js";
2
3
  import { staffCanonical, staffSourceProof, validStaffTarget } from "./staff-body.js";
3
4
  import { preflightCrossEnvHeaderSync, } from "./header-preflight.js";
4
5
  export const THEME_BUILDER_LAYOUT_KIND_POST_TYPES = {
@@ -43,9 +44,7 @@ function replaceCacheDestinationKind(target, kind) {
43
44
  return target.replace(/^tb_header_layout(?=#|$)/, kind);
44
45
  }
45
46
  export function preflightCrossEnvThemeBuilderLayoutSync(input) {
46
- // The shipped header-v1 engine remains the immutable compatibility analyzer.
47
- // The generic contract reuses its hazard inventory while owning a distinct
48
- // report and fingerprint namespace.
47
+ // Reuse header dependency resolution with a layout-specific fingerprint namespace.
49
48
  const base = preflightCrossEnvHeaderSync({
50
49
  source: { ...input.source, object_kind: "tb_header_layout" },
51
50
  target: { ...input.target, destination_kind: "tb_header_layout" },
@@ -58,6 +57,9 @@ export function preflightCrossEnvThemeBuilderLayoutSync(input) {
58
57
  const targetExpectedType = expectedPostType(targetKind);
59
58
  const body = sourceKind === "tb_body_layout" || targetKind === "tb_body_layout";
60
59
  if (body) {
60
+ if (base.rewrite_plan.menus) {
61
+ blockers.push({ code: "staff_body_menu_unsupported", message: "Staff body promotion cannot verify a menu-bearing recipe." });
62
+ }
61
63
  try {
62
64
  if (staffCanonical(staffSourceProof(input.source.markup)) !== staffCanonical(input.source.staff_body))
63
65
  throw Error("missing or mismatched source proof");
@@ -165,6 +167,7 @@ export function preflightCrossEnvThemeBuilderLayoutSync(input) {
165
167
  blockers,
166
168
  operator_actions: operatorActions,
167
169
  notes: [
170
+ ...base.notes.filter(note => note === PRIMARY_MENU_NOTE),
168
171
  "Preflight only: Free/core evidence and CLI do not mutate WordPress.",
169
172
  "The generic binding is distinct from the shipped header-v1 fingerprint.",
170
173
  "Template linkage is drift evidence only and never authorizes assignment mutation.",
@@ -207,7 +210,7 @@ export function preflightCrossEnvThemeBuilderLayoutSync(input) {
207
210
  operator_actions: stableIssues(operatorActions),
208
211
  validator_contract: validatorContract,
209
212
  };
210
- const schema = "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v1";
213
+ const schema = base.rewrite_plan.menus ? "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v2" : "diviops.cross_env.theme_builder_layout_preflight.confirmation_binding.v1";
211
214
  const canonicalInput = canonicalize(bindingInput);
212
215
  return {
213
216
  ...reportWithoutBinding,
@@ -0,0 +1,48 @@
1
+ import type { WPClient } from "../wp-client.js";
2
+ export interface MenuTerm {
3
+ id: number;
4
+ name: string;
5
+ slug: string;
6
+ }
7
+ export interface MenuIdentity extends MenuTerm {
8
+ digest: string;
9
+ }
10
+ export interface MenuMapping {
11
+ module: string;
12
+ source: MenuIdentity;
13
+ target: MenuIdentity;
14
+ match: "unique_name" | "operator";
15
+ }
16
+ export interface MenuSource {
17
+ menus?: MenuIdentity[];
18
+ menu_targets?: Record<string, number>;
19
+ }
20
+ export interface MenuTarget {
21
+ menus?: MenuIdentity[];
22
+ }
23
+ export declare const PRIMARY_MENU_NOTE = "Uses the destination's primary menu location.";
24
+ declare function menuSelection(attrs: unknown): number | "primary_location" | null;
25
+ export declare function menuReferences(markup: string): {
26
+ module: string;
27
+ selection: ReturnType<typeof menuSelection>;
28
+ }[];
29
+ export declare function planMenus(source: MenuSource & {
30
+ markup: string;
31
+ }, target: MenuTarget): {
32
+ refs: {
33
+ module: string;
34
+ selection: ReturnType<typeof menuSelection>;
35
+ }[];
36
+ mappings: MenuMapping[];
37
+ blockers: {
38
+ code: string;
39
+ message: string;
40
+ }[];
41
+ };
42
+ export declare function readMenus(client: WPClient, select: (term: MenuTerm) => boolean): Promise<MenuIdentity[]>;
43
+ export declare function targetMenus(client: WPClient, names?: string[], ids?: number[]): Promise<MenuTarget>;
44
+ export declare function targetMenuHints(source: MenuSource): {
45
+ names: string[] | undefined;
46
+ ids: number[];
47
+ };
48
+ export {};
@@ -0,0 +1,87 @@
1
+ import { createHash } from "node:crypto";
2
+ export const PRIMARY_MENU_NOTE = "Uses the destination's primary menu location.";
3
+ function menuSelection(attrs) {
4
+ let node = attrs;
5
+ for (const key of ["menu", "advanced", "menuId"]) {
6
+ if (!node || typeof node !== "object" || Array.isArray(node))
7
+ return null;
8
+ if (!Object.hasOwn(node, key))
9
+ return "primary_location";
10
+ node = node[key];
11
+ }
12
+ if (!node || typeof node !== "object" || Object.keys(node).join() !== "desktop")
13
+ return null;
14
+ const desktop = node.desktop;
15
+ if (!desktop || typeof desktop !== "object" || Object.keys(desktop).join() !== "value")
16
+ return null;
17
+ const value = desktop.value;
18
+ if (value === "")
19
+ return "primary_location";
20
+ if ((typeof value === "number" || typeof value === "string") &&
21
+ /^[1-9]\d*$/.test(String(value)) && Number.isSafeInteger(Number(value)))
22
+ return Number(value);
23
+ return null;
24
+ }
25
+ export function menuReferences(markup) {
26
+ const refs = [];
27
+ for (const match of markup.matchAll(/<!--\s+wp:(divi\/(?:fullwidth-)?menu)(?=[\s/])([\s\S]*?)-->/g)) {
28
+ let selection = null;
29
+ try {
30
+ selection = menuSelection(JSON.parse(match[2].replace(/\/\s*$/, "").trim() || "{}"));
31
+ }
32
+ catch { /* Malformed attributes remain a blocking reference. */ }
33
+ refs.push({ module: match[1], selection });
34
+ }
35
+ return refs;
36
+ }
37
+ export function planMenus(source, target) {
38
+ const refs = menuReferences(source.markup);
39
+ const mappings = [];
40
+ const blockers = [];
41
+ for (const ref of refs) {
42
+ if (ref.selection === "primary_location")
43
+ continue;
44
+ const origins = source.menus?.filter(menu => menu.id === ref.selection) ?? [];
45
+ const origin = origins[0];
46
+ const chosen = ref.selection === null ? undefined : source.menu_targets?.[ref.selection];
47
+ const matches = target.menus?.filter(menu => chosen === undefined ? menu.name === origin?.name : menu.id === chosen) ?? [];
48
+ if (origins.length !== 1 || !origin?.name || matches.length !== 1 ||
49
+ ![origin, matches[0]].every(menu => Number.isSafeInteger(menu.id) && menu.id > 0 &&
50
+ typeof menu.name === "string" && typeof menu.slug === "string" && /^[a-f0-9]{64}$/.test(menu.digest))) {
51
+ blockers.push({ code: "menu_mapping_unverified", message: `Cannot resolve ${ref.module} menu ${ref.selection ?? "(unsupported selection)"}. Inspect current menu names on both sites or provide an explicit destination for this source ID.` });
52
+ continue;
53
+ }
54
+ mappings.push({ module: ref.module, source: origin, target: matches[0], match: chosen === undefined ? "unique_name" : "operator" });
55
+ }
56
+ return { refs, mappings, blockers };
57
+ }
58
+ // Hash only the menu endpoint's published member fields, in their stored order.
59
+ // Only the digest and public term identity enter the exported plan.
60
+ async function readMenu(client, term) {
61
+ const result = await client.requestEnveloped(`/menu/get/${term.id}`);
62
+ if (!result.ok)
63
+ throw new Error("Cannot read the reviewed navigation menu.");
64
+ const { menu, items } = result.data;
65
+ if (menu.id !== term.id || menu.name !== term.name || menu.slug !== term.slug || !Array.isArray(items))
66
+ throw new Error("Navigation menu changed during inventory.");
67
+ const fields = ["id", "title", "url", "type", "object", "object_id", "parent", "order"];
68
+ const digest = createHash("sha256").update(JSON.stringify(items.map(item => fields.map(field => item[field])))).digest("hex");
69
+ return { id: menu.id, name: menu.name, slug: menu.slug, digest };
70
+ }
71
+ export async function readMenus(client, select) {
72
+ const result = await client.requestEnveloped("/menu/list");
73
+ if (!result.ok)
74
+ throw new Error("Cannot inventory navigation menus. Check edit_theme_options on the connected site.");
75
+ const menus = [];
76
+ for (const term of result.data.menus.filter(select))
77
+ menus.push(await readMenu(client, term));
78
+ return menus;
79
+ }
80
+ export async function targetMenus(client, names = [], ids = []) {
81
+ if (!names.length && !ids.length)
82
+ return {};
83
+ return { menus: await readMenus(client, term => names.includes(term.name) || ids.includes(term.id)) };
84
+ }
85
+ export function targetMenuHints(source) {
86
+ return { names: source.menus?.map(menu => menu.name), ids: Object.values(source.menu_targets ?? {}) };
87
+ }
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { ErrorCodes, envelopeMap, recordIdempotent, serializeEnvelope, withCode,
21
21
  import { preflightCrossEnvHeaderSync, } from "./cross-env-preflight/header-preflight.js";
22
22
  import { preflightCrossEnvThemeBuilderLayoutSync, } from "./cross-env-preflight/layout-preflight.js";
23
23
  import { crossEnvEvidenceLayoutKinds } from "./cross-env-preflight/layout-capability.js";
24
+ import { menuReferences, readMenus, targetMenuHints, targetMenus } from "./cross-env-preflight/menus.js";
24
25
  import { sourceHintsFromPayload } from "./cross-env-source-hints.js";
25
26
  import { createSourcePayloadRef, loadSourcePayloadRef, } from "./cross-env-preflight/source-payload-ref.js";
26
27
  import { optimizeSchema } from "./schema-optimizer.js";
@@ -2779,6 +2780,8 @@ function registerCrossEnvEvidenceTools() {
2779
2780
  .optional()
2780
2781
  .default("tb_header_layout")
2781
2782
  .describe(`Destination kind. Existing ${layoutLabel} layout evidence is supported.${staffNote}`),
2783
+ source_menu_names: z.array(z.string()).optional().describe("Menu names from the source export; inventories all matching destination menus."),
2784
+ target_menu_ids: z.array(z.number().int().positive()).optional().describe("Explicit destination IDs from the source export menu_targets."),
2782
2785
  source_asset_hints: z
2783
2786
  .array(z.string())
2784
2787
  .optional()
@@ -2799,7 +2802,7 @@ function registerCrossEnvEvidenceTools() {
2799
2802
  },
2800
2803
  annotations: { idempotentHint: true },
2801
2804
  _meta: { idempotent: "true" },
2802
- }, async ({ destination_id, destination_kind, source_asset_hints, source_upload_paths, source_attachment_ids, }) => {
2805
+ }, async ({ destination_id, destination_kind, source_menu_names, target_menu_ids, source_asset_hints, source_upload_paths, source_attachment_ids, }) => {
2803
2806
  const body = {
2804
2807
  destination_id,
2805
2808
  destination_kind: destination_kind ?? "tb_header_layout",
@@ -2813,9 +2816,11 @@ function registerCrossEnvEvidenceTools() {
2813
2816
  if (source_attachment_ids && source_attachment_ids.length > 0) {
2814
2817
  body.source_attachment_ids = source_attachment_ids;
2815
2818
  }
2816
- const result = await wp.requestEnveloped("/cross-env/target-context", {
2817
- method: "POST",
2818
- body,
2819
+ const result = await wrapResponse(async () => {
2820
+ const context = await wp.requestEnveloped("/cross-env/target-context", { method: "POST", body });
2821
+ if (context.ok)
2822
+ Object.assign(context.data, await targetMenus(wp, source_menu_names, target_menu_ids));
2823
+ return context;
2819
2824
  });
2820
2825
  return {
2821
2826
  content: [
@@ -2829,6 +2834,7 @@ function registerCrossEnvEvidenceTools() {
2829
2834
  registerPluginTool("diviops_cross_env_source_export_get", {
2830
2835
  description: `Export read-only, secret-free source-site payload for an offline cross-environment Theme Builder ${layoutLabel} preflight. Returns exact kind/post-type identity, sanitized markup and checksum, dependency inventories, and a bounded source_payload_ref. Free/core and read-only: no WordPress content, assignment, dependency, or cache mutation.${staffNote}`,
2831
2836
  inputSchema: {
2837
+ menu_targets: z.record(z.string(), z.number().int().positive()).optional().describe("Optional operator-reviewed source menu ID to destination menu ID choices."),
2832
2838
  source_id: z
2833
2839
  .number()
2834
2840
  .int()
@@ -2847,7 +2853,7 @@ function registerCrossEnvEvidenceTools() {
2847
2853
  },
2848
2854
  annotations: { idempotentHint: true },
2849
2855
  _meta: { idempotent: "true" },
2850
- }, async ({ source_id, source_kind }) => {
2856
+ }, async ({ source_id, source_kind, menu_targets }) => {
2851
2857
  const withRef = await wrapResponse(async () => {
2852
2858
  const body = {
2853
2859
  source_id,
@@ -2857,6 +2863,14 @@ function registerCrossEnvEvidenceTools() {
2857
2863
  method: "POST",
2858
2864
  body,
2859
2865
  });
2866
+ if (result.ok) {
2867
+ const refs = menuReferences(result.data.markup);
2868
+ if (refs.some(ref => typeof ref.selection === "number")) {
2869
+ result.data.menus = await readMenus(wp, term => refs.some(ref => ref.selection === term.id));
2870
+ if (menu_targets)
2871
+ result.data.menu_targets = menu_targets;
2872
+ }
2873
+ }
2860
2874
  return envelopeMap(result, (data) => ({
2861
2875
  ...data,
2862
2876
  source_payload_ref: createSourcePayloadRef(data),
@@ -4630,7 +4644,7 @@ function registerProTools() {
4630
4644
  }, { target: "managed_recovery", capabilityKey: "managed_recovery_plan_v1" });
4631
4645
  // diviops_cross_env_header_apply — guarded Pro apply for reviewed header preflight
4632
4646
  registerProTool("diviops_cross_env_header_apply", {
4633
- description: "Apply a reviewed cross-environment Theme Builder header payload into an existing target header layout (Pro tier; requires the cross_env Pro module). This first MVP is intentionally narrow: it requires `confirm_apply: true`, either an inline source export payload or a bounded `source_payload_ref` returned by diviops_cross_env_source_export_get, an existing target `destination_id`, and the reviewed `confirmation_binding.fingerprint` from `diviops-cross-env-preflight`. Large real headers should use `source_payload_ref`; inline `source_payload` remains supported for small/disposable tests. The server loads referenced payload bytes from its own `.diviops-tmp/cross-env-source-payloads/` artifact store, verifies checksum, re-exports current target context, reruns the TypeScript preflight engine, refuses fingerprint mismatch, unsafe verdicts, destination checksum drift, missing/ambiguous attachment remaps, missing global-color value evidence, missing target module preset definitions, and off-canvas/canvas references, then calls the Pro route with the verified plan. The Pro route re-loads the destination post, verifies the current checksum again, builds content only from source-origin upload URL rewrites and proven attachment-ID remaps, writes with readback/rollback evidence, and runs Divi static-resource cleanup plus explicit _divi_dynamic_assets_cached_feature_used cleanup. No media upload/import, global-color creation/import, preset import/clone, new layout creation, off-canvas reconcile, public/store/license change, or live-site smoke is performed by this tool. Returns the standardized envelope { ok, data?, error: { code, message, hint?, data? } }. Error codes include cross_env.confirmation_required, cross_env.source_payload_ref_invalid, cross_env.fingerprint_mismatch, cross_env.preflight_not_safe, cross_env.destination_checksum_drift, cross_env.source_checksum_mismatch, cross_env.content_write_corruption, invalid_input, not_found, forbidden, and wp_error.",
4647
+ description: "Apply a reviewed cross-environment Theme Builder header payload into an existing target header layout (Pro tier; requires the cross_env Pro module). This first MVP is intentionally narrow: it requires `confirm_apply: true`, either an inline source export payload or a bounded `source_payload_ref` returned by diviops_cross_env_source_export_get, an existing target `destination_id`, and the reviewed `confirmation_binding.fingerprint` from `diviops-cross-env-preflight`. Large real headers should use `source_payload_ref`; inline `source_payload` remains supported for small/disposable tests. The server loads referenced payload bytes from its own `.diviops-tmp/cross-env-source-payloads/` artifact store, verifies checksum, re-exports current target context, reruns the TypeScript preflight engine, refuses fingerprint mismatch, unsafe verdicts, destination checksum drift, missing/ambiguous attachment remaps, missing global-color value evidence, missing target module preset definitions, off-canvas/canvas references, and unverified navigation menus, then calls the Pro route with the verified plan. The Pro route re-loads the destination post, verifies the current checksum again, builds content from reviewed upload URL, attachment and menu mappings, writes with readback/rollback evidence, and runs Divi static-resource cleanup plus explicit _divi_dynamic_assets_cached_feature_used cleanup. No media upload/import, global-color creation/import, preset import/clone, new layout creation, off-canvas reconcile, public/store/license change, or live-site smoke is performed by this tool. Returns the standardized envelope { ok, data?, error: { code, message, hint?, data? } }. Error codes include cross_env.confirmation_required, cross_env.source_payload_ref_invalid, cross_env.fingerprint_mismatch, cross_env.preflight_not_safe, cross_env.destination_checksum_drift, cross_env.source_checksum_mismatch, cross_env.content_write_corruption, invalid_input, not_found, forbidden, and wp_error.",
4634
4648
  inputSchema: {
4635
4649
  source_payload: CrossEnvHeaderSourcePayloadSchema.optional().describe("The `data` object returned by diviops_cross_env_source_export_get on the source site. Use source_payload_ref instead for large real headers."),
4636
4650
  source_payload_ref: CrossEnvSourcePayloadRefSchema.optional().describe("Bounded server-local artifact reference returned as data.source_payload_ref by diviops_cross_env_source_export_get. Preferred for large real headers because it avoids inlining full markup through the model."),
@@ -4689,6 +4703,8 @@ function registerProTools() {
4689
4703
  const targetEnvelope = await wp.requestEnveloped("/cross-env/target-context", { method: "POST", body: targetBody });
4690
4704
  if (!targetEnvelope.ok)
4691
4705
  return targetEnvelope;
4706
+ const menuHints = targetMenuHints(resolvedSourcePayload);
4707
+ Object.assign(targetEnvelope.data, await targetMenus(wp, menuHints.names, menuHints.ids));
4692
4708
  const report = preflightCrossEnvHeaderSync({
4693
4709
  source: resolvedSourcePayload,
4694
4710
  target: targetEnvelope.data,
@@ -4798,6 +4814,8 @@ function registerProTools() {
4798
4814
  });
4799
4815
  if (!targetEnvelope.ok)
4800
4816
  return targetEnvelope;
4817
+ const menuHints = targetMenuHints(resolvedSourcePayload);
4818
+ Object.assign(targetEnvelope.data, await targetMenus(wp, menuHints.names, menuHints.ids));
4801
4819
  const report = preflightCrossEnvThemeBuilderLayoutSync({
4802
4820
  source: resolvedSourcePayload,
4803
4821
  target: targetEnvelope.data,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.78",
4
- "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
3
+ "version": "1.5.80",
4
+ "description": "MCP server for Divi 5 on WordPress. List pages, inspect presets and edit native Divi modules through the DiviOps Agent plugin.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {