@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 +2 -1
- package/dist/schema-route.d.ts +2 -0
- package/dist/schema-route.js +7 -0
- package/package.json +1 -1
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: [
|
|
@@ -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
|
+
}
|