godot-cli 0.12.0 → 0.13.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/README.md +18 -1
- package/dist/commands/build.d.ts +2 -0
- package/dist/commands/build.js +66 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/open.js +24 -1
- package/dist/commands/open.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/build.d.ts +36 -0
- package/dist/lib/build.js +174 -0
- package/dist/lib/build.js.map +1 -0
- package/dist/lib/open.js +33 -0
- package/dist/lib/open.js.map +1 -1
- package/dist/lib/types.d.ts +71 -0
- package/dist/lib.d.ts +2 -1
- package/dist/lib.js +1 -0
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ Requires Node `^20.19.0 || >=22.12.0`.
|
|
|
25
25
|
|
|
26
26
|
| Command | What it does |
|
|
27
27
|
| --- | --- |
|
|
28
|
-
| `open [path]` |
|
|
28
|
+
| `open [path]` | Build the project's C# assembly (so the addon loads on first open — see below), resolve the Godot editor binary, and launch `--editor --path <project>` with `GODOT_MCP_*` connection env vars. `--no-build` skips the build. |
|
|
29
|
+
| `build [path]` | Build the project's C# assembly (`dotnet build`) so the `godot_mcp` addon loads on the next editor open. GDScript-only projects (no `.csproj`) are a no-op. This is the same build `open` runs before launching. |
|
|
29
30
|
| `run-tool <tool> [path]` | POST to `<url>/api/tools/<tool>` with JSON input. |
|
|
30
31
|
| `run-system-tool <tool> [path]` | POST to `<url>/api/system-tools/<tool>` (tools not exposed to MCP clients). |
|
|
31
32
|
| `status [path]` | Detect a running Godot editor for the project and probe MCP-server health. |
|
|
@@ -38,6 +39,22 @@ Requires Node `^20.19.0 || >=22.12.0`.
|
|
|
38
39
|
| `remove-plugin [path]` | Disable the `godot_mcp` addon in `project.godot` `[editor_plugins]` (does not delete the addon files). |
|
|
39
40
|
| `update` | Check npm for a newer `godot-cli` and install it. |
|
|
40
41
|
|
|
42
|
+
### Build before open (`open` / `build`)
|
|
43
|
+
|
|
44
|
+
`open` **builds the project's C# assembly before launching the editor**. Godot instantiates an
|
|
45
|
+
enabled addon's `EditorPlugin` as soon as the editor loads — so on a *fresh* first open of a C#
|
|
46
|
+
project that was never built, no assembly exists yet and Godot fails with
|
|
47
|
+
`Unable to load addon script 'res://addons/godot_mcp/Editor/GodotMcpPlugin.cs' … Disabling the addon`.
|
|
48
|
+
Building first guarantees the assembly is present when the addon is instantiated.
|
|
49
|
+
|
|
50
|
+
- The build is the same one `godot-cli build` runs: `dotnet build <project>.csproj --configuration Debug`.
|
|
51
|
+
- **GDScript-only projects** (no `.csproj` at the root) are skipped automatically — there is nothing to compile.
|
|
52
|
+
- The build runs **unconditionally** for C# projects; `dotnet build` is incremental, so an up-to-date
|
|
53
|
+
project is a fast no-op. Pass `--no-build` to `open` to skip it (e.g. you already built, or want to
|
|
54
|
+
open as fast as possible).
|
|
55
|
+
- If the build **fails**, `open` does **not** launch the editor (launching would just reproduce the
|
|
56
|
+
disable-addon failure); the error is surfaced instead.
|
|
57
|
+
|
|
41
58
|
### Editor resolution (`open`)
|
|
42
59
|
|
|
43
60
|
`open` locates the Godot editor binary in this order:
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import * as ui from '../utils/ui.js';
|
|
4
|
+
import { verbose } from '../utils/ui.js';
|
|
5
|
+
import { buildProject } from '../lib/build.js';
|
|
6
|
+
export const buildCommand = new Command('build')
|
|
7
|
+
.description('Build the Godot project\'s C# assembly (dotnet build) so the godot_mcp addon loads on the next editor open. GDScript-only projects (no .csproj) are a no-op. This is the same build `open` runs before launching the editor.')
|
|
8
|
+
.argument('[path]', 'Path to the Godot project (defaults to current directory)')
|
|
9
|
+
.option('--path <path>', 'Path to the Godot project (defaults to current directory)')
|
|
10
|
+
.option('--configuration <cfg>', 'MSBuild configuration to compile (default: Debug)')
|
|
11
|
+
.option('--dotnet-path <path>', 'Explicit dotnet executable path (default: dotnet on PATH)')
|
|
12
|
+
.action(async (positionalPath, options) => {
|
|
13
|
+
const resolvedPath = positionalPath ?? options.path ?? process.cwd();
|
|
14
|
+
const projectPath = path.resolve(resolvedPath);
|
|
15
|
+
ui.heading('Building Godot C# project');
|
|
16
|
+
verbose(`Project path: ${projectPath}`);
|
|
17
|
+
const spinner = ui.startSpinner('Building C# assembly...');
|
|
18
|
+
const result = await buildProject({
|
|
19
|
+
projectPath,
|
|
20
|
+
configuration: options.configuration,
|
|
21
|
+
dotnetPath: options.dotnetPath,
|
|
22
|
+
onProgress: (event) => {
|
|
23
|
+
switch (event.phase) {
|
|
24
|
+
case 'build-running':
|
|
25
|
+
spinner.text = `Building ${path.basename(event.csprojPath)} ...`;
|
|
26
|
+
verbose(`Build command: ${event.command}`);
|
|
27
|
+
break;
|
|
28
|
+
case 'build-skipped':
|
|
29
|
+
verbose('No .csproj at project root — skipping build (GDScript-only).');
|
|
30
|
+
break;
|
|
31
|
+
default:
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (result.kind === 'failure') {
|
|
37
|
+
spinner.error('Build failed');
|
|
38
|
+
ui.error(result.errorMessage);
|
|
39
|
+
for (const warning of result.warnings) {
|
|
40
|
+
console.log('');
|
|
41
|
+
ui.warn(warning);
|
|
42
|
+
}
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
if (result.skipped) {
|
|
46
|
+
spinner.success('No C# to build (GDScript-only project)');
|
|
47
|
+
ui.info('This project has no .csproj at its root — nothing to compile.');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
spinner.success('C# assembly built');
|
|
51
|
+
ui.label('Project', result.projectPath);
|
|
52
|
+
if (result.csprojPath)
|
|
53
|
+
ui.label('Built', result.csprojPath);
|
|
54
|
+
if (result.configuration)
|
|
55
|
+
ui.label('Configuration', result.configuration);
|
|
56
|
+
// Surface the captured `dotnet build` output in verbose mode — otherwise
|
|
57
|
+
// a slow non-incremental first build shows only a static spinner.
|
|
58
|
+
if (result.output)
|
|
59
|
+
verbose(result.output.trim());
|
|
60
|
+
}
|
|
61
|
+
for (const warning of result.warnings) {
|
|
62
|
+
console.log('');
|
|
63
|
+
ui.warn(warning);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAQ/C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC;KAC7C,WAAW,CACV,8NAA8N,CAC/N;KACA,QAAQ,CAAC,QAAQ,EAAE,2DAA2D,CAAC;KAC/E,MAAM,CAAC,eAAe,EAAE,2DAA2D,CAAC;KACpF,MAAM,CAAC,uBAAuB,EAAE,mDAAmD,CAAC;KACpF,MAAM,CAAC,sBAAsB,EAAE,2DAA2D,CAAC;KAC3F,MAAM,CAAC,KAAK,EAAE,cAAkC,EAAE,OAAwB,EAAE,EAAE;IAC7E,MAAM,YAAY,GAAG,cAAc,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACrE,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/C,EAAE,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,OAAO,CAAC,iBAAiB,WAAW,EAAE,CAAC,CAAC;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AC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,UAAU;YAAE,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5D,IAAI,MAAM,CAAC,aAAa;YAAE,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QAC1E,yEAAyE;QACzE,kEAAkE;QAClE,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/dist/commands/open.js
CHANGED
|
@@ -18,6 +18,8 @@ export const openCommand = new Command('open')
|
|
|
18
18
|
.argument('[path]', 'Path to the Godot project (defaults to current directory)')
|
|
19
19
|
.option('--path <path>', 'Path to the Godot project (defaults to current directory)')
|
|
20
20
|
.option('--editor-path <path>', 'Explicit path to the Godot editor executable (skips discovery)')
|
|
21
|
+
.option('--no-build', 'Skip building the C# assembly before launching (GDScript-only projects skip automatically)')
|
|
22
|
+
.option('--build-configuration <cfg>', 'MSBuild configuration for the pre-open build (default: Debug)')
|
|
21
23
|
.option('--no-connect', 'Open without MCP connection environment variables')
|
|
22
24
|
.option('--url <url>', 'MCP server host to connect to (sets GODOT_MCP_HOST)')
|
|
23
25
|
.option('--cloud-url <url>', 'Cloud base URL override (sets GODOT_MCP_CLOUD_URL)')
|
|
@@ -56,10 +58,12 @@ export const openCommand = new Command('open')
|
|
|
56
58
|
ui.error('--mode must be "Cloud" or "Custom"');
|
|
57
59
|
process.exit(1);
|
|
58
60
|
}
|
|
59
|
-
const spinner = ui.startSpinner('Locating Godot editor...');
|
|
61
|
+
const spinner = ui.startSpinner(options.build === false ? 'Locating Godot editor...' : 'Building C# assembly...');
|
|
60
62
|
const result = await openProject({
|
|
61
63
|
projectPath,
|
|
62
64
|
editorPath: options.editorPath,
|
|
65
|
+
build: options.build !== false,
|
|
66
|
+
buildConfiguration: options.buildConfiguration,
|
|
63
67
|
noConnect: options.connect === false,
|
|
64
68
|
url: options.url,
|
|
65
69
|
cloudUrl: options.cloudUrl,
|
|
@@ -69,6 +73,25 @@ export const openCommand = new Command('open')
|
|
|
69
73
|
logLevel: options.logLevel,
|
|
70
74
|
onProgress: (event) => {
|
|
71
75
|
switch (event.phase) {
|
|
76
|
+
case 'build-running': {
|
|
77
|
+
spinner.text = `Building ${path.basename(event.csprojPath)} ...`;
|
|
78
|
+
verbose(`Build command: ${event.command}`);
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 'build-skipped': {
|
|
82
|
+
// GDScript-only project: no C# to compile. Correct the spinner so
|
|
83
|
+
// it doesn't leave "Building C# assembly..." implying a build ran.
|
|
84
|
+
verbose('No .csproj at project root — skipping build (GDScript-only).');
|
|
85
|
+
spinner.text = 'Locating Godot editor...';
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
case 'build-succeeded': {
|
|
89
|
+
spinner.success('C# assembly built');
|
|
90
|
+
verbose(`Built: ${event.csprojPath} (${event.configuration})`);
|
|
91
|
+
spinner.text = 'Locating Godot editor...';
|
|
92
|
+
spinner.start();
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
72
95
|
case 'editor-resolved': {
|
|
73
96
|
spinner.success('Godot editor located');
|
|
74
97
|
verbose(`Editor path: ${event.editorPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,IAAI,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
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { createRequire } from 'module';
|
|
3
|
+
import { buildCommand } from './commands/build.js';
|
|
3
4
|
import { openCommand } from './commands/open.js';
|
|
4
5
|
import { runToolCommand } from './commands/run-tool.js';
|
|
5
6
|
import { runSystemToolCommand } from './commands/run-system-tool.js';
|
|
@@ -25,6 +26,7 @@ program
|
|
|
25
26
|
.option('-v, --verbose', 'Enable verbose diagnostic output');
|
|
26
27
|
// Register all subcommands
|
|
27
28
|
const subcommands = [
|
|
29
|
+
buildCommand,
|
|
28
30
|
closeCommand,
|
|
29
31
|
configureCommand,
|
|
30
32
|
createProjectCommand,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8B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E,GAAa,CAAC,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BuildProjectOptions, BuildProjectResult } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Locate the single consumer `.csproj` directly at the Godot project root — the
|
|
4
|
+
* `.csproj` Godot compiles every project `.cs` (addon included) into. A
|
|
5
|
+
* `--dotnet` scaffold writes `<AssemblyName>.csproj` there. Returns `null` when
|
|
6
|
+
* the project has no root csproj (a GDScript-only project — nothing to build).
|
|
7
|
+
*
|
|
8
|
+
* When more than one csproj sits at the root, the first alphabetically is
|
|
9
|
+
* returned and the ambiguity is pushed onto `warnings` (all root csprojs compile
|
|
10
|
+
* into the same Godot assembly, so building one builds the dependency graph the
|
|
11
|
+
* editor will load). Pure / read-only `fs`. Exported for unit tests.
|
|
12
|
+
*/
|
|
13
|
+
export declare function findProjectCsproj(projectPath: string, warnings: string[]): string | null;
|
|
14
|
+
/**
|
|
15
|
+
* Build the C# assembly for a Godot project BEFORE the editor opens, so the
|
|
16
|
+
* editor finds a compiled assembly when it instantiates enabled `EditorPlugin`s
|
|
17
|
+
* (otherwise a fresh first open fails with "Unable to load addon script … —
|
|
18
|
+
* Disabling the addon", godotengine/godot#112701-class behavior).
|
|
19
|
+
*
|
|
20
|
+
* Library-safe: never calls `process.exit`, never throws past the public
|
|
21
|
+
* boundary, never writes to stdout/stderr (observability is via `onProgress`).
|
|
22
|
+
*
|
|
23
|
+
* Behavior:
|
|
24
|
+
* - Validates the path is an existing Godot project (`project.godot`).
|
|
25
|
+
* - GDScript-only projects (no root `.csproj`) are a SUCCESS with
|
|
26
|
+
* `skipped: true` / `skipReason: 'no-csproj'` — there is nothing to compile.
|
|
27
|
+
* - C# projects (a root `.csproj`) are built ALWAYS via `dotnet build <csproj>`.
|
|
28
|
+
* `dotnet build` is itself incremental, so an up-to-date project is a fast
|
|
29
|
+
* no-op; building unconditionally avoids the staleness-detection bugs that a
|
|
30
|
+
* "build-if-missing/stale" heuristic would introduce (the exact failure mode
|
|
31
|
+
* this fix exists to prevent — a stale/absent assembly the editor can't load).
|
|
32
|
+
* - A non-zero `dotnet build` exit (or a spawn error such as a missing
|
|
33
|
+
* `dotnet`) is a structured `{ kind: 'failure' }` carrying the captured
|
|
34
|
+
* output, so the caller can surface why the editor would disable the addon.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildProject(options: BuildProjectOptions): Promise<BuildProjectResult>;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { resolveProjectPath, isGodotProjectDir } from './open.js';
|
|
5
|
+
import { emitProgress } from './progress.js';
|
|
6
|
+
/**
|
|
7
|
+
* Locate the single consumer `.csproj` directly at the Godot project root — the
|
|
8
|
+
* `.csproj` Godot compiles every project `.cs` (addon included) into. A
|
|
9
|
+
* `--dotnet` scaffold writes `<AssemblyName>.csproj` there. Returns `null` when
|
|
10
|
+
* the project has no root csproj (a GDScript-only project — nothing to build).
|
|
11
|
+
*
|
|
12
|
+
* When more than one csproj sits at the root, the first alphabetically is
|
|
13
|
+
* returned and the ambiguity is pushed onto `warnings` (all root csprojs compile
|
|
14
|
+
* into the same Godot assembly, so building one builds the dependency graph the
|
|
15
|
+
* editor will load). Pure / read-only `fs`. Exported for unit tests.
|
|
16
|
+
*/
|
|
17
|
+
export function findProjectCsproj(projectPath, warnings) {
|
|
18
|
+
let names;
|
|
19
|
+
try {
|
|
20
|
+
names = fs.readdirSync(projectPath).filter((n) => n.toLowerCase().endsWith('.csproj'));
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
if (names.length === 0)
|
|
26
|
+
return null;
|
|
27
|
+
names.sort();
|
|
28
|
+
if (names.length > 1) {
|
|
29
|
+
warnings.push(`Multiple .csproj files found at the project root (${names.join(', ')}); built ${names[0]}.`);
|
|
30
|
+
}
|
|
31
|
+
return path.join(projectPath, names[0]);
|
|
32
|
+
}
|
|
33
|
+
/** Default MSBuild configuration the build step compiles. */
|
|
34
|
+
const DEFAULT_CONFIGURATION = 'Debug';
|
|
35
|
+
/**
|
|
36
|
+
* Build the C# assembly for a Godot project BEFORE the editor opens, so the
|
|
37
|
+
* editor finds a compiled assembly when it instantiates enabled `EditorPlugin`s
|
|
38
|
+
* (otherwise a fresh first open fails with "Unable to load addon script … —
|
|
39
|
+
* Disabling the addon", godotengine/godot#112701-class behavior).
|
|
40
|
+
*
|
|
41
|
+
* Library-safe: never calls `process.exit`, never throws past the public
|
|
42
|
+
* boundary, never writes to stdout/stderr (observability is via `onProgress`).
|
|
43
|
+
*
|
|
44
|
+
* Behavior:
|
|
45
|
+
* - Validates the path is an existing Godot project (`project.godot`).
|
|
46
|
+
* - GDScript-only projects (no root `.csproj`) are a SUCCESS with
|
|
47
|
+
* `skipped: true` / `skipReason: 'no-csproj'` — there is nothing to compile.
|
|
48
|
+
* - C# projects (a root `.csproj`) are built ALWAYS via `dotnet build <csproj>`.
|
|
49
|
+
* `dotnet build` is itself incremental, so an up-to-date project is a fast
|
|
50
|
+
* no-op; building unconditionally avoids the staleness-detection bugs that a
|
|
51
|
+
* "build-if-missing/stale" heuristic would introduce (the exact failure mode
|
|
52
|
+
* this fix exists to prevent — a stale/absent assembly the editor can't load).
|
|
53
|
+
* - A non-zero `dotnet build` exit (or a spawn error such as a missing
|
|
54
|
+
* `dotnet`) is a structured `{ kind: 'failure' }` carrying the captured
|
|
55
|
+
* output, so the caller can surface why the editor would disable the addon.
|
|
56
|
+
*/
|
|
57
|
+
export async function buildProject(options) {
|
|
58
|
+
const warnings = [];
|
|
59
|
+
let resolvedProjectPath;
|
|
60
|
+
try {
|
|
61
|
+
const { projectPath } = resolveProjectPath(options.projectPath, process.cwd());
|
|
62
|
+
resolvedProjectPath = projectPath;
|
|
63
|
+
if (!fs.existsSync(projectPath)) {
|
|
64
|
+
throw new Error(`Project path does not exist: ${projectPath}`);
|
|
65
|
+
}
|
|
66
|
+
if (!isGodotProjectDir(projectPath)) {
|
|
67
|
+
throw new Error(`Not a Godot project (missing project.godot): ${projectPath}`);
|
|
68
|
+
}
|
|
69
|
+
emitProgress(options.onProgress, {
|
|
70
|
+
phase: 'start',
|
|
71
|
+
message: `Building C# for Godot project at ${projectPath}`,
|
|
72
|
+
});
|
|
73
|
+
const csprojPath = findProjectCsproj(projectPath, warnings);
|
|
74
|
+
if (csprojPath === null) {
|
|
75
|
+
// GDScript-only project — nothing to compile. The editor opens fine
|
|
76
|
+
// without an assembly when no C# is present.
|
|
77
|
+
emitProgress(options.onProgress, {
|
|
78
|
+
phase: 'build-skipped',
|
|
79
|
+
message: 'No .csproj at the project root — GDScript-only project, skipping build.',
|
|
80
|
+
reason: 'no-csproj',
|
|
81
|
+
});
|
|
82
|
+
emitProgress(options.onProgress, { phase: 'done', message: 'Build skipped (no C#).' });
|
|
83
|
+
return {
|
|
84
|
+
kind: 'success',
|
|
85
|
+
success: true,
|
|
86
|
+
projectPath,
|
|
87
|
+
skipped: true,
|
|
88
|
+
skipReason: 'no-csproj',
|
|
89
|
+
warnings,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const configuration = options.configuration ?? DEFAULT_CONFIGURATION;
|
|
93
|
+
const dotnetBin = options.dotnetPath ?? 'dotnet';
|
|
94
|
+
const args = ['build', csprojPath, '--configuration', configuration];
|
|
95
|
+
emitProgress(options.onProgress, {
|
|
96
|
+
phase: 'build-running',
|
|
97
|
+
message: `Building ${path.basename(csprojPath)} (${configuration})`,
|
|
98
|
+
csprojPath,
|
|
99
|
+
command: [dotnetBin, ...args].join(' '),
|
|
100
|
+
});
|
|
101
|
+
const run = await runDotnetBuild(dotnetBin, args, projectPath, options.spawnImpl);
|
|
102
|
+
if (run.code !== 0) {
|
|
103
|
+
const detail = run.output.trim();
|
|
104
|
+
throw new Error(`dotnet build failed (exit ${run.code ?? 'null'}) for ${csprojPath}.` +
|
|
105
|
+
(detail.length > 0 ? `\n${detail}` : ''));
|
|
106
|
+
}
|
|
107
|
+
emitProgress(options.onProgress, {
|
|
108
|
+
phase: 'done',
|
|
109
|
+
message: `Built ${path.basename(csprojPath)} (${configuration}).`,
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
kind: 'success',
|
|
113
|
+
success: true,
|
|
114
|
+
projectPath,
|
|
115
|
+
csprojPath,
|
|
116
|
+
configuration,
|
|
117
|
+
skipped: false,
|
|
118
|
+
output: run.output,
|
|
119
|
+
warnings,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
124
|
+
return {
|
|
125
|
+
kind: 'failure',
|
|
126
|
+
success: false,
|
|
127
|
+
projectPath: resolvedProjectPath,
|
|
128
|
+
warnings,
|
|
129
|
+
errorMessage: errorObj.message,
|
|
130
|
+
error: errorObj,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Spawn `dotnet build`, capturing stdout+stderr, and resolve once it exits.
|
|
136
|
+
* Unlike the editor launch (which detaches), the build is awaited to completion
|
|
137
|
+
* so the assembly exists before the caller proceeds. Library-safe: a spawn
|
|
138
|
+
* `error` (e.g. `dotnet` not on PATH) resolves as a non-zero run rather than
|
|
139
|
+
* throwing past the boundary. `spawnImpl` is injectable for unit tests.
|
|
140
|
+
*/
|
|
141
|
+
function runDotnetBuild(bin, args, cwd, spawnImpl = spawn) {
|
|
142
|
+
return new Promise((resolve) => {
|
|
143
|
+
let settled = false;
|
|
144
|
+
const finish = (run) => {
|
|
145
|
+
if (settled)
|
|
146
|
+
return;
|
|
147
|
+
settled = true;
|
|
148
|
+
resolve(run);
|
|
149
|
+
};
|
|
150
|
+
let child;
|
|
151
|
+
try {
|
|
152
|
+
child = spawnImpl(bin, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
156
|
+
finish({ code: 127, output: `Failed to spawn "${bin}": ${msg}` });
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
let output = '';
|
|
160
|
+
child.stdout?.on('data', (chunk) => {
|
|
161
|
+
output += chunk.toString();
|
|
162
|
+
});
|
|
163
|
+
child.stderr?.on('data', (chunk) => {
|
|
164
|
+
output += chunk.toString();
|
|
165
|
+
});
|
|
166
|
+
child.on('error', (err) => {
|
|
167
|
+
finish({ code: 127, output: `${output}\nFailed to run "${bin}": ${err.message}` });
|
|
168
|
+
});
|
|
169
|
+
child.on('close', (code) => {
|
|
170
|
+
finish({ code, output });
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/lib/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,QAAkB;IAElB,IAAI,KAAe,CAAC;IACpB,IAAI,CAAC;QACH,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAA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AE,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/lib/open.js
CHANGED
|
@@ -4,6 +4,7 @@ import { findGodotBinary, launchEditor } from '../utils/godot-editor.js';
|
|
|
4
4
|
import { findGodotProcess } from '../utils/godot-process.js';
|
|
5
5
|
import { ENV_AUTH_OPTION, ENV_CLOUD_URL, ENV_CONNECTION_MODE, ENV_HOST, ENV_LOG_LEVEL, ENV_TOKEN, } from '../utils/connection.js';
|
|
6
6
|
import { emitProgress } from './progress.js';
|
|
7
|
+
import { buildProject } from './build.js';
|
|
7
8
|
/**
|
|
8
9
|
* Resolve the project path from an explicit option or fall back to the supplied
|
|
9
10
|
* cwd. Returns an absolute path plus a flag indicating whether the cwd fallback
|
|
@@ -77,6 +78,7 @@ export async function openProject(options) {
|
|
|
77
78
|
const warnings = [];
|
|
78
79
|
let resolvedProjectPath;
|
|
79
80
|
let resolvedEditorPath;
|
|
81
|
+
let built = false;
|
|
80
82
|
try {
|
|
81
83
|
const { projectPath } = resolveProjectPath(options.projectPath, process.cwd());
|
|
82
84
|
resolvedProjectPath = projectPath;
|
|
@@ -108,8 +110,38 @@ export async function openProject(options) {
|
|
|
108
110
|
projectPath,
|
|
109
111
|
warnings,
|
|
110
112
|
alreadyRunning: true,
|
|
113
|
+
built: false,
|
|
111
114
|
};
|
|
112
115
|
}
|
|
116
|
+
// Build the C# assembly BEFORE launching the editor, so a fresh first open
|
|
117
|
+
// finds a compiled assembly when it instantiates enabled EditorPlugins
|
|
118
|
+
// (otherwise the editor shows "Unable to load addon script … Disabling the
|
|
119
|
+
// addon"). GDScript-only projects are skipped inside buildProject. Opt out
|
|
120
|
+
// with `build: false`. A build failure aborts the open — launching anyway
|
|
121
|
+
// would reproduce the very disable-addon failure this guards against.
|
|
122
|
+
if (options.build !== false) {
|
|
123
|
+
const buildResult = await buildProject({
|
|
124
|
+
projectPath,
|
|
125
|
+
configuration: options.buildConfiguration,
|
|
126
|
+
dotnetPath: options.dotnetPath,
|
|
127
|
+
spawnImpl: options.buildSpawnImpl,
|
|
128
|
+
onProgress: options.onProgress,
|
|
129
|
+
});
|
|
130
|
+
if (buildResult.kind === 'failure') {
|
|
131
|
+
throw new Error(`Build before open failed; not launching the editor (it would disable the addon).\n${buildResult.errorMessage}`);
|
|
132
|
+
}
|
|
133
|
+
for (const w of buildResult.warnings)
|
|
134
|
+
warnings.push(w);
|
|
135
|
+
built = !buildResult.skipped;
|
|
136
|
+
if (!buildResult.skipped && buildResult.csprojPath !== undefined) {
|
|
137
|
+
emitProgress(options.onProgress, {
|
|
138
|
+
phase: 'build-succeeded',
|
|
139
|
+
message: 'C# assembly built before launch.',
|
|
140
|
+
csprojPath: buildResult.csprojPath,
|
|
141
|
+
configuration: buildResult.configuration ?? 'Debug',
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
113
145
|
// Locate the Godot binary.
|
|
114
146
|
const editorPath = findGodotBinary(options.editorPath);
|
|
115
147
|
if (!editorPath) {
|
|
@@ -165,6 +197,7 @@ export async function openProject(options) {
|
|
|
165
197
|
editorPid: pid,
|
|
166
198
|
projectPath,
|
|
167
199
|
warnings,
|
|
200
|
+
built,
|
|
168
201
|
};
|
|
169
202
|
}
|
|
170
203
|
catch (err) {
|
package/dist/lib/open.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/lib/open.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,SAAS,GACV,MAAM,wBAAwB,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,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7C,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;IACtE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -29,6 +29,20 @@ export type ProgressEvent = {
|
|
|
29
29
|
phase: 'project-scaffolded';
|
|
30
30
|
message: string;
|
|
31
31
|
projectPath: string;
|
|
32
|
+
} | {
|
|
33
|
+
phase: 'build-running';
|
|
34
|
+
message: string;
|
|
35
|
+
csprojPath: string;
|
|
36
|
+
command: string;
|
|
37
|
+
} | {
|
|
38
|
+
phase: 'build-skipped';
|
|
39
|
+
message: string;
|
|
40
|
+
reason: BuildSkipReason;
|
|
41
|
+
} | {
|
|
42
|
+
phase: 'build-succeeded';
|
|
43
|
+
message: string;
|
|
44
|
+
csprojPath: string;
|
|
45
|
+
configuration: string;
|
|
32
46
|
} | {
|
|
33
47
|
phase: 'editor-resolved';
|
|
34
48
|
message: string;
|
|
@@ -104,6 +118,44 @@ export interface SetupSkillsFailure {
|
|
|
104
118
|
error: Error;
|
|
105
119
|
}
|
|
106
120
|
export type SetupSkillsResult = SetupSkillsSuccess | SetupSkillsFailure;
|
|
121
|
+
/** Why a build was skipped rather than run. */
|
|
122
|
+
export type BuildSkipReason = 'no-csproj';
|
|
123
|
+
export interface BuildProjectOptions {
|
|
124
|
+
/** Path to the Godot project to build. Defaults to `process.cwd()`. */
|
|
125
|
+
projectPath?: string;
|
|
126
|
+
/** MSBuild configuration to compile. Defaults to `Debug` (CI parity). */
|
|
127
|
+
configuration?: string;
|
|
128
|
+
/** Explicit `dotnet` executable path. Defaults to `dotnet` on `PATH`. */
|
|
129
|
+
dotnetPath?: string;
|
|
130
|
+
/** Injectable `child_process.spawn` for tests (mock the build). */
|
|
131
|
+
spawnImpl?: typeof import('child_process').spawn;
|
|
132
|
+
onProgress?: ProgressCallback;
|
|
133
|
+
}
|
|
134
|
+
export interface BuildProjectSuccess {
|
|
135
|
+
kind: 'success';
|
|
136
|
+
success: true;
|
|
137
|
+
projectPath: string;
|
|
138
|
+
/** True when the project had no C# to build (GDScript-only). */
|
|
139
|
+
skipped: boolean;
|
|
140
|
+
/** Set when `skipped` is true. */
|
|
141
|
+
skipReason?: BuildSkipReason;
|
|
142
|
+
/** The `.csproj` that was built (absent when skipped). */
|
|
143
|
+
csprojPath?: string;
|
|
144
|
+
/** The MSBuild configuration compiled (absent when skipped). */
|
|
145
|
+
configuration?: string;
|
|
146
|
+
/** Captured `dotnet build` stdout+stderr (absent when skipped). */
|
|
147
|
+
output?: string;
|
|
148
|
+
warnings: string[];
|
|
149
|
+
}
|
|
150
|
+
export interface BuildProjectFailure {
|
|
151
|
+
kind: 'failure';
|
|
152
|
+
success: false;
|
|
153
|
+
projectPath?: string;
|
|
154
|
+
warnings: string[];
|
|
155
|
+
errorMessage: string;
|
|
156
|
+
error: Error;
|
|
157
|
+
}
|
|
158
|
+
export type BuildProjectResult = BuildProjectSuccess | BuildProjectFailure;
|
|
107
159
|
/** Auth option propagated to the editor as `GODOT_MCP_AUTH_OPTION`. */
|
|
108
160
|
export type OpenProjectAuthOption = 'None' | 'Required';
|
|
109
161
|
/** Connection mode propagated to the editor as `GODOT_MCP_CONNECTION_MODE`. */
|
|
@@ -113,6 +165,19 @@ export interface OpenProjectOptions {
|
|
|
113
165
|
projectPath?: string;
|
|
114
166
|
/** Explicit Godot editor executable path (skips resolution). */
|
|
115
167
|
editorPath?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Build the C# assembly (`dotnet build`) before launching the editor so a
|
|
170
|
+
* fresh first open loads the addon instead of failing with "Unable to load
|
|
171
|
+
* addon script … Disabling the addon". Defaults to `true`. Set `false` to skip
|
|
172
|
+
* (GDScript-only projects are skipped automatically — see `buildProject`).
|
|
173
|
+
*/
|
|
174
|
+
build?: boolean;
|
|
175
|
+
/** MSBuild configuration for the pre-open build. Defaults to `Debug`. */
|
|
176
|
+
buildConfiguration?: string;
|
|
177
|
+
/** Explicit `dotnet` executable path for the pre-open build. */
|
|
178
|
+
dotnetPath?: string;
|
|
179
|
+
/** Injectable `child_process.spawn` for the pre-open build (tests). */
|
|
180
|
+
buildSpawnImpl?: typeof import('child_process').spawn;
|
|
116
181
|
/** If `true`, skip wiring the GODOT_MCP_* env vars onto the editor process. */
|
|
117
182
|
noConnect?: boolean;
|
|
118
183
|
/** MCP server host — sets `GODOT_MCP_HOST`. */
|
|
@@ -138,6 +203,12 @@ export interface OpenProjectSuccess {
|
|
|
138
203
|
warnings: string[];
|
|
139
204
|
/** True when an editor was already running for this project; launch skipped. */
|
|
140
205
|
alreadyRunning?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Whether the C# assembly was built before launch: `true` when a build ran,
|
|
208
|
+
* `false` when skipped (`--no-build`, a GDScript-only project, or an
|
|
209
|
+
* already-running editor short-circuit).
|
|
210
|
+
*/
|
|
211
|
+
built?: boolean;
|
|
141
212
|
}
|
|
142
213
|
export interface OpenProjectFailure {
|
|
143
214
|
kind: 'failure';
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { openProject } from './lib/open.js';
|
|
2
|
+
export { buildProject } from './lib/build.js';
|
|
2
3
|
export { createProject } from './lib/create-project.js';
|
|
3
4
|
export { runTool, runSystemTool } from './lib/run-tool.js';
|
|
4
5
|
export { setupMcp, listAgentIds } from './lib/setup-mcp.js';
|
|
5
6
|
export { setupSkills } from './lib/setup-skills.js';
|
|
6
7
|
export { installPlugin, removePlugin } from './lib/install-plugin.js';
|
|
7
|
-
export type { ProgressEvent, ProgressCallback, ResultKind, OpenProjectOptions, OpenProjectResult, OpenProjectSuccess, OpenProjectFailure, OpenProjectAuthOption, OpenProjectConnectionMode, CreateProjectOptions, CreateProjectResult, CreateProjectSuccess, CreateProjectFailure, RunToolOptions, RunToolResult, RunToolSuccess, RunToolFailure, RunToolFailureReason, RunSystemToolOptions, RunSystemToolResult, RunSystemToolSuccess, RunSystemToolFailure, SetupMcpOptions, SetupMcpResult, SetupMcpSuccess, SetupMcpFailure, SetupSkillsOptions, SetupSkillsResult, SetupSkillsSuccess, SetupSkillsFailure, InstallPluginOptions, InstallPluginResult, InstallPluginSuccess, InstallPluginFailure, AddonMaterializeOutcome, CsprojPatchOutcome, RemovePluginOptions, RemovePluginResult, RemovePluginSuccess, RemovePluginFailure, } from './lib/types.js';
|
|
8
|
+
export type { ProgressEvent, ProgressCallback, ResultKind, OpenProjectOptions, OpenProjectResult, OpenProjectSuccess, OpenProjectFailure, OpenProjectAuthOption, OpenProjectConnectionMode, BuildProjectOptions, BuildProjectResult, BuildProjectSuccess, BuildProjectFailure, BuildSkipReason, CreateProjectOptions, CreateProjectResult, CreateProjectSuccess, CreateProjectFailure, RunToolOptions, RunToolResult, RunToolSuccess, RunToolFailure, RunToolFailureReason, RunSystemToolOptions, RunSystemToolResult, RunSystemToolSuccess, RunSystemToolFailure, SetupMcpOptions, SetupMcpResult, SetupMcpSuccess, SetupMcpFailure, SetupSkillsOptions, SetupSkillsResult, SetupSkillsSuccess, SetupSkillsFailure, InstallPluginOptions, InstallPluginResult, InstallPluginSuccess, InstallPluginFailure, AddonMaterializeOutcome, CsprojPatchOutcome, RemovePluginOptions, RemovePluginResult, RemovePluginSuccess, RemovePluginFailure, } from './lib/types.js';
|
package/dist/lib.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
// Consumers: `import { openProject } from 'godot-cli'` (maps to this file
|
|
14
14
|
// via the `exports` field in package.json).
|
|
15
15
|
export { openProject } from './lib/open.js';
|
|
16
|
+
export { buildProject } from './lib/build.js';
|
|
16
17
|
export { createProject } from './lib/create-project.js';
|
|
17
18
|
export { runTool, runSystemTool } from './lib/run-tool.js';
|
|
18
19
|
export { setupMcp, listAgentIds } from './lib/setup-mcp.js';
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,eAAe;AACf,+EAA+E;AAC/E,wDAAwD;AACxD,oDAAoD;AACpD,yEAAyE;AACzE,4DAA4D;AAC5D,+EAA+E;AAC/E,gEAAgE;AAChE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,4CAA4C;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,eAAe;AACf,+EAA+E;AAC/E,wDAAwD;AACxD,oDAAoD;AACpD,yEAAyE;AACzE,4DAA4D;AAC5D,+EAA+E;AAC/E,gEAAgE;AAChE,6EAA6E;AAC7E,EAAE;AACF,0EAA0E;AAC1E,4CAA4C;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "godot-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Cross-platform CLI tool for Godot-MCP (Skills & MCP). Resolves and launches the Godot editor with MCP connection env vars, runs MCP/system tools over HTTP, probes server health, configures AI agents (Claude Code, Cursor, VS Code, …), and enables/disables the godot_mcp addon. Works with Claude Code, Cursor, Copilot, and any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/lib.js",
|