gdharness 0.12.0 → 0.12.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 CHANGED
@@ -73,11 +73,12 @@ and integration suites run against a real engine on all three before anything is
73
73
 
74
74
  What each kind of release means here:
75
75
 
76
- - **Patch**: an answer that was wrong is now right. The output can change, because a wrong answer
77
- corrected is a fix rather than a feature, and leaving one wrong to protect whoever parsed it is
78
- how a tool stops being worth asking.
79
- - **Minor**: a tool, an op, an argument or a field was added, or behaviour a caller can see
80
- changed.
76
+ - **Patch**: nearly everything. An answer that was wrong is now right, and the output may change
77
+ shape for it, because a wrong answer corrected is a fix rather than a feature and leaving one
78
+ wrong to protect whoever parsed it is how a tool stops being worth asking. An addition nothing
79
+ has to adapt to is a patch too: a new argument, a new field, an argument reaching further than it
80
+ did. Ignore all of it and your calls still work.
81
+ - **Minor**: a new tool or a new op, meaning this does something it could not do before.
81
82
  - **Major**: a tool, an op, an argument or a field was renamed or taken away. Nothing else earns
82
83
  one.
83
84
 
package/build/cli.js CHANGED
@@ -39477,6 +39477,9 @@ async function enablePlugins(engine, projectPath, names) {
39477
39477
  }
39478
39478
  return outcomes;
39479
39479
  }
39480
+ function autoloadIsOurs(named) {
39481
+ return named === null || named === `res://${RUNTIME_AUTOLOAD.path}`;
39482
+ }
39480
39483
  async function setRuntime(engine, projectPath, on) {
39481
39484
  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);
39482
39485
  }
@@ -39533,7 +39536,9 @@ function inspectProject(projectPath) {
39533
39536
  }
39534
39537
  }
39535
39538
  const autoload = settings["autoload"];
39536
- const runtimeAutoload = autoload !== undefined && typeof readString(autoload, RUNTIME_AUTOLOAD.name) === "string";
39539
+ const registered = autoload === undefined ? undefined : readString(autoload, RUNTIME_AUTOLOAD.name);
39540
+ const runtimeAutoload = typeof registered === "string";
39541
+ const runtimeAutoloadPath = typeof registered === "string" ? registered.replace(/^\*/, "") : null;
39537
39542
  const named = autoloadPaths(settings);
39538
39543
  const tracked = trackedByGit(projectPath, [...named.values()]);
39539
39544
  for (const [name, path] of named) {
@@ -39553,6 +39558,7 @@ function inspectProject(projectPath) {
39553
39558
  addons,
39554
39559
  pluginsEnabled,
39555
39560
  runtimeAutoload,
39561
+ runtimeAutoloadPath,
39556
39562
  staleClasses,
39557
39563
  classCacheExists: cached !== null,
39558
39564
  problems
@@ -39839,6 +39845,18 @@ function said2(outcome, what) {
39839
39845
  console.error(` engine ${entry.severity}: ${entry.text}`);
39840
39846
  }
39841
39847
  }
39848
+ async function registerRuntime(godot, projectPath) {
39849
+ const named = inspectProject(projectPath).runtimeAutoloadPath;
39850
+ if (autoloadIsOurs(named)) {
39851
+ said2(await setRuntime(godot, projectPath, true), "registering the runtime autoload");
39852
+ console.log(`${RUNTIME_AUTOLOAD.name} autoload registered at res://${RUNTIME_AUTOLOAD.path}`);
39853
+ return;
39854
+ }
39855
+ console.log(`${RUNTIME_AUTOLOAD.name} autoload left at ${named}, which this project registers itself`);
39856
+ if (!existsSync13(join17(projectPath, (named ?? "").replace(/^res:\/\//, "")))) {
39857
+ console.log(` that file is not in this project, so it boots with a missing script: restore it, or point the entry at res://${RUNTIME_AUTOLOAD.path}`);
39858
+ }
39859
+ }
39842
39860
  var SETUP_FLAGS = new Set(["--runtime", "--no-runtime", "--no-connect", "--no-skill", "--json", "--yes"]);
39843
39861
  function namedHarnesses() {
39844
39862
  const flags = args.filter((arg) => arg.startsWith("--") && !SETUP_FLAGS.has(arg));
@@ -39941,8 +39959,7 @@ async function setup() {
39941
39959
  console.log(`${name}: ${outcome.ok ? String(outcome.payload["action"]) : "failed"}`);
39942
39960
  }
39943
39961
  if (runtime) {
39944
- said2(await setRuntime(godot, projectPath, true), "registering the runtime autoload");
39945
- console.log(`${RUNTIME_AUTOLOAD.name} autoload registered`);
39962
+ await registerRuntime(godot, projectPath);
39946
39963
  }
39947
39964
  const classes = await runOperation(godot, "refresh_class_cache", {}, projectPath);
39948
39965
  said2(classes, "rebuilding the class list");
@@ -40042,7 +40059,7 @@ async function upgrade() {
40042
40059
  said2(outcome, `enabling ${EDITOR_PLUGINS[index] ?? ""}`);
40043
40060
  }
40044
40061
  if (before.runtimeAutoload) {
40045
- said2(await setRuntime(godot, projectPath, true), "registering the runtime autoload");
40062
+ await registerRuntime(godot, projectPath);
40046
40063
  }
40047
40064
  said2(await runOperation(godot, "refresh_class_cache", {}, projectPath), "rebuilding the class list");
40048
40065
  const launch = launchFor(version, godot.godotPath, projectPath);
@@ -40092,8 +40109,12 @@ async function runtime3() {
40092
40109
  }
40093
40110
  const projectPath = projectArgument(2);
40094
40111
  const godot = await engine();
40095
- said2(await setRuntime(godot, projectPath, state === "on"), `turning the runtime ${state}`);
40096
- console.log(`${RUNTIME_AUTOLOAD.name} autoload ${state === "on" ? "registered" : "removed"}`);
40112
+ if (state === "on") {
40113
+ await registerRuntime(godot, projectPath);
40114
+ return;
40115
+ }
40116
+ said2(await setRuntime(godot, projectPath, false), "turning the runtime off");
40117
+ console.log(`${RUNTIME_AUTOLOAD.name} autoload removed`);
40097
40118
  }
40098
40119
  async function classes() {
40099
40120
  const projectPath = projectArgument(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
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",