@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,346 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { buildEntryToolResult, createSummarySubject } from "../../response-contract.js";
|
|
3
|
+
import { ERROR_CODES, createError } from "../../../errors.js";
|
|
4
|
+
import { buildEarlyTasksForBlocked, buildFullTaskStatusReport } from "../internal.js";
|
|
5
|
+
export async function handleProjectSummary(deps, input, detail, include) {
|
|
6
|
+
if (input.subject.kind !== "workspace") {
|
|
7
|
+
throw createError({
|
|
8
|
+
code: ERROR_CODES.INVALID_INPUT,
|
|
9
|
+
message: "task=project-summary requires subject.kind=workspace."
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
if (!input.version && !input.preferProjectVersion) {
|
|
13
|
+
const baseResult = buildEntryToolResult({
|
|
14
|
+
task: "project-summary",
|
|
15
|
+
detail,
|
|
16
|
+
include,
|
|
17
|
+
summary: {
|
|
18
|
+
status: "blocked",
|
|
19
|
+
headline: "project-summary requires version or preferProjectVersion=true.",
|
|
20
|
+
subject: createSummarySubject({
|
|
21
|
+
task: "project-summary",
|
|
22
|
+
kind: input.subject.kind,
|
|
23
|
+
projectPath: input.subject.projectPath,
|
|
24
|
+
discover: input.subject.discover
|
|
25
|
+
}),
|
|
26
|
+
nextActions: [
|
|
27
|
+
{
|
|
28
|
+
tool: "validate-project",
|
|
29
|
+
params: {
|
|
30
|
+
task: "project-summary",
|
|
31
|
+
subject: input.subject
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
notes: [
|
|
36
|
+
"Pass version explicitly, or retry with preferProjectVersion=true when gradle.properties declares the Minecraft version."
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
blocks: {
|
|
40
|
+
workspace: {
|
|
41
|
+
projectPath: input.subject.projectPath
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const tasks = await buildEarlyTasksForBlocked(input.subject.projectPath, detail, include);
|
|
46
|
+
return {
|
|
47
|
+
...baseResult,
|
|
48
|
+
...(tasks ? { tasks } : {}),
|
|
49
|
+
warnings: []
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const projectPath = input.subject.projectPath;
|
|
53
|
+
const detectedProjectVersion = input.preferProjectVersion
|
|
54
|
+
? await deps.detectProjectMinecraftVersion?.(projectPath)
|
|
55
|
+
: undefined;
|
|
56
|
+
const resolvedVersion = detectedProjectVersion ?? input.version;
|
|
57
|
+
const discover = input.subject.discover ?? ["mixins", "access-wideners"];
|
|
58
|
+
const [mixinConfigs, accessWideners, accessTransformers] = await Promise.all([
|
|
59
|
+
discover.includes("mixins")
|
|
60
|
+
? deps.discoverMixins(projectPath, input.configPaths)
|
|
61
|
+
: Promise.resolve([]),
|
|
62
|
+
discover.includes("access-wideners")
|
|
63
|
+
? deps.discoverAccessWideners(projectPath)
|
|
64
|
+
: Promise.resolve([]),
|
|
65
|
+
discover.includes("access-transformers")
|
|
66
|
+
? deps.discoverAccessTransformers?.(projectPath) ?? Promise.resolve([])
|
|
67
|
+
: Promise.resolve([])
|
|
68
|
+
]);
|
|
69
|
+
if (!resolvedVersion && (mixinConfigs.length > 0 || accessWideners.length > 0 || accessTransformers.length > 0)) {
|
|
70
|
+
const baseResult = buildEntryToolResult({
|
|
71
|
+
task: "project-summary",
|
|
72
|
+
detail,
|
|
73
|
+
include,
|
|
74
|
+
summary: {
|
|
75
|
+
status: "blocked",
|
|
76
|
+
headline: "Could not resolve Minecraft version for discovered workspace validators.",
|
|
77
|
+
subject: createSummarySubject({
|
|
78
|
+
task: "project-summary",
|
|
79
|
+
kind: input.subject.kind,
|
|
80
|
+
projectPath,
|
|
81
|
+
discover: input.subject.discover,
|
|
82
|
+
mapping: input.mapping,
|
|
83
|
+
sourcePriority: input.sourcePriority,
|
|
84
|
+
scope: input.scope
|
|
85
|
+
}),
|
|
86
|
+
nextActions: [
|
|
87
|
+
{
|
|
88
|
+
tool: "validate-project",
|
|
89
|
+
params: {
|
|
90
|
+
task: "project-summary",
|
|
91
|
+
subject: input.subject
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
notes: [
|
|
96
|
+
"Pass version explicitly, or make sure gradle.properties declares the Minecraft version before using preferProjectVersion=true."
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
blocks: {
|
|
100
|
+
workspace: {
|
|
101
|
+
projectPath
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const tasks = await buildEarlyTasksForBlocked(projectPath, detail, include, {
|
|
106
|
+
mixinDiscoveryCount: mixinConfigs.length,
|
|
107
|
+
awDiscoveryCount: accessWideners.length,
|
|
108
|
+
atDiscoveryCount: accessTransformers.length
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
...baseResult,
|
|
112
|
+
...(tasks ? { tasks } : {}),
|
|
113
|
+
warnings: [
|
|
114
|
+
"Could not resolve Minecraft version from gradle.properties for discovered workspace validators."
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (!resolvedVersion) {
|
|
119
|
+
const baseResult = buildEntryToolResult({
|
|
120
|
+
task: "project-summary",
|
|
121
|
+
detail,
|
|
122
|
+
include,
|
|
123
|
+
summary: {
|
|
124
|
+
status: "ok",
|
|
125
|
+
headline: `Validated ${mixinConfigs.length} mixin config(s), ${accessWideners.length} access widener(s), and ${accessTransformers.length} access transformer(s).`,
|
|
126
|
+
subject: createSummarySubject({
|
|
127
|
+
task: "project-summary",
|
|
128
|
+
kind: input.subject.kind,
|
|
129
|
+
projectPath,
|
|
130
|
+
discover: input.subject.discover,
|
|
131
|
+
mapping: input.mapping,
|
|
132
|
+
sourcePriority: input.sourcePriority,
|
|
133
|
+
scope: input.scope
|
|
134
|
+
}),
|
|
135
|
+
counts: {
|
|
136
|
+
valid: 0,
|
|
137
|
+
partial: 0,
|
|
138
|
+
invalid: 0
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
blocks: {
|
|
142
|
+
workspace: {
|
|
143
|
+
projectPath
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
const tasks = await buildEarlyTasksForBlocked(projectPath, detail, include);
|
|
148
|
+
return {
|
|
149
|
+
...baseResult,
|
|
150
|
+
...(tasks ? { tasks } : {}),
|
|
151
|
+
warnings: []
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const validationVersion = resolvedVersion;
|
|
155
|
+
const warnings = [];
|
|
156
|
+
const mixinDurationStart = Date.now();
|
|
157
|
+
let validMixins = 0;
|
|
158
|
+
let partialMixins = 0;
|
|
159
|
+
let invalidMixins = 0;
|
|
160
|
+
let mixinCaughtErrors = 0;
|
|
161
|
+
for (const configPath of mixinConfigs) {
|
|
162
|
+
try {
|
|
163
|
+
const mixinResult = await deps.validateMixin({
|
|
164
|
+
input: {
|
|
165
|
+
mode: "config",
|
|
166
|
+
configPaths: [configPath]
|
|
167
|
+
},
|
|
168
|
+
version: validationVersion,
|
|
169
|
+
mapping: input.mapping,
|
|
170
|
+
sourcePriority: input.sourcePriority,
|
|
171
|
+
scope: input.scope,
|
|
172
|
+
projectPath,
|
|
173
|
+
preferProjectVersion: false,
|
|
174
|
+
preferProjectMapping: input.preferProjectMapping,
|
|
175
|
+
sourceRoots: input.sourceRoots,
|
|
176
|
+
minSeverity: input.minSeverity,
|
|
177
|
+
hideUncertain: input.hideUncertain,
|
|
178
|
+
explain: input.explain,
|
|
179
|
+
warningMode: input.warningMode,
|
|
180
|
+
warningCategoryFilter: input.warningCategoryFilter,
|
|
181
|
+
treatInfoAsWarning: input.treatInfoAsWarning,
|
|
182
|
+
includeIssues: input.includeIssues
|
|
183
|
+
});
|
|
184
|
+
const summary = mixinResult.summary;
|
|
185
|
+
validMixins += summary?.valid ?? 0;
|
|
186
|
+
partialMixins += summary?.partial ?? 0;
|
|
187
|
+
invalidMixins += summary?.invalid ?? 0;
|
|
188
|
+
if (Array.isArray(mixinResult.warnings)) {
|
|
189
|
+
warnings.push(...mixinResult.warnings);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
invalidMixins += 1;
|
|
194
|
+
mixinCaughtErrors += 1;
|
|
195
|
+
if (error instanceof Error) {
|
|
196
|
+
warnings.push(`${configPath}: ${error.message}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const mixinDurationMs = Date.now() - mixinDurationStart;
|
|
201
|
+
const awDurationStart = Date.now();
|
|
202
|
+
let validAw = 0;
|
|
203
|
+
let invalidAw = 0;
|
|
204
|
+
let awCaughtErrors = 0;
|
|
205
|
+
for (const awPath of accessWideners) {
|
|
206
|
+
try {
|
|
207
|
+
const output = await deps.validateAccessWidener({
|
|
208
|
+
content: await readFile(awPath, "utf8"),
|
|
209
|
+
version: validationVersion,
|
|
210
|
+
mapping: input.mapping,
|
|
211
|
+
sourcePriority: input.sourcePriority,
|
|
212
|
+
projectPath,
|
|
213
|
+
scope: input.scope,
|
|
214
|
+
preferProjectVersion: input.preferProjectVersion
|
|
215
|
+
});
|
|
216
|
+
if (output.valid) {
|
|
217
|
+
validAw += 1;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
invalidAw += 1;
|
|
221
|
+
}
|
|
222
|
+
if (Array.isArray(output.warnings)) {
|
|
223
|
+
warnings.push(...output.warnings);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
invalidAw += 1;
|
|
228
|
+
awCaughtErrors += 1;
|
|
229
|
+
if (error instanceof Error) {
|
|
230
|
+
warnings.push(error.message);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const awDurationMs = Date.now() - awDurationStart;
|
|
235
|
+
const atDurationStart = Date.now();
|
|
236
|
+
let validAt = 0;
|
|
237
|
+
let invalidAt = 0;
|
|
238
|
+
let atCaughtErrors = 0;
|
|
239
|
+
for (const atPath of accessTransformers) {
|
|
240
|
+
try {
|
|
241
|
+
if (!deps.validateAccessTransformer) {
|
|
242
|
+
throw createError({
|
|
243
|
+
code: ERROR_CODES.CONTEXT_UNRESOLVED,
|
|
244
|
+
message: "Access Transformer validation is not configured."
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
const output = await deps.validateAccessTransformer({
|
|
248
|
+
content: await readFile(atPath, "utf8"),
|
|
249
|
+
version: validationVersion,
|
|
250
|
+
atNamespace: input.atNamespace,
|
|
251
|
+
sourcePriority: input.sourcePriority,
|
|
252
|
+
projectPath,
|
|
253
|
+
scope: input.scope,
|
|
254
|
+
preferProjectVersion: input.preferProjectVersion
|
|
255
|
+
});
|
|
256
|
+
if (output.valid) {
|
|
257
|
+
validAt += 1;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
invalidAt += 1;
|
|
261
|
+
}
|
|
262
|
+
if (Array.isArray(output.warnings)) {
|
|
263
|
+
warnings.push(...output.warnings);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
invalidAt += 1;
|
|
268
|
+
atCaughtErrors += 1;
|
|
269
|
+
if (error instanceof Error) {
|
|
270
|
+
warnings.push(error.message);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const atDurationMs = Date.now() - atDurationStart;
|
|
275
|
+
const invalidCount = invalidMixins + invalidAw + invalidAt;
|
|
276
|
+
const partialCount = partialMixins;
|
|
277
|
+
const status = invalidCount > 0 ? "invalid" : partialCount > 0 ? "partial" : "ok";
|
|
278
|
+
const baseResult = buildEntryToolResult({
|
|
279
|
+
task: "project-summary",
|
|
280
|
+
detail,
|
|
281
|
+
include,
|
|
282
|
+
summary: {
|
|
283
|
+
status,
|
|
284
|
+
headline: `Validated ${mixinConfigs.length} mixin config(s), ${accessWideners.length} access widener(s), and ${accessTransformers.length} access transformer(s).`,
|
|
285
|
+
subject: createSummarySubject({
|
|
286
|
+
task: "project-summary",
|
|
287
|
+
kind: input.subject.kind,
|
|
288
|
+
projectPath,
|
|
289
|
+
discover: input.subject.discover,
|
|
290
|
+
version: resolvedVersion,
|
|
291
|
+
mapping: input.mapping,
|
|
292
|
+
sourcePriority: input.sourcePriority,
|
|
293
|
+
scope: input.scope
|
|
294
|
+
}),
|
|
295
|
+
counts: {
|
|
296
|
+
valid: validMixins + validAw + validAt,
|
|
297
|
+
partial: partialCount,
|
|
298
|
+
invalid: invalidCount
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
blocks: {
|
|
302
|
+
project: {
|
|
303
|
+
summary: {
|
|
304
|
+
valid: validMixins + validAw + validAt,
|
|
305
|
+
partial: partialCount,
|
|
306
|
+
invalid: invalidCount
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
workspace: {
|
|
310
|
+
projectPath,
|
|
311
|
+
mixinConfigs,
|
|
312
|
+
accessWideners,
|
|
313
|
+
accessTransformers
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
alwaysBlocks: ["project"]
|
|
317
|
+
});
|
|
318
|
+
const tasks = await buildFullTaskStatusReport(deps, {
|
|
319
|
+
projectPath,
|
|
320
|
+
detail,
|
|
321
|
+
include,
|
|
322
|
+
resolvedVersion: validationVersion,
|
|
323
|
+
mapping: input.mapping,
|
|
324
|
+
sourcePriority: input.sourcePriority,
|
|
325
|
+
scope: input.scope,
|
|
326
|
+
preferProjectVersion: input.preferProjectVersion,
|
|
327
|
+
mixinDiscoveryCount: mixinConfigs.length,
|
|
328
|
+
mixinCaughtErrors,
|
|
329
|
+
mixinCounts: { ok: validMixins, partial: partialMixins, invalid: invalidMixins },
|
|
330
|
+
mixinDurationMs,
|
|
331
|
+
awDiscoveryCount: accessWideners.length,
|
|
332
|
+
awCaughtErrors,
|
|
333
|
+
awCounts: { ok: validAw, invalid: invalidAw },
|
|
334
|
+
awDurationMs,
|
|
335
|
+
atDiscoveryCount: accessTransformers.length,
|
|
336
|
+
atCaughtErrors,
|
|
337
|
+
atCounts: { ok: validAt, invalid: invalidAt },
|
|
338
|
+
atDurationMs
|
|
339
|
+
});
|
|
340
|
+
return {
|
|
341
|
+
...baseResult,
|
|
342
|
+
...(tasks ? { tasks } : {}),
|
|
343
|
+
warnings
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=project-summary.js.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { SourceMapping } from "../../types.js";
|
|
2
|
+
type TaskStatus = "ok" | "skipped" | "missing" | "error";
|
|
3
|
+
type TaskEntryBase = {
|
|
4
|
+
status: TaskStatus;
|
|
5
|
+
durationMs?: number;
|
|
6
|
+
error?: {
|
|
7
|
+
code: string;
|
|
8
|
+
detail: string;
|
|
9
|
+
};
|
|
10
|
+
warnings?: string[];
|
|
11
|
+
};
|
|
12
|
+
type TaskStatusReport = {
|
|
13
|
+
"workspace.detected": TaskEntryBase & {
|
|
14
|
+
evidence?: string[];
|
|
15
|
+
};
|
|
16
|
+
"gradle.readable": TaskEntryBase & {
|
|
17
|
+
propertiesPath?: string;
|
|
18
|
+
buildScripts?: string[];
|
|
19
|
+
};
|
|
20
|
+
"loom.cache.found": TaskEntryBase & {
|
|
21
|
+
cachePath?: string;
|
|
22
|
+
};
|
|
23
|
+
"minecraft.artifact.resolved": TaskEntryBase & {
|
|
24
|
+
artifactId?: string;
|
|
25
|
+
mapping?: SourceMapping;
|
|
26
|
+
};
|
|
27
|
+
"mixins.validated": TaskEntryBase & {
|
|
28
|
+
counts?: {
|
|
29
|
+
ok: number;
|
|
30
|
+
partial: number;
|
|
31
|
+
invalid: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
"accessWideners.validated": TaskEntryBase & {
|
|
35
|
+
counts?: {
|
|
36
|
+
ok: number;
|
|
37
|
+
invalid: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
"accessTransformers.validated": TaskEntryBase & {
|
|
41
|
+
counts?: {
|
|
42
|
+
ok: number;
|
|
43
|
+
invalid: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export type ValidateProjectDeps = {
|
|
48
|
+
validateMixin: (input: Record<string, unknown>) => Promise<Record<string, unknown> & {
|
|
49
|
+
warnings?: string[];
|
|
50
|
+
}>;
|
|
51
|
+
validateAccessWidener: (input: {
|
|
52
|
+
content: string;
|
|
53
|
+
version: string;
|
|
54
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
|
|
55
|
+
sourcePriority?: "loom-first" | "maven-first";
|
|
56
|
+
projectPath?: string;
|
|
57
|
+
scope?: "vanilla" | "merged" | "loader";
|
|
58
|
+
preferProjectVersion?: boolean;
|
|
59
|
+
}) => Promise<Record<string, unknown> & {
|
|
60
|
+
warnings?: string[];
|
|
61
|
+
}>;
|
|
62
|
+
validateAccessTransformer?: (input: {
|
|
63
|
+
content: string;
|
|
64
|
+
version: string;
|
|
65
|
+
atNamespace?: "srg" | "mojang" | "obfuscated";
|
|
66
|
+
sourcePriority?: "loom-first" | "maven-first";
|
|
67
|
+
projectPath?: string;
|
|
68
|
+
scope?: "vanilla" | "merged" | "loader";
|
|
69
|
+
preferProjectVersion?: boolean;
|
|
70
|
+
}) => Promise<Record<string, unknown> & {
|
|
71
|
+
warnings?: string[];
|
|
72
|
+
}>;
|
|
73
|
+
discoverMixins: (projectPath: string, configPaths?: string[]) => Promise<string[]>;
|
|
74
|
+
discoverAccessWideners: (projectPath: string) => Promise<string[]>;
|
|
75
|
+
discoverAccessTransformers?: (projectPath: string) => Promise<string[]>;
|
|
76
|
+
detectProjectMinecraftVersion?: (projectPath: string) => Promise<string | undefined>;
|
|
77
|
+
resolveArtifact?: (input: {
|
|
78
|
+
target: {
|
|
79
|
+
kind: "version";
|
|
80
|
+
value: string;
|
|
81
|
+
};
|
|
82
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
|
|
83
|
+
sourcePriority?: "loom-first" | "maven-first";
|
|
84
|
+
projectPath?: string;
|
|
85
|
+
scope?: "vanilla" | "merged" | "loader";
|
|
86
|
+
preferProjectVersion?: boolean;
|
|
87
|
+
}) => Promise<{
|
|
88
|
+
artifactId: string;
|
|
89
|
+
mappingApplied: SourceMapping;
|
|
90
|
+
warnings?: string[];
|
|
91
|
+
}>;
|
|
92
|
+
};
|
|
93
|
+
export declare function runUpstreamProbes(projectPath: string): Promise<{
|
|
94
|
+
workspace: TaskStatusReport["workspace.detected"];
|
|
95
|
+
gradle: TaskStatusReport["gradle.readable"];
|
|
96
|
+
loom: TaskStatusReport["loom.cache.found"];
|
|
97
|
+
}>;
|
|
98
|
+
export declare function buildEarlyTasksForBlocked(projectPath: string, detail: "summary" | "standard" | "full", include: string[], discovery?: {
|
|
99
|
+
mixinDiscoveryCount: number;
|
|
100
|
+
awDiscoveryCount: number;
|
|
101
|
+
atDiscoveryCount: number;
|
|
102
|
+
}): Promise<TaskStatusReport | undefined>;
|
|
103
|
+
export declare function buildFullTaskStatusReport(deps: ValidateProjectDeps, args: {
|
|
104
|
+
projectPath: string;
|
|
105
|
+
detail: "summary" | "standard" | "full";
|
|
106
|
+
include: string[];
|
|
107
|
+
resolvedVersion: string;
|
|
108
|
+
mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
|
|
109
|
+
sourcePriority?: "loom-first" | "maven-first";
|
|
110
|
+
scope?: "vanilla" | "merged" | "loader";
|
|
111
|
+
preferProjectVersion?: boolean;
|
|
112
|
+
mixinDiscoveryCount: number;
|
|
113
|
+
mixinCaughtErrors: number;
|
|
114
|
+
mixinCounts: {
|
|
115
|
+
ok: number;
|
|
116
|
+
partial: number;
|
|
117
|
+
invalid: number;
|
|
118
|
+
};
|
|
119
|
+
mixinDurationMs: number;
|
|
120
|
+
awDiscoveryCount: number;
|
|
121
|
+
awCaughtErrors: number;
|
|
122
|
+
awCounts: {
|
|
123
|
+
ok: number;
|
|
124
|
+
invalid: number;
|
|
125
|
+
};
|
|
126
|
+
awDurationMs: number;
|
|
127
|
+
atDiscoveryCount: number;
|
|
128
|
+
atCaughtErrors: number;
|
|
129
|
+
atCounts: {
|
|
130
|
+
ok: number;
|
|
131
|
+
invalid: number;
|
|
132
|
+
};
|
|
133
|
+
atDurationMs: number;
|
|
134
|
+
}): Promise<TaskStatusReport | undefined>;
|
|
135
|
+
export {};
|