@satelliteoflove/godot-mcp 0.1.0

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.
Files changed (81) hide show
  1. package/dist/__tests__/registry.test.d.ts +2 -0
  2. package/dist/__tests__/registry.test.d.ts.map +1 -0
  3. package/dist/__tests__/registry.test.js +116 -0
  4. package/dist/__tests__/registry.test.js.map +1 -0
  5. package/dist/__tests__/schema.test.d.ts +2 -0
  6. package/dist/__tests__/schema.test.d.ts.map +1 -0
  7. package/dist/__tests__/schema.test.js +67 -0
  8. package/dist/__tests__/schema.test.js.map +1 -0
  9. package/dist/connection/protocol.d.ts +103 -0
  10. package/dist/connection/protocol.d.ts.map +1 -0
  11. package/dist/connection/protocol.js +34 -0
  12. package/dist/connection/protocol.js.map +1 -0
  13. package/dist/connection/websocket.d.ts +33 -0
  14. package/dist/connection/websocket.d.ts.map +1 -0
  15. package/dist/connection/websocket.js +203 -0
  16. package/dist/connection/websocket.js.map +1 -0
  17. package/dist/core/define-resource.d.ts +9 -0
  18. package/dist/core/define-resource.d.ts.map +1 -0
  19. package/dist/core/define-resource.js +4 -0
  20. package/dist/core/define-resource.js.map +1 -0
  21. package/dist/core/define-tool.d.ts +9 -0
  22. package/dist/core/define-tool.d.ts.map +1 -0
  23. package/dist/core/define-tool.js +4 -0
  24. package/dist/core/define-tool.js.map +1 -0
  25. package/dist/core/registry.d.ts +28 -0
  26. package/dist/core/registry.d.ts.map +1 -0
  27. package/dist/core/registry.js +70 -0
  28. package/dist/core/registry.js.map +1 -0
  29. package/dist/core/schema.d.ts +3 -0
  30. package/dist/core/schema.d.ts.map +1 -0
  31. package/dist/core/schema.js +10 -0
  32. package/dist/core/schema.js.map +1 -0
  33. package/dist/core/types.d.ts +25 -0
  34. package/dist/core/types.d.ts.map +1 -0
  35. package/dist/core/types.js +2 -0
  36. package/dist/core/types.js.map +1 -0
  37. package/dist/index.d.ts +3 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +68 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/resources/index.d.ts +4 -0
  42. package/dist/resources/index.d.ts.map +1 -0
  43. package/dist/resources/index.js +10 -0
  44. package/dist/resources/index.js.map +1 -0
  45. package/dist/resources/scene.d.ts +4 -0
  46. package/dist/resources/scene.d.ts.map +1 -0
  47. package/dist/resources/scene.js +32 -0
  48. package/dist/resources/scene.js.map +1 -0
  49. package/dist/resources/script.d.ts +3 -0
  50. package/dist/resources/script.d.ts.map +1 -0
  51. package/dist/resources/script.js +19 -0
  52. package/dist/resources/script.js.map +1 -0
  53. package/dist/tools/editor.d.ts +28 -0
  54. package/dist/tools/editor.d.ts.map +1 -0
  55. package/dist/tools/editor.js +83 -0
  56. package/dist/tools/editor.js.map +1 -0
  57. package/dist/tools/index.d.ts +7 -0
  58. package/dist/tools/index.d.ts.map +1 -0
  59. package/dist/tools/index.js +19 -0
  60. package/dist/tools/index.js.map +1 -0
  61. package/dist/tools/node.d.ts +54 -0
  62. package/dist/tools/node.d.ts.map +1 -0
  63. package/dist/tools/node.js +84 -0
  64. package/dist/tools/node.js.map +1 -0
  65. package/dist/tools/project.d.ts +35 -0
  66. package/dist/tools/project.d.ts.map +1 -0
  67. package/dist/tools/project.js +78 -0
  68. package/dist/tools/project.js.map +1 -0
  69. package/dist/tools/scene.d.ts +32 -0
  70. package/dist/tools/scene.d.ts.map +1 -0
  71. package/dist/tools/scene.js +68 -0
  72. package/dist/tools/scene.js.map +1 -0
  73. package/dist/tools/script.d.ts +51 -0
  74. package/dist/tools/script.d.ts.map +1 -0
  75. package/dist/tools/script.js +86 -0
  76. package/dist/tools/script.js.map +1 -0
  77. package/dist/utils/errors.d.ts +16 -0
  78. package/dist/utils/errors.d.ts.map +1 -0
  79. package/dist/utils/errors.js +30 -0
  80. package/dist/utils/errors.js.map +1 -0
  81. package/package.json +52 -0
@@ -0,0 +1,4 @@
1
+ export function defineTool(config) {
2
+ return config;
3
+ }
4
+ //# sourceMappingURL=define-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-tool.js","sourceRoot":"","sources":["../../src/core/define-tool.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,UAAU,CAA4B,MAKrD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { AnyToolDefinition, ResourceDefinition, ToolContext } from './types.js';
2
+ declare class ToolRegistry {
3
+ private tools;
4
+ private resources;
5
+ registerTool(tool: AnyToolDefinition): void;
6
+ registerTools(tools: AnyToolDefinition[]): void;
7
+ registerResource(resource: ResourceDefinition): void;
8
+ registerResources(resources: ResourceDefinition[]): void;
9
+ getToolList(): Array<{
10
+ name: string;
11
+ description: string;
12
+ inputSchema: object;
13
+ }>;
14
+ getResourceList(): Array<{
15
+ uri: string;
16
+ name: string;
17
+ description: string;
18
+ mimeType: string;
19
+ }>;
20
+ executeTool(name: string, args: Record<string, unknown>, ctx: ToolContext): Promise<string>;
21
+ readResource(uri: string, ctx: ToolContext): Promise<string>;
22
+ hasTool(name: string): boolean;
23
+ hasResource(uri: string): boolean;
24
+ getResourceByUri(uri: string): ResourceDefinition | undefined;
25
+ }
26
+ export declare const registry: ToolRegistry;
27
+ export {};
28
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/core/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIrF,cAAM,YAAY;IAChB,OAAO,CAAC,KAAK,CAA6C;IAC1D,OAAO,CAAC,SAAS,CAA8C;IAE/D,YAAY,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI;IAO3C,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI;IAI/C,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI;IAOpD,iBAAiB,CAAC,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAI;IAIxD,WAAW,IAAI,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAQhF,eAAe,IAAI,KAAK,CAAC;QACvB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IAWI,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,GACf,OAAO,CAAC,MAAM,CAAC;IAaZ,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIjC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;CAG9D;AAED,eAAO,MAAM,QAAQ,cAAqB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { toInputSchema } from './schema.js';
2
+ import { formatError } from '../utils/errors.js';
3
+ class ToolRegistry {
4
+ tools = new Map();
5
+ resources = new Map();
6
+ registerTool(tool) {
7
+ if (this.tools.has(tool.name)) {
8
+ throw new Error(`Tool '${tool.name}' already registered`);
9
+ }
10
+ this.tools.set(tool.name, tool);
11
+ }
12
+ registerTools(tools) {
13
+ tools.forEach((tool) => this.registerTool(tool));
14
+ }
15
+ registerResource(resource) {
16
+ if (this.resources.has(resource.uri)) {
17
+ throw new Error(`Resource '${resource.uri}' already registered`);
18
+ }
19
+ this.resources.set(resource.uri, resource);
20
+ }
21
+ registerResources(resources) {
22
+ resources.forEach((resource) => this.registerResource(resource));
23
+ }
24
+ getToolList() {
25
+ return Array.from(this.tools.values()).map((tool) => ({
26
+ name: tool.name,
27
+ description: tool.description,
28
+ inputSchema: toInputSchema(tool.schema),
29
+ }));
30
+ }
31
+ getResourceList() {
32
+ return Array.from(this.resources.values()).map(({ uri, name, description, mimeType }) => ({
33
+ uri,
34
+ name,
35
+ description,
36
+ mimeType,
37
+ }));
38
+ }
39
+ async executeTool(name, args, ctx) {
40
+ const tool = this.tools.get(name);
41
+ if (!tool) {
42
+ throw new Error(`Unknown tool: ${name}`);
43
+ }
44
+ try {
45
+ const validated = tool.schema.parse(args);
46
+ return await tool.execute(validated, ctx);
47
+ }
48
+ catch (error) {
49
+ throw new Error(formatError(error));
50
+ }
51
+ }
52
+ async readResource(uri, ctx) {
53
+ const resource = this.resources.get(uri);
54
+ if (!resource) {
55
+ throw new Error(`Unknown resource: ${uri}`);
56
+ }
57
+ return await resource.handler(ctx);
58
+ }
59
+ hasTool(name) {
60
+ return this.tools.has(name);
61
+ }
62
+ hasResource(uri) {
63
+ return this.resources.has(uri);
64
+ }
65
+ getResourceByUri(uri) {
66
+ return this.resources.get(uri);
67
+ }
68
+ }
69
+ export const registry = new ToolRegistry();
70
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/core/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,YAAY;IACR,KAAK,GAAmC,IAAI,GAAG,EAAE,CAAC;IAClD,SAAS,GAAoC,IAAI,GAAG,EAAE,CAAC;IAE/D,YAAY,CAAC,IAAuB;QAClC,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC,IAAI,sBAAsB,CAAC,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AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { z } from 'zod';
2
+ export declare function toInputSchema(schema: z.ZodType): object;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,wBAAgB,aAAa,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAOvD"}
@@ -0,0 +1,10 @@
1
+ import { zodToJsonSchema } from 'zod-to-json-schema';
2
+ export function toInputSchema(schema) {
3
+ const jsonSchema = zodToJsonSchema(schema, {
4
+ $refStrategy: 'none',
5
+ target: 'jsonSchema7',
6
+ });
7
+ const { $schema, ...rest } = jsonSchema;
8
+ return rest;
9
+ }
10
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,MAAM,UAAU,GAAG,eAAe,CAAC,MAAM,EAAE;QACzC,YAAY,EAAE,MAAM;QACpB,MAAM,EAAE,aAAa;KACtB,CAAC,CAAC;IACH,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,UAAqC,CAAC;IACnE,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { z } from 'zod';
2
+ import type { GodotConnection } from '../connection/websocket.js';
3
+ export interface ToolContext {
4
+ godot: GodotConnection;
5
+ }
6
+ export interface ToolDefinition<TSchema extends z.ZodType = z.ZodType> {
7
+ name: string;
8
+ description: string;
9
+ schema: TSchema;
10
+ execute: (args: z.infer<TSchema>, ctx: ToolContext) => Promise<string>;
11
+ }
12
+ export interface AnyToolDefinition {
13
+ name: string;
14
+ description: string;
15
+ schema: z.ZodType;
16
+ execute: (args: unknown, ctx: ToolContext) => Promise<string>;
17
+ }
18
+ export interface ResourceDefinition {
19
+ uri: string;
20
+ name: string;
21
+ description: string;
22
+ mimeType: string;
23
+ handler: (ctx: ToolContext) => Promise<string>;
24
+ }
25
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,eAAe,CAAC;CACxB;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
3
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
5
+ import { initializeConnection, getGodotConnection } from './connection/websocket.js';
6
+ import { registry } from './core/registry.js';
7
+ import { registerAllTools } from './tools/index.js';
8
+ import { registerAllResources } from './resources/index.js';
9
+ registerAllTools();
10
+ registerAllResources();
11
+ async function main() {
12
+ const server = new Server({
13
+ name: 'godot-mcp',
14
+ version: '0.1.0',
15
+ }, {
16
+ capabilities: {
17
+ tools: {},
18
+ resources: {},
19
+ },
20
+ });
21
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
22
+ return { tools: registry.getToolList() };
23
+ });
24
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
25
+ const { name, arguments: args } = request.params;
26
+ const godot = getGodotConnection();
27
+ try {
28
+ const result = await registry.executeTool(name, args ?? {}, { godot });
29
+ return {
30
+ content: [{ type: 'text', text: result }],
31
+ };
32
+ }
33
+ catch (error) {
34
+ const message = error instanceof Error ? error.message : String(error);
35
+ return {
36
+ content: [{ type: 'text', text: `Error: ${message}` }],
37
+ isError: true,
38
+ };
39
+ }
40
+ });
41
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
42
+ return { resources: registry.getResourceList() };
43
+ });
44
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
45
+ const { uri } = request.params;
46
+ const godot = getGodotConnection();
47
+ const resource = registry.getResourceByUri(uri);
48
+ try {
49
+ const content = await registry.readResource(uri, { godot });
50
+ return {
51
+ contents: [{ uri, mimeType: resource?.mimeType ?? 'application/json', text: content }],
52
+ };
53
+ }
54
+ catch (error) {
55
+ const message = error instanceof Error ? error.message : String(error);
56
+ throw new Error(`Failed to read resource: ${message}`);
57
+ }
58
+ });
59
+ await initializeConnection();
60
+ const transport = new StdioServerTransport();
61
+ await server.connect(transport);
62
+ console.error('[godot-mcp] Server started');
63
+ }
64
+ main().catch((error) => {
65
+ console.error('[godot-mcp] Fatal error:', error);
66
+ process.exit(1);
67
+ });
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,gBAAgB,EAAE,CAAC;AACnB,oBAAoB,EAAE,CAAC;AAEvB,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;QACE,IAAI,EAAE,WAAW;QACjB,OAAO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ceneResources } from './scene.js';
3
+ export { scriptResources } from './script.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,IAAI,IAAI,CAG3C;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { registry } from '../core/registry.js';
2
+ import { sceneResources } from './scene.js';
3
+ import { scriptResources } from './script.js';
4
+ export function registerAllResources() {
5
+ registry.registerResources(sceneResources);
6
+ registry.registerResources(scriptResources);
7
+ }
8
+ export { sceneResources } from './scene.js';
9
+ export { scriptResources } from './script.js';
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,oBAAoB;IAClC,QAAQ,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAC3C,QAAQ,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;AAC9C,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const currentSceneResource: import("../core/types.js").ResourceDefinition;
2
+ export declare const sceneTreeResource: import("../core/types.js").ResourceDefinition;
3
+ export declare const sceneResources: import("../core/types.js").ResourceDefinition[];
4
+ //# sourceMappingURL=scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.d.ts","sourceRoot":"","sources":["../../src/resources/scene.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,+CAwB/B,CAAC;AAEH,eAAO,MAAM,iBAAiB,+CAS5B,CAAC;AAEH,eAAO,MAAM,cAAc,iDAA4C,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { defineResource } from '../core/define-resource.js';
2
+ export const currentSceneResource = defineResource({
3
+ uri: 'godot://scene/current',
4
+ name: 'Current Scene',
5
+ description: 'The currently open scene in the Godot editor',
6
+ mimeType: 'application/json',
7
+ async handler({ godot }) {
8
+ const result = await godot.sendCommand('get_current_scene');
9
+ if (!result.path) {
10
+ return JSON.stringify({ error: 'No scene currently open' });
11
+ }
12
+ return JSON.stringify({
13
+ path: result.path,
14
+ root: {
15
+ name: result.root_name,
16
+ type: result.root_type,
17
+ },
18
+ });
19
+ },
20
+ });
21
+ export const sceneTreeResource = defineResource({
22
+ uri: 'godot://scene/tree',
23
+ name: 'Scene Tree',
24
+ description: 'Full hierarchy of the current scene',
25
+ mimeType: 'application/json',
26
+ async handler({ godot }) {
27
+ const result = await godot.sendCommand('get_scene_tree');
28
+ return JSON.stringify(result.tree, null, 2);
29
+ },
30
+ });
31
+ export const sceneResources = [currentSceneResource, sceneTreeResource];
32
+ //# sourceMappingURL=scene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene.js","sourceRoot":"","sources":["../../src/resources/scene.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC;IACjD,GAAG,EAAE,uBAAuB;IAC5B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,kBAAkB;IAC5B,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;QACrB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAInC,mBAAmB,CAAC,CAAC;QAExB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM,CAAC,SAAS;gBACtB,IAAI,EAAE,MAAM,CAAC,SAAS;aACvB;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;IAC9C,GAAG,EAAE,oBAAoB;IACzB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,kBAAkB;IAC5B,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;QACrB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAAoB,gBAAgB,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const currentScriptResource: import("../core/types.js").ResourceDefinition;
2
+ export declare const scriptResources: import("../core/types.js").ResourceDefinition[];
3
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../src/resources/script.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,+CAoBhC,CAAC;AAEH,eAAO,MAAM,eAAe,iDAA0B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { defineResource } from '../core/define-resource.js';
2
+ export const currentScriptResource = defineResource({
3
+ uri: 'godot://script/current',
4
+ name: 'Current Script',
5
+ description: 'The currently open script in the Godot editor',
6
+ mimeType: 'text/x-gdscript',
7
+ async handler({ godot }) {
8
+ const result = await godot.sendCommand('get_current_script');
9
+ if (!result.path) {
10
+ return JSON.stringify({ error: 'No script currently open' });
11
+ }
12
+ return JSON.stringify({
13
+ path: result.path,
14
+ content: result.content,
15
+ });
16
+ },
17
+ });
18
+ export const scriptResources = [currentScriptResource];
19
+ //# sourceMappingURL=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.js","sourceRoot":"","sources":["../../src/resources/script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;IAClD,GAAG,EAAE,wBAAwB;IAC7B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,iBAAiB;IAC3B,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;QACrB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAGnC,oBAAoB,CAAC,CAAC;QAEzB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;QAC/D,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;YACpB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import type { AnyToolDefinition } from '../core/types.js';
3
+ export declare const getEditorState: import("../core/types.js").ToolDefinition<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
4
+ export declare const getSelectedNodes: import("../core/types.js").ToolDefinition<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
5
+ export declare const selectNode: import("../core/types.js").ToolDefinition<z.ZodObject<{
6
+ node_path: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ node_path: string;
9
+ }, {
10
+ node_path: string;
11
+ }>>;
12
+ export declare const runProject: import("../core/types.js").ToolDefinition<z.ZodObject<{
13
+ scene_path: z.ZodOptional<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ scene_path?: string | undefined;
16
+ }, {
17
+ scene_path?: string | undefined;
18
+ }>>;
19
+ export declare const stopProject: import("../core/types.js").ToolDefinition<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
20
+ export declare const getDebugOutput: import("../core/types.js").ToolDefinition<z.ZodObject<{
21
+ clear: z.ZodOptional<z.ZodBoolean>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ clear?: boolean | undefined;
24
+ }, {
25
+ clear?: boolean | undefined;
26
+ }>>;
27
+ export declare const editorTools: AnyToolDefinition[];
28
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/tools/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,cAAc,2FAYzB,CAAC;AAEH,eAAO,MAAM,gBAAgB,2FAa3B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;GAUrB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;GAarB,CAAC;AAEH,eAAO,MAAM,WAAW,2FAQtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;GAmBzB,CAAC;AAEH,eAAO,MAAM,WAAW,EAOnB,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { z } from 'zod';
2
+ import { defineTool } from '../core/define-tool.js';
3
+ export const getEditorState = defineTool({
4
+ name: 'get_editor_state',
5
+ description: 'Get the current state of the Godot editor',
6
+ schema: z.object({}),
7
+ async execute(_, { godot }) {
8
+ const result = await godot.sendCommand('get_editor_state');
9
+ return JSON.stringify(result, null, 2);
10
+ },
11
+ });
12
+ export const getSelectedNodes = defineTool({
13
+ name: 'get_selected_nodes',
14
+ description: 'Get the currently selected nodes in the editor',
15
+ schema: z.object({}),
16
+ async execute(_, { godot }) {
17
+ const result = await godot.sendCommand('get_selected_nodes');
18
+ if (result.selected.length === 0) {
19
+ return 'No nodes selected';
20
+ }
21
+ return `Selected nodes:\n${result.selected.map((p) => ` - ${p}`).join('\n')}`;
22
+ },
23
+ });
24
+ export const selectNode = defineTool({
25
+ name: 'select_node',
26
+ description: 'Select a node in the editor',
27
+ schema: z.object({
28
+ node_path: z.string().describe('Path to the node to select'),
29
+ }),
30
+ async execute({ node_path }, { godot }) {
31
+ await godot.sendCommand('select_node', { node_path });
32
+ return `Selected node: ${node_path}`;
33
+ },
34
+ });
35
+ export const runProject = defineTool({
36
+ name: 'run_project',
37
+ description: 'Run the current Godot project',
38
+ schema: z.object({
39
+ scene_path: z
40
+ .string()
41
+ .optional()
42
+ .describe('Optional specific scene to run (defaults to main scene)'),
43
+ }),
44
+ async execute({ scene_path }, { godot }) {
45
+ await godot.sendCommand('run_project', { scene_path });
46
+ return scene_path ? `Running scene: ${scene_path}` : 'Running project';
47
+ },
48
+ });
49
+ export const stopProject = defineTool({
50
+ name: 'stop_project',
51
+ description: 'Stop the running Godot project',
52
+ schema: z.object({}),
53
+ async execute(_, { godot }) {
54
+ await godot.sendCommand('stop_project');
55
+ return 'Stopped project';
56
+ },
57
+ });
58
+ export const getDebugOutput = defineTool({
59
+ name: 'get_debug_output',
60
+ description: 'Get debug output/print statements from the running project',
61
+ schema: z.object({
62
+ clear: z
63
+ .boolean()
64
+ .optional()
65
+ .describe('Whether to clear the output buffer after reading'),
66
+ }),
67
+ async execute({ clear }, { godot }) {
68
+ const result = await godot.sendCommand('get_debug_output', { clear: clear ?? false });
69
+ if (!result.output || result.output.trim() === '') {
70
+ return 'No debug output';
71
+ }
72
+ return `Debug output:\n\`\`\`\n${result.output}\n\`\`\``;
73
+ },
74
+ });
75
+ export const editorTools = [
76
+ getEditorState,
77
+ getSelectedNodes,
78
+ selectNode,
79
+ runProject,
80
+ stopProject,
81
+ getDebugOutput,
82
+ ];
83
+ //# sourceMappingURL=editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.js","sourceRoot":"","sources":["../../src/tools/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CAInC,kBAAkB,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE;QACxB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CACpC,oBAAoB,CACrB,CAAC;QACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC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AAI,EAAE,cAAc;IACpB,WAAW,EAAE,gCAAgC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACpB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE;QACxB,MAAM,KAAK,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QACxC,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,4DAA4D;IACzE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC;aACL,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,kDAAkD,CAAC;KAChE,CAAC;IACF,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE;QAChC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,WAAW,CACpC,kBAAkB,EAClB,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,CAC1B,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAClD,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QACD,OAAO,0BAA0B,MAAM,CAAC,MAAM,UAAU,CAAC;IAC3D,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,WAAW;IACX,cAAc;CACQ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function registerAllTools(): void;
2
+ export { sceneTools } from './scene.js';
3
+ export { nodeTools } from './node.js';
4
+ export { scriptTools } from './script.js';
5
+ export { editorTools } from './editor.js';
6
+ export { projectTools } from './project.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAOA,wBAAgB,gBAAgB,IAAI,IAAI,CAMvC;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { registry } from '../core/registry.js';
2
+ import { sceneTools } from './scene.js';
3
+ import { nodeTools } from './node.js';
4
+ import { scriptTools } from './script.js';
5
+ import { editorTools } from './editor.js';
6
+ import { projectTools } from './project.js';
7
+ export function registerAllTools() {
8
+ registry.registerTools(sceneTools);
9
+ registry.registerTools(nodeTools);
10
+ registry.registerTools(scriptTools);
11
+ registry.registerTools(editorTools);
12
+ registry.registerTools(projectTools);
13
+ }
14
+ export { sceneTools } from './scene.js';
15
+ export { nodeTools } from './node.js';
16
+ export { scriptTools } from './script.js';
17
+ export { editorTools } from './editor.js';
18
+ export { projectTools } from './project.js';
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,gBAAgB;IAC9B,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACpC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;IACpC,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ import type { AnyToolDefinition } from '../core/types.js';
3
+ export declare const getNodeProperties: import("../core/types.js").ToolDefinition<z.ZodObject<{
4
+ node_path: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ node_path: string;
7
+ }, {
8
+ node_path: string;
9
+ }>>;
10
+ export declare const createNode: import("../core/types.js").ToolDefinition<z.ZodObject<{
11
+ parent_path: z.ZodString;
12
+ node_type: z.ZodString;
13
+ node_name: z.ZodString;
14
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ parent_path: string;
17
+ node_type: string;
18
+ node_name: string;
19
+ properties?: Record<string, unknown> | undefined;
20
+ }, {
21
+ parent_path: string;
22
+ node_type: string;
23
+ node_name: string;
24
+ properties?: Record<string, unknown> | undefined;
25
+ }>>;
26
+ export declare const updateNode: import("../core/types.js").ToolDefinition<z.ZodObject<{
27
+ node_path: z.ZodString;
28
+ properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ node_path: string;
31
+ properties: Record<string, unknown>;
32
+ }, {
33
+ node_path: string;
34
+ properties: Record<string, unknown>;
35
+ }>>;
36
+ export declare const deleteNode: import("../core/types.js").ToolDefinition<z.ZodObject<{
37
+ node_path: z.ZodString;
38
+ }, "strip", z.ZodTypeAny, {
39
+ node_path: string;
40
+ }, {
41
+ node_path: string;
42
+ }>>;
43
+ export declare const reparentNode: import("../core/types.js").ToolDefinition<z.ZodObject<{
44
+ node_path: z.ZodString;
45
+ new_parent_path: z.ZodString;
46
+ }, "strip", z.ZodTypeAny, {
47
+ node_path: string;
48
+ new_parent_path: string;
49
+ }, {
50
+ node_path: string;
51
+ new_parent_path: string;
52
+ }>>;
53
+ export declare const nodeTools: AnyToolDefinition[];
54
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tools/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;GAc5B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;GA0BrB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;GAarB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;GAUrB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;GAWvB,CAAC;AAEH,eAAO,MAAM,SAAS,EAMjB,iBAAiB,EAAE,CAAC"}