@diviops/mcp-server 1.5.50 → 1.5.52

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.
Files changed (3) hide show
  1. package/README.md +57 -2
  2. package/dist/index.js +55 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,50 @@ The Node.js MCP server inside the DiviOps harness. It gives Claude Code, Codex,
8
8
  Claude Code <-> MCP Server (stdio) <-> WordPress REST API <-> DiviOps Agent plugin
9
9
  ```
10
10
 
11
- ## 1.5.50 candidate release note
11
+ ## 1.5.52 candidate release note
12
+
13
+ Adds `diviops_scf_text_value_update` for basic Free authoring of one existing
14
+ applicable top-level SCF 6.9.4 text field. It previews by default, requires exact
15
+ expected text, validates the field and verifies persisted value/reference after
16
+ one provider update. Free 1.5.23 supplies the capability-gated REST handler;
17
+ older plugins refuse before dispatch. No Pro or WP-CLI dependency is added.
18
+ Existing Divi bindings/design are not authored by this operation. Expected-state
19
+ checks are not atomic CAS, SCF snapshot rollback or full native-form equivalence.
20
+
21
+ SCF member 1.2 carries the writer's scope, failure handling and bounded local MCP
22
+ proof, distinct from historical native-editor evidence. That proof used temporary
23
+ Free 1.5.22/MCP 1.5.51, not this candidate pair. The feature remains a source
24
+ candidate until separately validated and published; restart MCP after supported
25
+ updates to refresh capabilities. No dependencies or global compatibility floors change.
26
+
27
+ Builder companion 1.4.5 carries the accepted Divi 5.13 source-derived schema
28
+ references, Contact Form Show Labels and Map-height ownership guidance, and
29
+ preset custom-ID precedence: use classes in reusable presets and unique
30
+ module-local custom-ID rows, not the separate CSS-ID field as an override.
31
+ It also carries native-portability guidance for importer/file handoffs, explicit
32
+ preset references versus effective defaults, empty-array resets and saved-state
33
+ readback. These are bounded guidance changes, not automatic preset repair,
34
+ cross-version import fidelity or blanket native-save compatibility. The builder
35
+ package version is independent of the SCF member version.
36
+
37
+ ## Previous 1.5.51 candidate release note
38
+
39
+ Adds `diviops_managed_recovery_plan_check` and
40
+ `diviops_managed_recovery_restore_apply` for an opt-in, reviewed one-site
41
+ recovery workflow. Plan and apply dry-run do not capture or restore; confirmed
42
+ apply delegates to the shared Free protection service. An exact completed
43
+ request replay returns the prior result without another restore, capture or
44
+ audit append. Inspect the separate recovery, readback and audit evidence rather
45
+ than inferring success from request completion.
46
+
47
+ The two tools require the active Pro managed-recovery target and
48
+ `managed_recovery_plan_v1`. Older compatible Free/Pro pairs retain the existing
49
+ policy, retention and audit tools; basic snapshot inspection and guarded undo
50
+ remain Free. Restart MCP after supported updates to refresh its capability
51
+ handshake. No dependency, transport, global version floor or restore UI change
52
+ is included. Candidate validation and publication are still separate steps.
53
+
54
+ ## Previous 1.5.50 candidate release note
12
55
 
13
56
  Clarifies that the existing status tool targets standard WordPress Posts and
14
57
  Pages, not custom post types or attachments. Free Agent 1.5.20 corrects the
@@ -180,7 +223,7 @@ The skill enforces the Divi block format, the design system, and the response co
180
223
 
181
224
  ## Tools at a glance
182
225
 
183
- The server exposes **94 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
226
+ The server exposes **95 always-on tools** across the categories below. Each category links to representative tools; the full table lives in [server-reference.md](../docs/server-reference.md).
184
227
 
185
228
  | Category | Use case | Tool prefixes |
186
229
  |----------|----------|---------------|
@@ -196,6 +239,17 @@ The server exposes **94 always-on tools** across the categories below. Each cate
196
239
  | WP-CLI passthrough | Escape hatch for site ops | `meta_wp_cli` |
197
240
  | Cache + meta | Connection probe, identity, icons, cache flush | `meta_*` |
198
241
 
242
+ Source candidate: `diviops_scf_text_value_update` is a Free REST writer, separate
243
+ from the existing SCF CLI schema tools. It previews by default and updates one
244
+ existing applicable top-level text field on an editable post, with exact expected
245
+ value, SCF 6.9.4 field validation and persisted value/reference readback. It requires
246
+ the precise Free plugin capability, not Pro or WP-CLI. Empty/literal-"0", multiline,
247
+ markup, nested/conditional fields and schema changes are outside its initial
248
+ scope. See the separately supplied DiviOps SCF skill's text-value contract
249
+ for exact inputs and failure semantics. No full native-form equivalence, atomic
250
+ CAS, SCF snapshot backup or automatic rollback/retry. The retained one-field
251
+ local proof does not qualify the new candidate packages or another runtime.
252
+
199
253
  Use `diviops_meta_info` as the S0 preflight before dogfooding or product work. It returns `server_version`, a numeric `tool_count`, a `tools` catalog summary (`registered_total`, always-on count, Pro possible/registered counts by target), `plugins` version records for `diviops-agent`, `diviops-agent-pro`, FluentCart, and FluentCart Pro when available, plus the existing handshake and slice state. In regular npm/stdio sessions, successfully observed plugin, module, capability, and registered-tool fields are the immutable handshake snapshot that built the session catalog. The additive `startup_capture` record supplies its non-secret timestamp, exact covered evidence, independent-component compatibility rule, and deterministic reconnect guidance. A failed handshake instead reports `startup_unavailable`, a bounded `startup_handshake_failed` reason class, and no covered target evidence. After a supported plugin, theme, or target change, reconnect or restart MCP before treating `meta_info`, the registered tools, or capability gates as current. Live read tools such as `diviops_fc_status` remain separate current observations; they do not rewrite startup registry truth.
200
254
 
201
255
  Launcher health mode keeps its stricter existing contract: `diviops_meta_ping` and `diviops_meta_info` re-observe model-visible target evidence on every call. The regular stdio `startup_capture` record does not alter launcher behavior, direct npm/stdio compatibility, or tool registration after initialization.
@@ -215,6 +269,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
215
269
  | FluentCart checkout readiness / gateway inspection (V3.2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_status`, `diviops_fc_gateway_list`, `diviops_fc_gateway_get` |
216
270
  | Cross-env reviewed layout rollout | Pro plugin + `cross_env` module enabled | `diviops_cross_env_header_apply`, `diviops_cross_env_layout_apply` |
217
271
  | Managed recovery Phase 1A | Pro plugin + opt-in `managed_recovery` module enabled | `diviops_managed_recovery_policy_get`, `diviops_managed_recovery_policy_preview`, `diviops_managed_recovery_policy_update`, `diviops_managed_recovery_retention_preview`, `diviops_managed_recovery_retention_apply`, `diviops_managed_recovery_audit_list` |
272
+ | Managed recovery Phase 1B | Same opt-in module + Free protected restore service + `managed_recovery_plan_v1` | `diviops_managed_recovery_plan_check`, `diviops_managed_recovery_restore_apply` |
218
273
 
219
274
  When the gates are not satisfied, the tools simply don't appear on the MCP surface — no error envelope, no missing-capability hint. See the `diviops-fluentcart` skill bundle for the operator-side guide.
220
275
 
package/dist/index.js CHANGED
@@ -3169,6 +3169,24 @@ registerLocalTool("diviops_meta_wp_cli", {
3169
3169
  });
3170
3170
  // ── SCF (Secure Custom Fields / ACF) wrappers ───────────────────────
3171
3171
  //
3172
+ // Free REST writer; deliberately separate from the existing CLI schema tools.
3173
+ const scfTextValueInput = z.string().min(1).max(4096).regex(/^[^<>\x00-\x1f\x7f]+$/)
3174
+ .refine((value) => value.trim() !== "" && value !== "0" && Buffer.byteLength(value, "utf8") <= 4096, "Expected single-line plain UTF-8 text (1-4096 bytes); whitespace-only and literal 0 are excluded.");
3175
+ registerPluginTool("diviops_scf_text_value_update", {
3176
+ description: "Update one existing applicable top-level SCF text value on an editable post. Free authoring; requires the scf_text_value_update plugin capability and active SCF 6.9.4, not WP-CLI or Pro. Exact expected_value precheck is not atomic CAS. Defaults to dry-run; preview before explicit apply. Single-line plain UTF-8 strings, at most 4096 bytes; empty, whitespace-only, literal 0, markup and control characters excluded in this initial contract. Calls field validation, not full native form-save validation. Provider hooks may transform values or have side effects. One update call with persisted value/reference readback; no snapshot backup, automatic rollback or retry. No definition, Divi binding/design or template writes. Error diagnostics omit values. Returns the standard envelope; stale state is scf.conflict, unchanged persisted state after an attempted change is scf.write_failed, unverified/changed readback is scf.mutation_uncertain.",
3177
+ inputSchema: z.object({
3178
+ post_id: z.number().int().positive(),
3179
+ field_key: z.string().regex(/^field_[A-Za-z0-9_]+$/),
3180
+ expected_value: scfTextValueInput,
3181
+ value: scfTextValueInput,
3182
+ dry_run: z.boolean().default(true),
3183
+ }).strict(),
3184
+ annotations: { idempotentHint: false },
3185
+ _meta: { idempotent: "conditional" },
3186
+ }, async (args) => {
3187
+ const result = await wp.requestEnveloped("/scf/text-value/update", { method: "POST", body: args });
3188
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_scf_text_value_update") }] };
3189
+ });
3172
3190
  // Typed wrappers over SCF 6.8.4+'s `wp scf json {status,sync,import,export}`
3173
3191
  // CLI family (also reachable as `wp acf json …`). The plugin file at
3174
3192
  // wp-content/plugins/secure-custom-fields/src/CLI/JsonCommand.php is the
@@ -4184,6 +4202,10 @@ const ManagedRecoveryRequestIdSchema = z
4184
4202
  .string()
4185
4203
  .regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$/)
4186
4204
  .describe("Caller-stable request ID used for confirmation binding and exact replay/conflict detection.");
4205
+ const ManagedRecoverySnapshotIdSchema = z
4206
+ .string()
4207
+ .regex(/^[A-Za-z0-9][A-Za-z0-9_-]{2,127}$/)
4208
+ .describe("Existing rollback snapshot ID to restore to its original supported page or layout target.");
4187
4209
  const ManagedRecoveryConfirmationSchema = {
4188
4210
  confirmation_fingerprint: z
4189
4211
  .string()
@@ -4282,6 +4304,39 @@ function registerProTools() {
4282
4304
  const result = await wp.requestEnveloped("/pro/managed-recovery/audit", { params: { page: String(page), per_page: String(per_page) } });
4283
4305
  return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_audit_list") }] };
4284
4306
  }, { target: "managed_recovery", capabilityKey: "managed_recovery_audit_v1" });
4307
+ registerProTool("diviops_managed_recovery_plan_check", {
4308
+ description: "Pure-read managed recovery plan for one existing rollback snapshot (Pro Phase 1B). Requires manage_options and current target edit permission. Returns value-free intended before-state and supported metadata actions, checksums, limits/exclusions, cache/readback expectations, and capture-on-apply readiness, not an already-created recovery point. Uses Free-owned protected dry-run validation and issues a maximum-15-minute site/actor/request/snapshot/state/policy/inventory-bound confirmation for restore_apply. Writes no options, snapshots, content, cache, or audit state and returns no raw content or metadata.",
4309
+ inputSchema: z.object({
4310
+ snapshot_id: ManagedRecoverySnapshotIdSchema,
4311
+ request_id: ManagedRecoveryRequestIdSchema,
4312
+ }).strict(),
4313
+ annotations: { readOnlyHint: true, idempotentHint: true },
4314
+ _meta: { idempotent: "true" },
4315
+ }, async ({ snapshot_id, request_id }) => {
4316
+ const result = await wp.requestEnveloped("/pro/managed-recovery/plan/check", { method: "POST", body: { snapshot_id, request_id } });
4317
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_plan_check") }] };
4318
+ }, { target: "managed_recovery", capabilityKey: "managed_recovery_plan_v1" });
4319
+ registerProTool("diviops_managed_recovery_restore_apply", {
4320
+ description: "Apply exactly the snapshot restore reviewed by managed_recovery_plan_check (Pro Phase 1B). Rechecks live permissions, compatibility, current plan, and signed confirmation binding before any target write. Non-dry apply durably reserves the request and delegates once to the Free protected restore service, which captures the current state before restoring. No force, target override, raw payload, automatic retry, or second apply. Exact completed request replay returns the prior redacted success or failure without further capture, restore, or audit; conflicting or incomplete requests refuse. Reports verified success, recovery after failure, partial failure, and audit persistence failure distinctly. dry_run performs zero option, snapshot, content, cache, or audit writes and no capture. " +
4321
+ DRY_RUN_DESC_SUFFIX,
4322
+ inputSchema: z.object({
4323
+ snapshot_id: ManagedRecoverySnapshotIdSchema,
4324
+ request_id: ManagedRecoveryRequestIdSchema,
4325
+ confirmation_fingerprint: ManagedRecoveryConfirmationSchema.confirmation_fingerprint
4326
+ .describe("Exact fingerprint returned by the matching managed_recovery_plan_check operation."),
4327
+ confirmation_token: ManagedRecoveryConfirmationSchema.confirmation_token
4328
+ .describe("Short-lived signed token returned by the matching managed_recovery_plan_check operation."),
4329
+ dry_run: DRY_RUN_FIELD,
4330
+ }).strict(),
4331
+ annotations: { readOnlyHint: false, idempotentHint: false },
4332
+ _meta: { idempotent: "false" },
4333
+ }, async ({ snapshot_id, request_id, confirmation_fingerprint, confirmation_token, dry_run }) => {
4334
+ const body = { snapshot_id, request_id, confirmation_fingerprint, confirmation_token };
4335
+ if (dry_run)
4336
+ body.dry_run = true;
4337
+ const result = await wp.requestEnveloped("/pro/managed-recovery/restore/apply", { method: "POST", body });
4338
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_restore_apply") }] };
4339
+ }, { target: "managed_recovery", capabilityKey: "managed_recovery_plan_v1" });
4285
4340
  // diviops_cross_env_header_apply — guarded Pro apply for reviewed header preflight
4286
4341
  registerProTool("diviops_cross_env_header_apply", {
4287
4342
  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.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.50",
3
+ "version": "1.5.52",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",