@diviops/mcp-server 1.5.20 → 1.5.22
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/README.md +1 -0
- package/dist/index.js +73 -1
- package/dist/schema-route.d.ts +2 -0
- package/dist/schema-route.js +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -88,6 +88,7 @@ Additional **conditionally-registered Pro tools** appear only on sites that have
|
|
|
88
88
|
| FluentCart license-settings read/write (V3) | Pro plugin + FluentCart Pro installed + module enabled | `diviops_fc_license_settings_get`, `diviops_fc_license_settings_update` |
|
|
89
89
|
| FluentCart order readback + guarded mark-paid (V3.1) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_order_list`, `diviops_fc_order_get`, `diviops_fc_order_mark_paid` |
|
|
90
90
|
| FluentCart license readback (V3.1) | Pro plugin + FluentCart Pro installed + module enabled | `diviops_fc_license_list`, `diviops_fc_license_get`, `diviops_fc_license_activations_list` |
|
|
91
|
+
| FluentCart checkout readiness / gateway inspection (V3.2) | Pro plugin + FluentCart installed + module enabled | `diviops_fc_status`, `diviops_fc_gateway_list`, `diviops_fc_gateway_get` |
|
|
91
92
|
|
|
92
93
|
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.
|
|
93
94
|
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { WPClient } from "./wp-client.js";
|
|
|
15
15
|
import { MissingCapabilityError } from "./compatibility.js";
|
|
16
16
|
import { ErrorCodes, envelopeMap, recordIdempotent, serializeEnvelope, withCode, wrapResponse, } from "./envelope.js";
|
|
17
17
|
import { optimizeSchema } from "./schema-optimizer.js";
|
|
18
|
+
import { schemaModuleRoute } from "./schema-route.js";
|
|
18
19
|
import { createWpCli } from "./wp-cli.js";
|
|
19
20
|
import { findForeignVarRefs, scanAttrsForForeignVarRefs, isolationErrorResult, } from "./validate-attrs.js";
|
|
20
21
|
import { readFileSync, readdirSync } from "fs";
|
|
@@ -347,7 +348,7 @@ registerPluginTool("diviops_schema_get_module", {
|
|
|
347
348
|
content: [{ type: "text", text: serializeEnvelope(failure, "diviops_schema_get_module") }],
|
|
348
349
|
};
|
|
349
350
|
}
|
|
350
|
-
const result = await wp.requestEnveloped(
|
|
351
|
+
const result = await wp.requestEnveloped(schemaModuleRoute(module_name));
|
|
351
352
|
const projected = envelopeMap(result, (data) => raw ? data : optimizeSchema(data));
|
|
352
353
|
return {
|
|
353
354
|
content: [
|
|
@@ -3893,6 +3894,77 @@ function registerProTools() {
|
|
|
3893
3894
|
target: "fluentcart",
|
|
3894
3895
|
capabilityKey: "fluentcart_license_activations_list",
|
|
3895
3896
|
});
|
|
3897
|
+
// ── V3.2 — checkout readiness / status ────────────────────────────
|
|
3898
|
+
//
|
|
3899
|
+
// Pre-check surface so smoke runners can answer "is this site ready
|
|
3900
|
+
// to checkout?" without admin UI, raw SQL, or eval-file probes. All
|
|
3901
|
+
// three tools are read-only.
|
|
3902
|
+
// diviops_fc_status — POST /diviops/v1/pro/fluentcart/status
|
|
3903
|
+
registerProTool("diviops_fc_status", {
|
|
3904
|
+
description: "Inspect FluentCart checkout/license readiness (Pro tier; V3.2). Read-only. Returns a structured snapshot covering: site (wp_url, host, is_local_hint, wp_version), plugins (fluent_cart, fluent_cart_pro, diviops_agent_pro — { active, version } each), store (order_mode, currency, currency_symbol, currency_position, store_country, store_state, checkout/cart/receipt/shop page IDs), modules (license.active, stock_management.active+advanced_inventory), tables (core / licensing / advanced_inventory groups with count/expected/ok and gated_by hints — `ok: null` means the group is optional and module is off), gateways (registered_count, enabled_count, enabled_methods, registered_methods, local_safe_methods — slug-only summary; use diviops_fc_gateway_list/get for details), counts (orders, licenses, license_activations), and readiness (verdict: green|yellow|red, checkout_writable, license_writable, local_no_money_smoke_ready, public_launch_ready, warnings[], blockers[]). Distinguishes \"fluentcart inactive\" from \"core schema missing\" from \"license module on but tables missing\" — the same gaps that drove earlier local checkout/license smokes into WP-CLI and eval-file probes. No secrets are returned at any layer; gateway settings are summarized through diviops_fc_gateway_* tools. Pass include_table_lists=true to receive the full present[]/missing[] table arrays (default: count/expected/ok only, to keep the response compact). Returns the standardized envelope { ok, data?, error: { code, message, hint? } }. Error codes: fluentcart.module_inactive (412); fluentcart.command_failed (500).",
|
|
3905
|
+
inputSchema: {
|
|
3906
|
+
include_table_lists: z
|
|
3907
|
+
.boolean()
|
|
3908
|
+
.optional()
|
|
3909
|
+
.default(false)
|
|
3910
|
+
.describe("When true, include the full present[] and missing[] arrays in each `tables.*` group. Default false to keep the response compact."),
|
|
3911
|
+
},
|
|
3912
|
+
annotations: { idempotentHint: true },
|
|
3913
|
+
_meta: { idempotent: "true" },
|
|
3914
|
+
}, async ({ include_table_lists, }) => {
|
|
3915
|
+
const body = {};
|
|
3916
|
+
if (include_table_lists !== undefined)
|
|
3917
|
+
body.include_table_lists = include_table_lists;
|
|
3918
|
+
const result = await wp.requestEnveloped("/pro/fluentcart/status", { method: "POST", body });
|
|
3919
|
+
return {
|
|
3920
|
+
content: [
|
|
3921
|
+
{
|
|
3922
|
+
type: "text",
|
|
3923
|
+
text: serializeEnvelope(result, "diviops_fc_status"),
|
|
3924
|
+
},
|
|
3925
|
+
],
|
|
3926
|
+
};
|
|
3927
|
+
}, { target: "fluentcart", capabilityKey: "fluentcart_status_get" });
|
|
3928
|
+
// diviops_fc_gateway_list — POST /diviops/v1/pro/fluentcart/gateways
|
|
3929
|
+
registerProTool("diviops_fc_gateway_list", {
|
|
3930
|
+
description: "List FluentCart registered payment gateways with secrets redacted (Pro tier; V3.2). Read-only. Returns one row per gateway registered with FluentCart's GatewayManager — each row carries `method`, `title`, `admin_title`, `label`, `route`, `enabled`, `upcoming`, `requires_pro`, `no_real_money` (true for offline/COD), `local_safe`, `webhook_required` (capability hint — reachability is NOT probed), `credentials_configured` (best-effort boolean inferred without reading credential values), `supports.subscriptions`, `supports.refund`, `settings_summary` (allowlisted non-secret fields only — `is_active`, `payment_mode`, `checkout_mode`, `checkout_label`, `checkout_logo`, `checkout_instructions`, `provider`, `define_*_keys` boolean flags, `*_is_encrypted` flags), `settings_source` (e.g. `fct_meta:fluent_cart_payment_settings_stripe`), `description`, `brand_color`, and a sanitized `meta` bag. NEVER returns: API keys, secret keys, publishable keys, webhook signing secrets, client IDs, customer IDs, vendor/seller IDs, tokens, or any value matching the credential-substring heuristic. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload: { gateways: GatewayRow[], count }. Error codes: fluentcart.module_inactive (412); fluentcart.command_failed (500). Use as the discovery call before diviops_fc_gateway_get to inspect a specific method.",
|
|
3931
|
+
inputSchema: {},
|
|
3932
|
+
annotations: { idempotentHint: true },
|
|
3933
|
+
_meta: { idempotent: "true" },
|
|
3934
|
+
}, async () => {
|
|
3935
|
+
const result = await wp.requestEnveloped("/pro/fluentcart/gateways", { method: "POST" });
|
|
3936
|
+
return {
|
|
3937
|
+
content: [
|
|
3938
|
+
{
|
|
3939
|
+
type: "text",
|
|
3940
|
+
text: serializeEnvelope(result, "diviops_fc_gateway_list"),
|
|
3941
|
+
},
|
|
3942
|
+
],
|
|
3943
|
+
};
|
|
3944
|
+
}, { target: "fluentcart", capabilityKey: "fluentcart_gateway_list" });
|
|
3945
|
+
// diviops_fc_gateway_get — POST /diviops/v1/pro/fluentcart/gateways/{method}
|
|
3946
|
+
registerProTool("diviops_fc_gateway_get", {
|
|
3947
|
+
description: "Fetch a single FluentCart payment gateway by method slug with secrets redacted (Pro tier; V3.2). Read-only. Same row shape as diviops_fc_gateway_list plus a `field_metadata` array describing what settings the gateway accepts (key + label + type + description from the gateway's `fields()` map) WITHOUT any stored values. `method` is one of the registered slugs from diviops_fc_gateway_list — common values: `offline_payment` (COD, local-safe, no webhook, no real money — the slug to use for local smoke runs), `stripe`, `paypal`, `paystack`, `airwallex`, `paddle` (Pro), `mollie` (Pro), `authorize_net` (Pro). NEVER returns credential values; field_metadata is metadata-only. Returns the standardized envelope { ok, data?, error: { code, message, hint? } }; success payload: { gateway: GatewayRow }. Error codes: invalid_input (HTTP 400) when method is empty; not_found (HTTP 404) when the slug is not registered (hint: \"Call diviops_fc_gateway_list to see the registered method slugs.\"); fluentcart.module_inactive (412); fluentcart.command_failed (500). Useful for confirming the local-safe gateway is enabled before a smoke run, and for surfacing whether Paddle / Stripe / etc. is registered without exposing keys.",
|
|
3948
|
+
inputSchema: {
|
|
3949
|
+
method: z
|
|
3950
|
+
.string()
|
|
3951
|
+
.min(1)
|
|
3952
|
+
.describe("Gateway method slug — e.g. `offline_payment`, `stripe`, `paypal`, `paddle`, `mollie`. Run diviops_fc_gateway_list first to enumerate registered slugs."),
|
|
3953
|
+
},
|
|
3954
|
+
annotations: { idempotentHint: true },
|
|
3955
|
+
_meta: { idempotent: "true" },
|
|
3956
|
+
}, async ({ method }) => {
|
|
3957
|
+
const safe = encodeURIComponent(method);
|
|
3958
|
+
const result = await wp.requestEnveloped(`/pro/fluentcart/gateways/${safe}`, { method: "POST" });
|
|
3959
|
+
return {
|
|
3960
|
+
content: [
|
|
3961
|
+
{
|
|
3962
|
+
type: "text",
|
|
3963
|
+
text: serializeEnvelope(result, "diviops_fc_gateway_get"),
|
|
3964
|
+
},
|
|
3965
|
+
],
|
|
3966
|
+
};
|
|
3967
|
+
}, { target: "fluentcart", capabilityKey: "fluentcart_gateway_get" });
|
|
3896
3968
|
}
|
|
3897
3969
|
// ── Start ────────────────────────────────────────────────────────────
|
|
3898
3970
|
async function main() {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function normalizeSchemaModuleName(moduleName) {
|
|
2
|
+
const trimmed = moduleName.trim();
|
|
3
|
+
return trimmed.startsWith("divi/") ? trimmed.slice("divi/".length) : trimmed;
|
|
4
|
+
}
|
|
5
|
+
export function schemaModuleRoute(moduleName) {
|
|
6
|
+
return `/schema/module/${encodeURIComponent(normalizeSchemaModuleName(moduleName))}`;
|
|
7
|
+
}
|