gdharness 0.12.15 → 0.12.16

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 CHANGED
@@ -36159,6 +36159,16 @@ function writeRunRecord(record) {
36159
36159
  mkdirSync6(runsDirectory(), { recursive: true });
36160
36160
  writeFileSync8(recordPath(), JSON.stringify(record, null, 2), "utf8");
36161
36161
  }
36162
+ function recordRunEnded(pid, exitCode) {
36163
+ const path = recordPath();
36164
+ const record = recordAt(path);
36165
+ if (record === null || record.pid !== pid) {
36166
+ return;
36167
+ }
36168
+ try {
36169
+ writeFileSync8(path, JSON.stringify({ ...record, exitCode }, null, 2), "utf8");
36170
+ } catch {}
36171
+ }
36162
36172
  function readRunRecord() {
36163
36173
  for (const path of recordPaths()) {
36164
36174
  const record = recordAt(path);
@@ -36192,7 +36202,8 @@ function recordAt(path) {
36192
36202
  startedAt,
36193
36203
  projectPath: typeof fields["projectPath"] === "string" ? fields["projectPath"] : "",
36194
36204
  arguments: Array.isArray(args) ? args.filter((value) => typeof value === "string") : [],
36195
- ...typeof fields["command"] === "string" ? { command: fields["command"] } : {}
36205
+ ...typeof fields["command"] === "string" ? { command: fields["command"] } : {},
36206
+ ...typeof fields["exitCode"] === "number" ? { exitCode: fields["exitCode"] } : {}
36196
36207
  };
36197
36208
  }
36198
36209
  function runningAs(pid) {
@@ -38006,6 +38017,9 @@ class GodotServer {
38006
38017
  this.logDebug(`Godot process exited with code ${code ?? "none"}`);
38007
38018
  log.finish();
38008
38019
  started.exitCode = code ?? -1;
38020
+ if (started.pid !== null) {
38021
+ recordRunEnded(started.pid, started.exitCode);
38022
+ }
38009
38023
  });
38010
38024
  child.on("error", (err) => {
38011
38025
  console.error("Failed to start Godot process:", err);
@@ -38110,8 +38124,8 @@ class GodotServer {
38110
38124
  this.drainTranscript(adopted);
38111
38125
  if (!alive(record.pid) || !couldStillBeTheRecordedRun(record)) {
38112
38126
  adopted.log.finish();
38113
- adopted.exitCode = null;
38114
- adopted.endedUnwatched = true;
38127
+ adopted.exitCode = record.exitCode ?? null;
38128
+ adopted.endedUnwatched = record.exitCode === undefined;
38115
38129
  }
38116
38130
  this.activeProcess = adopted;
38117
38131
  return adopted;
package/build/index.js CHANGED
@@ -27841,6 +27841,16 @@ function writeRunRecord(record) {
27841
27841
  mkdirSync3(runsDirectory(), { recursive: true });
27842
27842
  writeFileSync4(recordPath(), JSON.stringify(record, null, 2), "utf8");
27843
27843
  }
27844
+ function recordRunEnded(pid, exitCode) {
27845
+ const path = recordPath();
27846
+ const record = recordAt(path);
27847
+ if (record === null || record.pid !== pid) {
27848
+ return;
27849
+ }
27850
+ try {
27851
+ writeFileSync4(path, JSON.stringify({ ...record, exitCode }, null, 2), "utf8");
27852
+ } catch {}
27853
+ }
27844
27854
  function readRunRecord() {
27845
27855
  for (const path of recordPaths()) {
27846
27856
  const record = recordAt(path);
@@ -27874,7 +27884,8 @@ function recordAt(path) {
27874
27884
  startedAt,
27875
27885
  projectPath: typeof fields["projectPath"] === "string" ? fields["projectPath"] : "",
27876
27886
  arguments: Array.isArray(args) ? args.filter((value) => typeof value === "string") : [],
27877
- ...typeof fields["command"] === "string" ? { command: fields["command"] } : {}
27887
+ ...typeof fields["command"] === "string" ? { command: fields["command"] } : {},
27888
+ ...typeof fields["exitCode"] === "number" ? { exitCode: fields["exitCode"] } : {}
27878
27889
  };
27879
27890
  }
27880
27891
  function runningAs(pid) {
@@ -30789,6 +30800,9 @@ class GodotServer {
30789
30800
  this.logDebug(`Godot process exited with code ${code ?? "none"}`);
30790
30801
  log.finish();
30791
30802
  started.exitCode = code ?? -1;
30803
+ if (started.pid !== null) {
30804
+ recordRunEnded(started.pid, started.exitCode);
30805
+ }
30792
30806
  });
30793
30807
  child.on("error", (err) => {
30794
30808
  console.error("Failed to start Godot process:", err);
@@ -30893,8 +30907,8 @@ class GodotServer {
30893
30907
  this.drainTranscript(adopted);
30894
30908
  if (!alive(record.pid) || !couldStillBeTheRecordedRun(record)) {
30895
30909
  adopted.log.finish();
30896
- adopted.exitCode = null;
30897
- adopted.endedUnwatched = true;
30910
+ adopted.exitCode = record.exitCode ?? null;
30911
+ adopted.endedUnwatched = record.exitCode === undefined;
30898
30912
  }
30899
30913
  this.activeProcess = adopted;
30900
30914
  return adopted;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.12.15",
3
+ "version": "0.12.16",
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",