@adhisang/minecraft-modding-mcp 3.2.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.
Files changed (194) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +52 -32
  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 +59 -7
  7. package/dist/config.d.ts +10 -1
  8. package/dist/config.js +52 -1
  9. package/dist/entry-tools/analyze-symbol-service.d.ts +18 -18
  10. package/dist/entry-tools/analyze-symbol-service.js +13 -2
  11. package/dist/entry-tools/batch-class-members-service.d.ts +34 -0
  12. package/dist/entry-tools/batch-class-members-service.js +97 -0
  13. package/dist/entry-tools/batch-class-source-service.d.ts +37 -0
  14. package/dist/entry-tools/batch-class-source-service.js +100 -0
  15. package/dist/entry-tools/batch-mappings-service.d.ts +36 -0
  16. package/dist/entry-tools/batch-mappings-service.js +66 -0
  17. package/dist/entry-tools/batch-runner.d.ts +72 -0
  18. package/dist/entry-tools/batch-runner.js +90 -0
  19. package/dist/entry-tools/batch-symbol-exists-service.d.ts +46 -0
  20. package/dist/entry-tools/batch-symbol-exists-service.js +113 -0
  21. package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
  22. package/dist/entry-tools/inspect-minecraft/handlers/artifact.d.ts +5 -0
  23. package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +83 -0
  24. package/dist/entry-tools/inspect-minecraft/handlers/class-members.d.ts +6 -0
  25. package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +80 -0
  26. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.d.ts +5 -0
  27. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +248 -0
  28. package/dist/entry-tools/inspect-minecraft/handlers/class-source.d.ts +5 -0
  29. package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +60 -0
  30. package/dist/entry-tools/inspect-minecraft/handlers/file.d.ts +5 -0
  31. package/dist/entry-tools/inspect-minecraft/handlers/file.js +54 -0
  32. package/dist/entry-tools/inspect-minecraft/handlers/list-files.d.ts +5 -0
  33. package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +100 -0
  34. package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +5 -0
  35. package/dist/entry-tools/inspect-minecraft/handlers/search.js +155 -0
  36. package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +6 -0
  37. package/dist/entry-tools/inspect-minecraft/handlers/versions.js +49 -0
  38. package/dist/entry-tools/inspect-minecraft/internal.d.ts +1042 -0
  39. package/dist/entry-tools/inspect-minecraft/internal.js +448 -0
  40. package/dist/entry-tools/inspect-minecraft-service.d.ts +213 -328
  41. package/dist/entry-tools/inspect-minecraft-service.js +20 -1238
  42. package/dist/entry-tools/manage-cache-service.d.ts +16 -16
  43. package/dist/entry-tools/validate-project/cases/access-transformer.d.ts +6 -0
  44. package/dist/entry-tools/validate-project/cases/access-transformer.js +106 -0
  45. package/dist/entry-tools/validate-project/cases/access-widener.d.ts +6 -0
  46. package/dist/entry-tools/validate-project/cases/access-widener.js +86 -0
  47. package/dist/entry-tools/validate-project/cases/mixin.d.ts +6 -0
  48. package/dist/entry-tools/validate-project/cases/mixin.js +90 -0
  49. package/dist/entry-tools/validate-project/cases/project-summary.d.ts +97 -0
  50. package/dist/entry-tools/validate-project/cases/project-summary.js +346 -0
  51. package/dist/entry-tools/validate-project/internal.d.ts +135 -0
  52. package/dist/entry-tools/validate-project/internal.js +287 -0
  53. package/dist/entry-tools/validate-project-service.d.ts +63 -47
  54. package/dist/entry-tools/validate-project-service.js +12 -482
  55. package/dist/entry-tools/verify-mixin-target-service.d.ts +133 -0
  56. package/dist/entry-tools/verify-mixin-target-service.js +323 -0
  57. package/dist/error-mapping.d.ts +40 -0
  58. package/dist/error-mapping.js +139 -0
  59. package/dist/errors.d.ts +6 -0
  60. package/dist/errors.js +6 -0
  61. package/dist/index.d.ts +2 -0
  62. package/dist/index.js +170 -1314
  63. package/dist/lru-list.d.ts +31 -0
  64. package/dist/lru-list.js +102 -0
  65. package/dist/mapping/internal-types.d.ts +54 -0
  66. package/dist/mapping/internal-types.js +14 -0
  67. package/dist/mapping/loaders/mojang.d.ts +2 -0
  68. package/dist/mapping/loaders/mojang.js +64 -0
  69. package/dist/mapping/loaders/tiny-loom.d.ts +2 -0
  70. package/dist/mapping/loaders/tiny-loom.js +73 -0
  71. package/dist/mapping/loaders/tiny-maven.d.ts +2 -0
  72. package/dist/mapping/loaders/tiny-maven.js +104 -0
  73. package/dist/mapping/loaders/types.d.ts +14 -0
  74. package/dist/mapping/loaders/types.js +2 -0
  75. package/dist/mapping/lookup.d.ts +52 -0
  76. package/dist/mapping/lookup.js +496 -0
  77. package/dist/mapping/parsers/normalize.d.ts +10 -0
  78. package/dist/mapping/parsers/normalize.js +52 -0
  79. package/dist/mapping/parsers/proguard.d.ts +20 -0
  80. package/dist/mapping/parsers/proguard.js +138 -0
  81. package/dist/mapping/parsers/symbol-records.d.ts +27 -0
  82. package/dist/mapping/parsers/symbol-records.js +216 -0
  83. package/dist/mapping/parsers/tiny.d.ts +9 -0
  84. package/dist/mapping/parsers/tiny.js +96 -0
  85. package/dist/mapping/types.d.ts +147 -0
  86. package/dist/mapping/types.js +2 -0
  87. package/dist/mapping-pipeline-service.d.ts +10 -1
  88. package/dist/mapping-pipeline-service.js +16 -3
  89. package/dist/mapping-service.d.ts +15 -144
  90. package/dist/mapping-service.js +179 -1119
  91. package/dist/mixin/access-validators.d.ts +9 -0
  92. package/dist/mixin/access-validators.js +257 -0
  93. package/dist/mixin/annotation-validators.d.ts +5 -0
  94. package/dist/mixin/annotation-validators.js +162 -0
  95. package/dist/mixin/helpers.d.ts +28 -0
  96. package/dist/mixin/helpers.js +315 -0
  97. package/dist/mixin/parsed-validator.d.ts +8 -0
  98. package/dist/mixin/parsed-validator.js +337 -0
  99. package/dist/mixin/types.d.ts +208 -0
  100. package/dist/mixin/types.js +28 -0
  101. package/dist/mixin-validator.d.ts +9 -201
  102. package/dist/mixin-validator.js +8 -1005
  103. package/dist/observability.d.ts +18 -1
  104. package/dist/observability.js +44 -1
  105. package/dist/response-utils.d.ts +44 -10
  106. package/dist/response-utils.js +131 -17
  107. package/dist/source/access-validate.d.ts +4 -0
  108. package/dist/source/access-validate.js +254 -0
  109. package/dist/source/artifact-resolver.d.ts +110 -0
  110. package/dist/source/artifact-resolver.js +1174 -0
  111. package/dist/source/cache-metrics.d.ts +26 -0
  112. package/dist/source/cache-metrics.js +172 -0
  113. package/dist/source/class-source/members-builder.d.ts +34 -0
  114. package/dist/source/class-source/members-builder.js +46 -0
  115. package/dist/source/class-source/snippet-builder.d.ts +19 -0
  116. package/dist/source/class-source/snippet-builder.js +46 -0
  117. package/dist/source/class-source-helpers.d.ts +34 -0
  118. package/dist/source/class-source-helpers.js +140 -0
  119. package/dist/source/class-source.d.ts +42 -0
  120. package/dist/source/class-source.js +883 -0
  121. package/dist/source/descriptor-utils.d.ts +6 -0
  122. package/dist/source/descriptor-utils.js +37 -0
  123. package/dist/source/file-access.d.ts +4 -0
  124. package/dist/source/file-access.js +102 -0
  125. package/dist/source/indexer.d.ts +82 -0
  126. package/dist/source/indexer.js +505 -0
  127. package/dist/source/lifecycle/diff-utils.d.ts +9 -0
  128. package/dist/source/lifecycle/diff-utils.js +107 -0
  129. package/dist/source/lifecycle/diff.d.ts +2 -0
  130. package/dist/source/lifecycle/diff.js +265 -0
  131. package/dist/source/lifecycle/mapping-helpers.d.ts +22 -0
  132. package/dist/source/lifecycle/mapping-helpers.js +327 -0
  133. package/dist/source/lifecycle/runtime-check.d.ts +2 -0
  134. package/dist/source/lifecycle/runtime-check.js +142 -0
  135. package/dist/source/lifecycle/trace.d.ts +2 -0
  136. package/dist/source/lifecycle/trace.js +231 -0
  137. package/dist/source/lifecycle.d.ts +4 -0
  138. package/dist/source/lifecycle.js +5 -0
  139. package/dist/source/search.d.ts +51 -0
  140. package/dist/source/search.js +676 -0
  141. package/dist/source/shared-utils.d.ts +6 -0
  142. package/dist/source/shared-utils.js +55 -0
  143. package/dist/source/state.d.ts +21 -0
  144. package/dist/source/state.js +19 -0
  145. package/dist/source/symbol-resolver.d.ts +3 -0
  146. package/dist/source/symbol-resolver.js +212 -0
  147. package/dist/source/validate-mixin/pipeline/mapping-health.d.ts +3 -0
  148. package/dist/source/validate-mixin/pipeline/mapping-health.js +41 -0
  149. package/dist/source/validate-mixin/pipeline/parse.d.ts +2 -0
  150. package/dist/source/validate-mixin/pipeline/parse.js +10 -0
  151. package/dist/source/validate-mixin/pipeline/resolve.d.ts +3 -0
  152. package/dist/source/validate-mixin/pipeline/resolve.js +78 -0
  153. package/dist/source/validate-mixin/pipeline/target-lookup.d.ts +6 -0
  154. package/dist/source/validate-mixin/pipeline/target-lookup.js +260 -0
  155. package/dist/source/validate-mixin/pipeline-context.d.ts +72 -0
  156. package/dist/source/validate-mixin/pipeline-context.js +93 -0
  157. package/dist/source/validate-mixin.d.ts +22 -0
  158. package/dist/source/validate-mixin.js +799 -0
  159. package/dist/source/workspace-target.d.ts +18 -0
  160. package/dist/source/workspace-target.js +305 -0
  161. package/dist/source-resolver.d.ts +9 -1
  162. package/dist/source-resolver.js +14 -6
  163. package/dist/source-service.d.ts +178 -105
  164. package/dist/source-service.js +72 -5312
  165. package/dist/stage-emitter.d.ts +13 -0
  166. package/dist/stage-emitter.js +30 -0
  167. package/dist/stdio-supervisor.d.ts +61 -0
  168. package/dist/stdio-supervisor.js +326 -9
  169. package/dist/storage/artifacts-repo.d.ts +4 -1
  170. package/dist/storage/artifacts-repo.js +33 -5
  171. package/dist/storage/files-repo.d.ts +0 -2
  172. package/dist/storage/files-repo.js +0 -11
  173. package/dist/storage/migrations.d.ts +1 -1
  174. package/dist/storage/migrations.js +10 -2
  175. package/dist/storage/schema.d.ts +2 -0
  176. package/dist/storage/schema.js +25 -0
  177. package/dist/tool-contract-manifest.d.ts +1 -1
  178. package/dist/tool-contract-manifest.js +23 -6
  179. package/dist/tool-guidance.d.ts +82 -0
  180. package/dist/tool-guidance.js +734 -0
  181. package/dist/tool-schema-registry.d.ts +16 -0
  182. package/dist/tool-schema-registry.js +37 -0
  183. package/dist/tool-schemas.d.ts +3518 -0
  184. package/dist/tool-schemas.js +813 -0
  185. package/dist/types.d.ts +39 -0
  186. package/dist/version-service.js +7 -6
  187. package/dist/workspace-context-cache.d.ts +32 -0
  188. package/dist/workspace-context-cache.js +66 -0
  189. package/dist/workspace-mapping-service.d.ts +16 -0
  190. package/dist/workspace-mapping-service.js +173 -1
  191. package/docs/README-ja.md +414 -0
  192. package/docs/examples.md +483 -0
  193. package/docs/tool-reference.md +459 -0
  194. package/package.json +5 -2
@@ -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"]>, "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"]>, "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")[] | 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")[] | 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,97 @@
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 handleProjectSummary(deps: ValidateProjectDeps, input: ValidateProjectInput, detail: DetailLevel, include: string[]): Promise<{
5
+ warnings: string[];
6
+ tasks?: {
7
+ "workspace.detected": {
8
+ status: "error" | "ok" | "skipped" | "missing";
9
+ durationMs?: number;
10
+ error?: {
11
+ code: string;
12
+ detail: string;
13
+ };
14
+ warnings?: string[];
15
+ } & {
16
+ evidence?: string[];
17
+ };
18
+ "gradle.readable": {
19
+ status: "error" | "ok" | "skipped" | "missing";
20
+ durationMs?: number;
21
+ error?: {
22
+ code: string;
23
+ detail: string;
24
+ };
25
+ warnings?: string[];
26
+ } & {
27
+ propertiesPath?: string;
28
+ buildScripts?: string[];
29
+ };
30
+ "loom.cache.found": {
31
+ status: "error" | "ok" | "skipped" | "missing";
32
+ durationMs?: number;
33
+ error?: {
34
+ code: string;
35
+ detail: string;
36
+ };
37
+ warnings?: string[];
38
+ } & {
39
+ cachePath?: string;
40
+ };
41
+ "minecraft.artifact.resolved": {
42
+ status: "error" | "ok" | "skipped" | "missing";
43
+ durationMs?: number;
44
+ error?: {
45
+ code: string;
46
+ detail: string;
47
+ };
48
+ warnings?: string[];
49
+ } & {
50
+ artifactId?: string;
51
+ mapping?: import("../../../types.js").SourceMapping;
52
+ };
53
+ "mixins.validated": {
54
+ status: "error" | "ok" | "skipped" | "missing";
55
+ durationMs?: number;
56
+ error?: {
57
+ code: string;
58
+ detail: string;
59
+ };
60
+ warnings?: string[];
61
+ } & {
62
+ counts?: {
63
+ ok: number;
64
+ partial: number;
65
+ invalid: number;
66
+ };
67
+ };
68
+ "accessWideners.validated": {
69
+ status: "error" | "ok" | "skipped" | "missing";
70
+ durationMs?: number;
71
+ error?: {
72
+ code: string;
73
+ detail: string;
74
+ };
75
+ warnings?: string[];
76
+ } & {
77
+ counts?: {
78
+ ok: number;
79
+ invalid: number;
80
+ };
81
+ };
82
+ "accessTransformers.validated": {
83
+ status: "error" | "ok" | "skipped" | "missing";
84
+ durationMs?: number;
85
+ error?: {
86
+ code: string;
87
+ detail: string;
88
+ };
89
+ warnings?: string[];
90
+ } & {
91
+ counts?: {
92
+ ok: number;
93
+ invalid: number;
94
+ };
95
+ };
96
+ } | undefined;
97
+ }>;