gdharness 0.13.32 → 0.13.34

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
@@ -38289,11 +38289,17 @@ class GodotServer {
38289
38289
  }
38290
38290
  async editorPlayingState() {
38291
38291
  const status = this.godotBridge.getStatus();
38292
- if (!status.connected || status.addonVersion !== SERVER_VERSION) {
38292
+ if (!status.connected) {
38293
38293
  return null;
38294
38294
  }
38295
38295
  try {
38296
- const answer = await this.godotBridge.invokeTool("playing_status", {});
38296
+ const answer = await Promise.race([
38297
+ this.godotBridge.invokeTool("playing_status", {}),
38298
+ delay3(PLAYING_STATUS_MS).then(() => null)
38299
+ ]);
38300
+ if (answer === null) {
38301
+ return null;
38302
+ }
38297
38303
  return {
38298
38304
  playing: readBoolean(asParams(answer), "playing") ?? false,
38299
38305
  scene: readString(asParams(answer), "scenePath") ?? "",
@@ -38870,6 +38876,10 @@ class GodotServer {
38870
38876
  nothingOfOursIsRunning() {
38871
38877
  const status = this.godotBridge.getStatus();
38872
38878
  const noEditor = !status.connected ? " No editor is connected, so a game the editor is playing cannot be seen from here at all:" + " editor_status says whether one is on its way, and a run of yours that is still up is" + " reachable again once it is." : "";
38879
+ const live = this.aRuntimeOfOursIsAnswering();
38880
+ if (live !== null) {
38881
+ return `A game is running for ${live.project.path} and has announced its runtime on port ${live.port}, pid ${live.pid},` + " but this server did not start it and cannot reach it through the editor, so editor_run and" + " editor_output have nothing to answer about. The runtime_* tools reach it now." + " Do not start another: editor_run start replaces the game that is playing rather than" + " adding one, so it would end this one." + (this.godotBridge.getStatus().connected ? "" : " editor_status says whether an editor is on its way, and editor_run can end it once one is.");
38882
+ }
38873
38883
  const record = readRunRecord();
38874
38884
  if (record === null) {
38875
38885
  return `No game is running.${noEditor} Start one with editor_run.`;
@@ -38879,6 +38889,14 @@ class GodotServer {
38879
38889
  const ours = mine === null ? "this server was started without GDHARNESS_PROJECT and has no editor connected, so it cannot say whose that run is" : `this server serves ${mine}`;
38880
38890
  return `No game of this server's is running.${noEditor} A run started from ${whose} is recorded on this machine, and ${ours}, so it is not this server's to answer for or to end. Start one with editor_run.`;
38881
38891
  }
38892
+ aRuntimeOfOursIsAnswering() {
38893
+ const status = this.godotBridge.getStatus();
38894
+ const mine = this.ownProject ?? (status.connected ? status.projectPath ?? null : null);
38895
+ if (mine === null) {
38896
+ return null;
38897
+ }
38898
+ return discoverRuntimes().find((one) => one.project.path !== "" && isSameDirectory(mine, one.project.path)) ?? null;
38899
+ }
38882
38900
  couldBeOurs(project) {
38883
38901
  const status = this.godotBridge.getStatus();
38884
38902
  const mine = this.ownProject ?? (status.connected ? status.projectPath ?? null : null);
@@ -39272,7 +39290,7 @@ async function runGodotServer() {
39272
39290
  const server = new GodotServer;
39273
39291
  await server.run();
39274
39292
  }
39275
- var UPDATE_NOTICE_EVERY = 500, FEEDBACK_NOTICE_EVERY = 250, run6, __dirname2, EDITOR_RESTART_TIMEOUT_MS = 90000, SLOWEST_FRAME_RATE = 20, VALUE_NAMES, BRIDGE_RETRY_MS = 2000, SUCCESSOR_CHECK_MS = 1e4, CACHE_WRITE_MS = 2000, SCAN_START_MS = 2000, WAIT_FOR_RUN_MS = 600000, RUN_POLL_MS = 250, PATH_SOLUTIONS, PROJECT_FILE_ARGUMENTS, DEBUG_STATE_CALLS, PROJECT_INFO_SECTIONS2, RUNNER_DIRECTORY = "addons/gdUnit4/";
39293
+ var UPDATE_NOTICE_EVERY = 500, FEEDBACK_NOTICE_EVERY = 250, run6, __dirname2, EDITOR_RESTART_TIMEOUT_MS = 90000, SLOWEST_FRAME_RATE = 20, VALUE_NAMES, BRIDGE_RETRY_MS = 2000, SUCCESSOR_CHECK_MS = 1e4, CACHE_WRITE_MS = 2000, PLAYING_STATUS_MS = 1000, SCAN_START_MS = 2000, WAIT_FOR_RUN_MS = 600000, RUN_POLL_MS = 250, PATH_SOLUTIONS, PROJECT_FILE_ARGUMENTS, DEBUG_STATE_CALLS, PROJECT_INFO_SECTIONS2, RUNNER_DIRECTORY = "addons/gdUnit4/";
39276
39294
  var init_server3 = __esm(() => {
39277
39295
  init_mcp();
39278
39296
  init_stdio2();
package/build/index.js CHANGED
@@ -29651,6 +29651,7 @@ function outsideTheirLists(spec, args) {
29651
29651
  var BRIDGE_RETRY_MS = 2000;
29652
29652
  var SUCCESSOR_CHECK_MS = 1e4;
29653
29653
  var CACHE_WRITE_MS = 2000;
29654
+ var PLAYING_STATUS_MS = 1000;
29654
29655
  var SCAN_START_MS = 2000;
29655
29656
  var WAIT_FOR_RUN_MS = 600000;
29656
29657
  var RUN_POLL_MS = 250;
@@ -31029,11 +31030,17 @@ class GodotServer {
31029
31030
  }
31030
31031
  async editorPlayingState() {
31031
31032
  const status = this.godotBridge.getStatus();
31032
- if (!status.connected || status.addonVersion !== SERVER_VERSION) {
31033
+ if (!status.connected) {
31033
31034
  return null;
31034
31035
  }
31035
31036
  try {
31036
- const answer = await this.godotBridge.invokeTool("playing_status", {});
31037
+ const answer = await Promise.race([
31038
+ this.godotBridge.invokeTool("playing_status", {}),
31039
+ delay3(PLAYING_STATUS_MS).then(() => null)
31040
+ ]);
31041
+ if (answer === null) {
31042
+ return null;
31043
+ }
31037
31044
  return {
31038
31045
  playing: readBoolean(asParams(answer), "playing") ?? false,
31039
31046
  scene: readString(asParams(answer), "scenePath") ?? "",
@@ -31610,6 +31617,10 @@ class GodotServer {
31610
31617
  nothingOfOursIsRunning() {
31611
31618
  const status = this.godotBridge.getStatus();
31612
31619
  const noEditor = !status.connected ? " No editor is connected, so a game the editor is playing cannot be seen from here at all:" + " editor_status says whether one is on its way, and a run of yours that is still up is" + " reachable again once it is." : "";
31620
+ const live = this.aRuntimeOfOursIsAnswering();
31621
+ if (live !== null) {
31622
+ return `A game is running for ${live.project.path} and has announced its runtime on port ${live.port}, pid ${live.pid},` + " but this server did not start it and cannot reach it through the editor, so editor_run and" + " editor_output have nothing to answer about. The runtime_* tools reach it now." + " Do not start another: editor_run start replaces the game that is playing rather than" + " adding one, so it would end this one." + (this.godotBridge.getStatus().connected ? "" : " editor_status says whether an editor is on its way, and editor_run can end it once one is.");
31623
+ }
31613
31624
  const record = readRunRecord();
31614
31625
  if (record === null) {
31615
31626
  return `No game is running.${noEditor} Start one with editor_run.`;
@@ -31619,6 +31630,14 @@ class GodotServer {
31619
31630
  const ours = mine === null ? "this server was started without GDHARNESS_PROJECT and has no editor connected, so it cannot say whose that run is" : `this server serves ${mine}`;
31620
31631
  return `No game of this server's is running.${noEditor} A run started from ${whose} is recorded on this machine, and ${ours}, so it is not this server's to answer for or to end. Start one with editor_run.`;
31621
31632
  }
31633
+ aRuntimeOfOursIsAnswering() {
31634
+ const status = this.godotBridge.getStatus();
31635
+ const mine = this.ownProject ?? (status.connected ? status.projectPath ?? null : null);
31636
+ if (mine === null) {
31637
+ return null;
31638
+ }
31639
+ return discoverRuntimes().find((one) => one.project.path !== "" && isSameDirectory(mine, one.project.path)) ?? null;
31640
+ }
31622
31641
  couldBeOurs(project) {
31623
31642
  const status = this.godotBridge.getStatus();
31624
31643
  const mine = this.ownProject ?? (status.connected ? status.projectPath ?? null : null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.13.32",
3
+ "version": "0.13.34",
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",