gdharness 0.12.2 → 0.12.3
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/build/cli.js +32 -4
- package/package.json +1 -1
package/build/cli.js
CHANGED
|
@@ -39491,6 +39491,23 @@ function autoloadIsOurs(named) {
|
|
|
39491
39491
|
async function setRuntime(engine, projectPath, on) {
|
|
39492
39492
|
return on ? await runOperation2(engine, "add_autoload", { name: RUNTIME_AUTOLOAD.name, path: `res://${RUNTIME_AUTOLOAD.path}`, enabled: true }, projectPath) : await runOperation2(engine, "remove_autoload", { name: RUNTIME_AUTOLOAD.name }, projectPath);
|
|
39493
39493
|
}
|
|
39494
|
+
function loaderAmong(projectPath, named) {
|
|
39495
|
+
let byName = null;
|
|
39496
|
+
for (const [entry, path] of named) {
|
|
39497
|
+
if (entry === RUNTIME_AUTOLOAD.name || path === RUNTIME_AUTOLOAD.path) {
|
|
39498
|
+
continue;
|
|
39499
|
+
}
|
|
39500
|
+
let source = "";
|
|
39501
|
+
try {
|
|
39502
|
+
source = readFileSync7(join8(projectPath, path), "utf8");
|
|
39503
|
+
} catch {}
|
|
39504
|
+
if (source.includes(RUNTIME_AUTOLOAD.path)) {
|
|
39505
|
+
return { name: entry, path };
|
|
39506
|
+
}
|
|
39507
|
+
byName ??= path.toLowerCase().includes("gdharness") ? { name: entry, path } : null;
|
|
39508
|
+
}
|
|
39509
|
+
return byName;
|
|
39510
|
+
}
|
|
39494
39511
|
function autoloadPaths(settings) {
|
|
39495
39512
|
const named = new Map;
|
|
39496
39513
|
for (const [name, value] of Object.entries(settings["autoload"] ?? {})) {
|
|
@@ -39545,11 +39562,10 @@ function inspectProject(projectPath) {
|
|
|
39545
39562
|
}
|
|
39546
39563
|
const autoload = settings["autoload"];
|
|
39547
39564
|
const registered = autoload === undefined ? undefined : readString(autoload, RUNTIME_AUTOLOAD.name);
|
|
39548
|
-
const runtimeAutoload = typeof registered === "string";
|
|
39549
39565
|
const runtimeAutoloadPath = typeof registered === "string" ? registered.replace(/^\*/, "") : null;
|
|
39550
39566
|
const named = autoloadPaths(settings);
|
|
39551
|
-
const
|
|
39552
|
-
const
|
|
39567
|
+
const runtimeLoaderAutoload = loaderAmong(projectPath, named);
|
|
39568
|
+
const runtimeAutoload = runtimeAutoloadPath !== null || runtimeLoaderAutoload !== null;
|
|
39553
39569
|
const tracked = trackedByGit(projectPath, [...named.values()]);
|
|
39554
39570
|
for (const [name, path] of named) {
|
|
39555
39571
|
if (tracked !== null && !tracked.has(path) && existsSync7(join8(projectPath, path))) {
|
|
@@ -40109,7 +40125,7 @@ function doctorReport(projectPath) {
|
|
|
40109
40125
|
console.log(`addons/${addon.name}: ${addon.installed ? `installed, ${addon.version ?? "unknown version"}${addon.current ? "" : " (not this version)"}` : "missing"}`);
|
|
40110
40126
|
}
|
|
40111
40127
|
console.log(`editor plugins enabled: ${report.pluginsEnabled.join(", ") || "none"}`);
|
|
40112
|
-
console.log(`runtime autoload: ${report.runtimeAutoload ? "registered" : "not registered"}`);
|
|
40128
|
+
console.log(`runtime autoload: ${report.runtimeLoaderAutoload === null ? report.runtimeAutoload ? "registered" : "not registered" : `registered through res://${report.runtimeLoaderAutoload.path}, as ${report.runtimeLoaderAutoload.name}`}`);
|
|
40113
40129
|
console.log(report.classCacheExists ? `class cache: ${report.staleClasses.length === 0 ? "current" : `stale for ${report.staleClasses.join(", ")}`}` : "class cache: missing");
|
|
40114
40130
|
for (const problem of report.problems) {
|
|
40115
40131
|
console.log(`problem: ${problem}`);
|
|
@@ -40130,8 +40146,20 @@ async function runtime3() {
|
|
|
40130
40146
|
await registerRuntime(godot, projectPath);
|
|
40131
40147
|
return;
|
|
40132
40148
|
}
|
|
40149
|
+
const before = inspectProject(projectPath);
|
|
40150
|
+
const loader = before.runtimeLoaderAutoload;
|
|
40151
|
+
if (before.runtimeAutoloadPath === null) {
|
|
40152
|
+
console.log(`${RUNTIME_AUTOLOAD.name} autoload is not registered, so there was nothing to remove`);
|
|
40153
|
+
if (loader !== null) {
|
|
40154
|
+
console.log(` ${loader.name} names res://${loader.path}, which brings the runtime up its own way. That line is this project's, not this tool's, so nothing here has changed it: whatever that file decides about a release build still decides it.`);
|
|
40155
|
+
}
|
|
40156
|
+
return;
|
|
40157
|
+
}
|
|
40133
40158
|
said2(await setRuntime(godot, projectPath, false), "turning the runtime off");
|
|
40134
40159
|
console.log(`${RUNTIME_AUTOLOAD.name} autoload removed`);
|
|
40160
|
+
if (loader !== null) {
|
|
40161
|
+
console.log(` ${loader.name} still names res://${loader.path}, which brings the runtime up its own way: this command has not touched it, so whatever that file decides about a release build still decides it`);
|
|
40162
|
+
}
|
|
40135
40163
|
}
|
|
40136
40164
|
async function classes() {
|
|
40137
40165
|
const projectPath = projectArgument(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdharness",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"mcpName": "io.github.Aureliolo/gdharness",
|
|
5
5
|
"description": "A harness for driving a Godot 4 project from an agent: editor addons, a runtime bridge into the running game, an MCP server in front of them, and a CLI that installs and diagnoses the Godot side.",
|
|
6
6
|
"type": "module",
|