@adhisang/minecraft-modding-mcp 4.0.0 → 4.1.1
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/CHANGELOG.md +61 -0
- package/README.md +40 -23
- package/dist/build-suggested-call.d.ts +29 -0
- package/dist/build-suggested-call.js +58 -0
- package/dist/cache-registry.d.ts +3 -1
- package/dist/cache-registry.js +50 -6
- package/dist/entry-tools/analyze-symbol-service.d.ts +16 -16
- package/dist/entry-tools/batch-class-members-service.d.ts +34 -0
- package/dist/entry-tools/batch-class-members-service.js +97 -0
- package/dist/entry-tools/batch-class-source-service.d.ts +37 -0
- package/dist/entry-tools/batch-class-source-service.js +100 -0
- package/dist/entry-tools/batch-mappings-service.d.ts +36 -0
- package/dist/entry-tools/batch-mappings-service.js +66 -0
- package/dist/entry-tools/batch-runner.d.ts +72 -0
- package/dist/entry-tools/batch-runner.js +90 -0
- package/dist/entry-tools/batch-symbol-exists-service.d.ts +46 -0
- package/dist/entry-tools/batch-symbol-exists-service.js +113 -0
- package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
- package/dist/entry-tools/inspect-minecraft/handlers/artifact.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +83 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-members.d.ts +6 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +80 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-overview.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +248 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-source.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +60 -0
- package/dist/entry-tools/inspect-minecraft/handlers/file.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/file.js +54 -0
- package/dist/entry-tools/inspect-minecraft/handlers/list-files.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +100 -0
- package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/search.js +155 -0
- package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +6 -0
- package/dist/entry-tools/inspect-minecraft/handlers/versions.js +49 -0
- package/dist/entry-tools/inspect-minecraft/internal.d.ts +1042 -0
- package/dist/entry-tools/inspect-minecraft/internal.js +448 -0
- package/dist/entry-tools/inspect-minecraft-service.d.ts +193 -308
- package/dist/entry-tools/inspect-minecraft-service.js +20 -1244
- package/dist/entry-tools/manage-cache-service.d.ts +16 -16
- package/dist/entry-tools/validate-project/cases/access-transformer.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/access-transformer.js +106 -0
- package/dist/entry-tools/validate-project/cases/access-widener.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/access-widener.js +86 -0
- package/dist/entry-tools/validate-project/cases/mixin.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/mixin.js +90 -0
- package/dist/entry-tools/validate-project/cases/project-summary.d.ts +102 -0
- package/dist/entry-tools/validate-project/cases/project-summary.js +415 -0
- package/dist/entry-tools/validate-project/internal.d.ts +142 -0
- package/dist/entry-tools/validate-project/internal.js +303 -0
- package/dist/entry-tools/validate-project-service.d.ts +67 -47
- package/dist/entry-tools/validate-project-service.js +13 -563
- package/dist/entry-tools/verify-mixin-target-service.d.ts +133 -0
- package/dist/entry-tools/verify-mixin-target-service.js +323 -0
- package/dist/error-mapping.d.ts +40 -0
- package/dist/error-mapping.js +139 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +147 -1354
- package/dist/mapping/internal-types.d.ts +54 -0
- package/dist/mapping/internal-types.js +14 -0
- package/dist/mapping/loaders/mojang.d.ts +2 -0
- package/dist/mapping/loaders/mojang.js +64 -0
- package/dist/mapping/loaders/tiny-loom.d.ts +2 -0
- package/dist/mapping/loaders/tiny-loom.js +73 -0
- package/dist/mapping/loaders/tiny-maven.d.ts +2 -0
- package/dist/mapping/loaders/tiny-maven.js +104 -0
- package/dist/mapping/loaders/types.d.ts +14 -0
- package/dist/mapping/loaders/types.js +2 -0
- package/dist/mapping/lookup.d.ts +52 -0
- package/dist/mapping/lookup.js +496 -0
- package/dist/mapping/parsers/normalize.d.ts +10 -0
- package/dist/mapping/parsers/normalize.js +52 -0
- package/dist/mapping/parsers/proguard.d.ts +20 -0
- package/dist/mapping/parsers/proguard.js +138 -0
- package/dist/mapping/parsers/symbol-records.d.ts +27 -0
- package/dist/mapping/parsers/symbol-records.js +216 -0
- package/dist/mapping/parsers/tiny.d.ts +9 -0
- package/dist/mapping/parsers/tiny.js +96 -0
- package/dist/mapping/types.d.ts +147 -0
- package/dist/mapping/types.js +2 -0
- package/dist/mapping-pipeline-service.js +3 -2
- package/dist/mapping-service.d.ts +8 -145
- package/dist/mapping-service.js +30 -1207
- package/dist/mixin/access-validators.d.ts +9 -0
- package/dist/mixin/access-validators.js +257 -0
- package/dist/mixin/annotation-validators.d.ts +5 -0
- package/dist/mixin/annotation-validators.js +162 -0
- package/dist/mixin/helpers.d.ts +28 -0
- package/dist/mixin/helpers.js +315 -0
- package/dist/mixin/parsed-validator.d.ts +8 -0
- package/dist/mixin/parsed-validator.js +337 -0
- package/dist/mixin/types.d.ts +208 -0
- package/dist/mixin/types.js +28 -0
- package/dist/mixin-validator.d.ts +9 -201
- package/dist/mixin-validator.js +8 -1020
- package/dist/source/access-validate.d.ts +4 -0
- package/dist/source/access-validate.js +254 -0
- package/dist/source/artifact-resolver.d.ts +111 -0
- package/dist/source/artifact-resolver.js +1271 -0
- package/dist/source/cache-metrics.d.ts +26 -0
- package/dist/source/cache-metrics.js +172 -0
- package/dist/source/class-source/members-builder.d.ts +34 -0
- package/dist/source/class-source/members-builder.js +46 -0
- package/dist/source/class-source/snippet-builder.d.ts +19 -0
- package/dist/source/class-source/snippet-builder.js +46 -0
- package/dist/source/class-source-helpers.d.ts +34 -0
- package/dist/source/class-source-helpers.js +140 -0
- package/dist/source/class-source.d.ts +42 -0
- package/dist/source/class-source.js +883 -0
- package/dist/source/descriptor-utils.d.ts +6 -0
- package/dist/source/descriptor-utils.js +37 -0
- package/dist/source/file-access.d.ts +4 -0
- package/dist/source/file-access.js +102 -0
- package/dist/source/indexer.d.ts +82 -0
- package/dist/source/indexer.js +522 -0
- package/dist/source/lifecycle/diff-utils.d.ts +9 -0
- package/dist/source/lifecycle/diff-utils.js +107 -0
- package/dist/source/lifecycle/diff.d.ts +2 -0
- package/dist/source/lifecycle/diff.js +265 -0
- package/dist/source/lifecycle/mapping-helpers.d.ts +22 -0
- package/dist/source/lifecycle/mapping-helpers.js +327 -0
- package/dist/source/lifecycle/runtime-check.d.ts +2 -0
- package/dist/source/lifecycle/runtime-check.js +142 -0
- package/dist/source/lifecycle/trace.d.ts +2 -0
- package/dist/source/lifecycle/trace.js +231 -0
- package/dist/source/lifecycle.d.ts +4 -0
- package/dist/source/lifecycle.js +5 -0
- package/dist/source/search.d.ts +51 -0
- package/dist/source/search.js +676 -0
- package/dist/source/shared-utils.d.ts +6 -0
- package/dist/source/shared-utils.js +55 -0
- package/dist/source/state.d.ts +26 -0
- package/dist/source/state.js +24 -0
- package/dist/source/symbol-resolver.d.ts +3 -0
- package/dist/source/symbol-resolver.js +212 -0
- package/dist/source/validate-mixin/pipeline/mapping-health.d.ts +3 -0
- package/dist/source/validate-mixin/pipeline/mapping-health.js +41 -0
- package/dist/source/validate-mixin/pipeline/parse.d.ts +2 -0
- package/dist/source/validate-mixin/pipeline/parse.js +10 -0
- package/dist/source/validate-mixin/pipeline/resolve.d.ts +3 -0
- package/dist/source/validate-mixin/pipeline/resolve.js +78 -0
- package/dist/source/validate-mixin/pipeline/target-lookup.d.ts +6 -0
- package/dist/source/validate-mixin/pipeline/target-lookup.js +260 -0
- package/dist/source/validate-mixin/pipeline-context.d.ts +72 -0
- package/dist/source/validate-mixin/pipeline-context.js +93 -0
- package/dist/source/validate-mixin.d.ts +22 -0
- package/dist/source/validate-mixin.js +799 -0
- package/dist/source/workspace-target.d.ts +18 -0
- package/dist/source/workspace-target.js +305 -0
- package/dist/source-resolver.d.ts +1 -0
- package/dist/source-resolver.js +1 -1
- package/dist/source-service.d.ts +164 -170
- package/dist/source-service.js +70 -6116
- package/dist/stage-emitter.d.ts +13 -0
- package/dist/stage-emitter.js +30 -0
- package/dist/stdio-supervisor.d.ts +61 -0
- package/dist/stdio-supervisor.js +326 -9
- package/dist/tool-contract-manifest.d.ts +1 -1
- package/dist/tool-contract-manifest.js +23 -6
- package/dist/tool-guidance.d.ts +82 -0
- package/dist/tool-guidance.js +734 -0
- package/dist/tool-schema-registry.d.ts +16 -0
- package/dist/tool-schema-registry.js +37 -0
- package/dist/tool-schemas.d.ts +3518 -0
- package/dist/tool-schemas.js +813 -0
- package/dist/types.d.ts +36 -0
- package/dist/version-service.js +7 -6
- package/dist/workspace-context-cache.d.ts +32 -0
- package/dist/workspace-context-cache.js +66 -0
- package/dist/workspace-mapping-service.d.ts +16 -0
- package/dist/workspace-mapping-service.js +173 -1
- package/docs/README-ja.md +416 -0
- package/docs/examples.md +483 -0
- package/docs/tool-reference.md +462 -0
- package/package.json +17 -4
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { stat, readFile } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { isAppError } from "../../errors.js";
|
|
4
|
+
import { buildVersionSourceSearchRoots } from "../../gradle-paths.js";
|
|
5
|
+
const VALIDATE_PROJECT_TASKS_OFF = process.env.VALIDATE_PROJECT_TASKS_OFF === "1";
|
|
6
|
+
const TASK_KEYS = [
|
|
7
|
+
"workspace.detected",
|
|
8
|
+
"gradle.readable",
|
|
9
|
+
"loom.cache.found",
|
|
10
|
+
"minecraft.artifact.resolved",
|
|
11
|
+
"mixins.validated",
|
|
12
|
+
"accessWideners.validated",
|
|
13
|
+
"accessTransformers.validated"
|
|
14
|
+
];
|
|
15
|
+
// Helpers live as free functions so ValidateProjectService keeps its baseline
|
|
16
|
+
// declaration surface (constructor + execute only).
|
|
17
|
+
async function pathExists(target) {
|
|
18
|
+
try {
|
|
19
|
+
await stat(target);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function probeWorkspaceDetected(projectPath) {
|
|
27
|
+
const startedAt = Date.now();
|
|
28
|
+
const candidates = [
|
|
29
|
+
"gradle.properties",
|
|
30
|
+
"settings.gradle",
|
|
31
|
+
"settings.gradle.kts",
|
|
32
|
+
"build.gradle",
|
|
33
|
+
"build.gradle.kts"
|
|
34
|
+
];
|
|
35
|
+
try {
|
|
36
|
+
const evidence = [];
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
if (await pathExists(resolve(projectPath, candidate))) {
|
|
39
|
+
evidence.push(candidate);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const durationMs = Date.now() - startedAt;
|
|
43
|
+
if (evidence.length === 0) {
|
|
44
|
+
return { status: "missing", durationMs };
|
|
45
|
+
}
|
|
46
|
+
return { status: "ok", durationMs, evidence };
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
return {
|
|
50
|
+
status: "error",
|
|
51
|
+
durationMs: Date.now() - startedAt,
|
|
52
|
+
error: {
|
|
53
|
+
code: isAppError(error) ? error.code : "ERR_PROBE_FAILED",
|
|
54
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function probeGradleReadable(projectPath) {
|
|
60
|
+
const startedAt = Date.now();
|
|
61
|
+
const propertiesPath = resolve(projectPath, "gradle.properties");
|
|
62
|
+
try {
|
|
63
|
+
const propsExists = await pathExists(propertiesPath);
|
|
64
|
+
let propsRead = false;
|
|
65
|
+
if (propsExists) {
|
|
66
|
+
await readFile(propertiesPath, "utf8");
|
|
67
|
+
propsRead = true;
|
|
68
|
+
}
|
|
69
|
+
const buildScriptCandidates = [
|
|
70
|
+
"build.gradle",
|
|
71
|
+
"build.gradle.kts",
|
|
72
|
+
"settings.gradle",
|
|
73
|
+
"settings.gradle.kts"
|
|
74
|
+
];
|
|
75
|
+
const buildScripts = [];
|
|
76
|
+
for (const candidate of buildScriptCandidates) {
|
|
77
|
+
if (await pathExists(resolve(projectPath, candidate))) {
|
|
78
|
+
buildScripts.push(candidate);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const durationMs = Date.now() - startedAt;
|
|
82
|
+
if (!propsExists && buildScripts.length === 0) {
|
|
83
|
+
return { status: "missing", durationMs };
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
status: "ok",
|
|
87
|
+
durationMs,
|
|
88
|
+
...(propsRead ? { propertiesPath } : {}),
|
|
89
|
+
buildScripts
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return {
|
|
94
|
+
status: "error",
|
|
95
|
+
durationMs: Date.now() - startedAt,
|
|
96
|
+
error: {
|
|
97
|
+
code: isAppError(error) ? error.code : "ERR_GRADLE_READ_FAILED",
|
|
98
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function probeLoomCacheFound(projectPath) {
|
|
104
|
+
const startedAt = Date.now();
|
|
105
|
+
try {
|
|
106
|
+
const roots = buildVersionSourceSearchRoots(projectPath);
|
|
107
|
+
for (const root of roots) {
|
|
108
|
+
if (await pathExists(root)) {
|
|
109
|
+
return {
|
|
110
|
+
status: "ok",
|
|
111
|
+
durationMs: Date.now() - startedAt,
|
|
112
|
+
cachePath: root
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return { status: "missing", durationMs: Date.now() - startedAt };
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
return {
|
|
120
|
+
status: "error",
|
|
121
|
+
durationMs: Date.now() - startedAt,
|
|
122
|
+
error: {
|
|
123
|
+
code: isAppError(error) ? error.code : "ERR_LOOM_PROBE_FAILED",
|
|
124
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function probeMinecraftArtifactResolved(artifactProbe, args, stageEmitter) {
|
|
130
|
+
const startedAt = Date.now();
|
|
131
|
+
// Stage notification kept outside the probe's try block: a telemetry
|
|
132
|
+
// failure must not be classified as ERR_ARTIFACT_PROBE_FAILED.
|
|
133
|
+
try {
|
|
134
|
+
await stageEmitter?.("validate-project:artifact-probe", {
|
|
135
|
+
version: args.version,
|
|
136
|
+
mapping: args.mapping ?? "obfuscated",
|
|
137
|
+
projectPath: args.projectPath,
|
|
138
|
+
scope: args.scope ?? null
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// swallow telemetry failure
|
|
143
|
+
}
|
|
144
|
+
try {
|
|
145
|
+
const output = await artifactProbe({
|
|
146
|
+
target: { kind: "version", value: args.version },
|
|
147
|
+
mapping: args.mapping,
|
|
148
|
+
sourcePriority: args.sourcePriority,
|
|
149
|
+
projectPath: args.projectPath,
|
|
150
|
+
scope: args.scope,
|
|
151
|
+
preferProjectVersion: args.preferProjectVersion
|
|
152
|
+
});
|
|
153
|
+
return {
|
|
154
|
+
status: "ok",
|
|
155
|
+
durationMs: Date.now() - startedAt,
|
|
156
|
+
artifactId: output.artifactId,
|
|
157
|
+
mapping: output.mappingApplied,
|
|
158
|
+
...(Array.isArray(output.warnings) && output.warnings.length > 0
|
|
159
|
+
? { warnings: output.warnings }
|
|
160
|
+
: {})
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
return {
|
|
165
|
+
status: "error",
|
|
166
|
+
durationMs: Date.now() - startedAt,
|
|
167
|
+
error: {
|
|
168
|
+
code: isAppError(error) ? error.code : "ERR_ARTIFACT_PROBE_FAILED",
|
|
169
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function downstreamSkipReason(report, upstream) {
|
|
175
|
+
for (const key of upstream) {
|
|
176
|
+
const entry = report[key];
|
|
177
|
+
if (entry.status !== "ok") {
|
|
178
|
+
return { status: "skipped" };
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return undefined;
|
|
182
|
+
}
|
|
183
|
+
function buildValidationEntryWithCounts(upstream, discoveredCount, errorCount, counts, durationMs) {
|
|
184
|
+
// Real validator outcomes win over upstream skip when validators ran.
|
|
185
|
+
// The artifact probe is informational; its failure must not erase real counts.
|
|
186
|
+
if (discoveredCount > 0 || errorCount > 0) {
|
|
187
|
+
if (errorCount > 0) {
|
|
188
|
+
return { status: "error", durationMs, counts };
|
|
189
|
+
}
|
|
190
|
+
return { status: "ok", durationMs, counts };
|
|
191
|
+
}
|
|
192
|
+
if (upstream) {
|
|
193
|
+
return upstream;
|
|
194
|
+
}
|
|
195
|
+
return { status: "missing", durationMs };
|
|
196
|
+
}
|
|
197
|
+
function projectTaskEntry(entry, detail, include) {
|
|
198
|
+
const fullDetail = detail !== "summary" && include.includes("workspace");
|
|
199
|
+
if (fullDetail) {
|
|
200
|
+
return entry;
|
|
201
|
+
}
|
|
202
|
+
const slim = { status: entry.status };
|
|
203
|
+
if (entry.error) {
|
|
204
|
+
slim.error = entry.error;
|
|
205
|
+
}
|
|
206
|
+
if (entry.warnings && entry.warnings.length > 0) {
|
|
207
|
+
slim.warnings = entry.warnings;
|
|
208
|
+
}
|
|
209
|
+
return slim;
|
|
210
|
+
}
|
|
211
|
+
function projectTaskStatusReport(report, detail, include) {
|
|
212
|
+
const projected = {};
|
|
213
|
+
for (const key of TASK_KEYS) {
|
|
214
|
+
projected[key] = projectTaskEntry(report[key], detail, include);
|
|
215
|
+
}
|
|
216
|
+
return projected;
|
|
217
|
+
}
|
|
218
|
+
export async function runUpstreamProbes(projectPath) {
|
|
219
|
+
const workspace = await probeWorkspaceDetected(projectPath);
|
|
220
|
+
const loom = await probeLoomCacheFound(projectPath);
|
|
221
|
+
let gradle;
|
|
222
|
+
if (workspace.status !== "ok") {
|
|
223
|
+
gradle = { status: "skipped" };
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
gradle = await probeGradleReadable(projectPath);
|
|
227
|
+
}
|
|
228
|
+
return { workspace, gradle, loom };
|
|
229
|
+
}
|
|
230
|
+
export async function buildEarlyTasksForBlocked(projectPath, detail, include, discovery) {
|
|
231
|
+
if (VALIDATE_PROJECT_TASKS_OFF) {
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
234
|
+
const { workspace, gradle, loom } = await runUpstreamProbes(projectPath);
|
|
235
|
+
const minecraftArtifactResolved = {
|
|
236
|
+
status: "skipped"
|
|
237
|
+
};
|
|
238
|
+
const validatedSkipped = { status: "skipped" };
|
|
239
|
+
const buildValidatorEntry = (discoveredCount) => {
|
|
240
|
+
if (workspace.status !== "ok" || gradle.status !== "ok") {
|
|
241
|
+
return validatedSkipped;
|
|
242
|
+
}
|
|
243
|
+
if (minecraftArtifactResolved.status !== "ok") {
|
|
244
|
+
return validatedSkipped;
|
|
245
|
+
}
|
|
246
|
+
return discoveredCount === 0 || discoveredCount === undefined
|
|
247
|
+
? { status: "missing" }
|
|
248
|
+
: validatedSkipped;
|
|
249
|
+
};
|
|
250
|
+
const report = {
|
|
251
|
+
"workspace.detected": workspace,
|
|
252
|
+
"gradle.readable": gradle,
|
|
253
|
+
"loom.cache.found": loom,
|
|
254
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved,
|
|
255
|
+
"mixins.validated": buildValidatorEntry(discovery?.mixinDiscoveryCount),
|
|
256
|
+
"accessWideners.validated": buildValidatorEntry(discovery?.awDiscoveryCount),
|
|
257
|
+
"accessTransformers.validated": buildValidatorEntry(discovery?.atDiscoveryCount)
|
|
258
|
+
};
|
|
259
|
+
return projectTaskStatusReport(report, detail, include);
|
|
260
|
+
}
|
|
261
|
+
export async function buildFullTaskStatusReport(deps, args) {
|
|
262
|
+
if (VALIDATE_PROJECT_TASKS_OFF) {
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
const { workspace, gradle, loom } = await runUpstreamProbes(args.projectPath);
|
|
266
|
+
let minecraftArtifactResolved;
|
|
267
|
+
if (workspace.status !== "ok" || gradle.status !== "ok") {
|
|
268
|
+
minecraftArtifactResolved = { status: "skipped" };
|
|
269
|
+
}
|
|
270
|
+
else if (deps.probeMinecraftArtifact ?? deps.resolveArtifact) {
|
|
271
|
+
const artifactProbe = deps.probeMinecraftArtifact ?? deps.resolveArtifact;
|
|
272
|
+
minecraftArtifactResolved = await probeMinecraftArtifactResolved(artifactProbe, {
|
|
273
|
+
version: args.resolvedVersion,
|
|
274
|
+
mapping: args.mapping,
|
|
275
|
+
sourcePriority: args.sourcePriority,
|
|
276
|
+
projectPath: args.projectPath,
|
|
277
|
+
scope: args.scope,
|
|
278
|
+
preferProjectVersion: args.preferProjectVersion
|
|
279
|
+
}, args.stageEmitter);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
minecraftArtifactResolved = { status: "skipped" };
|
|
283
|
+
}
|
|
284
|
+
const upstreamSkip = downstreamSkipReason({
|
|
285
|
+
"workspace.detected": workspace,
|
|
286
|
+
"gradle.readable": gradle,
|
|
287
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved
|
|
288
|
+
}, ["workspace.detected", "gradle.readable", "minecraft.artifact.resolved"]);
|
|
289
|
+
const mixinsValidated = buildValidationEntryWithCounts(upstreamSkip, args.mixinDiscoveryCount, args.mixinCaughtErrors, args.mixinCounts, args.mixinDurationMs);
|
|
290
|
+
const accessWidenersValidated = buildValidationEntryWithCounts(upstreamSkip, args.awDiscoveryCount, args.awCaughtErrors, args.awCounts, args.awDurationMs);
|
|
291
|
+
const accessTransformersValidated = buildValidationEntryWithCounts(upstreamSkip, args.atDiscoveryCount, args.atCaughtErrors, args.atCounts, args.atDurationMs);
|
|
292
|
+
const report = {
|
|
293
|
+
"workspace.detected": workspace,
|
|
294
|
+
"gradle.readable": gradle,
|
|
295
|
+
"loom.cache.found": loom,
|
|
296
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved,
|
|
297
|
+
"mixins.validated": mixinsValidated,
|
|
298
|
+
"accessWideners.validated": accessWidenersValidated,
|
|
299
|
+
"accessTransformers.validated": accessTransformersValidated
|
|
300
|
+
};
|
|
301
|
+
return projectTaskStatusReport(report, args.detail, args.include);
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -1,4 +1,52 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { StageEmitter } from "../stage-emitter.js";
|
|
3
|
+
import type { SourceMapping } from "../types.js";
|
|
4
|
+
import { type ValidateProjectDeps } from "./validate-project/internal.js";
|
|
5
|
+
export type TaskStatus = "ok" | "skipped" | "missing" | "error";
|
|
6
|
+
type TaskEntryBase = {
|
|
7
|
+
status: TaskStatus;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
error?: {
|
|
10
|
+
code: string;
|
|
11
|
+
detail: string;
|
|
12
|
+
};
|
|
13
|
+
warnings?: string[];
|
|
14
|
+
};
|
|
15
|
+
export type TaskStatusReport = {
|
|
16
|
+
"workspace.detected": TaskEntryBase & {
|
|
17
|
+
evidence?: string[];
|
|
18
|
+
};
|
|
19
|
+
"gradle.readable": TaskEntryBase & {
|
|
20
|
+
propertiesPath?: string;
|
|
21
|
+
buildScripts?: string[];
|
|
22
|
+
};
|
|
23
|
+
"loom.cache.found": TaskEntryBase & {
|
|
24
|
+
cachePath?: string;
|
|
25
|
+
};
|
|
26
|
+
"minecraft.artifact.resolved": TaskEntryBase & {
|
|
27
|
+
artifactId?: string;
|
|
28
|
+
mapping?: SourceMapping;
|
|
29
|
+
};
|
|
30
|
+
"mixins.validated": TaskEntryBase & {
|
|
31
|
+
counts?: {
|
|
32
|
+
ok: number;
|
|
33
|
+
partial: number;
|
|
34
|
+
invalid: number;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
"accessWideners.validated": TaskEntryBase & {
|
|
38
|
+
counts?: {
|
|
39
|
+
ok: number;
|
|
40
|
+
invalid: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
"accessTransformers.validated": TaskEntryBase & {
|
|
44
|
+
counts?: {
|
|
45
|
+
ok: number;
|
|
46
|
+
invalid: number;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
2
50
|
export declare const validateProjectShape: {
|
|
3
51
|
task: z.ZodEnum<["project-summary", "mixin", "access-widener", "access-transformer"]>;
|
|
4
52
|
subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
@@ -397,7 +445,7 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
397
445
|
preferProjectMapping: boolean;
|
|
398
446
|
treatInfoAsWarning: boolean;
|
|
399
447
|
includeIssues: boolean;
|
|
400
|
-
task: "mixin" | "
|
|
448
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
401
449
|
subject: {
|
|
402
450
|
kind: "workspace";
|
|
403
451
|
projectPath: string;
|
|
@@ -439,20 +487,20 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
439
487
|
mode: "path";
|
|
440
488
|
};
|
|
441
489
|
};
|
|
442
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
443
490
|
version?: string | undefined;
|
|
444
|
-
|
|
491
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
492
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
445
493
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
446
494
|
sourceRoots?: string[] | undefined;
|
|
447
495
|
preferProjectVersion?: boolean | undefined;
|
|
448
496
|
warningMode?: "full" | "aggregated" | undefined;
|
|
449
497
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
450
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
451
498
|
configPaths?: string[] | undefined;
|
|
499
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
452
500
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
453
501
|
include?: string[] | undefined;
|
|
454
502
|
}, {
|
|
455
|
-
task: "mixin" | "
|
|
503
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
456
504
|
subject: {
|
|
457
505
|
kind: "workspace";
|
|
458
506
|
projectPath: string;
|
|
@@ -494,9 +542,9 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
494
542
|
mode: "path";
|
|
495
543
|
};
|
|
496
544
|
};
|
|
497
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
498
545
|
version?: string | undefined;
|
|
499
|
-
|
|
546
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
547
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
500
548
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
501
549
|
sourceRoots?: string[] | undefined;
|
|
502
550
|
preferProjectVersion?: boolean | undefined;
|
|
@@ -508,8 +556,8 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
508
556
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
509
557
|
treatInfoAsWarning?: boolean | undefined;
|
|
510
558
|
includeIssues?: boolean | undefined;
|
|
511
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
512
559
|
configPaths?: string[] | undefined;
|
|
560
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
513
561
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
514
562
|
include?: string[] | undefined;
|
|
515
563
|
}>, {
|
|
@@ -519,7 +567,7 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
519
567
|
preferProjectMapping: boolean;
|
|
520
568
|
treatInfoAsWarning: boolean;
|
|
521
569
|
includeIssues: boolean;
|
|
522
|
-
task: "mixin" | "
|
|
570
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
523
571
|
subject: {
|
|
524
572
|
kind: "workspace";
|
|
525
573
|
projectPath: string;
|
|
@@ -561,20 +609,20 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
561
609
|
mode: "path";
|
|
562
610
|
};
|
|
563
611
|
};
|
|
564
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
565
612
|
version?: string | undefined;
|
|
566
|
-
|
|
613
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
614
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
567
615
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
568
616
|
sourceRoots?: string[] | undefined;
|
|
569
617
|
preferProjectVersion?: boolean | undefined;
|
|
570
618
|
warningMode?: "full" | "aggregated" | undefined;
|
|
571
619
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
572
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
573
620
|
configPaths?: string[] | undefined;
|
|
621
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
574
622
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
575
623
|
include?: string[] | undefined;
|
|
576
624
|
}, {
|
|
577
|
-
task: "mixin" | "
|
|
625
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
578
626
|
subject: {
|
|
579
627
|
kind: "workspace";
|
|
580
628
|
projectPath: string;
|
|
@@ -616,9 +664,9 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
616
664
|
mode: "path";
|
|
617
665
|
};
|
|
618
666
|
};
|
|
619
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
620
667
|
version?: string | undefined;
|
|
621
|
-
|
|
668
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
669
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
622
670
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
623
671
|
sourceRoots?: string[] | undefined;
|
|
624
672
|
preferProjectVersion?: boolean | undefined;
|
|
@@ -630,42 +678,14 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
630
678
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
631
679
|
treatInfoAsWarning?: boolean | undefined;
|
|
632
680
|
includeIssues?: boolean | undefined;
|
|
633
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
634
681
|
configPaths?: string[] | undefined;
|
|
682
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
635
683
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
636
684
|
include?: string[] | undefined;
|
|
637
685
|
}>;
|
|
638
686
|
export type ValidateProjectInput = z.infer<typeof validateProjectSchema>;
|
|
639
|
-
type
|
|
640
|
-
|
|
641
|
-
warnings?: string[];
|
|
642
|
-
}>;
|
|
643
|
-
validateAccessWidener: (input: {
|
|
644
|
-
content: string;
|
|
645
|
-
version: string;
|
|
646
|
-
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
|
|
647
|
-
sourcePriority?: "loom-first" | "maven-first";
|
|
648
|
-
projectPath?: string;
|
|
649
|
-
scope?: "vanilla" | "merged" | "loader";
|
|
650
|
-
preferProjectVersion?: boolean;
|
|
651
|
-
}) => Promise<Record<string, unknown> & {
|
|
652
|
-
warnings?: string[];
|
|
653
|
-
}>;
|
|
654
|
-
validateAccessTransformer?: (input: {
|
|
655
|
-
content: string;
|
|
656
|
-
version: string;
|
|
657
|
-
atNamespace?: "srg" | "mojang" | "obfuscated";
|
|
658
|
-
sourcePriority?: "loom-first" | "maven-first";
|
|
659
|
-
projectPath?: string;
|
|
660
|
-
scope?: "vanilla" | "merged" | "loader";
|
|
661
|
-
preferProjectVersion?: boolean;
|
|
662
|
-
}) => Promise<Record<string, unknown> & {
|
|
663
|
-
warnings?: string[];
|
|
664
|
-
}>;
|
|
665
|
-
discoverMixins: (projectPath: string, configPaths?: string[]) => Promise<string[]>;
|
|
666
|
-
discoverAccessWideners: (projectPath: string) => Promise<string[]>;
|
|
667
|
-
discoverAccessTransformers?: (projectPath: string) => Promise<string[]>;
|
|
668
|
-
detectProjectMinecraftVersion?: (projectPath: string) => Promise<string | undefined>;
|
|
687
|
+
export type ValidateProjectExecuteOptions = {
|
|
688
|
+
stageEmitter?: StageEmitter;
|
|
669
689
|
};
|
|
670
690
|
export declare function discoverWorkspaceMixins(projectPath: string, configPaths?: string[]): Promise<string[]>;
|
|
671
691
|
export declare function discoverWorkspaceAccessWideners(projectPath: string): Promise<string[]>;
|
|
@@ -673,7 +693,7 @@ export declare function discoverWorkspaceAccessTransformers(projectPath: string)
|
|
|
673
693
|
export declare class ValidateProjectService {
|
|
674
694
|
private readonly deps;
|
|
675
695
|
constructor(deps: ValidateProjectDeps);
|
|
676
|
-
execute(input: ValidateProjectInput): Promise<Record<string, unknown> & {
|
|
696
|
+
execute(input: ValidateProjectInput, options?: ValidateProjectExecuteOptions): Promise<Record<string, unknown> & {
|
|
677
697
|
warnings?: string[];
|
|
678
698
|
}>;
|
|
679
699
|
}
|