gdharness 0.12.16 → 0.12.17

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
@@ -7467,6 +7467,13 @@ function addonMismatch(addonVersion, serverVersion) {
7467
7467
  }
7468
7468
  return `${both} Restart it with editor_launch restart to pick the new one up.`;
7469
7469
  }
7470
+ function markIfStale(answer, addonVersion, serverVersion) {
7471
+ const staleNote = addonMismatch(addonVersion, serverVersion);
7472
+ if (staleNote === undefined || typeof answer !== "object" || answer === null || Array.isArray(answer)) {
7473
+ return answer;
7474
+ }
7475
+ return { ...answer, addonIsStale: true, staleNote };
7476
+ }
7470
7477
  var DEBUG_MODE, GODOT_DEBUG_MODE_DEFAULT, SERVER_VERSION, UNVERSIONED = "addon from before versions were reported";
7471
7478
  var init_server_version = __esm(() => {
7472
7479
  init_update_check();
@@ -38328,7 +38335,7 @@ class GodotServer {
38328
38335
  ]);
38329
38336
  }
38330
38337
  try {
38331
- return this.jsonTextResponse(await this.godotBridge.invokeTool(toolName, args));
38338
+ return this.jsonTextResponse(markIfStale(await this.godotBridge.invokeTool(toolName, args), this.godotBridge.getStatus().addonVersion, SERVER_VERSION));
38332
38339
  } catch (error) {
38333
38340
  return this.createErrorResponse(`The editor answered ${toolName} with an error: ${errorMessage(error)}`);
38334
38341
  }
@@ -39911,7 +39918,9 @@ that is running, and the project on disk. ${TOOL_SPECS.length} tools, named \`do
39911
39918
  running games. There is no ambient project.
39912
39919
  - \`editor_status\` says whether an editor is connected and whether its addon matches the server.
39913
39920
  \`addonIsStale\` means they differ, and \`staleNote\` says which half is behind: an editor that
39914
- needs restarting, or a server that needs reconnecting in your harness.
39921
+ needs restarting, or a server that needs reconnecting in your harness. Every answer that came
39922
+ from the editor carries the same two when they differ, so a stale addon cannot answer quietly:
39923
+ believe a restart over a diagnostic that arrived with them.
39915
39924
  - Start the game with \`editor_run start\`, never by spawning an engine. The editor plays it, so
39916
39925
  its debugger holds it, which is what gives the \`debug_*\` tools something to talk to. Its answer
39917
39926
  says under \`runtime\` whether the game can be talked to yet; when it cannot, \`mayYetAnnounce\`
package/build/index.js CHANGED
@@ -10040,6 +10040,13 @@ function addonMismatch(addonVersion, serverVersion) {
10040
10040
  }
10041
10041
  return `${both} Restart it with editor_launch restart to pick the new one up.`;
10042
10042
  }
10043
+ function markIfStale(answer, addonVersion, serverVersion) {
10044
+ const staleNote = addonMismatch(addonVersion, serverVersion);
10045
+ if (staleNote === undefined || typeof answer !== "object" || answer === null || Array.isArray(answer)) {
10046
+ return answer;
10047
+ }
10048
+ return { ...answer, addonIsStale: true, staleNote };
10049
+ }
10043
10050
 
10044
10051
  // src/issues.ts
10045
10052
  var NEW_ISSUE = "https://github.com/Aureliolo/gdharness/issues/new";
@@ -31111,7 +31118,7 @@ class GodotServer {
31111
31118
  ]);
31112
31119
  }
31113
31120
  try {
31114
- return this.jsonTextResponse(await this.godotBridge.invokeTool(toolName, args));
31121
+ return this.jsonTextResponse(markIfStale(await this.godotBridge.invokeTool(toolName, args), this.godotBridge.getStatus().addonVersion, SERVER_VERSION));
31115
31122
  } catch (error) {
31116
31123
  return this.createErrorResponse(`The editor answered ${toolName} with an error: ${errorMessage(error)}`);
31117
31124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.12.16",
3
+ "version": "0.12.17",
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",