@adhisang/minecraft-modding-mcp 4.0.0 → 4.1.0
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 +47 -0
- package/README.md +36 -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 +97 -0
- package/dist/entry-tools/validate-project/cases/project-summary.js +346 -0
- package/dist/entry-tools/validate-project/internal.d.ts +135 -0
- package/dist/entry-tools/validate-project/internal.js +287 -0
- package/dist/entry-tools/validate-project-service.d.ts +63 -47
- package/dist/entry-tools/validate-project-service.js +12 -562
- 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 +142 -1352
- 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 +3 -144
- package/dist/mapping-service.js +19 -1201
- 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 +110 -0
- package/dist/source/artifact-resolver.js +1174 -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 +505 -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 +21 -0
- package/dist/source/state.js +19 -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-service.d.ts +147 -170
- package/dist/source-service.js +67 -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 +414 -0
- package/docs/examples.md +483 -0
- package/docs/tool-reference.md +459 -0
- package/package.json +3 -2
|
@@ -0,0 +1,287 @@
|
|
|
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(resolveArtifact, args) {
|
|
130
|
+
const startedAt = Date.now();
|
|
131
|
+
try {
|
|
132
|
+
const output = await resolveArtifact({
|
|
133
|
+
target: { kind: "version", value: args.version },
|
|
134
|
+
mapping: args.mapping,
|
|
135
|
+
sourcePriority: args.sourcePriority,
|
|
136
|
+
projectPath: args.projectPath,
|
|
137
|
+
scope: args.scope,
|
|
138
|
+
preferProjectVersion: args.preferProjectVersion
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
status: "ok",
|
|
142
|
+
durationMs: Date.now() - startedAt,
|
|
143
|
+
artifactId: output.artifactId,
|
|
144
|
+
mapping: output.mappingApplied,
|
|
145
|
+
...(Array.isArray(output.warnings) && output.warnings.length > 0
|
|
146
|
+
? { warnings: output.warnings }
|
|
147
|
+
: {})
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
return {
|
|
152
|
+
status: "error",
|
|
153
|
+
durationMs: Date.now() - startedAt,
|
|
154
|
+
error: {
|
|
155
|
+
code: isAppError(error) ? error.code : "ERR_ARTIFACT_PROBE_FAILED",
|
|
156
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function downstreamSkipReason(report, upstream) {
|
|
162
|
+
for (const key of upstream) {
|
|
163
|
+
const entry = report[key];
|
|
164
|
+
if (entry.status !== "ok") {
|
|
165
|
+
return { status: "skipped" };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
function buildValidationEntryWithCounts(upstream, discoveredCount, errorCount, counts, durationMs) {
|
|
171
|
+
if (upstream) {
|
|
172
|
+
return upstream;
|
|
173
|
+
}
|
|
174
|
+
if (discoveredCount === 0) {
|
|
175
|
+
return { status: "missing", durationMs };
|
|
176
|
+
}
|
|
177
|
+
if (errorCount > 0) {
|
|
178
|
+
return { status: "error", durationMs, counts };
|
|
179
|
+
}
|
|
180
|
+
return { status: "ok", durationMs, counts };
|
|
181
|
+
}
|
|
182
|
+
function projectTaskEntry(entry, detail, include) {
|
|
183
|
+
const fullDetail = detail !== "summary" && include.includes("workspace");
|
|
184
|
+
if (fullDetail) {
|
|
185
|
+
return entry;
|
|
186
|
+
}
|
|
187
|
+
const slim = { status: entry.status };
|
|
188
|
+
if (entry.error) {
|
|
189
|
+
slim.error = entry.error;
|
|
190
|
+
}
|
|
191
|
+
if (entry.warnings && entry.warnings.length > 0) {
|
|
192
|
+
slim.warnings = entry.warnings;
|
|
193
|
+
}
|
|
194
|
+
return slim;
|
|
195
|
+
}
|
|
196
|
+
function projectTaskStatusReport(report, detail, include) {
|
|
197
|
+
const projected = {};
|
|
198
|
+
for (const key of TASK_KEYS) {
|
|
199
|
+
projected[key] = projectTaskEntry(report[key], detail, include);
|
|
200
|
+
}
|
|
201
|
+
return projected;
|
|
202
|
+
}
|
|
203
|
+
export async function runUpstreamProbes(projectPath) {
|
|
204
|
+
const workspace = await probeWorkspaceDetected(projectPath);
|
|
205
|
+
const loom = await probeLoomCacheFound(projectPath);
|
|
206
|
+
let gradle;
|
|
207
|
+
if (workspace.status !== "ok") {
|
|
208
|
+
gradle = { status: "skipped" };
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
gradle = await probeGradleReadable(projectPath);
|
|
212
|
+
}
|
|
213
|
+
return { workspace, gradle, loom };
|
|
214
|
+
}
|
|
215
|
+
export async function buildEarlyTasksForBlocked(projectPath, detail, include, discovery) {
|
|
216
|
+
if (VALIDATE_PROJECT_TASKS_OFF) {
|
|
217
|
+
return undefined;
|
|
218
|
+
}
|
|
219
|
+
const { workspace, gradle, loom } = await runUpstreamProbes(projectPath);
|
|
220
|
+
const minecraftArtifactResolved = {
|
|
221
|
+
status: "skipped"
|
|
222
|
+
};
|
|
223
|
+
const validatedSkipped = { status: "skipped" };
|
|
224
|
+
const buildValidatorEntry = (discoveredCount) => {
|
|
225
|
+
if (workspace.status !== "ok" || gradle.status !== "ok") {
|
|
226
|
+
return validatedSkipped;
|
|
227
|
+
}
|
|
228
|
+
if (minecraftArtifactResolved.status !== "ok") {
|
|
229
|
+
return validatedSkipped;
|
|
230
|
+
}
|
|
231
|
+
return discoveredCount === 0 || discoveredCount === undefined
|
|
232
|
+
? { status: "missing" }
|
|
233
|
+
: validatedSkipped;
|
|
234
|
+
};
|
|
235
|
+
const report = {
|
|
236
|
+
"workspace.detected": workspace,
|
|
237
|
+
"gradle.readable": gradle,
|
|
238
|
+
"loom.cache.found": loom,
|
|
239
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved,
|
|
240
|
+
"mixins.validated": buildValidatorEntry(discovery?.mixinDiscoveryCount),
|
|
241
|
+
"accessWideners.validated": buildValidatorEntry(discovery?.awDiscoveryCount),
|
|
242
|
+
"accessTransformers.validated": buildValidatorEntry(discovery?.atDiscoveryCount)
|
|
243
|
+
};
|
|
244
|
+
return projectTaskStatusReport(report, detail, include);
|
|
245
|
+
}
|
|
246
|
+
export async function buildFullTaskStatusReport(deps, args) {
|
|
247
|
+
if (VALIDATE_PROJECT_TASKS_OFF) {
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
const { workspace, gradle, loom } = await runUpstreamProbes(args.projectPath);
|
|
251
|
+
let minecraftArtifactResolved;
|
|
252
|
+
if (workspace.status !== "ok" || gradle.status !== "ok") {
|
|
253
|
+
minecraftArtifactResolved = { status: "skipped" };
|
|
254
|
+
}
|
|
255
|
+
else if (deps.resolveArtifact) {
|
|
256
|
+
minecraftArtifactResolved = await probeMinecraftArtifactResolved(deps.resolveArtifact, {
|
|
257
|
+
version: args.resolvedVersion,
|
|
258
|
+
mapping: args.mapping,
|
|
259
|
+
sourcePriority: args.sourcePriority,
|
|
260
|
+
projectPath: args.projectPath,
|
|
261
|
+
scope: args.scope,
|
|
262
|
+
preferProjectVersion: args.preferProjectVersion
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
minecraftArtifactResolved = { status: "skipped" };
|
|
267
|
+
}
|
|
268
|
+
const upstreamSkip = downstreamSkipReason({
|
|
269
|
+
"workspace.detected": workspace,
|
|
270
|
+
"gradle.readable": gradle,
|
|
271
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved
|
|
272
|
+
}, ["workspace.detected", "gradle.readable", "minecraft.artifact.resolved"]);
|
|
273
|
+
const mixinsValidated = buildValidationEntryWithCounts(upstreamSkip, args.mixinDiscoveryCount, args.mixinCaughtErrors, args.mixinCounts, args.mixinDurationMs);
|
|
274
|
+
const accessWidenersValidated = buildValidationEntryWithCounts(upstreamSkip, args.awDiscoveryCount, args.awCaughtErrors, args.awCounts, args.awDurationMs);
|
|
275
|
+
const accessTransformersValidated = buildValidationEntryWithCounts(upstreamSkip, args.atDiscoveryCount, args.atCaughtErrors, args.atCounts, args.atDurationMs);
|
|
276
|
+
const report = {
|
|
277
|
+
"workspace.detected": workspace,
|
|
278
|
+
"gradle.readable": gradle,
|
|
279
|
+
"loom.cache.found": loom,
|
|
280
|
+
"minecraft.artifact.resolved": minecraftArtifactResolved,
|
|
281
|
+
"mixins.validated": mixinsValidated,
|
|
282
|
+
"accessWideners.validated": accessWidenersValidated,
|
|
283
|
+
"accessTransformers.validated": accessTransformersValidated
|
|
284
|
+
};
|
|
285
|
+
return projectTaskStatusReport(report, args.detail, args.include);
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -1,4 +1,51 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { SourceMapping } from "../types.js";
|
|
3
|
+
import { type ValidateProjectDeps } from "./validate-project/internal.js";
|
|
4
|
+
export type TaskStatus = "ok" | "skipped" | "missing" | "error";
|
|
5
|
+
type TaskEntryBase = {
|
|
6
|
+
status: TaskStatus;
|
|
7
|
+
durationMs?: number;
|
|
8
|
+
error?: {
|
|
9
|
+
code: string;
|
|
10
|
+
detail: string;
|
|
11
|
+
};
|
|
12
|
+
warnings?: string[];
|
|
13
|
+
};
|
|
14
|
+
export type TaskStatusReport = {
|
|
15
|
+
"workspace.detected": TaskEntryBase & {
|
|
16
|
+
evidence?: string[];
|
|
17
|
+
};
|
|
18
|
+
"gradle.readable": TaskEntryBase & {
|
|
19
|
+
propertiesPath?: string;
|
|
20
|
+
buildScripts?: string[];
|
|
21
|
+
};
|
|
22
|
+
"loom.cache.found": TaskEntryBase & {
|
|
23
|
+
cachePath?: string;
|
|
24
|
+
};
|
|
25
|
+
"minecraft.artifact.resolved": TaskEntryBase & {
|
|
26
|
+
artifactId?: string;
|
|
27
|
+
mapping?: SourceMapping;
|
|
28
|
+
};
|
|
29
|
+
"mixins.validated": TaskEntryBase & {
|
|
30
|
+
counts?: {
|
|
31
|
+
ok: number;
|
|
32
|
+
partial: number;
|
|
33
|
+
invalid: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
"accessWideners.validated": TaskEntryBase & {
|
|
37
|
+
counts?: {
|
|
38
|
+
ok: number;
|
|
39
|
+
invalid: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
"accessTransformers.validated": TaskEntryBase & {
|
|
43
|
+
counts?: {
|
|
44
|
+
ok: number;
|
|
45
|
+
invalid: number;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
2
49
|
export declare const validateProjectShape: {
|
|
3
50
|
task: z.ZodEnum<["project-summary", "mixin", "access-widener", "access-transformer"]>;
|
|
4
51
|
subject: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
@@ -397,7 +444,7 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
397
444
|
preferProjectMapping: boolean;
|
|
398
445
|
treatInfoAsWarning: boolean;
|
|
399
446
|
includeIssues: boolean;
|
|
400
|
-
task: "mixin" | "
|
|
447
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
401
448
|
subject: {
|
|
402
449
|
kind: "workspace";
|
|
403
450
|
projectPath: string;
|
|
@@ -439,20 +486,20 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
439
486
|
mode: "path";
|
|
440
487
|
};
|
|
441
488
|
};
|
|
442
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
443
489
|
version?: string | undefined;
|
|
444
|
-
|
|
490
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
491
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
445
492
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
446
493
|
sourceRoots?: string[] | undefined;
|
|
447
494
|
preferProjectVersion?: boolean | undefined;
|
|
448
495
|
warningMode?: "full" | "aggregated" | undefined;
|
|
449
496
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
450
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
451
497
|
configPaths?: string[] | undefined;
|
|
498
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
452
499
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
453
500
|
include?: string[] | undefined;
|
|
454
501
|
}, {
|
|
455
|
-
task: "mixin" | "
|
|
502
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
456
503
|
subject: {
|
|
457
504
|
kind: "workspace";
|
|
458
505
|
projectPath: string;
|
|
@@ -494,9 +541,9 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
494
541
|
mode: "path";
|
|
495
542
|
};
|
|
496
543
|
};
|
|
497
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
498
544
|
version?: string | undefined;
|
|
499
|
-
|
|
545
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
546
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
500
547
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
501
548
|
sourceRoots?: string[] | undefined;
|
|
502
549
|
preferProjectVersion?: boolean | undefined;
|
|
@@ -508,8 +555,8 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
508
555
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
509
556
|
treatInfoAsWarning?: boolean | undefined;
|
|
510
557
|
includeIssues?: boolean | undefined;
|
|
511
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
512
558
|
configPaths?: string[] | undefined;
|
|
559
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
513
560
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
514
561
|
include?: string[] | undefined;
|
|
515
562
|
}>, {
|
|
@@ -519,7 +566,7 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
519
566
|
preferProjectMapping: boolean;
|
|
520
567
|
treatInfoAsWarning: boolean;
|
|
521
568
|
includeIssues: boolean;
|
|
522
|
-
task: "mixin" | "
|
|
569
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
523
570
|
subject: {
|
|
524
571
|
kind: "workspace";
|
|
525
572
|
projectPath: string;
|
|
@@ -561,20 +608,20 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
561
608
|
mode: "path";
|
|
562
609
|
};
|
|
563
610
|
};
|
|
564
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
565
611
|
version?: string | undefined;
|
|
566
|
-
|
|
612
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
613
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
567
614
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
568
615
|
sourceRoots?: string[] | undefined;
|
|
569
616
|
preferProjectVersion?: boolean | undefined;
|
|
570
617
|
warningMode?: "full" | "aggregated" | undefined;
|
|
571
618
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
572
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
573
619
|
configPaths?: string[] | undefined;
|
|
620
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
574
621
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
575
622
|
include?: string[] | undefined;
|
|
576
623
|
}, {
|
|
577
|
-
task: "mixin" | "
|
|
624
|
+
task: "mixin" | "project-summary" | "access-widener" | "access-transformer";
|
|
578
625
|
subject: {
|
|
579
626
|
kind: "workspace";
|
|
580
627
|
projectPath: string;
|
|
@@ -616,9 +663,9 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
616
663
|
mode: "path";
|
|
617
664
|
};
|
|
618
665
|
};
|
|
619
|
-
mapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
620
666
|
version?: string | undefined;
|
|
621
|
-
|
|
667
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
|
|
668
|
+
scope?: "vanilla" | "merged" | "loader" | undefined;
|
|
622
669
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
623
670
|
sourceRoots?: string[] | undefined;
|
|
624
671
|
preferProjectVersion?: boolean | undefined;
|
|
@@ -630,43 +677,12 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
630
677
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
631
678
|
treatInfoAsWarning?: boolean | undefined;
|
|
632
679
|
includeIssues?: boolean | undefined;
|
|
633
|
-
atNamespace?: "mojang" | "obfuscated" | "srg" | undefined;
|
|
634
680
|
configPaths?: string[] | undefined;
|
|
681
|
+
atNamespace?: "obfuscated" | "mojang" | "srg" | undefined;
|
|
635
682
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
636
683
|
include?: string[] | undefined;
|
|
637
684
|
}>;
|
|
638
685
|
export type ValidateProjectInput = z.infer<typeof validateProjectSchema>;
|
|
639
|
-
type ValidateProjectDeps = {
|
|
640
|
-
validateMixin: (input: Record<string, unknown>) => Promise<Record<string, unknown> & {
|
|
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>;
|
|
669
|
-
};
|
|
670
686
|
export declare function discoverWorkspaceMixins(projectPath: string, configPaths?: string[]): Promise<string[]>;
|
|
671
687
|
export declare function discoverWorkspaceAccessWideners(projectPath: string): Promise<string[]>;
|
|
672
688
|
export declare function discoverWorkspaceAccessTransformers(projectPath: string): Promise<string[]>;
|