@adhisang/minecraft-modding-mcp 6.3.0 → 7.0.0-rc.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 (101) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/README.md +13 -3
  3. package/dist/cache-policy.d.ts +71 -0
  4. package/dist/cache-policy.js +83 -0
  5. package/dist/cache-registry.js +45 -8
  6. package/dist/cli.js +74 -3
  7. package/dist/compat-stdio-transport.d.ts +1 -1
  8. package/dist/compat-stdio-transport.js +13 -1
  9. package/dist/config.d.ts +3 -0
  10. package/dist/config.js +8 -2
  11. package/dist/decompiler/vineflower.d.ts +1 -0
  12. package/dist/decompiler/vineflower.js +8 -5
  13. package/dist/entry-tools/analyze-mod-service.d.ts +70 -136
  14. package/dist/entry-tools/analyze-symbol-service.d.ts +112 -150
  15. package/dist/entry-tools/compare-minecraft-service.d.ts +59 -145
  16. package/dist/entry-tools/entry-tool-schema.d.ts +38 -4
  17. package/dist/entry-tools/entry-tool-schema.js +4 -1
  18. package/dist/entry-tools/inspect-minecraft/internal.d.ts +235 -799
  19. package/dist/entry-tools/inspect-minecraft/internal.js +50 -13
  20. package/dist/entry-tools/inspect-minecraft-service.d.ts +372 -1736
  21. package/dist/entry-tools/manage-cache-service.d.ts +81 -91
  22. package/dist/entry-tools/validate-project/cases/mixin.js +26 -6
  23. package/dist/entry-tools/validate-project/cases/project-summary.d.ts +7 -7
  24. package/dist/entry-tools/validate-project-service.d.ts +164 -592
  25. package/dist/entry-tools/verify-mixin-target-service.d.ts +3 -19
  26. package/dist/entry-tools/verify-mixin-target-service.js +19 -1
  27. package/dist/era-classifier.d.ts +161 -0
  28. package/dist/era-classifier.js +292 -0
  29. package/dist/error-mapping.d.ts +76 -0
  30. package/dist/error-mapping.js +116 -8
  31. package/dist/index.d.ts +42 -4
  32. package/dist/index.js +636 -473
  33. package/dist/java-process.d.ts +2 -0
  34. package/dist/java-process.js +22 -2
  35. package/dist/json-rpc-framing.d.ts +77 -1
  36. package/dist/json-rpc-framing.js +249 -13
  37. package/dist/mapping/loaders/tiny-loom-selection.d.ts +88 -0
  38. package/dist/mapping/loaders/tiny-loom-selection.js +223 -0
  39. package/dist/mapping/loaders/tiny-loom.js +45 -33
  40. package/dist/mapping/loaders/tiny-maven.js +6 -11
  41. package/dist/mapping/parsers/tiny.d.ts +57 -0
  42. package/dist/mapping/parsers/tiny.js +99 -22
  43. package/dist/mapping-service.d.ts +19 -0
  44. package/dist/mapping-service.js +93 -9
  45. package/dist/maven-resolver.d.ts +18 -0
  46. package/dist/maven-resolver.js +20 -0
  47. package/dist/mcp-helpers.d.ts +19 -2
  48. package/dist/mcp-helpers.js +58 -9
  49. package/dist/minecraft-explorer-service.d.ts +1 -1
  50. package/dist/mixin/types.d.ts +8 -0
  51. package/dist/mod-analyzer.js +7 -7
  52. package/dist/mod-decompile-service.js +1 -0
  53. package/dist/nbt/java-nbt-codec.js +12 -2
  54. package/dist/nbt/json-patch.js +14 -3
  55. package/dist/nbt/pipeline.js +40 -3
  56. package/dist/nbt/typed-json.js +26 -1
  57. package/dist/registration-adapter.d.ts +32 -0
  58. package/dist/registration-adapter.js +52 -0
  59. package/dist/repo-downloader.d.ts +165 -0
  60. package/dist/repo-downloader.js +568 -10
  61. package/dist/request-context.d.ts +7 -0
  62. package/dist/request-context.js +9 -0
  63. package/dist/resources.d.ts +1 -1
  64. package/dist/resources.js +25 -19
  65. package/dist/server-identity.d.ts +27 -0
  66. package/dist/server-identity.js +26 -0
  67. package/dist/source/access-validate.js +53 -0
  68. package/dist/source/artifact-resolver.d.ts +81 -2
  69. package/dist/source/artifact-resolver.js +227 -15
  70. package/dist/source/class-source.d.ts +36 -0
  71. package/dist/source/class-source.js +222 -38
  72. package/dist/source/did-you-mean.d.ts +12 -1
  73. package/dist/source/did-you-mean.js +6 -2
  74. package/dist/source/file-access.js +150 -46
  75. package/dist/source/indexer.js +1 -0
  76. package/dist/source/shared-utils.d.ts +21 -0
  77. package/dist/source/shared-utils.js +23 -0
  78. package/dist/source-resolver.js +224 -57
  79. package/dist/source-service.d.ts +12 -1
  80. package/dist/stdio-supervisor.d.ts +357 -2
  81. package/dist/stdio-supervisor.js +1031 -80
  82. package/dist/storage/db.d.ts +2 -1
  83. package/dist/storage/db.js +15 -8
  84. package/dist/synthetic-decorator.d.ts +24 -0
  85. package/dist/synthetic-decorator.js +48 -0
  86. package/dist/tool-guidance.d.ts +17 -1
  87. package/dist/tool-guidance.js +323 -18
  88. package/dist/tool-schema-registry.d.ts +2 -0
  89. package/dist/tool-schema-registry.js +4 -0
  90. package/dist/tool-schemas.d.ts +2212 -3919
  91. package/dist/tool-schemas.js +33 -7
  92. package/dist/types.d.ts +35 -0
  93. package/dist/v1-parity-schemas.d.ts +7 -0
  94. package/dist/v1-parity-schemas.js +5584 -0
  95. package/dist/version-diff-service.d.ts +33 -0
  96. package/dist/version-diff-service.js +148 -3
  97. package/dist/version-service.js +36 -14
  98. package/dist/warning-details.js +18 -1
  99. package/docs/README-ja.md +5 -3
  100. package/docs/tool-reference.md +196 -19
  101. package/package.json +13 -8
@@ -1,123 +1,113 @@
1
1
  import { z } from "zod";
2
2
  import { type CacheRegistry } from "../cache-registry.js";
3
3
  export declare const manageCacheShape: {
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", "nested-jar", "workspace"]>, "many">>;
4
+ action: z.ZodEnum<{
5
+ summary: "summary";
6
+ list: "list";
7
+ inspect: "inspect";
8
+ delete: "delete";
9
+ prune: "prune";
10
+ rebuild: "rebuild";
11
+ verify: "verify";
12
+ }>;
13
+ cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
14
+ workspace: "workspace";
15
+ "artifact-index": "artifact-index";
16
+ downloads: "downloads";
17
+ mapping: "mapping";
18
+ registry: "registry";
19
+ "decompiled-source": "decompiled-source";
20
+ "mod-remap": "mod-remap";
21
+ "binary-remap": "binary-remap";
22
+ "nested-jar": "nested-jar";
23
+ }>>>;
6
24
  selector: z.ZodOptional<z.ZodObject<{
7
25
  artifactId: z.ZodOptional<z.ZodString>;
8
26
  version: z.ZodOptional<z.ZodString>;
9
27
  jarPath: z.ZodOptional<z.ZodString>;
10
28
  entryId: z.ZodOptional<z.ZodString>;
11
- status: z.ZodOptional<z.ZodEnum<["healthy", "partial", "stale", "orphaned", "corrupt", "in_use"]>>;
29
+ status: z.ZodOptional<z.ZodEnum<{
30
+ stale: "stale";
31
+ healthy: "healthy";
32
+ partial: "partial";
33
+ orphaned: "orphaned";
34
+ corrupt: "corrupt";
35
+ in_use: "in_use";
36
+ }>>;
12
37
  olderThan: z.ZodOptional<z.ZodString>;
13
38
  mapping: z.ZodOptional<z.ZodString>;
14
39
  scope: z.ZodOptional<z.ZodString>;
15
40
  projectPath: z.ZodOptional<z.ZodString>;
16
- }, "strip", z.ZodTypeAny, {
17
- version?: string | undefined;
18
- projectPath?: string | undefined;
19
- mapping?: string | undefined;
20
- jarPath?: string | undefined;
21
- entryId?: string | undefined;
22
- artifactId?: string | undefined;
23
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
24
- scope?: string | undefined;
25
- olderThan?: string | undefined;
26
- }, {
27
- version?: string | undefined;
28
- projectPath?: string | undefined;
29
- mapping?: string | undefined;
30
- jarPath?: string | undefined;
31
- entryId?: string | undefined;
32
- artifactId?: string | undefined;
33
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
34
- scope?: string | undefined;
35
- olderThan?: string | undefined;
41
+ }, z.core.$strip>>;
42
+ detail: z.ZodOptional<z.ZodEnum<{
43
+ summary: "summary";
44
+ standard: "standard";
45
+ full: "full";
36
46
  }>>;
37
- detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
38
- include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
47
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
48
+ [x: string]: string;
49
+ }>>>;
39
50
  limit: z.ZodDefault<z.ZodNumber>;
40
51
  cursor: z.ZodOptional<z.ZodString>;
41
- executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
52
+ executionMode: z.ZodDefault<z.ZodEnum<{
53
+ preview: "preview";
54
+ apply: "apply";
55
+ }>>;
42
56
  };
43
57
  export declare const manageCacheSchema: z.ZodObject<{
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", "nested-jar", "workspace"]>, "many">>;
58
+ action: z.ZodEnum<{
59
+ summary: "summary";
60
+ list: "list";
61
+ inspect: "inspect";
62
+ delete: "delete";
63
+ prune: "prune";
64
+ rebuild: "rebuild";
65
+ verify: "verify";
66
+ }>;
67
+ cacheKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
68
+ workspace: "workspace";
69
+ "artifact-index": "artifact-index";
70
+ downloads: "downloads";
71
+ mapping: "mapping";
72
+ registry: "registry";
73
+ "decompiled-source": "decompiled-source";
74
+ "mod-remap": "mod-remap";
75
+ "binary-remap": "binary-remap";
76
+ "nested-jar": "nested-jar";
77
+ }>>>;
46
78
  selector: z.ZodOptional<z.ZodObject<{
47
79
  artifactId: z.ZodOptional<z.ZodString>;
48
80
  version: z.ZodOptional<z.ZodString>;
49
81
  jarPath: z.ZodOptional<z.ZodString>;
50
82
  entryId: z.ZodOptional<z.ZodString>;
51
- status: z.ZodOptional<z.ZodEnum<["healthy", "partial", "stale", "orphaned", "corrupt", "in_use"]>>;
83
+ status: z.ZodOptional<z.ZodEnum<{
84
+ stale: "stale";
85
+ healthy: "healthy";
86
+ partial: "partial";
87
+ orphaned: "orphaned";
88
+ corrupt: "corrupt";
89
+ in_use: "in_use";
90
+ }>>;
52
91
  olderThan: z.ZodOptional<z.ZodString>;
53
92
  mapping: z.ZodOptional<z.ZodString>;
54
93
  scope: z.ZodOptional<z.ZodString>;
55
94
  projectPath: z.ZodOptional<z.ZodString>;
56
- }, "strip", z.ZodTypeAny, {
57
- version?: string | undefined;
58
- projectPath?: string | undefined;
59
- mapping?: string | undefined;
60
- jarPath?: string | undefined;
61
- entryId?: string | undefined;
62
- artifactId?: string | undefined;
63
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
64
- scope?: string | undefined;
65
- olderThan?: string | undefined;
66
- }, {
67
- version?: string | undefined;
68
- projectPath?: string | undefined;
69
- mapping?: string | undefined;
70
- jarPath?: string | undefined;
71
- entryId?: string | undefined;
72
- artifactId?: string | undefined;
73
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
74
- scope?: string | undefined;
75
- olderThan?: string | undefined;
95
+ }, z.core.$strip>>;
96
+ detail: z.ZodOptional<z.ZodEnum<{
97
+ summary: "summary";
98
+ standard: "standard";
99
+ full: "full";
76
100
  }>>;
77
- detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
78
- include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
101
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<{
102
+ [x: string]: string;
103
+ }>>>;
79
104
  limit: z.ZodDefault<z.ZodNumber>;
80
105
  cursor: z.ZodOptional<z.ZodString>;
81
- executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
82
- }, "strip", z.ZodTypeAny, {
83
- limit: number;
84
- executionMode: "preview" | "apply";
85
- action: "summary" | "list" | "inspect" | "verify" | "delete" | "prune" | "rebuild";
86
- cursor?: string | undefined;
87
- detail?: "summary" | "standard" | "full" | undefined;
88
- include?: string[] | undefined;
89
- cacheKinds?: ("workspace" | "artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap" | "nested-jar")[] | undefined;
90
- selector?: {
91
- version?: string | undefined;
92
- projectPath?: string | undefined;
93
- mapping?: string | undefined;
94
- jarPath?: string | undefined;
95
- entryId?: string | undefined;
96
- artifactId?: string | undefined;
97
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
98
- scope?: string | undefined;
99
- olderThan?: string | undefined;
100
- } | undefined;
101
- }, {
102
- action: "summary" | "list" | "inspect" | "verify" | "delete" | "prune" | "rebuild";
103
- limit?: number | undefined;
104
- cursor?: string | undefined;
105
- detail?: "summary" | "standard" | "full" | undefined;
106
- include?: string[] | undefined;
107
- executionMode?: "preview" | "apply" | undefined;
108
- cacheKinds?: ("workspace" | "artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap" | "binary-remap" | "nested-jar")[] | undefined;
109
- selector?: {
110
- version?: string | undefined;
111
- projectPath?: string | undefined;
112
- mapping?: string | undefined;
113
- jarPath?: string | undefined;
114
- entryId?: string | undefined;
115
- artifactId?: string | undefined;
116
- status?: "healthy" | "partial" | "stale" | "orphaned" | "corrupt" | "in_use" | undefined;
117
- scope?: string | undefined;
118
- olderThan?: string | undefined;
119
- } | undefined;
120
- }>;
106
+ executionMode: z.ZodDefault<z.ZodEnum<{
107
+ preview: "preview";
108
+ apply: "apply";
109
+ }>>;
110
+ }, z.core.$strip>;
121
111
  export type ManageCacheInput = z.infer<typeof manageCacheSchema>;
122
112
  export declare class ManageCacheService {
123
113
  private readonly deps;
@@ -21,14 +21,34 @@ export async function handleMixin(deps, input, detail, include) {
21
21
  details: {
22
22
  task: "mixin",
23
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.",
24
+ nextAction: "Pass version explicitly: the Minecraft version this project targets. task=\"project-summary\" supports preferProjectVersion for auto-detection from gradle.properties, but direct task=\"mixin\" requires an explicit version. Call the suggested list-versions to see what is available, then replay the exampleCalls template with that version substituted.",
25
+ // No concrete version can be derived here -- the caller omitted it and this
26
+ // task does not auto-detect one. A `suggestedCall` is a payload the caller
27
+ // may replay verbatim, so filling the hole with a made-up version produced
28
+ // a call that RUNS and validates the mixin against the wrong Minecraft
29
+ // version, which is worse than no suggestion.
30
+ //
31
+ // So the two roles are split, following what the sibling "a version is
32
+ // required but none was resolved" site already does in
33
+ // src/source/class-source.ts: `suggestedCall` is a REAL next step that
34
+ // needs nothing the caller does not have (list-versions takes no
35
+ // arguments and answers exactly the question blocking them), while the
36
+ // task="mixin" retry shape travels as an `exampleCalls` template whose
37
+ // placeholder makes the substitution the caller must perform obvious.
38
+ ...buildSuggestedCall({ tool: "list-versions", params: {} }),
25
39
  ...buildSuggestedCall({
26
40
  tool: "validate-project",
27
- params: {
28
- task: "mixin",
29
- subject: input.subject,
30
- version: "1.21.10"
31
- }
41
+ params: undefined,
42
+ examples: [
43
+ {
44
+ params: {
45
+ task: "mixin",
46
+ subject: input.subject,
47
+ version: "<your-mc-version>"
48
+ },
49
+ reason: "Replace <your-mc-version> with the Minecraft version this project targets (gradle.properties, or task=\"project-summary\" with preferProjectVersion=true reports it)."
50
+ }
51
+ ]
32
52
  })
33
53
  }
34
54
  });
@@ -9,7 +9,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
9
9
  warnings: string[];
10
10
  tasks?: {
11
11
  "workspace.detected": {
12
- status: "error" | "ok" | "skipped" | "missing";
12
+ status: "ok" | "error" | "missing" | "skipped";
13
13
  durationMs?: number;
14
14
  error?: {
15
15
  code: string;
@@ -20,7 +20,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
20
20
  evidence?: string[];
21
21
  };
22
22
  "gradle.readable": {
23
- status: "error" | "ok" | "skipped" | "missing";
23
+ status: "ok" | "error" | "missing" | "skipped";
24
24
  durationMs?: number;
25
25
  error?: {
26
26
  code: string;
@@ -32,7 +32,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
32
32
  buildScripts?: string[];
33
33
  };
34
34
  "loom.cache.found": {
35
- status: "error" | "ok" | "skipped" | "missing";
35
+ status: "ok" | "error" | "missing" | "skipped";
36
36
  durationMs?: number;
37
37
  error?: {
38
38
  code: string;
@@ -43,7 +43,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
43
43
  cachePath?: string;
44
44
  };
45
45
  "minecraft.artifact.resolved": {
46
- status: "error" | "ok" | "skipped" | "missing";
46
+ status: "ok" | "error" | "missing" | "skipped";
47
47
  durationMs?: number;
48
48
  error?: {
49
49
  code: string;
@@ -55,7 +55,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
55
55
  mapping?: import("../../../types.js").SourceMapping;
56
56
  };
57
57
  "mixins.validated": {
58
- status: "error" | "ok" | "skipped" | "missing";
58
+ status: "ok" | "error" | "missing" | "skipped";
59
59
  durationMs?: number;
60
60
  error?: {
61
61
  code: string;
@@ -70,7 +70,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
70
70
  };
71
71
  };
72
72
  "accessWideners.validated": {
73
- status: "error" | "ok" | "skipped" | "missing";
73
+ status: "ok" | "error" | "missing" | "skipped";
74
74
  durationMs?: number;
75
75
  error?: {
76
76
  code: string;
@@ -84,7 +84,7 @@ export declare function handleProjectSummary(deps: ValidateProjectDeps, input: V
84
84
  };
85
85
  };
86
86
  "accessTransformers.validated": {
87
- status: "error" | "ok" | "skipped" | "missing";
87
+ status: "ok" | "error" | "missing" | "skipped";
88
88
  durationMs?: number;
89
89
  error?: {
90
90
  code: string;