gdharness 0.13.11 → 0.13.12

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
@@ -7281,6 +7281,32 @@ var init_game_log = __esm(() => {
7281
7281
  STREAMS = ["stdout", "stderr", "transcript"];
7282
7282
  });
7283
7283
 
7284
+ // src/scratch.ts
7285
+ import { rmSync as rmSync2 } from "node:fs";
7286
+ function discardWith(remove, paths) {
7287
+ const left = [];
7288
+ for (const path of paths) {
7289
+ if (!path) {
7290
+ continue;
7291
+ }
7292
+ try {
7293
+ remove(path);
7294
+ } catch (error) {
7295
+ left.push({ path, reason: error instanceof Error ? error.message : String(error) });
7296
+ }
7297
+ }
7298
+ return left;
7299
+ }
7300
+ function discard(...paths) {
7301
+ return discardWith((path) => {
7302
+ rmSync2(path, SWEPT);
7303
+ }, paths);
7304
+ }
7305
+ var SWEPT;
7306
+ var init_scratch = __esm(() => {
7307
+ SWEPT = { recursive: true, force: true, maxRetries: 20, retryDelay: 250 };
7308
+ });
7309
+
7284
7310
  // src/update-check.ts
7285
7311
  import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync3 } from "node:fs";
7286
7312
  import { homedir as homedir3, tmpdir as tmpdir2 } from "node:os";
@@ -7554,7 +7580,7 @@ var init_class_cache = () => {};
7554
7580
 
7555
7581
  // src/headless.ts
7556
7582
  import { execFile as execFile3 } from "node:child_process";
7557
- import { mkdtempSync as mkdtempSync2, rmSync as rmSync3, writeFileSync as writeFileSync4 } from "node:fs";
7583
+ import { mkdtempSync as mkdtempSync2, writeFileSync as writeFileSync4 } from "node:fs";
7558
7584
  import { tmpdir as tmpdir3 } from "node:os";
7559
7585
  import { join as join7 } from "node:path";
7560
7586
  import { promisify as promisify3 } from "node:util";
@@ -7630,7 +7656,7 @@ async function runOperation2(engine, operation, params, projectPath) {
7630
7656
  messages: []
7631
7657
  };
7632
7658
  } finally {
7633
- rmSync3(paramsDir, { recursive: true, force: true });
7659
+ discard(paramsDir);
7634
7660
  }
7635
7661
  const payload = lastJsonObject2(stdout);
7636
7662
  if (payload === null) {
@@ -7645,6 +7671,7 @@ async function runOperation2(engine, operation, params, projectPath) {
7645
7671
  var run3;
7646
7672
  var init_headless = __esm(() => {
7647
7673
  init_game_log();
7674
+ init_scratch();
7648
7675
  run3 = promisify3(execFile3);
7649
7676
  });
7650
7677
 
@@ -30946,7 +30973,7 @@ var init_stdio2 = __esm(() => {
30946
30973
  });
30947
30974
 
30948
30975
  // src/bridge-announce.ts
30949
- import { mkdirSync as mkdirSync5, readFileSync as readFileSync9, rmSync as rmSync6, writeFileSync as writeFileSync7 } from "node:fs";
30976
+ import { mkdirSync as mkdirSync5, readFileSync as readFileSync9, rmSync as rmSync5, writeFileSync as writeFileSync7 } from "node:fs";
30950
30977
  import { dirname as dirname6, join as join11 } from "node:path";
30951
30978
  function announcementPath(projectPath) {
30952
30979
  return join11(projectPath, ".godot", "gdharness-bridge.json");
@@ -30994,7 +31021,7 @@ function withdrawBridge(path) {
30994
31021
  return;
30995
31022
  }
30996
31023
  try {
30997
- rmSync6(path, { force: true });
31024
+ rmSync5(path, { force: true });
30998
31025
  } catch (error) {
30999
31026
  console.error(`[SERVER] Could not withdraw the editor bridge announcement: ${errorMessage(error)}`);
31000
31027
  }
@@ -36330,7 +36357,7 @@ var init_runtime_client = __esm(() => {
36330
36357
 
36331
36358
  // src/run-record.ts
36332
36359
  import { execFileSync } from "node:child_process";
36333
- import { mkdirSync as mkdirSync6, openSync, readdirSync as readdirSync6, readFileSync as readFileSync13, rmSync as rmSync7, statSync as statSync3, writeFileSync as writeFileSync8 } from "node:fs";
36360
+ import { mkdirSync as mkdirSync6, openSync, readdirSync as readdirSync6, readFileSync as readFileSync13, rmSync as rmSync6, statSync as statSync3, writeFileSync as writeFileSync8 } from "node:fs";
36334
36361
  import { basename as basename2, join as join15 } from "node:path";
36335
36362
  function runsDirectory() {
36336
36363
  return join15(runtimeDirectory(), "runs");
@@ -36540,7 +36567,7 @@ function clearRunRecord(ours = () => true) {
36540
36567
  continue;
36541
36568
  }
36542
36569
  try {
36543
- rmSync7(path);
36570
+ rmSync6(path);
36544
36571
  } catch {}
36545
36572
  }
36546
36573
  }
@@ -36569,7 +36596,7 @@ function sweepTranscripts(keepMs = 24 * 60 * 60 * 1000, now = Date.now()) {
36569
36596
  continue;
36570
36597
  }
36571
36598
  try {
36572
- rmSync7(path);
36599
+ rmSync6(path);
36573
36600
  } catch {}
36574
36601
  }
36575
36602
  }
@@ -36578,7 +36605,7 @@ var init_run_record = __esm(() => {
36578
36605
  });
36579
36606
 
36580
36607
  // src/setup.ts
36581
- import { cpSync as cpSync2, existsSync as existsSync13, mkdirSync as mkdirSync7, readFileSync as readFileSync14, rmSync as rmSync8, writeFileSync as writeFileSync9 } from "node:fs";
36608
+ import { cpSync as cpSync2, existsSync as existsSync13, mkdirSync as mkdirSync7, readFileSync as readFileSync14, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "node:fs";
36582
36609
  import { dirname as dirname8, join as join16 } from "node:path";
36583
36610
  function installedAddonVersion(projectPath) {
36584
36611
  const marker = join16(projectPath, "addons", ADDONS2[0], VERSION_MARKER2);
@@ -36614,8 +36641,7 @@ import {
36614
36641
  openSync as openSync2,
36615
36642
  readdirSync as readdirSync7,
36616
36643
  readFileSync as readFileSync15,
36617
- readSync,
36618
- rmSync as rmSync9
36644
+ readSync
36619
36645
  } from "node:fs";
36620
36646
  import { tmpdir as tmpdir5 } from "node:os";
36621
36647
  import { basename as basename3, dirname as dirname9, join as join17, normalize as normalize3 } from "node:path";
@@ -37692,7 +37718,7 @@ class GodotServer {
37692
37718
  log.append("stderr", failed.stderr);
37693
37719
  exitCode = typeof failed.code === "number" ? failed.code : -1;
37694
37720
  } finally {
37695
- rmSync9(exportLogs, { recursive: true, force: true });
37721
+ discard(exportLogs);
37696
37722
  }
37697
37723
  log.finish();
37698
37724
  const problems = log.select({ severity: "warning", sinceLastCall: false, limit: 200 });
@@ -37790,8 +37816,7 @@ class GodotServer {
37790
37816
  } catch (error) {
37791
37817
  reportProblem = errorMessage(error);
37792
37818
  } finally {
37793
- rmSync9(reportsDir, { recursive: true, force: true });
37794
- rmSync9(userData, { recursive: true, force: true });
37819
+ discard(reportsDir, userData);
37795
37820
  }
37796
37821
  const engineEntries = run.log.select({ severity: "warning", sinceLastCall: false, limit: 200 }).entries.map(aboveTheRunner);
37797
37822
  const verdicts = {
@@ -38870,9 +38895,7 @@ class GodotServer {
38870
38895
  ]
38871
38896
  };
38872
38897
  } finally {
38873
- if (screenshotDir) {
38874
- rmSync9(screenshotDir, { recursive: true, force: true });
38875
- }
38898
+ discard(screenshotDir);
38876
38899
  }
38877
38900
  }
38878
38901
  async handleFindRuntimeNodes(args) {
@@ -38959,6 +38982,7 @@ var init_server3 = __esm(() => {
38959
38982
  init_resources();
38960
38983
  init_run_record();
38961
38984
  init_runtime_client();
38985
+ init_scratch();
38962
38986
  init_server_version();
38963
38987
  init_setup();
38964
38988
  init_tool_definitions();
@@ -39911,8 +39935,9 @@ function taken(harness, path, held, stripped) {
39911
39935
 
39912
39936
  // src/headless.ts
39913
39937
  init_game_log();
39938
+ init_scratch();
39914
39939
  import { execFile as execFile2 } from "node:child_process";
39915
- import { mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync2 } from "node:fs";
39940
+ import { mkdtempSync, writeFileSync as writeFileSync2 } from "node:fs";
39916
39941
  import { tmpdir } from "node:os";
39917
39942
  import { join as join4 } from "node:path";
39918
39943
  import { promisify as promisify2 } from "node:util";
@@ -39989,7 +40014,7 @@ async function runOperation(engine, operation, params, projectPath) {
39989
40014
  messages: []
39990
40015
  };
39991
40016
  } finally {
39992
- rmSync2(paramsDir, { recursive: true, force: true });
40017
+ discard(paramsDir);
39993
40018
  }
39994
40019
  const payload = lastJsonObject(stdout);
39995
40020
  if (payload === null) {
@@ -40138,7 +40163,7 @@ init_headless();
40138
40163
  init_resources();
40139
40164
  init_server_version();
40140
40165
  import { spawnSync } from "node:child_process";
40141
- import { cpSync, existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync7, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "node:fs";
40166
+ import { cpSync, existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync7, rmSync as rmSync3, writeFileSync as writeFileSync5 } from "node:fs";
40142
40167
  import { dirname as dirname3, join as join8 } from "node:path";
40143
40168
  import { fileURLToPath } from "node:url";
40144
40169
  var ADDONS = ["gdharness_editor", "gdharness_runtime", "auto_reload"];
@@ -40163,7 +40188,7 @@ function installAddons(projectPath, from = shippedAddonsDirectory()) {
40163
40188
  }
40164
40189
  const target = join8(projectPath, "addons", name);
40165
40190
  const replaced = existsSync7(target);
40166
- rmSync4(target, { recursive: true, force: true });
40191
+ rmSync3(target, { recursive: true, force: true });
40167
40192
  mkdirSync3(dirname3(target), { recursive: true });
40168
40193
  cpSync(source, target, { recursive: true });
40169
40194
  writeFileSync5(join8(target, VERSION_MARKER), `${SERVER_VERSION}
@@ -40177,7 +40202,7 @@ function removeAddons(projectPath) {
40177
40202
  for (const name of ADDONS) {
40178
40203
  const target = join8(projectPath, "addons", name);
40179
40204
  if (existsSync7(target)) {
40180
- rmSync4(target, { recursive: true, force: true });
40205
+ rmSync3(target, { recursive: true, force: true });
40181
40206
  removed.push(target);
40182
40207
  }
40183
40208
  }
@@ -40306,7 +40331,7 @@ function inspectProject(projectPath) {
40306
40331
 
40307
40332
  // src/skill.ts
40308
40333
  init_tool_definitions();
40309
- import { existsSync as existsSync8, mkdirSync as mkdirSync4, readdirSync as readdirSync3, rmSync as rmSync5, writeFileSync as writeFileSync6 } from "node:fs";
40334
+ import { existsSync as existsSync8, mkdirSync as mkdirSync4, readdirSync as readdirSync3, rmSync as rmSync4, writeFileSync as writeFileSync6 } from "node:fs";
40310
40335
  import { basename, dirname as dirname4, join as join9 } from "node:path";
40311
40336
 
40312
40337
  // src/tool-reference.ts
@@ -40551,7 +40576,7 @@ function removeSkill(directories, projectPath) {
40551
40576
  const removed = [];
40552
40577
  for (const directory of directories) {
40553
40578
  if (existsSync8(directory)) {
40554
- rmSync5(directory, { recursive: true, force: true });
40579
+ rmSync4(directory, { recursive: true, force: true });
40555
40580
  pruneEmpty(dirname4(directory), projectPath);
40556
40581
  removed.push(directory);
40557
40582
  }
@@ -40565,7 +40590,7 @@ function pruneEmpty(directory, projectPath) {
40565
40590
  if (readdirSync3(path).length > 0) {
40566
40591
  return;
40567
40592
  }
40568
- rmSync5(path, { recursive: true, force: true });
40593
+ rmSync4(path, { recursive: true, force: true });
40569
40594
  path = dirname4(path);
40570
40595
  }
40571
40596
  }
@@ -40573,7 +40598,7 @@ function writeSkill(directories, version) {
40573
40598
  const files = skillFiles(version);
40574
40599
  return directories.map((directory) => {
40575
40600
  const replaced = existsSync8(directory);
40576
- rmSync5(directory, { recursive: true, force: true });
40601
+ rmSync4(directory, { recursive: true, force: true });
40577
40602
  for (const [name, contents] of files) {
40578
40603
  const path = join9(directory, name);
40579
40604
  mkdirSync4(dirname4(path), { recursive: true });
package/build/index.js CHANGED
@@ -10151,8 +10151,7 @@ import {
10151
10151
  openSync as openSync2,
10152
10152
  readdirSync as readdirSync6,
10153
10153
  readFileSync as readFileSync11,
10154
- readSync,
10155
- rmSync as rmSync5
10154
+ readSync
10156
10155
  } from "node:fs";
10157
10156
  import { tmpdir as tmpdir4 } from "node:os";
10158
10157
  import { basename as basename2, dirname as dirname4, join as join11, normalize as normalize2 } from "node:path";
@@ -26324,10 +26323,35 @@ class GodotLocator {
26324
26323
 
26325
26324
  // src/headless.ts
26326
26325
  import { execFile as execFile2 } from "node:child_process";
26327
- import { mkdtempSync, rmSync as rmSync2, writeFileSync as writeFileSync3 } from "node:fs";
26326
+ import { mkdtempSync, writeFileSync as writeFileSync3 } from "node:fs";
26328
26327
  import { tmpdir as tmpdir2 } from "node:os";
26329
26328
  import { join as join6 } from "node:path";
26330
26329
  import { promisify as promisify2 } from "node:util";
26330
+
26331
+ // src/scratch.ts
26332
+ import { rmSync as rmSync2 } from "node:fs";
26333
+ var SWEPT = { recursive: true, force: true, maxRetries: 20, retryDelay: 250 };
26334
+ function discardWith(remove, paths) {
26335
+ const left = [];
26336
+ for (const path of paths) {
26337
+ if (!path) {
26338
+ continue;
26339
+ }
26340
+ try {
26341
+ remove(path);
26342
+ } catch (error) {
26343
+ left.push({ path, reason: error instanceof Error ? error.message : String(error) });
26344
+ }
26345
+ }
26346
+ return left;
26347
+ }
26348
+ function discard(...paths) {
26349
+ return discardWith((path) => {
26350
+ rmSync2(path, SWEPT);
26351
+ }, paths);
26352
+ }
26353
+
26354
+ // src/headless.ts
26331
26355
  var run2 = promisify2(execFile2);
26332
26356
  function snakeCased(params) {
26333
26357
  const result = emptyRecord();
@@ -26401,7 +26425,7 @@ async function runOperation(engine, operation, params, projectPath) {
26401
26425
  messages: []
26402
26426
  };
26403
26427
  } finally {
26404
- rmSync2(paramsDir, { recursive: true, force: true });
26428
+ discard(paramsDir);
26405
26429
  }
26406
26430
  const payload = lastJsonObject(stdout);
26407
26431
  if (payload === null) {
@@ -30446,7 +30470,7 @@ class GodotServer {
30446
30470
  log.append("stderr", failed.stderr);
30447
30471
  exitCode = typeof failed.code === "number" ? failed.code : -1;
30448
30472
  } finally {
30449
- rmSync5(exportLogs, { recursive: true, force: true });
30473
+ discard(exportLogs);
30450
30474
  }
30451
30475
  log.finish();
30452
30476
  const problems = log.select({ severity: "warning", sinceLastCall: false, limit: 200 });
@@ -30544,8 +30568,7 @@ class GodotServer {
30544
30568
  } catch (error) {
30545
30569
  reportProblem = errorMessage(error);
30546
30570
  } finally {
30547
- rmSync5(reportsDir, { recursive: true, force: true });
30548
- rmSync5(userData, { recursive: true, force: true });
30571
+ discard(reportsDir, userData);
30549
30572
  }
30550
30573
  const engineEntries = run.log.select({ severity: "warning", sinceLastCall: false, limit: 200 }).entries.map(aboveTheRunner);
30551
30574
  const verdicts = {
@@ -31624,9 +31647,7 @@ class GodotServer {
31624
31647
  ]
31625
31648
  };
31626
31649
  } finally {
31627
- if (screenshotDir) {
31628
- rmSync5(screenshotDir, { recursive: true, force: true });
31629
- }
31650
+ discard(screenshotDir);
31630
31651
  }
31631
31652
  }
31632
31653
  async handleFindRuntimeNodes(args) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "0.13.11",
3
+ "version": "0.13.12",
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",