@diviops/mcp-server 1.5.54 → 1.5.56

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
@@ -2,13 +2,69 @@
2
2
 
3
3
  **An AI harness for WordPress site authoring — Divi-native today, WordPress-wide by design.**
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 `divi-5-builder` skill so the agent applies Divi's block format and design rules correctly.
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.
6
6
 
7
7
  ```
8
8
  Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
9
9
  ```
10
10
 
11
- ## 1.5.54 candidate release note
11
+ ## 1.5.56 candidate release note
12
+
13
+ Aligns shipped setup documentation and attribute-reference citations with the
14
+ renamed `diviops-divi-5` skill. Updates three pinned production dependencies to
15
+ address reported advisories: `fast-uri` 3.1.8, `hono` 4.13.7 and `ip-address`
16
+ 10.7.1. No DiviOps tool implementation, schema or compatibility-floor change
17
+ is included. Dependency advisories do not establish exploitability in DiviOps.
18
+
19
+ Separately prepared Free 1.5.28 corrects explicit-index targeting of canonical
20
+ empty native Text modules and marks incomplete Inspector consumer reads as
21
+ unavailable. These plugin corrections do not require a new MCP capability or
22
+ raise the minimum MCP version.
23
+
24
+ Public builder companion 1.4.9 preserves existing Free/Pro guidance boundaries
25
+ and carries the renamed skill and preset typography ownership guidance. The
26
+ marketplace plugin identifier remains `divi-5-builder`; it is not the skill name.
27
+ Existing SCF/FluentCart guidance may still link to the old skill directory.
28
+ Keep that working installation until matching companion guidance is available,
29
+ or use an explicitly reviewed link-only migration. Do not leave two discoverable
30
+ builder copies or overwrite local edits. Updating npm or WordPress does not
31
+ update independently installed skills or refresh already-read instructions.
32
+
33
+ This is source preparation, not exact-package qualification, runtime acceptance
34
+ or public delivery. Pro, Design Library and paid-skill delivery remain separate.
35
+
36
+ ## Previous 1.5.55 candidate release note
37
+
38
+ With Free 1.5.27, preset deletion supports real dry-run previews and guarded
39
+ `preset_ids` exact-set apply through `preset_delete_exact_v1`. Review the preview
40
+ and pass its registry checksum on apply; bounded reference checks run again.
41
+ Defaults, references and incomplete evidence refuse even with force. Legacy
42
+ single-ID deletion retains its default-only guard, without reference checks.
43
+ MCP refuses new safety parameters on old or capability-unverified handlers.
44
+ These checks are point-in-time, not a transaction or automatic rollback.
45
+
46
+ Native Code content strings may contain literal pseudo-escapes; shared validation
47
+ and write serialization checks still require valid JSON and block delimiters.
48
+ Free 1.5.27 also fixes uncached reads/readback of valid empty page content.
49
+
50
+ `diviops_page_update_content` can retain a successful reviewed dry-run using
51
+ `retain_content:true`; apply with `content_ref` instead of resending `content`,
52
+ keeping the same target, expected checksum and backup intent. References are
53
+ memory-only, MCP-process-local and one-use, expire five minutes from reservation,
54
+ and are limited to eight candidates, 2 MiB each and 8 MiB total. They are consumed
55
+ before apply checks/dispatch, even on failed or uncertain apply: inspect the
56
+ target and review a new dry-run instead of automatically retrying. Existing write
57
+ checks still run. Retention is not approval, a backup, cross-client isolation or
58
+ a reduction in content sent from MCP to WordPress. Direct-content calls remain.
59
+
60
+ Public builder companion 1.4.8 carries exact-ID deletion and retained-content
61
+ guidance, stable native FAQ wrapper sizing, and source-qualified Divi 5.13.1
62
+ generated guidance. Dependencies and compatibility floors are unchanged.
63
+ This is source preparation only: local source evidence does not qualify these
64
+ packages or establish that staging has the fixes. Package validation, runtime
65
+ adoption and publication require separate authorization.
66
+
67
+ ## Previous 1.5.54 candidate release note
12
68
 
13
69
  Adds optional `bounded:true` to `diviops_page_get` for UTF-8-safe raw content
14
70
  chunks of at most 4096 bytes, with a full-page checksum and byte-offset
@@ -221,7 +277,7 @@ change direct npm/stdio support.
221
277
 
222
278
  For a deeper walkthrough (containerized environments, WP-CLI configuration, troubleshooting installation), see [setup-guide.md](../docs/setup-guide.md).
223
279
 
224
- ### 4. Load the `divi-5-builder` skill
280
+ ### 4. Load the `diviops-divi-5` skill
225
281
 
226
282
  Install it for Claude Code by running
227
283
  `claude plugin marketplace add oaris-dev/diviops` and then
@@ -229,7 +285,14 @@ Install it for Claude Code by running
229
285
  `skills/*` into the supported skill directory for Codex/manual setups. WordPress
230
286
  and npm updates do not update manual skill copies. Avoid simultaneous
231
287
  plugin-managed and stale manual copies, then restart the client and confirm
232
- `divi-5-builder` is visible.
288
+ `diviops-divi-5` is visible. The plugin package keeps its historical
289
+ `divi-5-builder` identifier for update continuity; that is not the skill name.
290
+ For an existing installation, use the
291
+ [selected-root replacement procedure](../docs/setup-guide.md) before copying:
292
+ inventory both `divi-5-builder` and `diviops-divi-5` roots, preserve local edits
293
+ and rollback outside discovery roots, and retire only the confirmed old copy.
294
+ Unknown ownership or modified copies require review; do not add a discoverable
295
+ old-name alias. Disk freshness alone does not establish loaded-session freshness.
233
296
 
234
297
  ### 5. Prove native module authoring
235
298
 
@@ -528,6 +591,8 @@ Every write tool accepts `dry_run: boolean` (default `false`). When `true`, the
528
591
 
529
592
  `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).
530
593
 
594
+ Preset deletion requires `preset_delete_exact_v1` for real dry-run or guarded `preset_ids` (1-200 exact IDs). Preview returns a registry checksum; exact-set apply requires it and rechecks defaults/references across all post content, postmeta and canonical preset definitions. Incomplete evidence refuses, and force cannot bypass exact-set checks. Legacy `preset_id` remains default-guard-only, with its existing force override. MCP never forwards new safety parameters to old or capability-unverified handlers, which could otherwise ignore `dry_run` and delete. See [coverage, limits and nontransactional semantics](../docs/safety-patterns.md#exact-set-preset-deletion).
595
+
531
596
  Selected guarded post-content write tools also accept `backup: true`. In apply
532
597
  mode the Free plugin stores an option-backed rollback snapshot before writing
533
598
  and returns `data.backup` evidence with the snapshot id and status. With
@@ -589,7 +654,7 @@ Common quick fixes — full reference in [troubleshooting.md](../docs/troublesho
589
654
  - [safety-patterns.md](../docs/safety-patterns.md) — Pattern A (refuse-with-override) + Pattern B (preview-then-commit) + universal `dry_run`
590
655
  - [troubleshooting.md](../docs/troubleshooting.md) — common errors and resolutions
591
656
  - [idempotency-audit.md](../docs/idempotency-audit.md) — repeat-call semantics per tool
592
- - **`divi-5-builder` skill** — block format rules, design patterns, workflow guidance (ships in the dist repo)
657
+ - **`diviops-divi-5` skill** — block format rules, design patterns, workflow guidance (ships in the dist repo)
593
658
 
594
659
  ## Requirements
595
660
 
@@ -48,7 +48,7 @@
48
48
  "cell_evidence_level": "SCHEMA_OBSERVED",
49
49
  "cell_divi_version": "5.5.2",
50
50
  "verified_at": "2026-05-19",
51
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
51
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
52
52
  "caveats": ["Tier 1 documented as universally applicable in module-formats.md; no module-specific VB capture for divi/heading on this wrapper yet"]
53
53
  },
54
54
  "divi/text": {
@@ -57,7 +57,7 @@
57
57
  "cell_evidence_level": "SCHEMA_OBSERVED",
58
58
  "cell_divi_version": "5.5.2",
59
59
  "verified_at": "2026-05-19",
60
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
60
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
61
61
  "caveats": []
62
62
  },
63
63
  "divi/button": {
@@ -66,7 +66,7 @@
66
66
  "cell_evidence_level": "SCHEMA_OBSERVED",
67
67
  "cell_divi_version": "5.5.2",
68
68
  "verified_at": "2026-05-19",
69
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
69
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
70
70
  "caveats": ["Button background is canonically authored at button.decoration.background (Tier 2 button group), not module.decoration.background; module-level background works only when intentionally targeting the surrounding wrapper"]
71
71
  }
72
72
  }
@@ -96,7 +96,7 @@
96
96
  "cell_evidence_level": "SCHEMA_OBSERVED",
97
97
  "cell_divi_version": "5.5.2",
98
98
  "verified_at": "2026-05-19",
99
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
99
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
100
100
  "caveats": []
101
101
  },
102
102
  "divi/text": {
@@ -105,7 +105,7 @@
105
105
  "cell_evidence_level": "SCHEMA_OBSERVED",
106
106
  "cell_divi_version": "5.5.2",
107
107
  "verified_at": "2026-05-19",
108
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
108
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
109
109
  "caveats": []
110
110
  },
111
111
  "divi/button": {
@@ -114,7 +114,7 @@
114
114
  "cell_evidence_level": "SCHEMA_OBSERVED",
115
115
  "cell_divi_version": "5.5.2",
116
116
  "verified_at": "2026-05-19",
117
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
117
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
118
118
  "caveats": ["Button-module padding lives on module.decoration.spacing per Button exception, NOT button.decoration.spacing (which is VB-hidden / non-functional). See module-formats.md."]
119
119
  },
120
120
  "divi/row": {
@@ -123,7 +123,7 @@
123
123
  "cell_evidence_level": "SCHEMA_OBSERVED",
124
124
  "cell_divi_version": "5.5.2",
125
125
  "verified_at": "2026-05-19",
126
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
126
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
127
127
  "caveats": []
128
128
  },
129
129
  "divi/column": {
@@ -132,7 +132,7 @@
132
132
  "cell_evidence_level": "SCHEMA_OBSERVED",
133
133
  "cell_divi_version": "5.5.2",
134
134
  "verified_at": "2026-05-19",
135
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
135
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
136
136
  "caveats": []
137
137
  },
138
138
  "divi/group": {
@@ -141,7 +141,7 @@
141
141
  "cell_evidence_level": "SCHEMA_OBSERVED",
142
142
  "cell_divi_version": "5.5.2",
143
143
  "verified_at": "2026-05-19",
144
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
144
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
145
145
  "caveats": []
146
146
  }
147
147
  }
@@ -173,7 +173,7 @@
173
173
  "cell_evidence_level": "SCHEMA_OBSERVED",
174
174
  "cell_divi_version": "5.5.2",
175
175
  "verified_at": "2026-05-19",
176
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
176
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
177
177
  "caveats": []
178
178
  },
179
179
  "divi/heading": {
@@ -182,7 +182,7 @@
182
182
  "cell_evidence_level": "SCHEMA_OBSERVED",
183
183
  "cell_divi_version": "5.5.2",
184
184
  "verified_at": "2026-05-19",
185
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
185
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
186
186
  "caveats": []
187
187
  },
188
188
  "divi/text": {
@@ -191,7 +191,7 @@
191
191
  "cell_evidence_level": "SCHEMA_OBSERVED",
192
192
  "cell_divi_version": "5.5.2",
193
193
  "verified_at": "2026-05-19",
194
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
194
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
195
195
  "caveats": []
196
196
  },
197
197
  "divi/image": {
@@ -200,7 +200,7 @@
200
200
  "cell_evidence_level": "SCHEMA_OBSERVED",
201
201
  "cell_divi_version": "5.5.2",
202
202
  "verified_at": "2026-05-19",
203
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#image-vb-verified-2026-03-19-schema-audited-2026-04-12--exception",
203
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#image-vb-verified-2026-03-19-schema-audited-2026-04-12--exception",
204
204
  "caveats": ["Image-module exception: border lives on image.decoration.border, NOT module.decoration.border. Border radius from preset alone does not render — reinforce inline per module-formats.md image-specific quirk."]
205
205
  }
206
206
  }
@@ -208,7 +208,7 @@
208
208
  {
209
209
  "pattern_family": "module.decoration.sizing",
210
210
  "pattern_evidence_level": "SCHEMA_OBSERVED",
211
- "pattern_evidence_source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
211
+ "pattern_evidence_source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
212
212
  "pattern_divi_version": "5.5.2",
213
213
  "pattern_verified_at": "2026-05-19",
214
214
  "canonical_shape_note": "sizing.desktop.value.{maxWidth, width, flexType, alignment, alignSelf, minHeight, height}. flexType uses 24-unit grid ('8_24', '12_24'). flexType requires parent row display:'flex' per module-formats.md Column section. No Phase 1 capture for sizing yet; pattern remains SCHEMA_OBSERVED until a VB-roundtrip lands.",
@@ -219,7 +219,7 @@
219
219
  "cell_evidence_level": "SCHEMA_OBSERVED",
220
220
  "cell_divi_version": "5.5.2",
221
221
  "verified_at": "2026-05-19",
222
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#column-vb-verified-2026-03-19-flex-pipeline-reverified-2026-05-09-against-divi-541-",
222
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#column-vb-verified-2026-03-19-flex-pipeline-reverified-2026-05-09-against-divi-541-",
223
223
  "caveats": ["flexType requires parent row display:'flex'; on block-display rows Divi emits the legacy et_pb_column_N_M class and ignores flexType (intentional Divi behavior, not a bug)"]
224
224
  },
225
225
  "divi/group": {
@@ -228,7 +228,7 @@
228
228
  "cell_evidence_level": "SCHEMA_OBSERVED",
229
229
  "cell_divi_version": "5.5.2",
230
230
  "verified_at": "2026-05-19",
231
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#group-vb-verified-2026-03-21-",
231
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#group-vb-verified-2026-03-21-",
232
232
  "caveats": []
233
233
  },
234
234
  "divi/section": {
@@ -237,7 +237,7 @@
237
237
  "cell_evidence_level": "SCHEMA_OBSERVED",
238
238
  "cell_divi_version": "5.5.2",
239
239
  "verified_at": "2026-05-19",
240
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-1--common-decoration-all-modules",
240
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-1--common-decoration-all-modules",
241
241
  "caveats": []
242
242
  }
243
243
  }
@@ -276,7 +276,7 @@
276
276
  "cell_evidence_level": "SCHEMA_OBSERVED",
277
277
  "cell_divi_version": "5.5.2",
278
278
  "verified_at": "2026-05-19",
279
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
279
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
280
280
  "caveats": ["Wrapper inferred from module-formats.md Font Family B; not VB-roundtripped on divi/blurb specifically"]
281
281
  },
282
282
  "divi/number-counter": {
@@ -287,7 +287,7 @@
287
287
  "cell_evidence_level": "SCHEMA_OBSERVED",
288
288
  "cell_divi_version": "5.5.2",
289
289
  "verified_at": "2026-05-19",
290
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
290
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
291
291
  "caveats": []
292
292
  },
293
293
  "divi/testimonial": {
@@ -298,7 +298,7 @@
298
298
  "cell_evidence_level": "SCHEMA_OBSERVED",
299
299
  "cell_divi_version": "5.5.2",
300
300
  "verified_at": "2026-05-19",
301
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
301
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
302
302
  "caveats": ["Testimonial also exposes jobTitle and company variants; each is a separate cell"]
303
303
  },
304
304
  "divi/accordion-item": {
@@ -309,7 +309,7 @@
309
309
  "cell_evidence_level": "SCHEMA_OBSERVED",
310
310
  "cell_divi_version": "5.5.2",
311
311
  "verified_at": "2026-05-19",
312
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
312
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
313
313
  "caveats": []
314
314
  },
315
315
  "divi/slide": {
@@ -320,7 +320,7 @@
320
320
  "cell_evidence_level": "SCHEMA_OBSERVED",
321
321
  "cell_divi_version": "5.5.2",
322
322
  "verified_at": "2026-05-19",
323
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
323
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
324
324
  "caveats": []
325
325
  }
326
326
  }
@@ -383,7 +383,7 @@
383
383
  "cell_evidence_level": "SCHEMA_OBSERVED",
384
384
  "cell_divi_version": "5.5.2",
385
385
  "verified_at": "2026-05-19",
386
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
386
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
387
387
  "caveats": []
388
388
  },
389
389
  "divi/accordion-item": {
@@ -394,7 +394,7 @@
394
394
  "cell_evidence_level": "SCHEMA_OBSERVED",
395
395
  "cell_divi_version": "5.5.2",
396
396
  "verified_at": "2026-05-19",
397
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
397
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
398
398
  "caveats": []
399
399
  },
400
400
  "divi/slide": {
@@ -405,7 +405,7 @@
405
405
  "cell_evidence_level": "SCHEMA_OBSERVED",
406
406
  "cell_divi_version": "5.5.2",
407
407
  "verified_at": "2026-05-19",
408
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
408
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
409
409
  "caveats": []
410
410
  },
411
411
  "divi/blurb": {
@@ -416,7 +416,7 @@
416
416
  "cell_evidence_level": "SCHEMA_OBSERVED",
417
417
  "cell_divi_version": "5.5.2",
418
418
  "verified_at": "2026-05-19",
419
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
419
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
420
420
  "caveats": []
421
421
  }
422
422
  }
@@ -509,7 +509,7 @@
509
509
  "cell_evidence_level": "SCHEMA_OBSERVED",
510
510
  "cell_divi_version": "5.5.2",
511
511
  "verified_at": "2026-05-19",
512
- "source": ".claude/skills/divi-5-builder/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
512
+ "source": ".claude/skills/diviops-divi-5/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
513
513
  "caveats": [
514
514
  "divi/spacing group bucket VB-confirmed (5.4.0); per-module title-spacing cell needs its own roundtrip",
515
515
  "group_id is NOT VB-verified for this cell — value 'title.decoration.spacing' is schema-inferred. The canonical section spacing capture (5.6.0) proved the section cell uses groupId='designSpacing' (Composable Settings panel id, not dotted attr path); whether heading uses the same value or a wrapper-prefixed variant is unverified. Do NOT use this group_id for preset writes until a heading-spacing capture on the canonical clean reference substrate lands. Note: write/reset sandbox presets (ids ecs423stpr, yjh59i25br) are bound to title wrapper with the same sparse-emit shape, but these are unverified residue and explicitly NOT used as evidence; proper capture on the canonical reference substrate is required."
@@ -523,7 +523,7 @@
523
523
  "cell_evidence_level": "SCHEMA_OBSERVED",
524
524
  "cell_divi_version": "5.5.2",
525
525
  "verified_at": "2026-05-19",
526
- "source": ".claude/skills/divi-5-builder/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
526
+ "source": ".claude/skills/diviops-divi-5/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
527
527
  "caveats": [
528
528
  "group_id is NOT VB-verified for this cell — value 'content.decoration.spacing' is schema-inferred. The canonical section spacing capture (5.6.0) proved the section cell uses groupId='designSpacing' (Composable Settings panel id, not dotted attr path); whether text uses the same value or a wrapper-prefixed variant is unverified. Do NOT use this group_id for preset writes until a text-spacing capture on the canonical clean reference substrate lands."
529
529
  ]
@@ -553,7 +553,7 @@
553
553
  "cell_evidence_level": "SCHEMA_OBSERVED",
554
554
  "cell_divi_version": "5.5.2",
555
555
  "verified_at": "2026-05-19",
556
- "source": ".claude/skills/divi-5-builder/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
556
+ "source": ".claude/skills/diviops-divi-5/references/presets.md#known-group-bucket-inventory-vb-verified-2026-05-04",
557
557
  "caveats": [
558
558
  "Button padding is canonically authored on module.decoration.spacing per Button exception (NOT button.decoration.spacing which is VB-hidden)",
559
559
  "group_id is NOT VB-verified for this cell — value 'module.decoration.spacing' is schema-inferred. The canonical section spacing capture (5.6.0) proved the section cell uses groupId='designSpacing' (Composable Settings panel id, not dotted attr path); whether button uses the same value or differs is unverified. Do NOT use this group_id for preset writes until a button-spacing capture on the canonical clean reference substrate lands."
@@ -571,7 +571,7 @@
571
571
  "evidence_level": "SCHEMA_OBSERVED",
572
572
  "divi_version": "5.5.2",
573
573
  "verified_at": "2026-05-19",
574
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
574
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#button-vb-verified-2026-03-31-for-511-schema-audited-2026-04-12-",
575
575
  "status": "documented",
576
576
  "caveats": ["innerContent is per-instance, not normally preset-authored; the Phase 1 captures focus on preset shape so this cell remains SCHEMA_OBSERVED for now"]
577
577
  },
@@ -583,7 +583,7 @@
583
583
  "evidence_level": "SCHEMA_OBSERVED",
584
584
  "divi_version": "5.5.2",
585
585
  "verified_at": "2026-05-19",
586
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#text-vb-verified-2026-03-19-schema-audited-2026-04-12-",
586
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#text-vb-verified-2026-03-19-schema-audited-2026-04-12-",
587
587
  "status": "documented",
588
588
  "caveats": []
589
589
  },
@@ -595,7 +595,7 @@
595
595
  "evidence_level": "SCHEMA_OBSERVED",
596
596
  "divi_version": "5.5.2",
597
597
  "verified_at": "2026-05-19",
598
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#heading-vb-verified-2026-03-19-schema-audited-2026-04-12-",
598
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#heading-vb-verified-2026-03-19-schema-audited-2026-04-12-",
599
599
  "status": "documented",
600
600
  "caveats": []
601
601
  },
@@ -607,7 +607,7 @@
607
607
  "evidence_level": "SCHEMA_OBSERVED",
608
608
  "divi_version": "5.5.2",
609
609
  "verified_at": "2026-05-19",
610
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#tier-2--pattern-families",
610
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#tier-2--pattern-families",
611
611
  "status": "documented",
612
612
  "caveats": ["headingLevel is a structural-only field — preset's styleAttrs strip it per presets.md storage-format notes"]
613
613
  },
@@ -619,7 +619,7 @@
619
619
  "evidence_level": "SCHEMA_OBSERVED",
620
620
  "divi_version": "5.5.2",
621
621
  "verified_at": "2026-05-19",
622
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#image-vb-verified-2026-03-19-schema-audited-2026-04-12--exception",
622
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#image-vb-verified-2026-03-19-schema-audited-2026-04-12--exception",
623
623
  "status": "documented",
624
624
  "caveats": ["Combined form appears to work in practice; VB round-trip test pending per module-formats.md drift candidate note"]
625
625
  },
@@ -631,7 +631,7 @@
631
631
  "evidence_level": "SCHEMA_OBSERVED",
632
632
  "divi_version": "5.5.2",
633
633
  "verified_at": "2026-05-19",
634
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#icon-vb-verified-2026-03-19-schema-audited-2026-04-12-",
634
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#icon-vb-verified-2026-03-19-schema-audited-2026-04-12-",
635
635
  "status": "documented",
636
636
  "caveats": []
637
637
  },
@@ -643,7 +643,7 @@
643
643
  "evidence_level": "SCHEMA_OBSERVED",
644
644
  "divi_version": "5.5.2",
645
645
  "verified_at": "2026-05-19",
646
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#dividers-section-only-vb-verified-2026-03-23",
646
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#dividers-section-only-vb-verified-2026-03-23",
647
647
  "status": "documented",
648
648
  "caveats": ["Section only; Row/Column/Group do not support dividers"]
649
649
  },
@@ -655,7 +655,7 @@
655
655
  "evidence_level": "SCHEMA_OBSERVED",
656
656
  "divi_version": "5.5.2",
657
657
  "verified_at": "2026-05-19",
658
- "source": ".claude/skills/divi-5-builder/references/module-formats.md#column-vb-verified-2026-03-19-flex-pipeline-reverified-2026-05-09-against-divi-541-",
658
+ "source": ".claude/skills/diviops-divi-5/references/module-formats.md#column-vb-verified-2026-03-19-flex-pipeline-reverified-2026-05-09-against-divi-541-",
659
659
  "status": "documented",
660
660
  "caveats": ["Requires parent row display:'flex'; otherwise Divi emits legacy et_pb_column_N_M and ignores flexType (intentional Divi behavior)"]
661
661
  }
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import { z } from "zod";
14
14
  import { WPClient } from "./wp-client.js";
15
15
  import { BOUNDED_PAGE_CAPABILITY, boundedPageError, serializeBoundedPageRead } from "./bounded-page-read.js";
16
16
  import { requestAuthoringWrite } from "./authoring-shape-integration.js";
17
+ import { PageContentCandidates, PAGE_CANDIDATE_LIMITS, candidateError } from "./page-content-candidates.js";
17
18
  import { capabilityUpgradeHint, MissingCapabilityError, observedVersion, proToolGatesSatisfied, } from "./compatibility.js";
18
19
  import { missingCapabilityEnvelope, } from "./capability-envelope.js";
19
20
  import { ErrorCodes, envelopeMap, recordIdempotent, serializeEnvelope, withCode, wrapResponse, } from "./envelope.js";
@@ -56,6 +57,7 @@ const wp = new WPClient({
56
57
  applicationPassword: WP_APP_PASSWORD,
57
58
  });
58
59
  const authoringWrite = (endpoint, method, body, operation, dryRun) => requestAuthoringWrite(wp, { endpoint, method, body, operation, dryRun });
60
+ const pageContentCandidates = new PageContentCandidates();
59
61
  // WP-CLI (optional — Local by Flywheel via WP_PATH, or custom wrapper via WP_CLI_CMD)
60
62
  const WP_PATH = process.env.WP_PATH ?? "";
61
63
  const WP_CLI_CMD = process.env.WP_CLI_CMD?.trim() ?? "";
@@ -1284,13 +1286,16 @@ registerPluginTool("diviops_seo_metadata_update", {
1284
1286
  };
1285
1287
  });
1286
1288
  registerPluginTool("diviops_page_update_content", {
1287
- description: "Update the content of a page with Divi block markup. The content should be valid WordPress block markup using divi/* blocks. IMPORTANT: This overwrites the entire page content. Pass expected_checksum from diviops_page_get to refuse stale writes; omission preserves the legacy unconditional-write contract. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing page_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403), stale content returns 'page.content_drift' (HTTP 409), and non-string content returns 'invalid_input' with `error.data = { field, received_type }`." +
1289
+ description: "Update the content of a page with Divi block markup. The content should be valid WordPress block markup using divi/* blocks. IMPORTANT: This overwrites the entire page content. Pass expected_checksum from diviops_page_get to refuse stale writes; omission preserves the legacy unconditional-write contract. Optionally set retain_content:true with dry_run:true and expected_checksum to retain a successful candidate in this process for 5 minutes (2 MiB each, 8 references / 8 MiB total). Returns data.content_ref, content_checksum, expires_at alongside the dry-run plan. Apply using content_ref instead of content, repeating the same page_id, expected_checksum and backup intent. References are process-local and single-use, consumed before writer dispatch even on failure; never automatically retry. Restart/expiry requires a new dry-run. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing page_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403), stale content returns 'page.content_drift' (HTTP 409), and non-string content returns 'invalid_input' with `error.data = { field, received_type }`." +
1288
1290
  DRY_RUN_DESC_SUFFIX,
1289
1291
  inputSchema: {
1290
1292
  page_id: z.number().describe("WordPress post/page ID to update"),
1291
1293
  content: z
1292
1294
  .string()
1295
+ .optional()
1293
1296
  .describe("Full page content in WordPress block markup format (<!-- wp:divi/section -->...<!-- /wp:divi/section -->)"),
1297
+ content_ref: z.string().optional().describe("Single-use reference from a successful retained dry-run; apply only, mutually exclusive with content."),
1298
+ retain_content: z.boolean().optional().describe("Retain content only on an explicitly confirmed successful dry-run. Requires expected_checksum. content_checksum hashes exact submitted UTF-8 bytes, not normalized persisted bytes. Capacity and the 5-minute TTL begin before the upstream request. MCP-process-local, not isolated per client session."),
1294
1299
  expected_checksum: z
1295
1300
  .string()
1296
1301
  .regex(/^sha256:[a-f0-9]{64}$/)
@@ -1301,7 +1306,24 @@ registerPluginTool("diviops_page_update_content", {
1301
1306
  },
1302
1307
  annotations: { idempotentHint: false },
1303
1308
  _meta: { idempotent: "conditional" },
1304
- }, async ({ page_id, content, expected_checksum, dry_run, backup }) => {
1309
+ }, async ({ page_id, content, content_ref, retain_content, expected_checksum, dry_run, backup }) => {
1310
+ const reply = (result) => ({ content: [{ type: "text", text: serializeEnvelope(result, "diviops_page_update_content") }] });
1311
+ if ((content === undefined) === (content_ref === undefined) ||
1312
+ (retain_content === true && (dry_run !== true || content === undefined)) ||
1313
+ (content_ref !== undefined && (dry_run === true || retain_content === true)) ||
1314
+ ((retain_content === true || content_ref !== undefined) && (expected_checksum === undefined || !Number.isSafeInteger(page_id) || page_id <= 0))) {
1315
+ return reply(candidateError("invalid_input", "Provide exactly one of content or content_ref. Retention requires content, dry_run:true, a positive page_id and expected_checksum; reference apply requires the same page, checksum and backup intent."));
1316
+ }
1317
+ if (retain_content && Buffer.byteLength(content, "utf8") > PAGE_CANDIDATE_LIMITS.candidateBytes) {
1318
+ return reply(candidateError("page.content_ref_capacity", "Retained candidate exceeds the 2 MiB limit."));
1319
+ }
1320
+ const binding = { site: WP_URL, page_id, expected_checksum: expected_checksum, backup: backup === true };
1321
+ if (content_ref !== undefined) {
1322
+ const resolved = pageContentCandidates.consume(content_ref, binding);
1323
+ if (!resolved.ok)
1324
+ return reply(resolved);
1325
+ content = resolved.data;
1326
+ }
1305
1327
  const backupGate = backupCapabilityError("diviops_page_update_content", backup);
1306
1328
  if (backupGate)
1307
1329
  return backupGate;
@@ -1318,12 +1340,27 @@ registerPluginTool("diviops_page_update_content", {
1318
1340
  body.dry_run = true;
1319
1341
  if (backup)
1320
1342
  body.backup = true;
1321
- const result = await authoringWrite(`/page/update-content/${page_id}`, "POST", body, "page_update_content", dry_run === true);
1322
- return {
1323
- content: [
1324
- { type: "text", text: serializeEnvelope(result, "diviops_page_update_content") },
1325
- ],
1326
- };
1343
+ const reservation = retain_content ? pageContentCandidates.reserve(binding, content) : undefined;
1344
+ if (reservation && !reservation.ok)
1345
+ return reply(reservation);
1346
+ try {
1347
+ const result = await authoringWrite(`/page/update-content/${page_id}`, "POST", body, "page_update_content", dry_run === true);
1348
+ if (reservation?.ok && result.ok) {
1349
+ const data = result.data;
1350
+ if (!data || typeof data !== "object" || !("dry_run" in data) || data.dry_run !== true) {
1351
+ return reply(candidateError("page.content_ref_unconfirmed", "Writer did not confirm a successful dry-run; no candidate retained."));
1352
+ }
1353
+ if (!pageContentCandidates.confirm(reservation.data.content_ref)) {
1354
+ return reply(candidateError("page.content_ref_invalid", "Candidate expired during dry-run; run a new retained dry-run."));
1355
+ }
1356
+ return reply({ ok: true, data: { ...data, ...reservation.data } });
1357
+ }
1358
+ return reply(result);
1359
+ }
1360
+ finally {
1361
+ if (reservation?.ok)
1362
+ pageContentCandidates.cancel(reservation.data.content_ref);
1363
+ }
1327
1364
  });
1328
1365
  registerPluginTool("diviops_page_update_meta", {
1329
1366
  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." +
@@ -1424,7 +1461,7 @@ registerPluginTool("diviops_render_preview", {
1424
1461
  };
1425
1462
  });
1426
1463
  registerPluginTool("diviops_validate_blocks", {
1427
- description: "Validate Divi block markup before saving. 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 regression checks on shipped pages without round-tripping the markup blob). Provide exactly one. Checks structure (malformed comments, unknown blocks, missing builderVersion), required attributes (layout display on containers), and known pitfalls (button padding path, icon.enable, gradient enabled/positions). Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { valid: bool, total_blocks: number, errors: Finding[], warnings: Finding[] } where each Finding is { block, index, code, message, path? }. Note: shape errors detected in the markup surface as success-branch `data.errors[]` entries (NOT `validation_failed` envelopes) — the findings array is the payload, not an error. The envelope's error branch fires only for tool-level failures (`invalid_input` for neither/both supplied or invalid page_id; `forbidden` for missing edit_post; `not_found` for unknown page_id; `divi_error` for an exception in the walker).",
1464
+ description: "Validate Divi block markup before saving. 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 regression checks on shipped pages without round-tripping the markup blob). Provide exactly one. Checks shared write serialization and marker integrity (literal pseudo-escapes are allowed in native Code content strings), structure (malformed comments, unknown blocks, missing builderVersion), required attributes (layout display on containers), and known pitfalls (button padding path, icon.enable, gradient enabled/positions). Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload is { valid: bool, total_blocks: number, errors: Finding[], warnings: Finding[] } where each Finding is { block, index, code, message, path? }. Serialization failures return valid:false with invalid_serialization findings and total_blocks:0 because the tree was not walked. Note: shape errors detected in the markup surface as success-branch `data.errors[]` entries (NOT `validation_failed` envelopes) — the findings array is the payload, not an error. The envelope's error branch fires only for tool-level failures (`invalid_input` for neither/both supplied or invalid page_id; `forbidden` for missing edit_post; `not_found` for unknown page_id; `divi_error` for an exception in the walker).",
1428
1465
  inputSchema: {
1429
1466
  content: z
1430
1467
  .string()
@@ -2227,20 +2264,35 @@ registerPluginTool("diviops_preset_update", {
2227
2264
  };
2228
2265
  });
2229
2266
  registerPluginTool("diviops_preset_delete", {
2230
- description: "Delete a specific preset by ID. Use diviops_preset_audit first to verify the preset is unreferenced before deleting. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing preset_id returns code 'not_found' with a hint to diviops_preset_audit. Refuses with code 'conflict' (HTTP 409) and `error.data = { preset_id, type, module, name, reason: 'is_default' }` if the target is the registered default for its module/group bucket — clear the pointer first via diviops_preset_set_default with unset=true, or pass force=true to delete and clear the pointer in one write. The `reason` discriminator field leaves room for future conflict reasons (referenced_in_chain, etc.) without reshaping.",
2267
+ description: "Delete presets by exact ID. Legacy preset_id mode checks only the bucket default, NOT references; force=true deletes a default and clears its pointer. Additive preset_ids mode accepts 1-200 unique IDs, refuses defaults, references, unknown/ambiguous IDs, stale registry and incomplete evidence; force cannot bypass these checks. Preview with dry_run:true returns an exact plan and registry_checksum; apply requires expected_registry_checksum and rescans references. Scans all post_content (including revisions/Theme Builder), postmeta, canonical preset definitions/default pointers; conservative matches refuse. Evidence limits: 10000 rows per table, 64 MiB post evidence, nesting 64; unsupported/malformed evidence refuses. Only selected records are removed, in one registry write. No content edits, normalization, transactional guarantee or automatic rollback. Keep other writers idle. Real dry_run in either mode and all exact-set calls require preset_delete_exact_v1; older/unknown plugin capability refuses before dispatch. Returns the standardized envelope; exact-set conflicts carry error.data.reason. Legacy missing IDs return not_found.",
2231
2268
  inputSchema: {
2232
- preset_id: z.string().describe("Preset ID to delete"),
2269
+ preset_id: z.string().min(1).optional().describe("Legacy single ID; mutually exclusive with preset_ids. No reference safeguard."),
2270
+ preset_ids: z.array(z.string().regex(/^[A-Za-z0-9_-]{1,128}$/)).min(1).max(200).optional().describe("Exact guarded selection, never name/duplicate heuristics."),
2271
+ dry_run: z.boolean().optional().describe("True previews with zero writes; false/omitted applies. Capability-gated in both modes."),
2272
+ expected_registry_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/).optional().describe("Exact preview registry_checksum, required for preset_ids apply only."),
2233
2273
  force: z
2234
2274
  .boolean()
2235
2275
  .optional()
2236
- .describe("When true, deletes the preset even if it is the registered default and clears the default pointer in the same write. Default false (refuse-by-default)."),
2276
+ .describe("Legacy preset_id only: delete a default and clear its pointer. Ignored in exact-set mode; never bypasses its safeguards."),
2237
2277
  },
2238
2278
  annotations: { idempotentHint: true },
2239
2279
  _meta: { idempotent: "true" },
2240
- }, async ({ preset_id, force }) => {
2241
- const body = { preset_id };
2280
+ }, async ({ preset_id, preset_ids, force, dry_run, expected_registry_checksum }) => {
2281
+ const exact = preset_ids !== undefined;
2282
+ if ((preset_id !== undefined) === exact || (exact && (new Set(preset_ids).size !== preset_ids.length || (!dry_run && expected_registry_checksum === undefined))) || (!exact && expected_registry_checksum !== undefined)) {
2283
+ return { content: [{ type: "text", text: serializeEnvelope({ ok: false, error: { code: "invalid_input", message: "Supply preset_id OR 1-200 unique preset_ids; exact-set apply requires expected_registry_checksum from preview." } }, "diviops_preset_delete") }] };
2284
+ }
2285
+ // Never let an old handler silently ignore preview/exact-set parameters and delete.
2286
+ if ((exact || dry_run !== undefined || expected_registry_checksum !== undefined) && (handshakeState.kind !== "ok" || handshakeState.capabilities.preset_delete_exact_v1 !== true)) {
2287
+ return missingCapabilityEnvelope(new MissingCapabilityError("preset_delete_exact_v1", handshakeState.kind === "ok" ? handshakeState.pluginVersion : undefined), "diviops_preset_delete", { serverVersion: SERVER_VERSION });
2288
+ }
2289
+ const body = exact ? { preset_ids } : { preset_id };
2242
2290
  if (force !== undefined)
2243
2291
  body.force = force;
2292
+ if (dry_run !== undefined)
2293
+ body.dry_run = dry_run;
2294
+ if (expected_registry_checksum !== undefined)
2295
+ body.expected_registry_checksum = expected_registry_checksum;
2244
2296
  const result = await wp.requestEnveloped("/preset/delete", {
2245
2297
  method: "POST",
2246
2298
  body,
@@ -2714,7 +2766,7 @@ registerPluginTool("diviops_tb_layout_update", {
2714
2766
  };
2715
2767
  });
2716
2768
  registerPluginTool("diviops_tb_layout_block_insert", {
2717
- description: "Insert one or more serialized Divi blocks into an existing Theme Builder layout without replacing the whole layout. Target a unique parent with `parent_selector` (for example `divi/group[adminLabel=\"Legal Col\"]`, or `divi/group` only when it is unique) or an explicit zero-based `parent_path` from the parsed block tree such as `0.1.2`. `position=append|prepend` inserts as children of the target block; `position=before|after` inserts beside the target within its parent. Ambiguous selectors return ok:false with code 'invalid_input'; missing targets return 'not_found'. The route parses and validates the inserted blocks, rejects malformed pseudo-escapes such as bare `u003c`, validates the final serialized layout before saving, and returns a no-op when the exact requested block sequence already exists at the insertion point." +
2769
+ description: "Insert one or more serialized Divi blocks into an existing Theme Builder layout without replacing the whole layout. Target a unique parent with `parent_selector` (for example `divi/group[adminLabel=\"Legal Col\"]`, or `divi/group` only when it is unique) or an explicit zero-based `parent_path` from the parsed block tree such as `0.1.2`. `position=append|prepend` inserts as children of the target block; `position=before|after` inserts beside the target within its parent. Ambiguous selectors return ok:false with code 'invalid_input'; missing targets return 'not_found'. The route parses and validates the inserted blocks, rejects malformed serialization (literal pseudo-escapes such as bare `u003c` are allowed in native Code content strings), validates the final serialized layout before saving, and returns a no-op when the exact requested block sequence already exists at the insertion point." +
2718
2770
  DRY_RUN_DESC_SUFFIX,
2719
2771
  inputSchema: {
2720
2772
  layout_id: z.number().int().describe("Theme Builder layout post ID to mutate"),
@@ -0,0 +1,34 @@
1
+ import type { DiviopsResponse } from "./envelope.js";
2
+ export declare const PAGE_CANDIDATE_LIMITS: Readonly<{
3
+ ttlMs: 300000;
4
+ count: 8;
5
+ candidateBytes: number;
6
+ totalBytes: number;
7
+ }>;
8
+ type Binding = {
9
+ site: string;
10
+ page_id: number;
11
+ expected_checksum: string;
12
+ backup: boolean;
13
+ };
14
+ export declare const candidateError: (code: string, message: string) => DiviopsResponse<never>;
15
+ /** Memory-only, process-local, single-use references. No payload is written to disk. */
16
+ export declare class PageContentCandidates {
17
+ private readonly now;
18
+ private entries;
19
+ private bytes;
20
+ private timer?;
21
+ constructor(now?: () => number);
22
+ private prune;
23
+ private remove;
24
+ private schedule;
25
+ reserve(binding: Binding, content: string): DiviopsResponse<{
26
+ content_ref: string;
27
+ content_checksum: string;
28
+ expires_at: string;
29
+ }>;
30
+ confirm(ref: string): boolean;
31
+ cancel(ref: string): void;
32
+ consume(ref: string, binding: Binding): DiviopsResponse<string>;
33
+ }
34
+ export {};
@@ -0,0 +1,74 @@
1
+ import { createHash, randomBytes } from "node:crypto";
2
+ export const PAGE_CANDIDATE_LIMITS = Object.freeze({ ttlMs: 300_000, count: 8, candidateBytes: 2 * 1024 * 1024, totalBytes: 8 * 1024 * 1024 });
3
+ export const candidateError = (code, message) => ({ ok: false, error: { code, message } });
4
+ const checksum = (content) => `sha256:${createHash("sha256").update(content, "utf8").digest("hex")}`;
5
+ /** Memory-only, process-local, single-use references. No payload is written to disk. */
6
+ export class PageContentCandidates {
7
+ now;
8
+ entries = new Map();
9
+ bytes = 0;
10
+ timer;
11
+ constructor(now = Date.now) {
12
+ this.now = now;
13
+ }
14
+ prune() {
15
+ for (const [ref, entry] of this.entries) {
16
+ if (entry.expires <= this.now())
17
+ this.remove(ref, entry);
18
+ }
19
+ }
20
+ remove(ref, entry) {
21
+ this.entries.delete(ref);
22
+ this.bytes -= entry.bytes;
23
+ }
24
+ schedule() {
25
+ if (this.timer)
26
+ clearTimeout(this.timer);
27
+ this.timer = undefined;
28
+ if (!this.entries.size)
29
+ return;
30
+ const expires = Math.min(...Array.from(this.entries.values(), e => e.expires));
31
+ this.timer = setTimeout(() => { this.prune(); this.schedule(); }, Math.max(1, expires - this.now()));
32
+ this.timer.unref();
33
+ }
34
+ reserve(binding, content) {
35
+ this.prune();
36
+ const bytes = Buffer.byteLength(content, "utf8");
37
+ if (bytes > PAGE_CANDIDATE_LIMITS.candidateBytes || this.entries.size >= PAGE_CANDIDATE_LIMITS.count || this.bytes + bytes > PAGE_CANDIDATE_LIMITS.totalBytes) {
38
+ return candidateError("page.content_ref_capacity", "Candidate retention capacity exceeded; resend content after capacity becomes available.");
39
+ }
40
+ const ref = `pcr_${randomBytes(32).toString("hex")}`;
41
+ const entry = { ...binding, content, content_checksum: checksum(content), bytes, expires: this.now() + PAGE_CANDIDATE_LIMITS.ttlMs, ready: false };
42
+ this.entries.set(ref, entry);
43
+ this.bytes += bytes;
44
+ this.schedule();
45
+ return { ok: true, data: { content_ref: ref, content_checksum: entry.content_checksum, expires_at: new Date(entry.expires).toISOString() } };
46
+ }
47
+ confirm(ref) {
48
+ this.prune();
49
+ const entry = this.entries.get(ref);
50
+ if (!entry)
51
+ return false;
52
+ entry.ready = true;
53
+ return true;
54
+ }
55
+ cancel(ref) {
56
+ const entry = this.entries.get(ref);
57
+ if (entry && !entry.ready)
58
+ this.remove(ref, entry);
59
+ this.schedule();
60
+ }
61
+ consume(ref, binding) {
62
+ this.prune();
63
+ const entry = this.entries.get(ref);
64
+ if (!entry || !entry.ready)
65
+ return candidateError("page.content_ref_invalid", "Unknown, expired, or consumed content_ref. Run a new retained dry-run.");
66
+ if (entry.site !== binding.site || entry.page_id !== binding.page_id || entry.expected_checksum !== binding.expected_checksum || entry.backup !== binding.backup || checksum(entry.content) !== entry.content_checksum) {
67
+ return candidateError("page.content_ref_mismatch", "content_ref does not match the site, page, reviewed checksum, or backup intent.");
68
+ }
69
+ // Synchronous removal precedes every asynchronous writer dispatch, including failures.
70
+ this.remove(ref, entry);
71
+ this.schedule();
72
+ return { ok: true, data: entry.content };
73
+ }
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.54",
3
+ "version": "1.5.56",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -63,9 +63,9 @@
63
63
  "@hono/node-server": "2.1.0",
64
64
  "@modelcontextprotocol/sdk": "^1.30.0",
65
65
  "body-parser": "2.3.0",
66
- "fast-uri": "3.1.7",
67
- "hono": "4.13.5",
68
- "ip-address": "10.5.0",
66
+ "fast-uri": "3.1.8",
67
+ "hono": "4.13.7",
68
+ "ip-address": "10.7.1",
69
69
  "zod": "^4.3.6"
70
70
  },
71
71
  "devDependencies": {