gdharness 0.9.6 → 0.9.7

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
@@ -15716,7 +15716,7 @@ var init_tool_definitions = __esm(() => {
15716
15716
  },
15717
15717
  {
15718
15718
  name: "editor_rescan",
15719
- description: "Makes the running editor scan the project filesystem, so files written outside it, and any class_name they declare, become visible. Needs the editor connected.",
15719
+ description: "Makes the running editor scan the project filesystem, so files written outside it are picked up. The scan is a change-detecting walk rather than an unconditional reparse, so a file the editor has already recorded and reads as unchanged is one it does not look inside again: a class_name usually becomes visible this way and on one project did not, with the cache on disk still missing it after the scan said it was done. project_import refresh_classes is the one that rebuilds the class list from the declarations on disk, whatever the editor thinks it has seen. Needs the editor connected.",
15720
15720
  parameters: {
15721
15721
  projectPath: PROJECT_PATH,
15722
15722
  timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." }
@@ -35264,12 +35264,14 @@ class GodotLSPClient {
35264
35264
  if (!this.socket) {
35265
35265
  this.connected = false;
35266
35266
  this.initialized = false;
35267
+ this.forgetOpenDocuments();
35267
35268
  return;
35268
35269
  }
35269
35270
  const socketToClose = this.socket;
35270
35271
  this.socket = null;
35271
35272
  this.connected = false;
35272
35273
  this.initialized = false;
35274
+ this.forgetOpenDocuments();
35273
35275
  await new Promise((resolveClose) => {
35274
35276
  socketToClose.once("close", () => {
35275
35277
  resolveClose();
@@ -35401,6 +35403,7 @@ class GodotLSPClient {
35401
35403
  this.connected = false;
35402
35404
  this.initialized = false;
35403
35405
  this.socket = null;
35406
+ this.forgetOpenDocuments();
35404
35407
  const failure = new Error(`Godot LSP connection error: ${error.message}`);
35405
35408
  this.rejectAllPending(failure);
35406
35409
  this.rejectAllDiagnosticsWaiters(failure);
@@ -35409,10 +35412,14 @@ class GodotLSPClient {
35409
35412
  this.connected = false;
35410
35413
  this.initialized = false;
35411
35414
  this.socket = null;
35415
+ this.forgetOpenDocuments();
35412
35416
  const closed = new Error("Godot LSP socket closed");
35413
35417
  this.rejectAllPending(closed);
35414
35418
  this.rejectAllDiagnosticsWaiters(closed);
35415
35419
  }
35420
+ forgetOpenDocuments() {
35421
+ this.documentVersions.clear();
35422
+ }
35416
35423
  rejectAllPending(error) {
35417
35424
  this.pendingRequests.forEach((pending, id) => {
35418
35425
  clearTimeout(pending.timer);
@@ -36457,9 +36464,10 @@ class GodotServer {
36457
36464
  const known = new Set([...Object.keys(spec.parameters), ...spec.operations ? ["op"] : []]);
36458
36465
  const unknown = Object.keys(args).filter((key) => !known.has(key));
36459
36466
  if (unknown.length > 0) {
36467
+ const takes = known.size === 0 ? "It takes no arguments." : `It takes: ${[...known].join(", ")}.`;
36460
36468
  return {
36461
36469
  ok: false,
36462
- response: this.createErrorResponse(`${spec.name} does not take ${unknown.join(", ")}. It takes: ${[...known].join(", ")}.`)
36470
+ response: this.createErrorResponse(`${spec.name} does not take ${unknown.join(", ")}. ${takes}`)
36463
36471
  };
36464
36472
  }
36465
36473
  const wrong = wrongTypes(spec, args);
package/build/index.js CHANGED
@@ -26694,12 +26694,14 @@ class GodotLSPClient {
26694
26694
  if (!this.socket) {
26695
26695
  this.connected = false;
26696
26696
  this.initialized = false;
26697
+ this.forgetOpenDocuments();
26697
26698
  return;
26698
26699
  }
26699
26700
  const socketToClose = this.socket;
26700
26701
  this.socket = null;
26701
26702
  this.connected = false;
26702
26703
  this.initialized = false;
26704
+ this.forgetOpenDocuments();
26703
26705
  await new Promise((resolveClose) => {
26704
26706
  socketToClose.once("close", () => {
26705
26707
  resolveClose();
@@ -26831,6 +26833,7 @@ class GodotLSPClient {
26831
26833
  this.connected = false;
26832
26834
  this.initialized = false;
26833
26835
  this.socket = null;
26836
+ this.forgetOpenDocuments();
26834
26837
  const failure = new Error(`Godot LSP connection error: ${error.message}`);
26835
26838
  this.rejectAllPending(failure);
26836
26839
  this.rejectAllDiagnosticsWaiters(failure);
@@ -26839,10 +26842,14 @@ class GodotLSPClient {
26839
26842
  this.connected = false;
26840
26843
  this.initialized = false;
26841
26844
  this.socket = null;
26845
+ this.forgetOpenDocuments();
26842
26846
  const closed = new Error("Godot LSP socket closed");
26843
26847
  this.rejectAllPending(closed);
26844
26848
  this.rejectAllDiagnosticsWaiters(closed);
26845
26849
  }
26850
+ forgetOpenDocuments() {
26851
+ this.documentVersions.clear();
26852
+ }
26846
26853
  rejectAllPending(error) {
26847
26854
  this.pendingRequests.forEach((pending, id) => {
26848
26855
  clearTimeout(pending.timer);
@@ -28319,7 +28326,7 @@ var TOOL_SPECS = [
28319
28326
  },
28320
28327
  {
28321
28328
  name: "editor_rescan",
28322
- description: "Makes the running editor scan the project filesystem, so files written outside it, and any class_name they declare, become visible. Needs the editor connected.",
28329
+ description: "Makes the running editor scan the project filesystem, so files written outside it are picked up. The scan is a change-detecting walk rather than an unconditional reparse, so a file the editor has already recorded and reads as unchanged is one it does not look inside again: a class_name usually becomes visible this way and on one project did not, with the cache on disk still missing it after the scan said it was done. project_import refresh_classes is the one that rebuilds the class list from the declarations on disk, whatever the editor thinks it has seen. Needs the editor connected.",
28323
28330
  parameters: {
28324
28331
  projectPath: PROJECT_PATH,
28325
28332
  timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." }
@@ -29237,9 +29244,10 @@ class GodotServer {
29237
29244
  const known = new Set([...Object.keys(spec.parameters), ...spec.operations ? ["op"] : []]);
29238
29245
  const unknown = Object.keys(args).filter((key) => !known.has(key));
29239
29246
  if (unknown.length > 0) {
29247
+ const takes = known.size === 0 ? "It takes no arguments." : `It takes: ${[...known].join(", ")}.`;
29240
29248
  return {
29241
29249
  ok: false,
29242
- response: this.createErrorResponse(`${spec.name} does not take ${unknown.join(", ")}. It takes: ${[...known].join(", ")}.`)
29250
+ response: this.createErrorResponse(`${spec.name} does not take ${unknown.join(", ")}. ${takes}`)
29243
29251
  };
29244
29252
  }
29245
29253
  const wrong = wrongTypes(spec, args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
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",