@adhisang/minecraft-modding-mcp 1.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 +11 -0
- package/LICENSE +21 -0
- package/README.md +765 -0
- package/dist/access-widener-parser.d.ts +24 -0
- package/dist/access-widener-parser.js +77 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +4 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +178 -0
- package/dist/decompiler/vineflower.d.ts +15 -0
- package/dist/decompiler/vineflower.js +185 -0
- package/dist/errors.d.ts +50 -0
- package/dist/errors.js +49 -0
- package/dist/hash.d.ts +1 -0
- package/dist/hash.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1447 -0
- package/dist/java-process.d.ts +16 -0
- package/dist/java-process.js +120 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.js +21 -0
- package/dist/mapping-pipeline-service.d.ts +18 -0
- package/dist/mapping-pipeline-service.js +60 -0
- package/dist/mapping-service.d.ts +161 -0
- package/dist/mapping-service.js +1706 -0
- package/dist/maven-resolver.d.ts +22 -0
- package/dist/maven-resolver.js +122 -0
- package/dist/minecraft-explorer-service.d.ts +43 -0
- package/dist/minecraft-explorer-service.js +562 -0
- package/dist/mixin-parser.d.ts +34 -0
- package/dist/mixin-parser.js +194 -0
- package/dist/mixin-validator.d.ts +59 -0
- package/dist/mixin-validator.js +274 -0
- package/dist/mod-analyzer.d.ts +23 -0
- package/dist/mod-analyzer.js +346 -0
- package/dist/mod-decompile-service.d.ts +39 -0
- package/dist/mod-decompile-service.js +136 -0
- package/dist/mod-remap-service.d.ts +17 -0
- package/dist/mod-remap-service.js +186 -0
- package/dist/mod-search-service.d.ts +28 -0
- package/dist/mod-search-service.js +174 -0
- package/dist/mojang-tiny-mapping-service.d.ts +13 -0
- package/dist/mojang-tiny-mapping-service.js +351 -0
- package/dist/nbt/java-nbt-codec.d.ts +3 -0
- package/dist/nbt/java-nbt-codec.js +385 -0
- package/dist/nbt/json-patch.d.ts +3 -0
- package/dist/nbt/json-patch.js +352 -0
- package/dist/nbt/pipeline.d.ts +39 -0
- package/dist/nbt/pipeline.js +173 -0
- package/dist/nbt/typed-json.d.ts +10 -0
- package/dist/nbt/typed-json.js +205 -0
- package/dist/nbt/types.d.ts +66 -0
- package/dist/nbt/types.js +2 -0
- package/dist/observability.d.ts +88 -0
- package/dist/observability.js +165 -0
- package/dist/path-converter.d.ts +12 -0
- package/dist/path-converter.js +161 -0
- package/dist/path-resolver.d.ts +19 -0
- package/dist/path-resolver.js +78 -0
- package/dist/registry-service.d.ts +29 -0
- package/dist/registry-service.js +214 -0
- package/dist/repo-downloader.d.ts +15 -0
- package/dist/repo-downloader.js +111 -0
- package/dist/resources.d.ts +3 -0
- package/dist/resources.js +154 -0
- package/dist/search-hit-accumulator.d.ts +38 -0
- package/dist/search-hit-accumulator.js +153 -0
- package/dist/source-jar-reader.d.ts +13 -0
- package/dist/source-jar-reader.js +216 -0
- package/dist/source-resolver.d.ts +14 -0
- package/dist/source-resolver.js +274 -0
- package/dist/source-service.d.ts +404 -0
- package/dist/source-service.js +2881 -0
- package/dist/storage/artifacts-repo.d.ts +45 -0
- package/dist/storage/artifacts-repo.js +209 -0
- package/dist/storage/db.d.ts +14 -0
- package/dist/storage/db.js +132 -0
- package/dist/storage/files-repo.d.ts +78 -0
- package/dist/storage/files-repo.js +437 -0
- package/dist/storage/index-meta-repo.d.ts +35 -0
- package/dist/storage/index-meta-repo.js +97 -0
- package/dist/storage/migrations.d.ts +11 -0
- package/dist/storage/migrations.js +71 -0
- package/dist/storage/schema.d.ts +1 -0
- package/dist/storage/schema.js +160 -0
- package/dist/storage/sqlite.d.ts +20 -0
- package/dist/storage/sqlite.js +111 -0
- package/dist/storage/symbols-repo.d.ts +63 -0
- package/dist/storage/symbols-repo.js +401 -0
- package/dist/symbols/symbol-extractor.d.ts +7 -0
- package/dist/symbols/symbol-extractor.js +64 -0
- package/dist/tiny-remapper-resolver.d.ts +1 -0
- package/dist/tiny-remapper-resolver.js +62 -0
- package/dist/tiny-remapper-service.d.ts +16 -0
- package/dist/tiny-remapper-service.js +73 -0
- package/dist/types.d.ts +120 -0
- package/dist/types.js +2 -0
- package/dist/version-diff-service.d.ts +41 -0
- package/dist/version-diff-service.js +222 -0
- package/dist/version-service.d.ts +70 -0
- package/dist/version-service.js +411 -0
- package/dist/vineflower-resolver.d.ts +1 -0
- package/dist/vineflower-resolver.js +62 -0
- package/dist/workspace-mapping-service.d.ts +18 -0
- package/dist/workspace-mapping-service.js +89 -0
- package/package.json +61 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface JavaProcessOptions {
|
|
2
|
+
jarPath: string;
|
|
3
|
+
args: string[];
|
|
4
|
+
cwd?: string;
|
|
5
|
+
timeoutMs?: number;
|
|
6
|
+
maxMemoryMb?: number;
|
|
7
|
+
minMemoryMb?: number;
|
|
8
|
+
normalizePathArgs?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface JavaProcessResult {
|
|
11
|
+
exitCode: number;
|
|
12
|
+
stdoutTail: string;
|
|
13
|
+
stderrTail: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function assertJavaAvailable(): Promise<void>;
|
|
16
|
+
export declare function runJavaProcess(options: JavaProcessOptions): Promise<JavaProcessResult>;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createError, ERROR_CODES } from "./errors.js";
|
|
3
|
+
import { normalizePathForHost } from "./path-converter.js";
|
|
4
|
+
const JAVA_CHECK_TIMEOUT_MS = 2_000;
|
|
5
|
+
const MAX_STDIO_SNAPSHOT = 6_240;
|
|
6
|
+
function limitStdio(text) {
|
|
7
|
+
if (text.length <= MAX_STDIO_SNAPSHOT) {
|
|
8
|
+
return text;
|
|
9
|
+
}
|
|
10
|
+
return text.slice(-MAX_STDIO_SNAPSHOT);
|
|
11
|
+
}
|
|
12
|
+
function isAbsolutePath(value) {
|
|
13
|
+
return value.startsWith("/") || /^[A-Za-z]:[\\/]/.test(value);
|
|
14
|
+
}
|
|
15
|
+
function isOptionArg(value) {
|
|
16
|
+
return value.startsWith("-");
|
|
17
|
+
}
|
|
18
|
+
function normalizeArgs(args) {
|
|
19
|
+
return args.map((arg) => {
|
|
20
|
+
if (isOptionArg(arg)) {
|
|
21
|
+
return arg;
|
|
22
|
+
}
|
|
23
|
+
if (isAbsolutePath(arg)) {
|
|
24
|
+
return normalizePathForHost(arg);
|
|
25
|
+
}
|
|
26
|
+
return arg;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export async function assertJavaAvailable() {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const proc = spawn("java", ["-version"], { stdio: "ignore" });
|
|
32
|
+
const timer = setTimeout(() => {
|
|
33
|
+
proc.kill();
|
|
34
|
+
reject(createError({
|
|
35
|
+
code: ERROR_CODES.JAVA_UNAVAILABLE,
|
|
36
|
+
message: "java was not available within timeout."
|
|
37
|
+
}));
|
|
38
|
+
}, JAVA_CHECK_TIMEOUT_MS);
|
|
39
|
+
proc.once("error", () => {
|
|
40
|
+
clearTimeout(timer);
|
|
41
|
+
reject(createError({
|
|
42
|
+
code: ERROR_CODES.JAVA_UNAVAILABLE,
|
|
43
|
+
message: "java command is not available."
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
46
|
+
proc.once("exit", (code) => {
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
if (code !== 0 && code !== null) {
|
|
49
|
+
reject(createError({
|
|
50
|
+
code: ERROR_CODES.JAVA_UNAVAILABLE,
|
|
51
|
+
message: "java -version failed."
|
|
52
|
+
}));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
resolve();
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export function runJavaProcess(options) {
|
|
60
|
+
const { jarPath, args, cwd, timeoutMs = 120_000, maxMemoryMb, minMemoryMb, normalizePathArgs = false } = options;
|
|
61
|
+
const jvmArgs = [];
|
|
62
|
+
if (maxMemoryMb) {
|
|
63
|
+
jvmArgs.push(`-Xmx${maxMemoryMb}m`);
|
|
64
|
+
}
|
|
65
|
+
if (minMemoryMb) {
|
|
66
|
+
jvmArgs.push(`-Xms${minMemoryMb}m`);
|
|
67
|
+
}
|
|
68
|
+
const normalizedJar = normalizePathArgs ? normalizePathForHost(jarPath) : jarPath;
|
|
69
|
+
const processedArgs = normalizePathArgs ? normalizeArgs(args) : args;
|
|
70
|
+
const spawnArgs = [...jvmArgs, "-jar", normalizedJar, ...processedArgs];
|
|
71
|
+
return new Promise((resolve, reject) => {
|
|
72
|
+
const proc = spawn("java", spawnArgs, {
|
|
73
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
74
|
+
...(cwd ? { cwd } : {})
|
|
75
|
+
});
|
|
76
|
+
let stdout = "";
|
|
77
|
+
let stderr = "";
|
|
78
|
+
const timer = setTimeout(() => {
|
|
79
|
+
proc.kill();
|
|
80
|
+
reject(createError({
|
|
81
|
+
code: ERROR_CODES.JAVA_PROCESS_FAILED,
|
|
82
|
+
message: "Java process timed out.",
|
|
83
|
+
details: {
|
|
84
|
+
jarPath: normalizedJar,
|
|
85
|
+
reason: "timeout",
|
|
86
|
+
timeoutMs,
|
|
87
|
+
stderrTail: limitStdio(stderr)
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
}, timeoutMs);
|
|
91
|
+
proc.stdout?.on("data", (chunk) => {
|
|
92
|
+
stdout += chunk.toString("utf8");
|
|
93
|
+
stdout = limitStdio(stdout);
|
|
94
|
+
});
|
|
95
|
+
proc.stderr?.on("data", (chunk) => {
|
|
96
|
+
stderr += chunk.toString("utf8");
|
|
97
|
+
stderr = limitStdio(stderr);
|
|
98
|
+
});
|
|
99
|
+
proc.once("error", (error) => {
|
|
100
|
+
clearTimeout(timer);
|
|
101
|
+
reject(createError({
|
|
102
|
+
code: ERROR_CODES.JAVA_PROCESS_FAILED,
|
|
103
|
+
message: "Java process failed to start.",
|
|
104
|
+
details: {
|
|
105
|
+
jarPath: normalizedJar,
|
|
106
|
+
error: error instanceof Error ? error.message : String(error)
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
});
|
|
110
|
+
proc.once("exit", (code) => {
|
|
111
|
+
clearTimeout(timer);
|
|
112
|
+
resolve({
|
|
113
|
+
exitCode: code ?? -1,
|
|
114
|
+
stdoutTail: limitStdio(stdout),
|
|
115
|
+
stderrTail: limitStdio(stderr)
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=java-process.js.map
|
package/dist/logger.d.ts
ADDED
package/dist/logger.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function serializeLog(level, event, details) {
|
|
2
|
+
return JSON.stringify({
|
|
3
|
+
timestamp: new Date().toISOString(),
|
|
4
|
+
level,
|
|
5
|
+
event,
|
|
6
|
+
...(details ?? {})
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
export function log(level, event, details) {
|
|
10
|
+
const line = serializeLog(level, event, details);
|
|
11
|
+
if (level === "error") {
|
|
12
|
+
console.error(line);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (level === "warn") {
|
|
16
|
+
console.warn(line);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
console.info(line);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ResolvedSourceArtifact, SourceMapping, SourceTargetInput } from "./types.js";
|
|
2
|
+
export interface MappingPipelineInput {
|
|
3
|
+
requestedMapping: SourceMapping;
|
|
4
|
+
target: SourceTargetInput;
|
|
5
|
+
resolved: ResolvedSourceArtifact;
|
|
6
|
+
}
|
|
7
|
+
export interface MappingPipelineResult {
|
|
8
|
+
mappingApplied: SourceMapping;
|
|
9
|
+
qualityFlags: string[];
|
|
10
|
+
transformChain: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Mapping pipeline for v0.3.
|
|
14
|
+
* Current implementation enforces explicit guarantees:
|
|
15
|
+
* - official: always pass-through
|
|
16
|
+
* - mojang: requires source-backed artifact; decompile-only artifacts are rejected
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyMappingPipeline(input: MappingPipelineInput): MappingPipelineResult;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { createError, ERROR_CODES } from "./errors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Mapping pipeline for v0.3.
|
|
4
|
+
* Current implementation enforces explicit guarantees:
|
|
5
|
+
* - official: always pass-through
|
|
6
|
+
* - mojang: requires source-backed artifact; decompile-only artifacts are rejected
|
|
7
|
+
*/
|
|
8
|
+
export function applyMappingPipeline(input) {
|
|
9
|
+
const transformChain = [];
|
|
10
|
+
const qualityFlags = [];
|
|
11
|
+
if (input.requestedMapping === "official") {
|
|
12
|
+
transformChain.push("mapping:official-pass-through");
|
|
13
|
+
if (input.resolved.isDecompiled) {
|
|
14
|
+
qualityFlags.push("decompiled");
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
qualityFlags.push("source-backed");
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
mappingApplied: "official",
|
|
21
|
+
qualityFlags,
|
|
22
|
+
transformChain
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (input.requestedMapping !== "mojang" &&
|
|
26
|
+
input.requestedMapping !== "intermediary" &&
|
|
27
|
+
input.requestedMapping !== "yarn") {
|
|
28
|
+
throw createError({
|
|
29
|
+
code: ERROR_CODES.MAPPING_UNAVAILABLE,
|
|
30
|
+
message: `Unsupported mapping "${input.requestedMapping}".`,
|
|
31
|
+
details: {
|
|
32
|
+
requestedMapping: input.requestedMapping,
|
|
33
|
+
target: input.target
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const hasSource = Boolean(input.resolved.sourceJarPath);
|
|
38
|
+
if (!hasSource) {
|
|
39
|
+
throw createError({
|
|
40
|
+
code: ERROR_CODES.MAPPING_NOT_APPLIED,
|
|
41
|
+
message: `Requested ${input.requestedMapping} mapping cannot be guaranteed for this artifact because only decompile path is available.`,
|
|
42
|
+
details: {
|
|
43
|
+
requestedMapping: input.requestedMapping,
|
|
44
|
+
target: input.target,
|
|
45
|
+
origin: input.resolved.origin,
|
|
46
|
+
binaryJarPath: input.resolved.binaryJarPath,
|
|
47
|
+
sourceJarPath: input.resolved.sourceJarPath,
|
|
48
|
+
nextAction: "Provide a source-backed artifact (source jar) or use mapping=official."
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
transformChain.push(`mapping:${input.requestedMapping}-source-backed`);
|
|
53
|
+
qualityFlags.push("source-backed");
|
|
54
|
+
return {
|
|
55
|
+
mappingApplied: input.requestedMapping,
|
|
56
|
+
qualityFlags,
|
|
57
|
+
transformChain
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=mapping-pipeline-service.js.map
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import type { Config, MappingSourcePriority, SourceMapping } from "./types.js";
|
|
2
|
+
import { VersionService } from "./version-service.js";
|
|
3
|
+
type MappingLookupSource = "loom-cache" | "maven" | "mojang-client-mappings";
|
|
4
|
+
type MappingSymbolKind = "class" | "field" | "method";
|
|
5
|
+
type VersionMappingsResolver = Pick<VersionService, "resolveVersionMappings">;
|
|
6
|
+
export type MappingMatchKind = "exact" | "normalized" | "simple-name";
|
|
7
|
+
export type MappingLookupCandidate = {
|
|
8
|
+
symbol: string;
|
|
9
|
+
matchKind: MappingMatchKind;
|
|
10
|
+
confidence: number;
|
|
11
|
+
kind: MappingSymbolKind;
|
|
12
|
+
owner?: string;
|
|
13
|
+
name: string;
|
|
14
|
+
descriptor?: string;
|
|
15
|
+
};
|
|
16
|
+
export type MappingLookupProvenance = {
|
|
17
|
+
source: MappingLookupSource;
|
|
18
|
+
mappingArtifact: string;
|
|
19
|
+
version: string;
|
|
20
|
+
priority: MappingSourcePriority;
|
|
21
|
+
};
|
|
22
|
+
export type SymbolQueryKind = MappingSymbolKind;
|
|
23
|
+
export type SymbolQueryInput = {
|
|
24
|
+
kind: SymbolQueryKind;
|
|
25
|
+
name: string;
|
|
26
|
+
owner?: string;
|
|
27
|
+
descriptor?: string;
|
|
28
|
+
};
|
|
29
|
+
export type SymbolReference = {
|
|
30
|
+
kind: SymbolQueryKind;
|
|
31
|
+
name: string;
|
|
32
|
+
owner?: string;
|
|
33
|
+
descriptor?: string;
|
|
34
|
+
symbol: string;
|
|
35
|
+
};
|
|
36
|
+
export type SymbolResolutionStatus = "resolved" | "not_found" | "ambiguous" | "mapping_unavailable";
|
|
37
|
+
export type SymbolResolutionOutput = {
|
|
38
|
+
querySymbol: SymbolReference;
|
|
39
|
+
mappingContext: {
|
|
40
|
+
version: string;
|
|
41
|
+
sourceMapping: SourceMapping;
|
|
42
|
+
targetMapping?: SourceMapping;
|
|
43
|
+
sourcePriorityApplied: MappingSourcePriority;
|
|
44
|
+
};
|
|
45
|
+
resolved: boolean;
|
|
46
|
+
status: SymbolResolutionStatus;
|
|
47
|
+
resolvedSymbol?: SymbolReference;
|
|
48
|
+
candidates: Array<SymbolReference & Pick<MappingLookupCandidate, "matchKind" | "confidence">>;
|
|
49
|
+
warnings: string[];
|
|
50
|
+
provenance?: MappingLookupProvenance;
|
|
51
|
+
};
|
|
52
|
+
export type FindMappingInput = {
|
|
53
|
+
version: string;
|
|
54
|
+
kind: SymbolQueryKind;
|
|
55
|
+
name: string;
|
|
56
|
+
owner?: string;
|
|
57
|
+
descriptor?: string;
|
|
58
|
+
sourceMapping: SourceMapping;
|
|
59
|
+
targetMapping: SourceMapping;
|
|
60
|
+
sourcePriority?: MappingSourcePriority;
|
|
61
|
+
};
|
|
62
|
+
export type FindMappingOutput = SymbolResolutionOutput;
|
|
63
|
+
export type EnsureMappingAvailableInput = {
|
|
64
|
+
version: string;
|
|
65
|
+
sourceMapping: SourceMapping;
|
|
66
|
+
targetMapping: SourceMapping;
|
|
67
|
+
sourcePriority?: MappingSourcePriority;
|
|
68
|
+
};
|
|
69
|
+
export type EnsureMappingAvailableOutput = {
|
|
70
|
+
transformChain: string[];
|
|
71
|
+
warnings: string[];
|
|
72
|
+
provenance?: MappingLookupProvenance;
|
|
73
|
+
};
|
|
74
|
+
export type ResolveMethodMappingExactInput = {
|
|
75
|
+
version: string;
|
|
76
|
+
kind: SymbolQueryKind;
|
|
77
|
+
name: string;
|
|
78
|
+
owner?: string;
|
|
79
|
+
descriptor?: string;
|
|
80
|
+
sourceMapping: SourceMapping;
|
|
81
|
+
targetMapping: SourceMapping;
|
|
82
|
+
sourcePriority?: MappingSourcePriority;
|
|
83
|
+
};
|
|
84
|
+
export type ResolveMethodMappingExactOutput = SymbolResolutionOutput;
|
|
85
|
+
export type ClassApiMatrixKind = "class" | "field" | "method";
|
|
86
|
+
export type ClassApiMatrixInput = {
|
|
87
|
+
version: string;
|
|
88
|
+
className: string;
|
|
89
|
+
classNameMapping: SourceMapping;
|
|
90
|
+
sourcePriority?: MappingSourcePriority;
|
|
91
|
+
includeKinds?: ClassApiMatrixKind[];
|
|
92
|
+
};
|
|
93
|
+
export type ClassApiMatrixEntry = {
|
|
94
|
+
symbol: string;
|
|
95
|
+
owner?: string;
|
|
96
|
+
name: string;
|
|
97
|
+
descriptor?: string;
|
|
98
|
+
};
|
|
99
|
+
export type ClassApiMatrixRow = {
|
|
100
|
+
kind: ClassApiMatrixKind;
|
|
101
|
+
descriptor?: string;
|
|
102
|
+
official?: ClassApiMatrixEntry;
|
|
103
|
+
mojang?: ClassApiMatrixEntry;
|
|
104
|
+
intermediary?: ClassApiMatrixEntry;
|
|
105
|
+
yarn?: ClassApiMatrixEntry;
|
|
106
|
+
completeness: boolean;
|
|
107
|
+
};
|
|
108
|
+
export type ClassApiMatrixOutput = {
|
|
109
|
+
version: string;
|
|
110
|
+
className: string;
|
|
111
|
+
classNameMapping: SourceMapping;
|
|
112
|
+
classIdentity: Partial<Record<SourceMapping, string>>;
|
|
113
|
+
rows: ClassApiMatrixRow[];
|
|
114
|
+
warnings: string[];
|
|
115
|
+
};
|
|
116
|
+
export type SymbolExistenceInput = {
|
|
117
|
+
version: string;
|
|
118
|
+
kind: SymbolQueryKind;
|
|
119
|
+
name: string;
|
|
120
|
+
owner?: string;
|
|
121
|
+
descriptor?: string;
|
|
122
|
+
sourceMapping: SourceMapping;
|
|
123
|
+
sourcePriority?: MappingSourcePriority;
|
|
124
|
+
};
|
|
125
|
+
export type SymbolExistenceOutput = SymbolResolutionOutput;
|
|
126
|
+
export declare class MappingService {
|
|
127
|
+
private readonly config;
|
|
128
|
+
private readonly versionService;
|
|
129
|
+
private readonly fetchFn;
|
|
130
|
+
private readonly graphCache;
|
|
131
|
+
private readonly buildLocks;
|
|
132
|
+
constructor(config: Config, versionService?: VersionMappingsResolver, fetchFn?: typeof fetch);
|
|
133
|
+
findMapping(input: FindMappingInput): Promise<FindMappingOutput>;
|
|
134
|
+
ensureMappingAvailable(input: EnsureMappingAvailableInput): Promise<EnsureMappingAvailableOutput>;
|
|
135
|
+
resolveMethodMappingExact(input: ResolveMethodMappingExactInput): Promise<ResolveMethodMappingExactOutput>;
|
|
136
|
+
getClassApiMatrix(input: ClassApiMatrixInput): Promise<ClassApiMatrixOutput>;
|
|
137
|
+
checkSymbolExists(input: SymbolExistenceInput): Promise<SymbolExistenceOutput>;
|
|
138
|
+
private mapRecordBetweenMappings;
|
|
139
|
+
private mapCandidatesAlongPath;
|
|
140
|
+
private provenanceForPath;
|
|
141
|
+
private loadGraph;
|
|
142
|
+
private buildGraph;
|
|
143
|
+
private mergePairs;
|
|
144
|
+
private loadMojangPairs;
|
|
145
|
+
private loadTinyPairsFromLoom;
|
|
146
|
+
private loadTinyPairsFromMaven;
|
|
147
|
+
private parseTinyFromJar;
|
|
148
|
+
private fetchYarnCoordinates;
|
|
149
|
+
private trimGraphCache;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Resolve and cache a Tiny v2 mapping file for the given Minecraft version.
|
|
153
|
+
*
|
|
154
|
+
* @param version - Minecraft version (e.g. "1.20.4")
|
|
155
|
+
* @param mapping - "intermediary" or "yarn"
|
|
156
|
+
* @param cacheDir - The application cache directory
|
|
157
|
+
* @param fetchFn - Optional fetch implementation for testing
|
|
158
|
+
* @returns Path to the extracted Tiny v2 file
|
|
159
|
+
*/
|
|
160
|
+
export declare function resolveTinyMappingFile(version: string, mapping: "intermediary" | "yarn", cacheDir: string, fetchFn?: typeof fetch): Promise<string>;
|
|
161
|
+
export {};
|