@diviops/mcp-server 1.5.21 → 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/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(`/schema/module/${encodeURIComponent(module_name)}`);
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: [
@@ -0,0 +1,2 @@
1
+ export declare function normalizeSchemaModuleName(moduleName: string): string;
2
+ export declare function schemaModuleRoute(moduleName: string): string;
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviops/mcp-server",
3
- "version": "1.5.21",
3
+ "version": "1.5.22",
4
4
  "description": "MCP server exposing Divi 5 Visual Builder as tools for Claude",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",