@adhisang/minecraft-modding-mcp 3.1.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/README.md +37 -18
- package/dist/access-transformer-parser.d.ts +17 -0
- package/dist/access-transformer-parser.js +97 -0
- package/dist/cache-registry.d.ts +1 -1
- package/dist/cache-registry.js +10 -2
- package/dist/concurrency.d.ts +1 -0
- package/dist/concurrency.js +24 -0
- package/dist/config.d.ts +10 -1
- package/dist/config.js +52 -1
- package/dist/decompiler/vineflower.js +22 -21
- package/dist/entry-tools/analyze-mod-service.d.ts +4 -4
- package/dist/entry-tools/analyze-symbol-service.d.ts +22 -22
- package/dist/entry-tools/analyze-symbol-service.js +13 -2
- package/dist/entry-tools/inspect-minecraft-service.d.ts +168 -168
- package/dist/entry-tools/inspect-minecraft-service.js +8 -2
- package/dist/entry-tools/manage-cache-service.d.ts +4 -4
- package/dist/entry-tools/validate-project-service.d.ts +153 -16
- package/dist/entry-tools/validate-project-service.js +442 -25
- package/dist/gradle-paths.d.ts +4 -0
- package/dist/gradle-paths.js +57 -0
- package/dist/index.js +148 -30
- package/dist/lru-list.d.ts +31 -0
- package/dist/lru-list.js +102 -0
- package/dist/mapping-pipeline-service.d.ts +12 -1
- package/dist/mapping-pipeline-service.js +28 -1
- package/dist/mapping-service.d.ts +16 -0
- package/dist/mapping-service.js +405 -68
- package/dist/minecraft-explorer-service.d.ts +13 -0
- package/dist/minecraft-explorer-service.js +8 -4
- package/dist/mixin-validator.d.ts +33 -2
- package/dist/mixin-validator.js +218 -17
- package/dist/mod-analyzer.d.ts +1 -0
- package/dist/mod-analyzer.js +17 -1
- package/dist/mod-decompile-service.js +4 -4
- package/dist/mod-remap-service.js +1 -54
- package/dist/mod-search-service.d.ts +1 -0
- package/dist/mod-search-service.js +84 -51
- package/dist/observability.d.ts +18 -1
- package/dist/observability.js +44 -1
- package/dist/response-utils.d.ts +69 -0
- package/dist/response-utils.js +227 -0
- package/dist/source-jar-reader.d.ts +16 -0
- package/dist/source-jar-reader.js +103 -1
- package/dist/source-resolver.d.ts +9 -1
- package/dist/source-resolver.js +23 -16
- package/dist/source-service.d.ts +119 -3
- package/dist/source-service.js +1836 -218
- package/dist/storage/artifacts-repo.d.ts +4 -1
- package/dist/storage/artifacts-repo.js +33 -5
- package/dist/storage/files-repo.d.ts +0 -2
- package/dist/storage/files-repo.js +0 -11
- package/dist/storage/migrations.d.ts +1 -1
- package/dist/storage/migrations.js +10 -2
- package/dist/storage/schema.d.ts +2 -0
- package/dist/storage/schema.js +25 -0
- package/dist/tool-contract-manifest.js +8 -6
- package/dist/types.d.ts +20 -0
- package/dist/workspace-mapping-service.d.ts +13 -0
- package/dist/workspace-mapping-service.js +146 -14
- package/package.json +3 -1
|
@@ -3,7 +3,9 @@ import { createError, ERROR_CODES } from "./errors.js";
|
|
|
3
3
|
* Mapping pipeline for v0.3.
|
|
4
4
|
* Current implementation enforces explicit guarantees:
|
|
5
5
|
* - obfuscated: always pass-through
|
|
6
|
-
* - mojang: requires source-backed
|
|
6
|
+
* - mojang: requires source-backed artifacts on legacy obfuscated versions,
|
|
7
|
+
* but unobfuscated runtime jars can pass through directly,
|
|
8
|
+
* or binary-only artifacts may be remapped + decompiled when allowBinaryRemap=true
|
|
7
9
|
*/
|
|
8
10
|
export function applyMappingPipeline(input) {
|
|
9
11
|
const transformChain = [];
|
|
@@ -22,6 +24,20 @@ export function applyMappingPipeline(input) {
|
|
|
22
24
|
transformChain
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
if (input.requestedMapping === "mojang" && input.runtimeNamesUnobfuscated) {
|
|
28
|
+
transformChain.push("mapping:mojang-runtime-unobfuscated");
|
|
29
|
+
if (input.resolved.isDecompiled) {
|
|
30
|
+
qualityFlags.push("decompiled");
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
qualityFlags.push("source-backed");
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
mappingApplied: "mojang",
|
|
37
|
+
qualityFlags,
|
|
38
|
+
transformChain
|
|
39
|
+
};
|
|
40
|
+
}
|
|
25
41
|
if (input.requestedMapping !== "mojang" &&
|
|
26
42
|
input.requestedMapping !== "intermediary" &&
|
|
27
43
|
input.requestedMapping !== "yarn") {
|
|
@@ -36,6 +52,17 @@ export function applyMappingPipeline(input) {
|
|
|
36
52
|
}
|
|
37
53
|
const hasSource = Boolean(input.resolved.sourceJarPath);
|
|
38
54
|
if (!hasSource) {
|
|
55
|
+
if (input.requestedMapping === "mojang" &&
|
|
56
|
+
input.allowBinaryRemap === true &&
|
|
57
|
+
Boolean(input.resolved.binaryJarPath)) {
|
|
58
|
+
transformChain.push("binary-remap:obf->mojang", "decompile:vineflower");
|
|
59
|
+
qualityFlags.push("binary-remapped", "decompiled");
|
|
60
|
+
return {
|
|
61
|
+
mappingApplied: "mojang",
|
|
62
|
+
qualityFlags,
|
|
63
|
+
transformChain
|
|
64
|
+
};
|
|
65
|
+
}
|
|
39
66
|
throw createError({
|
|
40
67
|
code: ERROR_CODES.MAPPING_NOT_APPLIED,
|
|
41
68
|
message: `Requested ${input.requestedMapping} mapping cannot be guaranteed for this artifact because only decompile path is available.`,
|
|
@@ -62,6 +62,7 @@ export type FindMappingInput = {
|
|
|
62
62
|
sourceMapping: SourceMapping;
|
|
63
63
|
targetMapping: SourceMapping;
|
|
64
64
|
sourcePriority?: MappingSourcePriority;
|
|
65
|
+
projectPath?: string;
|
|
65
66
|
disambiguation?: {
|
|
66
67
|
ownerHint?: string;
|
|
67
68
|
descriptorHint?: string;
|
|
@@ -74,6 +75,7 @@ export type EnsureMappingAvailableInput = {
|
|
|
74
75
|
sourceMapping: SourceMapping;
|
|
75
76
|
targetMapping: SourceMapping;
|
|
76
77
|
sourcePriority?: MappingSourcePriority;
|
|
78
|
+
projectPath?: string;
|
|
77
79
|
};
|
|
78
80
|
export type EnsureMappingAvailableOutput = {
|
|
79
81
|
transformChain: string[];
|
|
@@ -88,6 +90,7 @@ export type ResolveMethodMappingExactInput = {
|
|
|
88
90
|
sourceMapping: SourceMapping;
|
|
89
91
|
targetMapping: SourceMapping;
|
|
90
92
|
sourcePriority?: MappingSourcePriority;
|
|
93
|
+
projectPath?: string;
|
|
91
94
|
maxCandidates?: number;
|
|
92
95
|
};
|
|
93
96
|
export type ResolveMethodMappingExactOutput = SymbolResolutionOutput;
|
|
@@ -145,6 +148,16 @@ export declare class MappingService {
|
|
|
145
148
|
private readonly fetchFn;
|
|
146
149
|
private readonly graphCache;
|
|
147
150
|
private readonly buildLocks;
|
|
151
|
+
private readonly resolutionCache;
|
|
152
|
+
private static readonly RESOLUTION_CACHE_MAX;
|
|
153
|
+
private static readonly RESOLUTION_CACHE_TTL_MS;
|
|
154
|
+
private resolutionCacheHits;
|
|
155
|
+
private resolutionCacheMisses;
|
|
156
|
+
get resolutionCacheStats(): {
|
|
157
|
+
hits: number;
|
|
158
|
+
misses: number;
|
|
159
|
+
size: number;
|
|
160
|
+
};
|
|
148
161
|
constructor(config: Config, versionService?: VersionMappingsResolver, fetchFn?: typeof fetch);
|
|
149
162
|
findMapping(input: FindMappingInput): Promise<FindMappingOutput>;
|
|
150
163
|
ensureMappingAvailable(input: EnsureMappingAvailableInput): Promise<EnsureMappingAvailableOutput>;
|
|
@@ -153,6 +166,7 @@ export declare class MappingService {
|
|
|
153
166
|
checkSymbolExists(input: SymbolExistenceInput): Promise<SymbolExistenceOutput>;
|
|
154
167
|
private mapRecordBetweenMappings;
|
|
155
168
|
private mapCandidatesAlongPath;
|
|
169
|
+
private projectMethodDescriptorToTarget;
|
|
156
170
|
private provenanceForPath;
|
|
157
171
|
/**
|
|
158
172
|
* Probe the mapping graph health for a given version.
|
|
@@ -178,6 +192,8 @@ export declare class MappingService {
|
|
|
178
192
|
private fetchYarnCoordinates;
|
|
179
193
|
private trimGraphCache;
|
|
180
194
|
releaseGraphCacheEntry(version: string, sourcePriority?: MappingSourcePriority): void;
|
|
195
|
+
private buildResolutionCacheKey;
|
|
196
|
+
private trimResolutionCache;
|
|
181
197
|
}
|
|
182
198
|
/**
|
|
183
199
|
* Resolve and cache a Tiny v2 mapping file for the given Minecraft version.
|