@diviops/mcp-server 1.5.50 → 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 +19 -1
  2. package/dist/index.js +37 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,24 @@ 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.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
12
29
 
13
30
  Clarifies that the existing status tool targets standard WordPress Posts and
14
31
  Pages, not custom post types or attachments. Free Agent 1.5.20 corrects the
@@ -215,6 +232,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
215
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` |
216
233
  | Cross-env reviewed layout rollout | Pro plugin + `cross_env` module enabled | `diviops_cross_env_header_apply`, `diviops_cross_env_layout_apply` |
217
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` |
218
236
 
219
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.
220
238
 
package/dist/index.js CHANGED
@@ -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.50",
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",