@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
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  import { type CacheRegistry } from "../cache-registry.js";
3
3
  export declare const manageCacheShape: {
4
4
  action: z.ZodEnum<["summary", "list", "inspect", "delete", "prune", "rebuild", "verify"]>;
5
- cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["artifact-index", "downloads", "mapping", "registry", "decompiled-source", "mod-remap", "binary-remap"]>, "many">>;
5
+ cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["artifact-index", "downloads", "mapping", "registry", "decompiled-source", "mod-remap", "binary-remap", "workspace"]>, "many">>;
6
6
  selector: z.ZodOptional<z.ZodObject<{
7
7
  artifactId: z.ZodOptional<z.ZodString>;
8
8
  version: z.ZodOptional<z.ZodString>;
@@ -14,23 +14,23 @@ export declare const manageCacheShape: {
14
14
  scope: z.ZodOptional<z.ZodString>;
15
15
  projectPath: z.ZodOptional<z.ZodString>;
16
16
  }, "strip", z.ZodTypeAny, {
17
+ version?: string | undefined;
18
+ projectPath?: string | undefined;
17
19
  mapping?: string | undefined;
18
20
  jarPath?: string | undefined;
19
- projectPath?: string | undefined;
20
21
  entryId?: string | undefined;
21
22
  artifactId?: string | undefined;
22
23
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
23
- version?: string | undefined;
24
24
  scope?: string | undefined;
25
25
  olderThan?: string | undefined;
26
26
  }, {
27
+ version?: string | undefined;
28
+ projectPath?: string | undefined;
27
29
  mapping?: string | undefined;
28
30
  jarPath?: string | undefined;
29
- projectPath?: string | undefined;
30
31
  entryId?: string | undefined;
31
32
  artifactId?: string | undefined;
32
33
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
33
- version?: string | undefined;
34
34
  scope?: string | undefined;
35
35
  olderThan?: string | undefined;
36
36
  }>>;
@@ -42,7 +42,7 @@ export declare const manageCacheShape: {
42
42
  };
43
43
  export declare const manageCacheSchema: z.ZodObject<{
44
44
  action: z.ZodEnum<["summary", "list", "inspect", "delete", "prune", "rebuild", "verify"]>;
45
- cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["artifact-index", "downloads", "mapping", "registry", "decompiled-source", "mod-remap", "binary-remap"]>, "many">>;
45
+ cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["artifact-index", "downloads", "mapping", "registry", "decompiled-source", "mod-remap", "binary-remap", "workspace"]>, "many">>;
46
46
  selector: z.ZodOptional<z.ZodObject<{
47
47
  artifactId: z.ZodOptional<z.ZodString>;
48
48
  version: z.ZodOptional<z.ZodString>;
@@ -54,23 +54,23 @@ export declare const manageCacheSchema: z.ZodObject<{
54
54
  scope: z.ZodOptional<z.ZodString>;
55
55
  projectPath: z.ZodOptional<z.ZodString>;
56
56
  }, "strip", z.ZodTypeAny, {
57
+ version?: string | undefined;
58
+ projectPath?: string | undefined;
57
59
  mapping?: string | undefined;
58
60
  jarPath?: string | undefined;
59
- projectPath?: string | undefined;
60
61
  entryId?: string | undefined;
61
62
  artifactId?: string | undefined;
62
63
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
63
- version?: string | undefined;
64
64
  scope?: string | undefined;
65
65
  olderThan?: string | undefined;
66
66
  }, {
67
+ version?: string | undefined;
68
+ projectPath?: string | undefined;
67
69
  mapping?: string | undefined;
68
70
  jarPath?: string | undefined;
69
- projectPath?: string | undefined;
70
71
  entryId?: string | undefined;
71
72
  artifactId?: string | undefined;
72
73
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
73
- version?: string | undefined;
74
74
  scope?: string | undefined;
75
75
  olderThan?: string | undefined;
76
76
  }>>;
@@ -86,15 +86,15 @@ export declare const manageCacheSchema: z.ZodObject<{
86
86
  cursor?: string | undefined;
87
87
  detail?: "full" | "summary" | "standard" | undefined;
88
88
  include?: string[] | undefined;
89
- cacheKinds?: ("artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap")[] | undefined;
89
+ cacheKinds?: ("workspace" | "artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap")[] | undefined;
90
90
  selector?: {
91
+ version?: string | undefined;
92
+ projectPath?: string | undefined;
91
93
  mapping?: string | undefined;
92
94
  jarPath?: string | undefined;
93
- projectPath?: string | undefined;
94
95
  entryId?: string | undefined;
95
96
  artifactId?: string | undefined;
96
97
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
97
- version?: string | undefined;
98
98
  scope?: string | undefined;
99
99
  olderThan?: string | undefined;
100
100
  } | undefined;
@@ -105,15 +105,15 @@ export declare const manageCacheSchema: z.ZodObject<{
105
105
  detail?: "full" | "summary" | "standard" | undefined;
106
106
  include?: string[] | undefined;
107
107
  executionMode?: "preview" | "apply" | undefined;
108
- cacheKinds?: ("artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap")[] | undefined;
108
+ cacheKinds?: ("workspace" | "artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap")[] | undefined;
109
109
  selector?: {
110
+ version?: string | undefined;
111
+ projectPath?: string | undefined;
110
112
  mapping?: string | undefined;
111
113
  jarPath?: string | undefined;
112
- projectPath?: string | undefined;
113
114
  entryId?: string | undefined;
114
115
  artifactId?: string | undefined;
115
116
  status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
116
- version?: string | undefined;
117
117
  scope?: string | undefined;
118
118
  olderThan?: string | undefined;
119
119
  } | undefined;
@@ -0,0 +1,6 @@
1
+ import { type DetailLevel } from "../../response-contract.js";
2
+ import type { ValidateProjectInput } from "../../validate-project-service.js";
3
+ import { type ValidateProjectDeps } from "../internal.js";
4
+ export declare function handleAccessTransformer(deps: ValidateProjectDeps, input: ValidateProjectInput, detail: DetailLevel, include: string[]): Promise<{
5
+ warnings: string[];
6
+ }>;
@@ -0,0 +1,106 @@
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 { buildSuggestedCall } from "../../../build-suggested-call.js";
5
+ export async function handleAccessTransformer(deps, input, detail, include) {
6
+ if (input.subject.kind !== "access-transformer") {
7
+ throw createError({
8
+ code: ERROR_CODES.INVALID_INPUT,
9
+ message: "task=access-transformer requires subject.kind=access-transformer.",
10
+ details: {
11
+ task: input.task,
12
+ subjectKind: input.subject.kind,
13
+ failedStage: "input-validation",
14
+ nextAction: "Set subject.kind to \"access-transformer\" for task=\"access-transformer\"."
15
+ }
16
+ });
17
+ }
18
+ if (!input.version) {
19
+ throw createError({
20
+ code: ERROR_CODES.INVALID_INPUT,
21
+ message: "task=access-transformer requires version.",
22
+ details: {
23
+ task: "access-transformer",
24
+ failedStage: "input-validation",
25
+ nextAction: "Pass version explicitly (e.g. \"1.21.10\"). Access Transformer validation resolves class names against a specific Minecraft version.",
26
+ ...buildSuggestedCall({
27
+ tool: "validate-project",
28
+ params: {
29
+ task: "access-transformer",
30
+ subject: input.subject,
31
+ version: "1.21.10"
32
+ }
33
+ })
34
+ }
35
+ });
36
+ }
37
+ const content = input.subject.input.mode === "inline"
38
+ ? input.subject.input.content
39
+ : await readFile(input.subject.input.path, "utf8");
40
+ if (!deps.validateAccessTransformer) {
41
+ throw createError({
42
+ code: ERROR_CODES.CONTEXT_UNRESOLVED,
43
+ message: "Access Transformer validation is not configured.",
44
+ details: {
45
+ task: "access-transformer",
46
+ failedStage: "dependency-resolution",
47
+ nextAction: "The current runtime was built without an Access Transformer validator. Rebuild the MCP server with validateAccessTransformer configured, or use task=\"access-widener\" if the workspace uses Fabric AccessWideners."
48
+ }
49
+ });
50
+ }
51
+ const output = await deps.validateAccessTransformer({
52
+ content,
53
+ version: input.version,
54
+ atNamespace: input.atNamespace,
55
+ sourcePriority: input.sourcePriority,
56
+ scope: input.scope,
57
+ preferProjectVersion: input.preferProjectVersion
58
+ });
59
+ const issueEntries = Array.isArray(output.entries)
60
+ ? output.entries.filter((entry) => {
61
+ if (!entry || typeof entry !== "object" || !("valid" in entry)) {
62
+ return true;
63
+ }
64
+ return entry.valid !== true;
65
+ })
66
+ : undefined;
67
+ return {
68
+ ...buildEntryToolResult({
69
+ task: "access-transformer",
70
+ detail,
71
+ include,
72
+ summary: {
73
+ status: output.valid ? "ok" : "invalid",
74
+ headline: output.valid
75
+ ? "Access Transformer is valid."
76
+ : "Access Transformer contains validation issues.",
77
+ subject: createSummarySubject({
78
+ task: "access-transformer",
79
+ kind: input.subject.kind,
80
+ input: input.subject.input,
81
+ version: input.version,
82
+ sourcePriority: input.sourcePriority,
83
+ scope: input.scope,
84
+ atNamespace: input.atNamespace
85
+ }),
86
+ counts: {
87
+ valid: output.valid ? 1 : 0,
88
+ invalid: output.valid ? 0 : 1
89
+ }
90
+ },
91
+ blocks: {
92
+ project: {
93
+ summary: {
94
+ total: 1,
95
+ valid: output.valid ? 1 : 0,
96
+ invalid: output.valid ? 0 : 1
97
+ }
98
+ },
99
+ issues: include.includes("issues") || detail !== "summary" ? issueEntries : undefined
100
+ },
101
+ alwaysBlocks: ["project"]
102
+ }),
103
+ warnings: Array.isArray(output.warnings) ? output.warnings : []
104
+ };
105
+ }
106
+ //# sourceMappingURL=access-transformer.js.map
@@ -0,0 +1,6 @@
1
+ import { type DetailLevel } from "../../response-contract.js";
2
+ import type { ValidateProjectInput } from "../../validate-project-service.js";
3
+ import { type ValidateProjectDeps } from "../internal.js";
4
+ export declare function handleAccessWidener(deps: ValidateProjectDeps, input: ValidateProjectInput, detail: DetailLevel, include: string[]): Promise<{
5
+ warnings: string[];
6
+ }>;
@@ -0,0 +1,86 @@
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 { buildSuggestedCall } from "../../../build-suggested-call.js";
5
+ export async function handleAccessWidener(deps, input, detail, include) {
6
+ if (input.subject.kind !== "access-widener") {
7
+ throw createError({
8
+ code: ERROR_CODES.INVALID_INPUT,
9
+ message: "task=access-widener requires subject.kind=access-widener.",
10
+ details: {
11
+ task: input.task,
12
+ subjectKind: input.subject.kind,
13
+ failedStage: "input-validation",
14
+ nextAction: "Set subject.kind to \"access-widener\" for task=\"access-widener\"."
15
+ }
16
+ });
17
+ }
18
+ if (!input.version) {
19
+ throw createError({
20
+ code: ERROR_CODES.INVALID_INPUT,
21
+ message: "task=access-widener requires version.",
22
+ details: {
23
+ task: "access-widener",
24
+ failedStage: "input-validation",
25
+ nextAction: "Pass version explicitly (e.g. \"1.21.10\"). Access Widener validation resolves class names against a specific Minecraft version.",
26
+ ...buildSuggestedCall({
27
+ tool: "validate-project",
28
+ params: {
29
+ task: "access-widener",
30
+ subject: input.subject,
31
+ version: "1.21.10"
32
+ }
33
+ })
34
+ }
35
+ });
36
+ }
37
+ const content = input.subject.input.mode === "inline"
38
+ ? input.subject.input.content
39
+ : await readFile(input.subject.input.path, "utf8");
40
+ const output = await deps.validateAccessWidener({
41
+ content,
42
+ version: input.version,
43
+ mapping: input.mapping,
44
+ sourcePriority: input.sourcePriority,
45
+ scope: input.scope,
46
+ preferProjectVersion: input.preferProjectVersion
47
+ });
48
+ return {
49
+ ...buildEntryToolResult({
50
+ task: "access-widener",
51
+ detail,
52
+ include,
53
+ summary: {
54
+ status: output.valid ? "ok" : "invalid",
55
+ headline: output.valid
56
+ ? "Access Widener is valid."
57
+ : "Access Widener contains validation issues.",
58
+ subject: createSummarySubject({
59
+ task: "access-widener",
60
+ kind: input.subject.kind,
61
+ input: input.subject.input,
62
+ version: input.version,
63
+ mapping: input.mapping,
64
+ sourcePriority: input.sourcePriority
65
+ }),
66
+ counts: {
67
+ valid: output.valid ? 1 : 0,
68
+ invalid: output.valid ? 0 : 1
69
+ }
70
+ },
71
+ blocks: {
72
+ project: {
73
+ summary: {
74
+ total: 1,
75
+ valid: output.valid ? 1 : 0,
76
+ invalid: output.valid ? 0 : 1
77
+ }
78
+ },
79
+ issues: include.includes("issues") || detail !== "summary" ? output.issues : undefined
80
+ },
81
+ alwaysBlocks: ["project"]
82
+ }),
83
+ warnings: Array.isArray(output.warnings) ? output.warnings : []
84
+ };
85
+ }
86
+ //# sourceMappingURL=access-widener.js.map
@@ -0,0 +1,6 @@
1
+ import { type DetailLevel } from "../../response-contract.js";
2
+ import type { ValidateProjectInput } from "../../validate-project-service.js";
3
+ import { type ValidateProjectDeps } from "../internal.js";
4
+ export declare function handleMixin(deps: ValidateProjectDeps, input: ValidateProjectInput, detail: DetailLevel, include: string[]): Promise<{
5
+ warnings: string[];
6
+ }>;
@@ -0,0 +1,90 @@
1
+ import { buildEntryToolResult, createSummarySubject } from "../../response-contract.js";
2
+ import { ERROR_CODES, createError } from "../../../errors.js";
3
+ import { buildSuggestedCall } from "../../../build-suggested-call.js";
4
+ export async function handleMixin(deps, input, detail, include) {
5
+ if (input.subject.kind !== "mixin") {
6
+ throw createError({
7
+ code: ERROR_CODES.INVALID_INPUT,
8
+ message: "task=mixin requires subject.kind=mixin.",
9
+ details: {
10
+ task: input.task,
11
+ subjectKind: input.subject.kind,
12
+ failedStage: "input-validation",
13
+ nextAction: "Set subject.kind to \"mixin\" for task=\"mixin\"."
14
+ }
15
+ });
16
+ }
17
+ if (!input.version) {
18
+ throw createError({
19
+ code: ERROR_CODES.INVALID_INPUT,
20
+ message: "task=mixin requires version.",
21
+ details: {
22
+ task: "mixin",
23
+ failedStage: "input-validation",
24
+ nextAction: "Pass version explicitly (e.g. \"1.21.10\"). task=\"project-summary\" supports preferProjectVersion for auto-detection from gradle.properties, but direct task=\"mixin\" requires an explicit version.",
25
+ ...buildSuggestedCall({
26
+ tool: "validate-project",
27
+ params: {
28
+ task: "mixin",
29
+ subject: input.subject,
30
+ version: "1.21.10"
31
+ }
32
+ })
33
+ }
34
+ });
35
+ }
36
+ const output = await deps.validateMixin({
37
+ input: input.subject.input,
38
+ version: input.version,
39
+ mapping: input.mapping,
40
+ sourcePriority: input.sourcePriority,
41
+ scope: input.scope,
42
+ preferProjectVersion: input.preferProjectVersion,
43
+ preferProjectMapping: input.preferProjectMapping,
44
+ sourceRoots: input.sourceRoots,
45
+ minSeverity: input.minSeverity,
46
+ hideUncertain: input.hideUncertain,
47
+ explain: input.explain,
48
+ warningMode: input.warningMode,
49
+ warningCategoryFilter: input.warningCategoryFilter,
50
+ treatInfoAsWarning: input.treatInfoAsWarning,
51
+ includeIssues: input.includeIssues
52
+ });
53
+ const summary = output.summary;
54
+ const invalidCount = summary?.invalid ?? 0;
55
+ const partialCount = summary?.partial ?? 0;
56
+ return {
57
+ ...buildEntryToolResult({
58
+ task: "mixin",
59
+ detail,
60
+ include,
61
+ summary: {
62
+ status: invalidCount > 0 ? "invalid" : partialCount > 0 ? "partial" : "ok",
63
+ headline: `Validated ${summary?.total ?? 0} mixin input(s).`,
64
+ subject: createSummarySubject({
65
+ task: "mixin",
66
+ kind: input.subject.kind,
67
+ input: input.subject.input,
68
+ version: input.version,
69
+ mapping: input.mapping,
70
+ sourcePriority: input.sourcePriority,
71
+ scope: input.scope
72
+ }),
73
+ counts: {
74
+ valid: summary?.valid ?? 0,
75
+ partial: partialCount,
76
+ invalid: invalidCount
77
+ }
78
+ },
79
+ blocks: {
80
+ project: {
81
+ summary
82
+ },
83
+ issues: include.includes("issues") || detail !== "summary" ? output.results : undefined
84
+ },
85
+ alwaysBlocks: ["project"]
86
+ }),
87
+ warnings: Array.isArray(output.warnings) ? output.warnings : []
88
+ };
89
+ }
90
+ //# sourceMappingURL=mixin.js.map
@@ -0,0 +1,102 @@
1
+ import { type DetailLevel } from "../../response-contract.js";
2
+ import type { StageEmitter } from "../../../stage-emitter.js";
3
+ import type { ValidateProjectInput } from "../../validate-project-service.js";
4
+ import { type ValidateProjectDeps } from "../internal.js";
5
+ type ProjectSummaryOptions = {
6
+ stageEmitter?: StageEmitter;
7
+ };
8
+ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: ValidateProjectInput, detail: DetailLevel, include: string[], options?: ProjectSummaryOptions): Promise<{
9
+ warnings: string[];
10
+ tasks?: {
11
+ "workspace.detected": {
12
+ status: "error" | "ok" | "skipped" | "missing";
13
+ durationMs?: number;
14
+ error?: {
15
+ code: string;
16
+ detail: string;
17
+ };
18
+ warnings?: string[];
19
+ } & {
20
+ evidence?: string[];
21
+ };
22
+ "gradle.readable": {
23
+ status: "error" | "ok" | "skipped" | "missing";
24
+ durationMs?: number;
25
+ error?: {
26
+ code: string;
27
+ detail: string;
28
+ };
29
+ warnings?: string[];
30
+ } & {
31
+ propertiesPath?: string;
32
+ buildScripts?: string[];
33
+ };
34
+ "loom.cache.found": {
35
+ status: "error" | "ok" | "skipped" | "missing";
36
+ durationMs?: number;
37
+ error?: {
38
+ code: string;
39
+ detail: string;
40
+ };
41
+ warnings?: string[];
42
+ } & {
43
+ cachePath?: string;
44
+ };
45
+ "minecraft.artifact.resolved": {
46
+ status: "error" | "ok" | "skipped" | "missing";
47
+ durationMs?: number;
48
+ error?: {
49
+ code: string;
50
+ detail: string;
51
+ };
52
+ warnings?: string[];
53
+ } & {
54
+ artifactId?: string;
55
+ mapping?: import("../../../types.js").SourceMapping;
56
+ };
57
+ "mixins.validated": {
58
+ status: "error" | "ok" | "skipped" | "missing";
59
+ durationMs?: number;
60
+ error?: {
61
+ code: string;
62
+ detail: string;
63
+ };
64
+ warnings?: string[];
65
+ } & {
66
+ counts?: {
67
+ ok: number;
68
+ partial: number;
69
+ invalid: number;
70
+ };
71
+ };
72
+ "accessWideners.validated": {
73
+ status: "error" | "ok" | "skipped" | "missing";
74
+ durationMs?: number;
75
+ error?: {
76
+ code: string;
77
+ detail: string;
78
+ };
79
+ warnings?: string[];
80
+ } & {
81
+ counts?: {
82
+ ok: number;
83
+ invalid: number;
84
+ };
85
+ };
86
+ "accessTransformers.validated": {
87
+ status: "error" | "ok" | "skipped" | "missing";
88
+ durationMs?: number;
89
+ error?: {
90
+ code: string;
91
+ detail: string;
92
+ };
93
+ warnings?: string[];
94
+ } & {
95
+ counts?: {
96
+ ok: number;
97
+ invalid: number;
98
+ };
99
+ };
100
+ } | undefined;
101
+ }>;
102
+ export {};