@diviops/mcp-server 1.5.49 → 1.5.51

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 +27 -1
  2. package/dist/index.js +38 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -8,7 +8,32 @@ 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.49 candidate release note
11
+ ## 1.5.51 candidate release note
12
+
13
+ Adds `diviops_managed_recovery_plan_check` and
14
+ `diviops_managed_recovery_restore_apply` for an opt-in, reviewed one-site
15
+ recovery workflow. Plan and apply dry-run do not capture or restore; confirmed
16
+ apply delegates to the shared Free protection service. An exact completed
17
+ request replay returns the prior result without another restore, capture or
18
+ audit append. Inspect the separate recovery, readback and audit evidence rather
19
+ than inferring success from request completion.
20
+
21
+ The two tools require the active Pro managed-recovery target and
22
+ `managed_recovery_plan_v1`. Older compatible Free/Pro pairs retain the existing
23
+ policy, retention and audit tools; basic snapshot inspection and guarded undo
24
+ remain Free. Restart MCP after supported updates to refresh its capability
25
+ handshake. No dependency, transport, global version floor or restore UI change
26
+ is included. Candidate validation and publication are still separate steps.
27
+
28
+ ## Previous 1.5.50 candidate release note
29
+
30
+ Clarifies that the existing status tool targets standard WordPress Posts and
31
+ Pages, not custom post types or attachments. Free Agent 1.5.20 corrects the
32
+ endpoint's rejection of standard Posts while preserving edit and applicable
33
+ publish permissions before dry-run plans and no-op responses. Existing request
34
+ shapes and scheduling rules are unchanged; no Pro update is required.
35
+
36
+ ## Previous 1.5.49 candidate release note
12
37
 
13
38
  - Adds bounded staff-body source/target evidence and preflight, plus guarded Pro
14
39
  apply dispatch to one existing isolated target body. Target records supply
@@ -207,6 +232,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
207
232
  | FluentCart checkout readiness / gateway inspection (V3.2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_status`, `diviops_fc_gateway_list`, `diviops_fc_gateway_get` |
208
233
  | Cross-env reviewed layout rollout | Pro plugin + `cross_env` module enabled | `diviops_cross_env_header_apply`, `diviops_cross_env_layout_apply` |
209
234
  | 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` |
235
+ | 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` |
210
236
 
211
237
  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.
212
238
 
package/dist/index.js CHANGED
@@ -1940,7 +1940,7 @@ registerPluginTool("diviops_page_trash", {
1940
1940
  };
1941
1941
  });
1942
1942
  registerPluginTool("diviops_page_update_status", {
1943
- description: "Update a page's post_status. Valid statuses: publish, draft, private, pending, future. status='future' requires date_gmt (ISO 8601 UTC, must be in the future) — server writes both post_date_gmt and the site-tz post_date so WP's scheduler picks it up. status='publish' on a previously-scheduled post clears the future date so it publishes immediately. Idempotent: same-status update returns ok:true with `data.noop = true`. Pass dry_run=true to preview the standard `data.plan = { summary, changes[] }` without mutating. Replaces wp-cli `post update --post_status=...` routing. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403); status enum violations and date_gmt validation failures return 'invalid_input' with `error.data` documenting the field.",
1943
+ description: "Update a standard WordPress post or page's post_status; custom post types and attachments are not supported. Valid statuses: publish, draft, private, pending, future. status='future' requires date_gmt (ISO 8601 UTC, must be in the future) — server writes both post_date_gmt and the site-tz post_date so WP's scheduler picks it up. status='publish' on a previously-scheduled post clears the future date so it publishes immediately. Idempotent: same-status update returns ok:true with `data.noop = true`. Pass dry_run=true to preview the standard `data.plan = { summary, changes[] }` without mutating. Replaces wp-cli `post update --post_status=...` routing. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; missing post_id returns 'not_found', edit-permission failures return 'forbidden' (HTTP 403); status enum violations and date_gmt validation failures return 'invalid_input' with `error.data` documenting the field.",
1944
1944
  inputSchema: {
1945
1945
  post_id: z.number().int().describe("WordPress post/page ID"),
1946
1946
  status: z
@@ -4184,6 +4184,10 @@ const ManagedRecoveryRequestIdSchema = z
4184
4184
  .string()
4185
4185
  .regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{2,127}$/)
4186
4186
  .describe("Caller-stable request ID used for confirmation binding and exact replay/conflict detection.");
4187
+ const ManagedRecoverySnapshotIdSchema = z
4188
+ .string()
4189
+ .regex(/^[A-Za-z0-9][A-Za-z0-9_-]{2,127}$/)
4190
+ .describe("Existing rollback snapshot ID to restore to its original supported page or layout target.");
4187
4191
  const ManagedRecoveryConfirmationSchema = {
4188
4192
  confirmation_fingerprint: z
4189
4193
  .string()
@@ -4282,6 +4286,39 @@ function registerProTools() {
4282
4286
  const result = await wp.requestEnveloped("/pro/managed-recovery/audit", { params: { page: String(page), per_page: String(per_page) } });
4283
4287
  return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_audit_list") }] };
4284
4288
  }, { target: "managed_recovery", capabilityKey: "managed_recovery_audit_v1" });
4289
+ registerProTool("diviops_managed_recovery_plan_check", {
4290
+ 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.",
4291
+ inputSchema: z.object({
4292
+ snapshot_id: ManagedRecoverySnapshotIdSchema,
4293
+ request_id: ManagedRecoveryRequestIdSchema,
4294
+ }).strict(),
4295
+ annotations: { readOnlyHint: true, idempotentHint: true },
4296
+ _meta: { idempotent: "true" },
4297
+ }, async ({ snapshot_id, request_id }) => {
4298
+ const result = await wp.requestEnveloped("/pro/managed-recovery/plan/check", { method: "POST", body: { snapshot_id, request_id } });
4299
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_plan_check") }] };
4300
+ }, { target: "managed_recovery", capabilityKey: "managed_recovery_plan_v1" });
4301
+ registerProTool("diviops_managed_recovery_restore_apply", {
4302
+ 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. " +
4303
+ DRY_RUN_DESC_SUFFIX,
4304
+ inputSchema: z.object({
4305
+ snapshot_id: ManagedRecoverySnapshotIdSchema,
4306
+ request_id: ManagedRecoveryRequestIdSchema,
4307
+ confirmation_fingerprint: ManagedRecoveryConfirmationSchema.confirmation_fingerprint
4308
+ .describe("Exact fingerprint returned by the matching managed_recovery_plan_check operation."),
4309
+ confirmation_token: ManagedRecoveryConfirmationSchema.confirmation_token
4310
+ .describe("Short-lived signed token returned by the matching managed_recovery_plan_check operation."),
4311
+ dry_run: DRY_RUN_FIELD,
4312
+ }).strict(),
4313
+ annotations: { readOnlyHint: false, idempotentHint: false },
4314
+ _meta: { idempotent: "false" },
4315
+ }, async ({ snapshot_id, request_id, confirmation_fingerprint, confirmation_token, dry_run }) => {
4316
+ const body = { snapshot_id, request_id, confirmation_fingerprint, confirmation_token };
4317
+ if (dry_run)
4318
+ body.dry_run = true;
4319
+ const result = await wp.requestEnveloped("/pro/managed-recovery/restore/apply", { method: "POST", body });
4320
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_managed_recovery_restore_apply") }] };
4321
+ }, { target: "managed_recovery", capabilityKey: "managed_recovery_plan_v1" });
4285
4322
  // diviops_cross_env_header_apply — guarded Pro apply for reviewed header preflight
4286
4323
  registerProTool("diviops_cross_env_header_apply", {
4287
4324
  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.49",
3
+ "version": "1.5.51",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -64,7 +64,7 @@
64
64
  "@modelcontextprotocol/sdk": "^1.30.0",
65
65
  "body-parser": "2.3.0",
66
66
  "fast-uri": "3.1.7",
67
- "hono": "4.13.1",
67
+ "hono": "4.13.5",
68
68
  "ip-address": "10.5.0",
69
69
  "zod": "^4.3.6"
70
70
  },