@diviops/mcp-server 1.5.46 → 1.5.48
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/dist/index.js +35 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2759,15 +2759,21 @@ registerPluginTool("diviops_tb_template_create", {
|
|
|
2759
2759
|
.optional()
|
|
2760
2760
|
.default("")
|
|
2761
2761
|
.describe("Footer block markup (empty = inherit from default template)"),
|
|
2762
|
+
body_content: z.string().optional().default("").describe("Body block markup (omitted/empty = existing no-custom-body behavior). Nonempty content requires plugin capability tb_template_create_body; returns body_layout_id. No global Theme Builder save or legacy cleanup."),
|
|
2762
2763
|
dry_run: DRY_RUN_FIELD,
|
|
2763
2764
|
},
|
|
2764
2765
|
annotations: { idempotentHint: false },
|
|
2765
2766
|
_meta: { idempotent: "false" },
|
|
2766
|
-
}, async ({ title, condition, header_content, footer_content, dry_run }) => {
|
|
2767
|
-
const
|
|
2767
|
+
}, async ({ title, condition, header_content, footer_content, body_content, dry_run }) => {
|
|
2768
|
+
const bodyGate = conditionalCapabilityError("diviops_tb_template_create", "tb_template_create_body", body_content !== "", "Omit body_content only when no custom body layout is intended.");
|
|
2769
|
+
if (bodyGate)
|
|
2770
|
+
return bodyGate;
|
|
2771
|
+
const isolationGate = writerIsolationErrorResult("diviops_tb_template_create", { header_content, footer_content, body_content });
|
|
2768
2772
|
if (isolationGate)
|
|
2769
2773
|
return isolationGate;
|
|
2770
2774
|
const body = { title, condition, header_content, footer_content };
|
|
2775
|
+
if (body_content !== "")
|
|
2776
|
+
body.body_content = body_content;
|
|
2771
2777
|
if (dry_run)
|
|
2772
2778
|
body.dry_run = true;
|
|
2773
2779
|
const result = await authoringWrite("/theme-builder/template/create", "POST", body, "tb_template_create", dry_run === true);
|
|
@@ -4737,6 +4743,33 @@ function registerProTools() {
|
|
|
4737
4743
|
capabilityKey: "fluentcart_campaign_page_apply",
|
|
4738
4744
|
requiredCapabilities: ["page_update_content_expected_checksum"],
|
|
4739
4745
|
});
|
|
4746
|
+
const campaignRefreshSchema = z.object({
|
|
4747
|
+
page_id: z.number().int().positive().describe("Explicit editable draft page, never a receipt-derived target."),
|
|
4748
|
+
product_id: z.number().int().positive().describe("Ready product matching the existing native BuyNow variation."),
|
|
4749
|
+
expected_page_checksum: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
4750
|
+
refresh: z.enum(["title", "image", "title_and_image"]),
|
|
4751
|
+
targets: z.object({
|
|
4752
|
+
section_auto_index: z.string().regex(/^section:[1-9][0-9]*$/),
|
|
4753
|
+
heading_auto_index: z.string().regex(/^heading:[1-9][0-9]*$/),
|
|
4754
|
+
image_auto_index: z.string().regex(/^image:[1-9][0-9]*$/),
|
|
4755
|
+
}).strict().describe("Current-layout indices for the first campaign section, hero H1 and product Image; no label/text guessing."),
|
|
4756
|
+
image_attachment_id: z.number().int().positive().optional().describe("Required for image/title_and_image; forbidden for title. Existing readable raster attachment only."),
|
|
4757
|
+
confirm_plan_sha256: z.string().regex(/^sha256:[a-f0-9]{64}$/).optional(),
|
|
4758
|
+
dry_run: z.boolean().optional().default(true),
|
|
4759
|
+
}).strict();
|
|
4760
|
+
registerProTool("diviops_fc_campaign_page_refresh", {
|
|
4761
|
+
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.",
|
|
4762
|
+
inputSchema: campaignRefreshSchema,
|
|
4763
|
+
annotations: { idempotentHint: false }, _meta: { idempotent: "conditional" },
|
|
4764
|
+
}, async (args) => {
|
|
4765
|
+
if ((args.image_attachment_id !== undefined) !== (args.refresh !== "title") || (!args.dry_run && !args.confirm_plan_sha256)) {
|
|
4766
|
+
return { isError: true, content: [{ type: "text", text: serializeEnvelope({
|
|
4767
|
+
ok: false, error: { code: "invalid_input", message: "Image input must match the refresh mode; apply requires the reviewed plan confirmation.", data: { mutated: false } },
|
|
4768
|
+
}, "diviops_fc_campaign_page_refresh") }] };
|
|
4769
|
+
}
|
|
4770
|
+
const result = await wp.requestEnveloped("/pro/fluentcart/campaign-page/refresh", { method: "POST", body: args });
|
|
4771
|
+
return { content: [{ type: "text", text: serializeEnvelope(result, "diviops_fc_campaign_page_refresh") }] };
|
|
4772
|
+
}, { target: "fluentcart", capabilityKey: "fluentcart_campaign_page_refresh", requiredCapabilities: ["page_update_content_expected_checksum"] });
|
|
4740
4773
|
// ── V2 — simple product writes ─────────────────────────────────────
|
|
4741
4774
|
//
|
|
4742
4775
|
// Three Pro write tools backing the constrained simple-onetime-product
|