gdharness 0.13.24 → 0.13.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 +20 -4
- package/build/index.js +11 -2
- package/package.json +1 -1
package/build/cli.js
CHANGED
|
@@ -7619,6 +7619,15 @@ function contradictedDiagnostics(messages, classes, sourceOf) {
|
|
|
7619
7619
|
}
|
|
7620
7620
|
return found;
|
|
7621
7621
|
}
|
|
7622
|
+
function staleAnalysisNote(contradicted, dependsOn) {
|
|
7623
|
+
if (contradicted.length === 0) {
|
|
7624
|
+
return "";
|
|
7625
|
+
}
|
|
7626
|
+
const types = new Set(contradicted.map((one) => one.type));
|
|
7627
|
+
const declaring = [...new Set(contradicted.map((one) => one.declaredIn))].sort();
|
|
7628
|
+
const lever = dependsOn.length === 0 ? ", and the named types depend on no other global class, so that lever is not available here. " + "That is the common case rather than the awkward one: an edit near a type that depends on " + "something refreshes it before the fault is noticed, which is why a type with no " + "dependencies is where this turns up" : `, so changing ${[...dependsOn].sort().join(", ")} and rescanning is worth a try`;
|
|
7629
|
+
return `The editor is reporting against an older copy of ${types.size === 1 ? "a type" : "some types"} ` + "named under contradictedByTheFile. Each member listed is declared in the file the class cache " + "points at, so those diagnostics are wrong however the code is written. Run editor_rescan first: " + "it costs about half a second, it cleared this in one of five attempts in the project that " + "reported it, and it cleared both reproductions measured in a second project, the scan itself " + "returning in 243ms and 275ms. " + "The fault behind it is that a script the editor has loaded keeps the copy it built, and nothing " + `rebuilds that copy when the file changes; ${declaring.length === 1 ? `editor_rescan with reloadScript set to ${declaring[0]} recompiles that copy` : `reloadScript takes one script, so a call each for ${declaring.join(" and ")} recompiles those copies`} from the file into the same ` + "object and answers with the members it has afterwards under reloadedMethods. Read that and the " + "next diagnostics as two readings rather than one: a built copy has been seen stale here while " + "the diagnostics on it read clean, so the reload is worth doing and is not known to be what " + "clears these. The other lever measured is that a held type is refreshed when something it " + `depends on changes rather than when it changes itself${lever}. editor_launch restart has always ` + "worked and costs a window. project_import refresh_classes does not, and answers added: [] while " + "this is happening.";
|
|
7630
|
+
}
|
|
7622
7631
|
function cacheWrittenAt(projectPath) {
|
|
7623
7632
|
const cache = join6(projectPath, ".godot", "global_script_class_cache.cfg");
|
|
7624
7633
|
try {
|
|
@@ -15234,6 +15243,13 @@ function argumentsOf(spec, op) {
|
|
|
15234
15243
|
function toolsWithoutProjectPath() {
|
|
15235
15244
|
return TOOL_SPECS.filter((spec) => !Object.hasOwn(spec.parameters, "projectPath")).map((spec) => spec.name).sort();
|
|
15236
15245
|
}
|
|
15246
|
+
function projectPathSentence(without = toolsWithoutProjectPath()) {
|
|
15247
|
+
if (without.length === 0) {
|
|
15248
|
+
return "Every call takes `projectPath`";
|
|
15249
|
+
}
|
|
15250
|
+
const named = without.map((name) => `\`${name}\``).join(", ");
|
|
15251
|
+
return `Every call takes \`projectPath\` except ${named}, which ${without.length === 1 ? "takes" : "take"} none`;
|
|
15252
|
+
}
|
|
15237
15253
|
function toolSpec(name) {
|
|
15238
15254
|
return SPECS_BY_NAME[name];
|
|
15239
15255
|
}
|
|
@@ -15970,7 +15986,7 @@ var init_tool_definitions = __esm(() => {
|
|
|
15970
15986
|
timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." },
|
|
15971
15987
|
reloadScript: {
|
|
15972
15988
|
type: "string",
|
|
15973
|
-
description: "A script to recompile in the editor after the scan, for the
|
|
15989
|
+
description: "A script to recompile in the editor after the scan, for the half a scan does not reach: a script the editor has loaded keeps the copy it built, that copy is refreshed when one of its dependencies changes rather than when it changes itself, and a scan leaves it alone. Measured here, a built copy comes back without a method added to it while script_diagnostics on the same script reads clean in the same window, so the copy the editor built and whatever the analyser resolves types against are not known to be one thing: reload for the copy, and read the diagnostics as a separate answer rather than as this one confirmed. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
|
|
15974
15990
|
}
|
|
15975
15991
|
},
|
|
15976
15992
|
requires: ["projectPath"]
|
|
@@ -38133,7 +38149,7 @@ class GodotServer {
|
|
|
38133
38149
|
}
|
|
38134
38150
|
}
|
|
38135
38151
|
}
|
|
38136
|
-
notes.push(
|
|
38152
|
+
notes.push(staleAnalysisNote(contradicted, [...dependsOn]));
|
|
38137
38153
|
}
|
|
38138
38154
|
const uncached = unloaded.filter((type) => !type.inTheClassCache);
|
|
38139
38155
|
if (uncached.length > 0) {
|
|
@@ -40642,7 +40658,7 @@ function renderToolsMarkdown() {
|
|
|
40642
40658
|
`${TOOL_SPECS.length} tools, named \`domain_verb\`. A tool that does several related things takes an`,
|
|
40643
40659
|
"`op`. An unknown op or argument is refused with the valid set listed. Generated from the server.",
|
|
40644
40660
|
"",
|
|
40645
|
-
|
|
40661
|
+
`${projectPathSentence()}: the \`runtime_*\` and \`debug_*\` ones pick between running games`,
|
|
40646
40662
|
"instead, and the others answer about the editor on this server. An argument a tool does not",
|
|
40647
40663
|
"declare is refused rather than ignored. Answers are read from the engine after the change, not",
|
|
40648
40664
|
"echoed from the request. Engine stderr comes back under `engine_messages`.",
|
|
@@ -40701,7 +40717,7 @@ that is running, and the project on disk. ${TOOL_SPECS.length} tools, named \`do
|
|
|
40701
40717
|
|
|
40702
40718
|
## Start here
|
|
40703
40719
|
|
|
40704
|
-
-
|
|
40720
|
+
- ${projectPathSentence()}. The \`runtime_*\` and \`debug_*\` ones pick between running
|
|
40705
40721
|
games instead; the others answer about the editor this server is connected to. There is no
|
|
40706
40722
|
ambient project, and an argument a tool does not declare is refused rather than ignored.
|
|
40707
40723
|
- \`editor_status\` says whether an editor is connected and whether its addon matches the server.
|
package/build/index.js
CHANGED
|
@@ -24879,6 +24879,15 @@ function contradictedDiagnostics(messages, classes, sourceOf) {
|
|
|
24879
24879
|
}
|
|
24880
24880
|
return found;
|
|
24881
24881
|
}
|
|
24882
|
+
function staleAnalysisNote(contradicted, dependsOn) {
|
|
24883
|
+
if (contradicted.length === 0) {
|
|
24884
|
+
return "";
|
|
24885
|
+
}
|
|
24886
|
+
const types = new Set(contradicted.map((one) => one.type));
|
|
24887
|
+
const declaring = [...new Set(contradicted.map((one) => one.declaredIn))].sort();
|
|
24888
|
+
const lever = dependsOn.length === 0 ? ", and the named types depend on no other global class, so that lever is not available here. " + "That is the common case rather than the awkward one: an edit near a type that depends on " + "something refreshes it before the fault is noticed, which is why a type with no " + "dependencies is where this turns up" : `, so changing ${[...dependsOn].sort().join(", ")} and rescanning is worth a try`;
|
|
24889
|
+
return `The editor is reporting against an older copy of ${types.size === 1 ? "a type" : "some types"} ` + "named under contradictedByTheFile. Each member listed is declared in the file the class cache " + "points at, so those diagnostics are wrong however the code is written. Run editor_rescan first: " + "it costs about half a second, it cleared this in one of five attempts in the project that " + "reported it, and it cleared both reproductions measured in a second project, the scan itself " + "returning in 243ms and 275ms. " + "The fault behind it is that a script the editor has loaded keeps the copy it built, and nothing " + `rebuilds that copy when the file changes; ${declaring.length === 1 ? `editor_rescan with reloadScript set to ${declaring[0]} recompiles that copy` : `reloadScript takes one script, so a call each for ${declaring.join(" and ")} recompiles those copies`} from the file into the same ` + "object and answers with the members it has afterwards under reloadedMethods. Read that and the " + "next diagnostics as two readings rather than one: a built copy has been seen stale here while " + "the diagnostics on it read clean, so the reload is worth doing and is not known to be what " + "clears these. The other lever measured is that a held type is refreshed when something it " + `depends on changes rather than when it changes itself${lever}. editor_launch restart has always ` + "worked and costs a window. project_import refresh_classes does not, and answers added: [] while " + "this is happening.";
|
|
24890
|
+
}
|
|
24882
24891
|
function cacheWrittenAt(projectPath) {
|
|
24883
24892
|
const cache = join3(projectPath, ".godot", "global_script_class_cache.cfg");
|
|
24884
24893
|
try {
|
|
@@ -29084,7 +29093,7 @@ var TOOL_SPECS = [
|
|
|
29084
29093
|
timeoutMs: { type: "number", description: "How long to wait for the scan. Default 30000." },
|
|
29085
29094
|
reloadScript: {
|
|
29086
29095
|
type: "string",
|
|
29087
|
-
description: "A script to recompile in the editor after the scan, for the
|
|
29096
|
+
description: "A script to recompile in the editor after the scan, for the half a scan does not reach: a script the editor has loaded keeps the copy it built, that copy is refreshed when one of its dependencies changes rather than when it changes itself, and a scan leaves it alone. Measured here, a built copy comes back without a method added to it while script_diagnostics on the same script reads clean in the same window, so the copy the editor built and whatever the analyser resolves types against are not known to be one thing: reload for the copy, and read the diagnostics as a separate answer rather than as this one confirmed. This recompiles into the same object, so the holders that kept the stale copy alive see the new one. The methods it has afterwards come back under reloadedMethods, because a reload that compiled nothing and answered OK is the failure worth catching."
|
|
29088
29097
|
}
|
|
29089
29098
|
},
|
|
29090
29099
|
requires: ["projectPath"]
|
|
@@ -30882,7 +30891,7 @@ class GodotServer {
|
|
|
30882
30891
|
}
|
|
30883
30892
|
}
|
|
30884
30893
|
}
|
|
30885
|
-
notes.push(
|
|
30894
|
+
notes.push(staleAnalysisNote(contradicted, [...dependsOn]));
|
|
30886
30895
|
}
|
|
30887
30896
|
const uncached = unloaded.filter((type) => !type.inTheClassCache);
|
|
30888
30897
|
if (uncached.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gdharness",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.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",
|