@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.
Files changed (176) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +40 -23
  3. package/dist/build-suggested-call.d.ts +29 -0
  4. package/dist/build-suggested-call.js +58 -0
  5. package/dist/cache-registry.d.ts +3 -1
  6. package/dist/cache-registry.js +50 -6
  7. package/dist/entry-tools/analyze-symbol-service.d.ts +16 -16
  8. package/dist/entry-tools/batch-class-members-service.d.ts +34 -0
  9. package/dist/entry-tools/batch-class-members-service.js +97 -0
  10. package/dist/entry-tools/batch-class-source-service.d.ts +37 -0
  11. package/dist/entry-tools/batch-class-source-service.js +100 -0
  12. package/dist/entry-tools/batch-mappings-service.d.ts +36 -0
  13. package/dist/entry-tools/batch-mappings-service.js +66 -0
  14. package/dist/entry-tools/batch-runner.d.ts +72 -0
  15. package/dist/entry-tools/batch-runner.js +90 -0
  16. package/dist/entry-tools/batch-symbol-exists-service.d.ts +46 -0
  17. package/dist/entry-tools/batch-symbol-exists-service.js +113 -0
  18. package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
  19. package/dist/entry-tools/inspect-minecraft/handlers/artifact.d.ts +5 -0
  20. package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +83 -0
  21. package/dist/entry-tools/inspect-minecraft/handlers/class-members.d.ts +6 -0
  22. package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +80 -0
  23. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.d.ts +5 -0
  24. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +248 -0
  25. package/dist/entry-tools/inspect-minecraft/handlers/class-source.d.ts +5 -0
  26. package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +60 -0
  27. package/dist/entry-tools/inspect-minecraft/handlers/file.d.ts +5 -0
  28. package/dist/entry-tools/inspect-minecraft/handlers/file.js +54 -0
  29. package/dist/entry-tools/inspect-minecraft/handlers/list-files.d.ts +5 -0
  30. package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +100 -0
  31. package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +5 -0
  32. package/dist/entry-tools/inspect-minecraft/handlers/search.js +155 -0
  33. package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +6 -0
  34. package/dist/entry-tools/inspect-minecraft/handlers/versions.js +49 -0
  35. package/dist/entry-tools/inspect-minecraft/internal.d.ts +1042 -0
  36. package/dist/entry-tools/inspect-minecraft/internal.js +448 -0
  37. package/dist/entry-tools/inspect-minecraft-service.d.ts +193 -308
  38. package/dist/entry-tools/inspect-minecraft-service.js +20 -1244
  39. package/dist/entry-tools/manage-cache-service.d.ts +16 -16
  40. package/dist/entry-tools/validate-project/cases/access-transformer.d.ts +6 -0
  41. package/dist/entry-tools/validate-project/cases/access-transformer.js +106 -0
  42. package/dist/entry-tools/validate-project/cases/access-widener.d.ts +6 -0
  43. package/dist/entry-tools/validate-project/cases/access-widener.js +86 -0
  44. package/dist/entry-tools/validate-project/cases/mixin.d.ts +6 -0
  45. package/dist/entry-tools/validate-project/cases/mixin.js +90 -0
  46. package/dist/entry-tools/validate-project/cases/project-summary.d.ts +102 -0
  47. package/dist/entry-tools/validate-project/cases/project-summary.js +415 -0
  48. package/dist/entry-tools/validate-project/internal.d.ts +142 -0
  49. package/dist/entry-tools/validate-project/internal.js +303 -0
  50. package/dist/entry-tools/validate-project-service.d.ts +67 -47
  51. package/dist/entry-tools/validate-project-service.js +13 -563
  52. package/dist/entry-tools/verify-mixin-target-service.d.ts +133 -0
  53. package/dist/entry-tools/verify-mixin-target-service.js +323 -0
  54. package/dist/error-mapping.d.ts +40 -0
  55. package/dist/error-mapping.js +139 -0
  56. package/dist/errors.d.ts +6 -0
  57. package/dist/errors.js +6 -0
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.js +147 -1354
  60. package/dist/mapping/internal-types.d.ts +54 -0
  61. package/dist/mapping/internal-types.js +14 -0
  62. package/dist/mapping/loaders/mojang.d.ts +2 -0
  63. package/dist/mapping/loaders/mojang.js +64 -0
  64. package/dist/mapping/loaders/tiny-loom.d.ts +2 -0
  65. package/dist/mapping/loaders/tiny-loom.js +73 -0
  66. package/dist/mapping/loaders/tiny-maven.d.ts +2 -0
  67. package/dist/mapping/loaders/tiny-maven.js +104 -0
  68. package/dist/mapping/loaders/types.d.ts +14 -0
  69. package/dist/mapping/loaders/types.js +2 -0
  70. package/dist/mapping/lookup.d.ts +52 -0
  71. package/dist/mapping/lookup.js +496 -0
  72. package/dist/mapping/parsers/normalize.d.ts +10 -0
  73. package/dist/mapping/parsers/normalize.js +52 -0
  74. package/dist/mapping/parsers/proguard.d.ts +20 -0
  75. package/dist/mapping/parsers/proguard.js +138 -0
  76. package/dist/mapping/parsers/symbol-records.d.ts +27 -0
  77. package/dist/mapping/parsers/symbol-records.js +216 -0
  78. package/dist/mapping/parsers/tiny.d.ts +9 -0
  79. package/dist/mapping/parsers/tiny.js +96 -0
  80. package/dist/mapping/types.d.ts +147 -0
  81. package/dist/mapping/types.js +2 -0
  82. package/dist/mapping-pipeline-service.js +3 -2
  83. package/dist/mapping-service.d.ts +8 -145
  84. package/dist/mapping-service.js +30 -1207
  85. package/dist/mixin/access-validators.d.ts +9 -0
  86. package/dist/mixin/access-validators.js +257 -0
  87. package/dist/mixin/annotation-validators.d.ts +5 -0
  88. package/dist/mixin/annotation-validators.js +162 -0
  89. package/dist/mixin/helpers.d.ts +28 -0
  90. package/dist/mixin/helpers.js +315 -0
  91. package/dist/mixin/parsed-validator.d.ts +8 -0
  92. package/dist/mixin/parsed-validator.js +337 -0
  93. package/dist/mixin/types.d.ts +208 -0
  94. package/dist/mixin/types.js +28 -0
  95. package/dist/mixin-validator.d.ts +9 -201
  96. package/dist/mixin-validator.js +8 -1020
  97. package/dist/source/access-validate.d.ts +4 -0
  98. package/dist/source/access-validate.js +254 -0
  99. package/dist/source/artifact-resolver.d.ts +111 -0
  100. package/dist/source/artifact-resolver.js +1271 -0
  101. package/dist/source/cache-metrics.d.ts +26 -0
  102. package/dist/source/cache-metrics.js +172 -0
  103. package/dist/source/class-source/members-builder.d.ts +34 -0
  104. package/dist/source/class-source/members-builder.js +46 -0
  105. package/dist/source/class-source/snippet-builder.d.ts +19 -0
  106. package/dist/source/class-source/snippet-builder.js +46 -0
  107. package/dist/source/class-source-helpers.d.ts +34 -0
  108. package/dist/source/class-source-helpers.js +140 -0
  109. package/dist/source/class-source.d.ts +42 -0
  110. package/dist/source/class-source.js +883 -0
  111. package/dist/source/descriptor-utils.d.ts +6 -0
  112. package/dist/source/descriptor-utils.js +37 -0
  113. package/dist/source/file-access.d.ts +4 -0
  114. package/dist/source/file-access.js +102 -0
  115. package/dist/source/indexer.d.ts +82 -0
  116. package/dist/source/indexer.js +522 -0
  117. package/dist/source/lifecycle/diff-utils.d.ts +9 -0
  118. package/dist/source/lifecycle/diff-utils.js +107 -0
  119. package/dist/source/lifecycle/diff.d.ts +2 -0
  120. package/dist/source/lifecycle/diff.js +265 -0
  121. package/dist/source/lifecycle/mapping-helpers.d.ts +22 -0
  122. package/dist/source/lifecycle/mapping-helpers.js +327 -0
  123. package/dist/source/lifecycle/runtime-check.d.ts +2 -0
  124. package/dist/source/lifecycle/runtime-check.js +142 -0
  125. package/dist/source/lifecycle/trace.d.ts +2 -0
  126. package/dist/source/lifecycle/trace.js +231 -0
  127. package/dist/source/lifecycle.d.ts +4 -0
  128. package/dist/source/lifecycle.js +5 -0
  129. package/dist/source/search.d.ts +51 -0
  130. package/dist/source/search.js +676 -0
  131. package/dist/source/shared-utils.d.ts +6 -0
  132. package/dist/source/shared-utils.js +55 -0
  133. package/dist/source/state.d.ts +26 -0
  134. package/dist/source/state.js +24 -0
  135. package/dist/source/symbol-resolver.d.ts +3 -0
  136. package/dist/source/symbol-resolver.js +212 -0
  137. package/dist/source/validate-mixin/pipeline/mapping-health.d.ts +3 -0
  138. package/dist/source/validate-mixin/pipeline/mapping-health.js +41 -0
  139. package/dist/source/validate-mixin/pipeline/parse.d.ts +2 -0
  140. package/dist/source/validate-mixin/pipeline/parse.js +10 -0
  141. package/dist/source/validate-mixin/pipeline/resolve.d.ts +3 -0
  142. package/dist/source/validate-mixin/pipeline/resolve.js +78 -0
  143. package/dist/source/validate-mixin/pipeline/target-lookup.d.ts +6 -0
  144. package/dist/source/validate-mixin/pipeline/target-lookup.js +260 -0
  145. package/dist/source/validate-mixin/pipeline-context.d.ts +72 -0
  146. package/dist/source/validate-mixin/pipeline-context.js +93 -0
  147. package/dist/source/validate-mixin.d.ts +22 -0
  148. package/dist/source/validate-mixin.js +799 -0
  149. package/dist/source/workspace-target.d.ts +18 -0
  150. package/dist/source/workspace-target.js +305 -0
  151. package/dist/source-resolver.d.ts +1 -0
  152. package/dist/source-resolver.js +1 -1
  153. package/dist/source-service.d.ts +164 -170
  154. package/dist/source-service.js +70 -6116
  155. package/dist/stage-emitter.d.ts +13 -0
  156. package/dist/stage-emitter.js +30 -0
  157. package/dist/stdio-supervisor.d.ts +61 -0
  158. package/dist/stdio-supervisor.js +326 -9
  159. package/dist/tool-contract-manifest.d.ts +1 -1
  160. package/dist/tool-contract-manifest.js +23 -6
  161. package/dist/tool-guidance.d.ts +82 -0
  162. package/dist/tool-guidance.js +734 -0
  163. package/dist/tool-schema-registry.d.ts +16 -0
  164. package/dist/tool-schema-registry.js +37 -0
  165. package/dist/tool-schemas.d.ts +3518 -0
  166. package/dist/tool-schemas.js +813 -0
  167. package/dist/types.d.ts +36 -0
  168. package/dist/version-service.js +7 -6
  169. package/dist/workspace-context-cache.d.ts +32 -0
  170. package/dist/workspace-context-cache.js +66 -0
  171. package/dist/workspace-mapping-service.d.ts +16 -0
  172. package/dist/workspace-mapping-service.js +173 -1
  173. package/docs/README-ja.md +416 -0
  174. package/docs/examples.md +483 -0
  175. package/docs/tool-reference.md +462 -0
  176. 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" | "access-widener" | "access-transformer" | "project-summary";
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
- scope?: "loader" | "merged" | "vanilla" | undefined;
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" | "access-widener" | "access-transformer" | "project-summary";
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
- scope?: "loader" | "merged" | "vanilla" | undefined;
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" | "access-widener" | "access-transformer" | "project-summary";
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
- scope?: "loader" | "merged" | "vanilla" | undefined;
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" | "access-widener" | "access-transformer" | "project-summary";
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
- scope?: "loader" | "merged" | "vanilla" | undefined;
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 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>;
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
  }