gdharness 1.2.3 → 1.2.4

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
@@ -42117,6 +42117,30 @@ function projectKey(projectPath) {
42117
42117
  function runRecordPath(projectPath, directory = runtimeDirectory()) {
42118
42118
  return join24(directory, "runs", `note-${projectKey(projectPath)}.json`);
42119
42119
  }
42120
+ function latestRunPath(servedBy, directory = runtimeDirectory()) {
42121
+ return join24(directory, "runs", `latest-${projectKey(servedBy)}.json`);
42122
+ }
42123
+ function writeLatestRun(servedBy, latest) {
42124
+ try {
42125
+ mkdirSync14(runsDirectory(), { recursive: true });
42126
+ writeFileSync16(latestRunPath(servedBy), JSON.stringify(latest, null, 2), "utf8");
42127
+ } catch {}
42128
+ }
42129
+ function readLatestRun(servedBy, directory = runtimeDirectory()) {
42130
+ try {
42131
+ const fields = JSON.parse(readFileSync21(latestRunPath(servedBy, directory), "utf8"));
42132
+ if (typeof fields !== "object" || fields === null) {
42133
+ return null;
42134
+ }
42135
+ const { projectPath, pid, startedAt } = fields;
42136
+ if (typeof projectPath !== "string" || typeof startedAt !== "number") {
42137
+ return null;
42138
+ }
42139
+ return { projectPath, pid: typeof pid === "number" ? pid : null, startedAt };
42140
+ } catch {
42141
+ return null;
42142
+ }
42143
+ }
42120
42144
  function openTranscript(startedAt) {
42121
42145
  mkdirSync14(runsDirectory(), { recursive: true });
42122
42146
  const path = join24(runsDirectory(), `run-${startedAt}.log`);
@@ -46563,6 +46587,7 @@ class GodotServer {
46563
46587
  ...which === null ? {} : { play: which }
46564
46588
  };
46565
46589
  this.activeProcess = played;
46590
+ this.noteTheLatestRun({ projectPath, pid: null, startedAt });
46566
46591
  this.watchThePlayedConsole();
46567
46592
  writeEditorRunNote({
46568
46593
  projectPath,
@@ -46915,6 +46940,7 @@ class GodotServer {
46915
46940
  return launched;
46916
46941
  }
46917
46942
  const startedBy = Date.now();
46943
+ this.noteTheLatestRun({ projectPath, pid: launched.pid, startedAt });
46918
46944
  sweepTranscripts();
46919
46945
  const noted = readRunRecord(projectPath);
46920
46946
  const keeper = noted?.pid === launched.pid ? noted.keeper : undefined;
@@ -47153,7 +47179,8 @@ class GodotServer {
47153
47179
  async adoptRecordedRun() {
47154
47180
  const project = this.ourProject();
47155
47181
  const found = project === null ? [] : [readRunRecord(project), this.startedForUs(project)];
47156
- const record = found.reduce((newest, one) => one !== null && (newest === null || one.startedAt > newest.startedAt) ? one : newest, null);
47182
+ const latest = project === null ? null : readLatestRun(project);
47183
+ const record = latest === null ? found.reduce((newest, one) => one !== null && (newest === null || one.startedAt > newest.startedAt) ? one : newest, null) : found.find((one) => one !== null && one.pid === latest.pid && one.startedAt === latest.startedAt) ?? null;
47157
47184
  if (record === null || !(this.couldBeOurs(record.projectPath) || this.couldBeOurs(record.servedBy ?? ""))) {
47158
47185
  return null;
47159
47186
  }
@@ -47193,6 +47220,12 @@ class GodotServer {
47193
47220
  const mine = this.ourProject();
47194
47221
  return mine === null ? {} : { servedBy: mine };
47195
47222
  }
47223
+ noteTheLatestRun(latest) {
47224
+ const mine = this.ourProject();
47225
+ if (mine !== null) {
47226
+ writeLatestRun(mine, latest);
47227
+ }
47228
+ }
47196
47229
  startedForUs(project) {
47197
47230
  return everyRunRecord().find((one) => one.servedBy !== undefined && isSameDirectory(one.servedBy, project) && !(one.projectPath !== "" && isSameDirectory(one.projectPath, project))) ?? null;
47198
47231
  }
@@ -399,7 +399,7 @@ static func why_hidden(node: Node) -> String:
399
399
  var control: Control = node as Control
400
400
  var instead: Node = null if control == null else drawn_at(control)
401
401
  if instead != null:
402
- return " (%s; %s is drawn where it would be)" % [", and ".join(named), instead.get_path()]
402
+ return " (%s; a click where it would be reaches %s)" % [", and ".join(named), instead.get_path()]
403
403
  var outermost: Node = hiding.back()
404
404
  var beside: Array[String] = []
405
405
  var parent: Node = outermost.get_parent()
package/build/index.js CHANGED
@@ -32922,6 +32922,30 @@ function projectKey(projectPath) {
32922
32922
  function runRecordPath(projectPath, directory = runtimeDirectory()) {
32923
32923
  return join19(directory, "runs", `note-${projectKey(projectPath)}.json`);
32924
32924
  }
32925
+ function latestRunPath(servedBy, directory = runtimeDirectory()) {
32926
+ return join19(directory, "runs", `latest-${projectKey(servedBy)}.json`);
32927
+ }
32928
+ function writeLatestRun(servedBy, latest) {
32929
+ try {
32930
+ mkdirSync11(runsDirectory(), { recursive: true });
32931
+ writeFileSync13(latestRunPath(servedBy), JSON.stringify(latest, null, 2), "utf8");
32932
+ } catch {}
32933
+ }
32934
+ function readLatestRun(servedBy, directory = runtimeDirectory()) {
32935
+ try {
32936
+ const fields = JSON.parse(readFileSync18(latestRunPath(servedBy, directory), "utf8"));
32937
+ if (typeof fields !== "object" || fields === null) {
32938
+ return null;
32939
+ }
32940
+ const { projectPath, pid, startedAt } = fields;
32941
+ if (typeof projectPath !== "string" || typeof startedAt !== "number") {
32942
+ return null;
32943
+ }
32944
+ return { projectPath, pid: typeof pid === "number" ? pid : null, startedAt };
32945
+ } catch {
32946
+ return null;
32947
+ }
32948
+ }
32925
32949
  var SHARED_NOTE = "run.json";
32926
32950
  function openTranscript(startedAt) {
32927
32951
  mkdirSync11(runsDirectory(), { recursive: true });
@@ -39060,6 +39084,7 @@ class GodotServer {
39060
39084
  ...which === null ? {} : { play: which }
39061
39085
  };
39062
39086
  this.activeProcess = played;
39087
+ this.noteTheLatestRun({ projectPath, pid: null, startedAt });
39063
39088
  this.watchThePlayedConsole();
39064
39089
  writeEditorRunNote({
39065
39090
  projectPath,
@@ -39412,6 +39437,7 @@ class GodotServer {
39412
39437
  return launched;
39413
39438
  }
39414
39439
  const startedBy = Date.now();
39440
+ this.noteTheLatestRun({ projectPath, pid: launched.pid, startedAt });
39415
39441
  sweepTranscripts();
39416
39442
  const noted = readRunRecord(projectPath);
39417
39443
  const keeper = noted?.pid === launched.pid ? noted.keeper : undefined;
@@ -39650,7 +39676,8 @@ class GodotServer {
39650
39676
  async adoptRecordedRun() {
39651
39677
  const project = this.ourProject();
39652
39678
  const found = project === null ? [] : [readRunRecord(project), this.startedForUs(project)];
39653
- const record = found.reduce((newest, one) => one !== null && (newest === null || one.startedAt > newest.startedAt) ? one : newest, null);
39679
+ const latest = project === null ? null : readLatestRun(project);
39680
+ const record = latest === null ? found.reduce((newest, one) => one !== null && (newest === null || one.startedAt > newest.startedAt) ? one : newest, null) : found.find((one) => one !== null && one.pid === latest.pid && one.startedAt === latest.startedAt) ?? null;
39654
39681
  if (record === null || !(this.couldBeOurs(record.projectPath) || this.couldBeOurs(record.servedBy ?? ""))) {
39655
39682
  return null;
39656
39683
  }
@@ -39690,6 +39717,12 @@ class GodotServer {
39690
39717
  const mine = this.ourProject();
39691
39718
  return mine === null ? {} : { servedBy: mine };
39692
39719
  }
39720
+ noteTheLatestRun(latest) {
39721
+ const mine = this.ourProject();
39722
+ if (mine !== null) {
39723
+ writeLatestRun(mine, latest);
39724
+ }
39725
+ }
39693
39726
  startedForUs(project) {
39694
39727
  return everyRunRecord().find((one) => one.servedBy !== undefined && isSameDirectory(one.servedBy, project) && !(one.projectPath !== "" && isSameDirectory(one.projectPath, project))) ?? null;
39695
39728
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
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",