@diviops/mcp-server 1.5.46 → 1.5.47

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 (2) hide show
  1. package/dist/index.js +27 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4737,6 +4737,33 @@ function registerProTools() {
4737
4737
  capabilityKey: "fluentcart_campaign_page_apply",
4738
4738
  requiredCapabilities: ["page_update_content_expected_checksum"],
4739
4739
  });
4740
+ const campaignRefreshSchema = z.object({
4741
+ page_id: z.number().int().positive().describe("Explicit editable draft page, never a receipt-derived target."),
4742
+ product_id: z.number().int().positive().describe("Ready product matching the existing native BuyNow variation."),
4743
+ expected_page_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
4744
+ refresh: z.enum(["title", "image", "title_and_image"]),
4745
+ targets: z.object({
4746
+ section_auto_index: z.string().regex(/^section:[1-9][0-9]*$/),
4747
+ heading_auto_index: z.string().regex(/^heading:[1-9][0-9]*$/),
4748
+ image_auto_index: z.string().regex(/^image:[1-9][0-9]*$/),
4749
+ }).strict().describe("Current-layout indices for the first campaign section, hero H1 and product Image; no label/text guessing."),
4750
+ image_attachment_id: z.number().int().positive().optional().describe("Required for image/title_and_image; forbidden for title. Existing readable raster attachment only."),
4751
+ confirm_plan_sha256: z.string().regex(/^sha256:[a-f0-9]{64}$/).optional(),
4752
+ dry_run: z.boolean().optional().default(true),
4753
+ }).strict();
4754
+ registerProTool("diviops_fc_campaign_page_refresh", {
4755
+ description: "Refresh only the reviewed product title and/or explicitly selected image in one polished flexible campaign on a draft page. Preserves its 16-block segment, seven existing module-preset bindings, all local design/copy and single native BuyNow. Requires exact current page checksum and explicit section/H1/Image auto-indices, not a generator receipt. Defaults to dry-run; apply requires its exact confirmation.plan_sha256 and rechecks consumed product/image state. No-op creates no backup or write. Changed content delegates once to the Free checksum/backup writer; its existing failure compensation may restore content. Returns maintenance evidence, never a PAGE/SECTION receipt. No automatic catalog sync, preset repair, publication or commerce mutation.",
4756
+ inputSchema: campaignRefreshSchema,
4757
+ annotations: { idempotentHint: false }, _meta: { idempotent: "conditional" },
4758
+ }, async (args) => {
4759
+ if ((args.image_attachment_id !== undefined) !== (args.refresh !== "title") || (!args.dry_run && !args.confirm_plan_sha256)) {
4760
+ return { isError: true, content: [{ type: "text", text: serializeEnvelope({
4761
+ ok: false, error: { code: "invalid_input", message: "Image input must match the refresh mode; apply requires the reviewed plan confirmation.", data: { mutated: false } },
4762
+ }, "diviops_fc_campaign_page_refresh") }] };
4763
+ }
4764
+ const result = await wp.requestEnveloped("/pro/fluentcart/campaign-page/refresh", { method: "POST", body: args });
4765
+ return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_fc_campaign_page_refresh") }] };
4766
+ }, { target: "fluentcart", capabilityKey: "fluentcart_campaign_page_refresh", requiredCapabilities: ["page_update_content_expected_checksum"] });
4740
4767
  // ── V2 — simple product writes ─────────────────────────────────────
4741
4768
  //
4742
4769
  // Three Pro write tools backing the constrained simple-onetime-product
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.46",
3
+ "version": "1.5.47",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",