gdharness 1.1.25 → 1.1.26

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
@@ -17556,7 +17556,7 @@ var init_tool_definitions = __esm(() => {
17556
17556
  requires: ["projectPath"]
17557
17557
  },
17558
17558
  stop: {
17559
- summary: "end the run and answer with what it printed last, naming the process ended under endedPid: for a run the editor plays, the number its game announced under, read at the stop rather than remembered, and the operating system hands a freed number to the next process, so it can equal the game before it. A game that started processes of its own keeps them unless andChildren says to end those too. stopped is false, with the number under notSignalled, when that number no longer answers as the process the run was started as and nothing was signalled, and false with the number under stillGoing when what was told to end was still running ten seconds later",
17559
+ summary: "end the run and answer with what it printed last, naming the process ended under endedPid: for a run the editor plays, the number its game announced under, read at the stop rather than remembered, and the operating system hands a freed number to the next process, so it can equal the game before it. A game that started processes of its own keeps them unless andChildren says to end those too. stopped is false, with the number under notSignalled, when that number no longer answers as the process the run was started as and nothing was signalled, the note naming which property it failed on, and false with the number under stillGoing when what was told to end was still running ten seconds later. endedThrough says how the stop ended a run that was going: keeper (the process that started the game ended it through the handle it holds), signal (its pid was signalled once shown to still be the run), or editor (the editor playing it was asked). A start that ends the run before it says how under endedPreviousRunThrough, with the same values, and one that refused to signal that run names the property it failed on under previousRunLeftBecause",
17560
17560
  requires: []
17561
17561
  },
17562
17562
  check: {
@@ -39767,7 +39767,7 @@ function stopVerdict(stop) {
39767
39767
  return {
39768
39768
  stopped: false,
39769
39769
  notSignalled: stop.endedPid,
39770
- note: `Nothing was ended: pid ${stop.endedPid ?? "unknown"} no longer answers as the process this run was started as (its engine, its project and when it started), so it was not signalled. If that process is still the game, end it yourself, for instance with runtime_invoke calling get_tree().quit() when the game has the runtime addon; if it is not, it belongs to something else.`,
39770
+ note: `Nothing was ended: pid ${stop.endedPid ?? "unknown"} no longer answers as the process this run was started as (${stop.notEndedBecause ?? "its engine, its project and when it started"}), so it was not signalled. If that process is still the game, end it yourself, for instance with runtime_invoke calling get_tree().quit() when the game has the runtime addon; if it is not, it belongs to something else.`,
39771
39771
  withChildren: false
39772
39772
  };
39773
39773
  }
@@ -39788,6 +39788,15 @@ function stopVerdict(stop) {
39788
39788
  withChildren: true
39789
39789
  };
39790
39790
  }
39791
+ function previousRunHow(ended) {
39792
+ if (ended === null) {
39793
+ return {};
39794
+ }
39795
+ return {
39796
+ ...ended.through === undefined || ended.ending === "refused" ? {} : { endedPreviousRunThrough: ended.through },
39797
+ ...ended.ending === "refused" && ended.notEndedBecause !== undefined ? { previousRunLeftBecause: ended.notEndedBecause } : {}
39798
+ };
39799
+ }
39791
39800
  function endedPreviousRun(ended) {
39792
39801
  if (ended?.ending !== "gone") {
39793
39802
  return;
@@ -42512,9 +42521,12 @@ class GodotServer {
42512
42521
  if (before !== null && await this.runStillGoing(before)) {
42513
42522
  this.logDebug("Ending the running game before starting another");
42514
42523
  const endingFrom = Date.now();
42524
+ const ending = await this.endActiveGame("editor_run start, which ends the run that was going before it starts another", true);
42515
42525
  ended = {
42516
42526
  pid: before.pid ?? this.announcedPidOf(before) ?? null,
42517
- ending: await this.endActiveGame("editor_run start, which ends the run that was going before it starts another", true)
42527
+ ending,
42528
+ ...before.endedThrough === undefined ? {} : { through: before.endedThrough },
42529
+ ...before.notEndedBecause === undefined ? {} : { notEndedBecause: before.notEndedBecause }
42518
42530
  };
42519
42531
  this.logDebug(`The running game was ${ended.ending} after ${Date.now() - endingFrom}ms`);
42520
42532
  }
@@ -42562,6 +42574,7 @@ class GodotServer {
42562
42574
  savesNote: asked.value.savesIn !== undefined && savesStayPut() ? SAVES_NOT_MOVED_NOTE : undefined,
42563
42575
  endedPreviousRun: endedPreviousRun(ended),
42564
42576
  previousRunLeft: previousRunLeft(ended),
42577
+ ...previousRunHow(ended),
42565
42578
  runtime: await this.runtimeUp(project.value.path, alreadyPlaying, runtimeWaitMs, given.value.length > 0),
42566
42579
  message: `Use editor_output for what it prints and editor_run stop to end it.${spawnedInstead}${endedForThis}${alsoRunning}`
42567
42580
  });
@@ -42714,6 +42727,7 @@ class GodotServer {
42714
42727
  debugPort: readNumber(playAnswer, "debugPort"),
42715
42728
  endedPreviousRun: endedPreviousRun(ended),
42716
42729
  previousRunLeft: previousRunLeft(ended),
42730
+ ...previousRunHow(ended),
42717
42731
  breakpoints: breakpoints.applied.length === 0 ? undefined : this.breakpointsAsProjectSpells(projectPath, breakpoints.applied),
42718
42732
  breakpointsRefused: breakpoints.refused.length === 0 ? undefined : breakpoints.refused.map((one) => ({
42719
42733
  scriptPath: projectSpelling(projectPath, one.scriptPath),
@@ -42868,6 +42882,7 @@ class GodotServer {
42868
42882
  running.log.record("warning", `This run was not ended here: the editor could not be asked to stop it (${asked.content[0]?.text ?? "no reason given"}).`);
42869
42883
  return "unreached";
42870
42884
  }
42885
+ running.endedThrough = "editor";
42871
42886
  if (announced === undefined) {
42872
42887
  return await this.untilTheEditorStopsPlaying() ? "gone" : "lingering";
42873
42888
  }
@@ -42896,6 +42911,7 @@ class GodotServer {
42896
42911
  if (why !== null) {
42897
42912
  clearTheRecord();
42898
42913
  running.endedHere = null;
42914
+ running.notEndedBecause = why;
42899
42915
  running.log.record("warning", `This run was not ended here: pid ${running.pid} no longer answers as the process the run was started as (${why}), so nothing was signalled. If that process is still the game, end it yourself; if it is not, it belongs to something else.`);
42900
42916
  return "refused";
42901
42917
  }
@@ -42920,6 +42936,9 @@ class GodotServer {
42920
42936
  running.exitCode = null;
42921
42937
  running.exitSignal = "SIGTERM";
42922
42938
  }
42939
+ if (landed) {
42940
+ running.endedThrough = "signal";
42941
+ }
42923
42942
  clearTheRecord();
42924
42943
  running.log.record(gone ? "info" : "warning", declined !== null ? `gdharness could not signal pid ${running.pid}: the operating system refused it (${declined}). It had described that process as ${described}.` : !gone ? `gdharness signalled pid ${running.pid}, which the operating system described as ${described}, and it was still running ${STOP_WAIT_MS / 1000} seconds later.` : landed ? `gdharness ended pid ${running.pid}, which the operating system described as ${described}.` : `gdharness signalled pid ${running.pid} and it was already gone; the operating system had described it as ${described}.`);
42925
42944
  return gone ? "gone" : "lingering";
@@ -42930,6 +42949,9 @@ class GodotServer {
42930
42949
  this.logDebug(`The keeper of pid ${pid} could not be asked to end it (${asked.unreached})`);
42931
42950
  return null;
42932
42951
  }
42952
+ if (asked === "signalled") {
42953
+ run.endedThrough = "keeper";
42954
+ }
42933
42955
  const gone = await untilGone([pid]);
42934
42956
  if (gone) {
42935
42957
  await this.untilTheExitIsRecorded(run);
@@ -43655,11 +43677,13 @@ class GodotServer {
43655
43677
  endedPid,
43656
43678
  throughEditor: stopped.throughEditor,
43657
43679
  exitSignal: stopped.exitSignal,
43658
- clean: cleanVerdict(stopped)
43680
+ clean: cleanVerdict(stopped),
43681
+ ...stopped.notEndedBecause === undefined ? {} : { notEndedBecause: stopped.notEndedBecause }
43659
43682
  });
43660
43683
  return this.jsonTextResponse({
43661
43684
  stopped: verdict.stopped,
43662
43685
  through: stopped.throughEditor ? "editor" : "gdharness",
43686
+ endedThrough: wasRunning ? stopped.endedThrough : undefined,
43663
43687
  endedPid: verdict.endedPid,
43664
43688
  notSignalled: verdict.notSignalled,
43665
43689
  stillGoing: verdict.stillGoing,
@@ -43724,6 +43748,7 @@ class GodotServer {
43724
43748
  through: "gdharness",
43725
43749
  endedPid: gone ? pid : undefined,
43726
43750
  stillGoing: gone ? undefined : pid,
43751
+ ...landed ? { endedThrough: "signal" } : {},
43727
43752
  ...childrenFields(ended),
43728
43753
  exitedBeforeStop: !landed,
43729
43754
  note: `${!gone ? `pid ${pid} was told to end and was still running ${STOP_WAIT_MS / 1000} seconds later, so it has not stopped: a game of this project that no server here was holding,` : landed ? `pid ${pid} was ended: a game of this project that no server here was holding,` : `pid ${pid} had already gone when it was signalled: a game of this project that no server here was holding,`} identified by its announcement and by its command line, ${read.executable} run with --path ${read.projectPath ?? ""}. Nothing here read what it printed or holds its exit code, so neither is in this answer.${gone ? "" : " editor_status says when it has gone."} ${aboutTheChildren(ended, false)}`
package/build/index.js CHANGED
@@ -31540,7 +31540,7 @@ var TOOL_SPECS = [
31540
31540
  requires: ["projectPath"]
31541
31541
  },
31542
31542
  stop: {
31543
- summary: "end the run and answer with what it printed last, naming the process ended under endedPid: for a run the editor plays, the number its game announced under, read at the stop rather than remembered, and the operating system hands a freed number to the next process, so it can equal the game before it. A game that started processes of its own keeps them unless andChildren says to end those too. stopped is false, with the number under notSignalled, when that number no longer answers as the process the run was started as and nothing was signalled, and false with the number under stillGoing when what was told to end was still running ten seconds later",
31543
+ summary: "end the run and answer with what it printed last, naming the process ended under endedPid: for a run the editor plays, the number its game announced under, read at the stop rather than remembered, and the operating system hands a freed number to the next process, so it can equal the game before it. A game that started processes of its own keeps them unless andChildren says to end those too. stopped is false, with the number under notSignalled, when that number no longer answers as the process the run was started as and nothing was signalled, the note naming which property it failed on, and false with the number under stillGoing when what was told to end was still running ten seconds later. endedThrough says how the stop ended a run that was going: keeper (the process that started the game ended it through the handle it holds), signal (its pid was signalled once shown to still be the run), or editor (the editor playing it was asked). A start that ends the run before it says how under endedPreviousRunThrough, with the same values, and one that refused to signal that run names the property it failed on under previousRunLeftBecause",
31544
31544
  requires: []
31545
31545
  },
31546
31546
  check: {
@@ -32287,7 +32287,7 @@ function stopVerdict(stop) {
32287
32287
  return {
32288
32288
  stopped: false,
32289
32289
  notSignalled: stop.endedPid,
32290
- note: `Nothing was ended: pid ${stop.endedPid ?? "unknown"} no longer answers as the process this run was started as (its engine, its project and when it started), so it was not signalled. If that process is still the game, end it yourself, for instance with runtime_invoke calling get_tree().quit() when the game has the runtime addon; if it is not, it belongs to something else.`,
32290
+ note: `Nothing was ended: pid ${stop.endedPid ?? "unknown"} no longer answers as the process this run was started as (${stop.notEndedBecause ?? "its engine, its project and when it started"}), so it was not signalled. If that process is still the game, end it yourself, for instance with runtime_invoke calling get_tree().quit() when the game has the runtime addon; if it is not, it belongs to something else.`,
32291
32291
  withChildren: false
32292
32292
  };
32293
32293
  }
@@ -32308,6 +32308,15 @@ function stopVerdict(stop) {
32308
32308
  withChildren: true
32309
32309
  };
32310
32310
  }
32311
+ function previousRunHow(ended) {
32312
+ if (ended === null) {
32313
+ return {};
32314
+ }
32315
+ return {
32316
+ ...ended.through === undefined || ended.ending === "refused" ? {} : { endedPreviousRunThrough: ended.through },
32317
+ ...ended.ending === "refused" && ended.notEndedBecause !== undefined ? { previousRunLeftBecause: ended.notEndedBecause } : {}
32318
+ };
32319
+ }
32311
32320
  function endedPreviousRun(ended) {
32312
32321
  if (ended?.ending !== "gone") {
32313
32322
  return;
@@ -35092,9 +35101,12 @@ class GodotServer {
35092
35101
  if (before !== null && await this.runStillGoing(before)) {
35093
35102
  this.logDebug("Ending the running game before starting another");
35094
35103
  const endingFrom = Date.now();
35104
+ const ending = await this.endActiveGame("editor_run start, which ends the run that was going before it starts another", true);
35095
35105
  ended = {
35096
35106
  pid: before.pid ?? this.announcedPidOf(before) ?? null,
35097
- ending: await this.endActiveGame("editor_run start, which ends the run that was going before it starts another", true)
35107
+ ending,
35108
+ ...before.endedThrough === undefined ? {} : { through: before.endedThrough },
35109
+ ...before.notEndedBecause === undefined ? {} : { notEndedBecause: before.notEndedBecause }
35098
35110
  };
35099
35111
  this.logDebug(`The running game was ${ended.ending} after ${Date.now() - endingFrom}ms`);
35100
35112
  }
@@ -35142,6 +35154,7 @@ class GodotServer {
35142
35154
  savesNote: asked.value.savesIn !== undefined && savesStayPut() ? SAVES_NOT_MOVED_NOTE : undefined,
35143
35155
  endedPreviousRun: endedPreviousRun(ended),
35144
35156
  previousRunLeft: previousRunLeft(ended),
35157
+ ...previousRunHow(ended),
35145
35158
  runtime: await this.runtimeUp(project.value.path, alreadyPlaying, runtimeWaitMs, given.value.length > 0),
35146
35159
  message: `Use editor_output for what it prints and editor_run stop to end it.${spawnedInstead}${endedForThis}${alsoRunning}`
35147
35160
  });
@@ -35294,6 +35307,7 @@ class GodotServer {
35294
35307
  debugPort: readNumber(playAnswer, "debugPort"),
35295
35308
  endedPreviousRun: endedPreviousRun(ended),
35296
35309
  previousRunLeft: previousRunLeft(ended),
35310
+ ...previousRunHow(ended),
35297
35311
  breakpoints: breakpoints.applied.length === 0 ? undefined : this.breakpointsAsProjectSpells(projectPath, breakpoints.applied),
35298
35312
  breakpointsRefused: breakpoints.refused.length === 0 ? undefined : breakpoints.refused.map((one) => ({
35299
35313
  scriptPath: projectSpelling(projectPath, one.scriptPath),
@@ -35448,6 +35462,7 @@ class GodotServer {
35448
35462
  running.log.record("warning", `This run was not ended here: the editor could not be asked to stop it (${asked.content[0]?.text ?? "no reason given"}).`);
35449
35463
  return "unreached";
35450
35464
  }
35465
+ running.endedThrough = "editor";
35451
35466
  if (announced === undefined) {
35452
35467
  return await this.untilTheEditorStopsPlaying() ? "gone" : "lingering";
35453
35468
  }
@@ -35476,6 +35491,7 @@ class GodotServer {
35476
35491
  if (why !== null) {
35477
35492
  clearTheRecord();
35478
35493
  running.endedHere = null;
35494
+ running.notEndedBecause = why;
35479
35495
  running.log.record("warning", `This run was not ended here: pid ${running.pid} no longer answers as the process the run was started as (${why}), so nothing was signalled. If that process is still the game, end it yourself; if it is not, it belongs to something else.`);
35480
35496
  return "refused";
35481
35497
  }
@@ -35500,6 +35516,9 @@ class GodotServer {
35500
35516
  running.exitCode = null;
35501
35517
  running.exitSignal = "SIGTERM";
35502
35518
  }
35519
+ if (landed) {
35520
+ running.endedThrough = "signal";
35521
+ }
35503
35522
  clearTheRecord();
35504
35523
  running.log.record(gone ? "info" : "warning", declined !== null ? `gdharness could not signal pid ${running.pid}: the operating system refused it (${declined}). It had described that process as ${described}.` : !gone ? `gdharness signalled pid ${running.pid}, which the operating system described as ${described}, and it was still running ${STOP_WAIT_MS / 1000} seconds later.` : landed ? `gdharness ended pid ${running.pid}, which the operating system described as ${described}.` : `gdharness signalled pid ${running.pid} and it was already gone; the operating system had described it as ${described}.`);
35505
35524
  return gone ? "gone" : "lingering";
@@ -35510,6 +35529,9 @@ class GodotServer {
35510
35529
  this.logDebug(`The keeper of pid ${pid} could not be asked to end it (${asked.unreached})`);
35511
35530
  return null;
35512
35531
  }
35532
+ if (asked === "signalled") {
35533
+ run.endedThrough = "keeper";
35534
+ }
35513
35535
  const gone = await untilGone([pid]);
35514
35536
  if (gone) {
35515
35537
  await this.untilTheExitIsRecorded(run);
@@ -36235,11 +36257,13 @@ class GodotServer {
36235
36257
  endedPid,
36236
36258
  throughEditor: stopped.throughEditor,
36237
36259
  exitSignal: stopped.exitSignal,
36238
- clean: cleanVerdict(stopped)
36260
+ clean: cleanVerdict(stopped),
36261
+ ...stopped.notEndedBecause === undefined ? {} : { notEndedBecause: stopped.notEndedBecause }
36239
36262
  });
36240
36263
  return this.jsonTextResponse({
36241
36264
  stopped: verdict.stopped,
36242
36265
  through: stopped.throughEditor ? "editor" : "gdharness",
36266
+ endedThrough: wasRunning ? stopped.endedThrough : undefined,
36243
36267
  endedPid: verdict.endedPid,
36244
36268
  notSignalled: verdict.notSignalled,
36245
36269
  stillGoing: verdict.stillGoing,
@@ -36304,6 +36328,7 @@ class GodotServer {
36304
36328
  through: "gdharness",
36305
36329
  endedPid: gone ? pid : undefined,
36306
36330
  stillGoing: gone ? undefined : pid,
36331
+ ...landed ? { endedThrough: "signal" } : {},
36307
36332
  ...childrenFields(ended),
36308
36333
  exitedBeforeStop: !landed,
36309
36334
  note: `${!gone ? `pid ${pid} was told to end and was still running ${STOP_WAIT_MS / 1000} seconds later, so it has not stopped: a game of this project that no server here was holding,` : landed ? `pid ${pid} was ended: a game of this project that no server here was holding,` : `pid ${pid} had already gone when it was signalled: a game of this project that no server here was holding,`} identified by its announcement and by its command line, ${read.executable} run with --path ${read.projectPath ?? ""}. Nothing here read what it printed or holds its exit code, so neither is in this answer.${gone ? "" : " editor_status says when it has gone."} ${aboutTheChildren(ended, false)}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
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",