@satelliteoflove/godot-mcp 3.4.0 → 3.4.1

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/addon/plugin.cfg CHANGED
@@ -3,6 +3,6 @@
3
3
  name="Godot MCP"
4
4
  description="Model Context Protocol server for AI assistant integration"
5
5
  author="godot-mcp"
6
- version="3.4.0"
6
+ version="3.4.1"
7
7
  script="plugin.gd"
8
8
  godot_version_min="4.5"
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAEtC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAMrD"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAmDtC,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAOrD"}
@@ -1,9 +1,50 @@
1
1
  import { z } from 'zod';
2
+ // The Anthropic API forbids oneOf/anyOf/allOf at the root of inputSchema.
3
+ // Zod v4's toJSONSchema emits `oneOf` for discriminatedUnion, so we flatten
4
+ // all branches into a single object schema. The discriminator field's `const`
5
+ // values are collected into an `enum`; all other per-branch properties are
6
+ // merged and become optional at the top level. Actual validation still runs
7
+ // through Zod when the tool is called.
8
+ function flattenUnionToObject(schema) {
9
+ const branches = (schema.oneOf ?? schema.anyOf ?? schema.allOf);
10
+ if (!branches || branches.length === 0) {
11
+ return { type: 'object' };
12
+ }
13
+ const mergedProperties = {};
14
+ const requiredSets = branches.map((b) => Array.isArray(b.required) ? b.required : []);
15
+ for (const branch of branches) {
16
+ const props = branch.properties;
17
+ if (props)
18
+ Object.assign(mergedProperties, props);
19
+ }
20
+ // Only fields required in every branch stay required at the top level.
21
+ const commonRequired = requiredSets.length > 0
22
+ ? requiredSets[0].filter((k) => requiredSets.every((r) => r.includes(k)))
23
+ : [];
24
+ // If a common-required field has a `const` in every branch, replace it
25
+ // with an `enum` so the model knows which values are valid.
26
+ for (const key of commonRequired) {
27
+ const constValues = branches.flatMap((b) => {
28
+ const prop = b.properties?.[key];
29
+ return prop?.const !== undefined ? [prop.const] : [];
30
+ });
31
+ if (constValues.length === branches.length) {
32
+ mergedProperties[key] = { type: 'string', enum: constValues };
33
+ }
34
+ }
35
+ return {
36
+ type: 'object',
37
+ ...(Object.keys(mergedProperties).length > 0 ? { properties: mergedProperties } : {}),
38
+ ...(commonRequired.length > 0 ? { required: commonRequired } : {}),
39
+ };
40
+ }
2
41
  export function toInputSchema(schema) {
3
- const jsonSchema = z.toJSONSchema(schema, {
4
- target: 'draft-07',
5
- });
42
+ const jsonSchema = z.toJSONSchema(schema, { target: 'draft-07' });
6
43
  const { $schema, ...rest } = jsonSchema;
7
- return rest;
44
+ if (rest.type === 'object')
45
+ return rest;
46
+ if (rest.oneOf || rest.anyOf || rest.allOf)
47
+ return flattenUnionToObject(rest);
48
+ return { type: 'object', ...rest };
8
49
  }
9
50
  //# sourceMappingURL=schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAgB,MAAM,KAAK,CAAC;AAEtC,MAAM,UAAU,aAAa,CAAC,MAAe;IAC3C,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE;QACxC,MAAM,EAAE,UAAU;KACnB,CAAC,CAAC;IACH,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,UAAqC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAgB,MA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AG,IAAI,EAAE,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@satelliteoflove/godot-mcp",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "MCP server for Godot Engine integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",