@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.
- package/CHANGELOG.md +72 -0
- package/README.md +52 -32
- package/dist/build-suggested-call.d.ts +29 -0
- package/dist/build-suggested-call.js +58 -0
- package/dist/cache-registry.d.ts +3 -1
- package/dist/cache-registry.js +59 -7
- package/dist/config.d.ts +10 -1
- package/dist/config.js +52 -1
- package/dist/entry-tools/analyze-symbol-service.d.ts +18 -18
- package/dist/entry-tools/analyze-symbol-service.js +13 -2
- package/dist/entry-tools/batch-class-members-service.d.ts +34 -0
- package/dist/entry-tools/batch-class-members-service.js +97 -0
- package/dist/entry-tools/batch-class-source-service.d.ts +37 -0
- package/dist/entry-tools/batch-class-source-service.js +100 -0
- package/dist/entry-tools/batch-mappings-service.d.ts +36 -0
- package/dist/entry-tools/batch-mappings-service.js +66 -0
- package/dist/entry-tools/batch-runner.d.ts +72 -0
- package/dist/entry-tools/batch-runner.js +90 -0
- package/dist/entry-tools/batch-symbol-exists-service.d.ts +46 -0
- package/dist/entry-tools/batch-symbol-exists-service.js +113 -0
- package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
- package/dist/entry-tools/inspect-minecraft/handlers/artifact.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +83 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-members.d.ts +6 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +80 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-overview.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +248 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-source.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +60 -0
- package/dist/entry-tools/inspect-minecraft/handlers/file.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/file.js +54 -0
- package/dist/entry-tools/inspect-minecraft/handlers/list-files.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +100 -0
- package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +5 -0
- package/dist/entry-tools/inspect-minecraft/handlers/search.js +155 -0
- package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +6 -0
- package/dist/entry-tools/inspect-minecraft/handlers/versions.js +49 -0
- package/dist/entry-tools/inspect-minecraft/internal.d.ts +1042 -0
- package/dist/entry-tools/inspect-minecraft/internal.js +448 -0
- package/dist/entry-tools/inspect-minecraft-service.d.ts +213 -328
- package/dist/entry-tools/inspect-minecraft-service.js +20 -1238
- package/dist/entry-tools/manage-cache-service.d.ts +16 -16
- package/dist/entry-tools/validate-project/cases/access-transformer.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/access-transformer.js +106 -0
- package/dist/entry-tools/validate-project/cases/access-widener.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/access-widener.js +86 -0
- package/dist/entry-tools/validate-project/cases/mixin.d.ts +6 -0
- package/dist/entry-tools/validate-project/cases/mixin.js +90 -0
- package/dist/entry-tools/validate-project/cases/project-summary.d.ts +97 -0
- package/dist/entry-tools/validate-project/cases/project-summary.js +346 -0
- package/dist/entry-tools/validate-project/internal.d.ts +135 -0
- package/dist/entry-tools/validate-project/internal.js +287 -0
- package/dist/entry-tools/validate-project-service.d.ts +63 -47
- package/dist/entry-tools/validate-project-service.js +12 -482
- package/dist/entry-tools/verify-mixin-target-service.d.ts +133 -0
- package/dist/entry-tools/verify-mixin-target-service.js +323 -0
- package/dist/error-mapping.d.ts +40 -0
- package/dist/error-mapping.js +139 -0
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +170 -1314
- package/dist/lru-list.d.ts +31 -0
- package/dist/lru-list.js +102 -0
- package/dist/mapping/internal-types.d.ts +54 -0
- package/dist/mapping/internal-types.js +14 -0
- package/dist/mapping/loaders/mojang.d.ts +2 -0
- package/dist/mapping/loaders/mojang.js +64 -0
- package/dist/mapping/loaders/tiny-loom.d.ts +2 -0
- package/dist/mapping/loaders/tiny-loom.js +73 -0
- package/dist/mapping/loaders/tiny-maven.d.ts +2 -0
- package/dist/mapping/loaders/tiny-maven.js +104 -0
- package/dist/mapping/loaders/types.d.ts +14 -0
- package/dist/mapping/loaders/types.js +2 -0
- package/dist/mapping/lookup.d.ts +52 -0
- package/dist/mapping/lookup.js +496 -0
- package/dist/mapping/parsers/normalize.d.ts +10 -0
- package/dist/mapping/parsers/normalize.js +52 -0
- package/dist/mapping/parsers/proguard.d.ts +20 -0
- package/dist/mapping/parsers/proguard.js +138 -0
- package/dist/mapping/parsers/symbol-records.d.ts +27 -0
- package/dist/mapping/parsers/symbol-records.js +216 -0
- package/dist/mapping/parsers/tiny.d.ts +9 -0
- package/dist/mapping/parsers/tiny.js +96 -0
- package/dist/mapping/types.d.ts +147 -0
- package/dist/mapping/types.js +2 -0
- package/dist/mapping-pipeline-service.d.ts +10 -1
- package/dist/mapping-pipeline-service.js +16 -3
- package/dist/mapping-service.d.ts +15 -144
- package/dist/mapping-service.js +179 -1119
- package/dist/mixin/access-validators.d.ts +9 -0
- package/dist/mixin/access-validators.js +257 -0
- package/dist/mixin/annotation-validators.d.ts +5 -0
- package/dist/mixin/annotation-validators.js +162 -0
- package/dist/mixin/helpers.d.ts +28 -0
- package/dist/mixin/helpers.js +315 -0
- package/dist/mixin/parsed-validator.d.ts +8 -0
- package/dist/mixin/parsed-validator.js +337 -0
- package/dist/mixin/types.d.ts +208 -0
- package/dist/mixin/types.js +28 -0
- package/dist/mixin-validator.d.ts +9 -201
- package/dist/mixin-validator.js +8 -1005
- package/dist/observability.d.ts +18 -1
- package/dist/observability.js +44 -1
- package/dist/response-utils.d.ts +44 -10
- package/dist/response-utils.js +131 -17
- package/dist/source/access-validate.d.ts +4 -0
- package/dist/source/access-validate.js +254 -0
- package/dist/source/artifact-resolver.d.ts +110 -0
- package/dist/source/artifact-resolver.js +1174 -0
- package/dist/source/cache-metrics.d.ts +26 -0
- package/dist/source/cache-metrics.js +172 -0
- package/dist/source/class-source/members-builder.d.ts +34 -0
- package/dist/source/class-source/members-builder.js +46 -0
- package/dist/source/class-source/snippet-builder.d.ts +19 -0
- package/dist/source/class-source/snippet-builder.js +46 -0
- package/dist/source/class-source-helpers.d.ts +34 -0
- package/dist/source/class-source-helpers.js +140 -0
- package/dist/source/class-source.d.ts +42 -0
- package/dist/source/class-source.js +883 -0
- package/dist/source/descriptor-utils.d.ts +6 -0
- package/dist/source/descriptor-utils.js +37 -0
- package/dist/source/file-access.d.ts +4 -0
- package/dist/source/file-access.js +102 -0
- package/dist/source/indexer.d.ts +82 -0
- package/dist/source/indexer.js +505 -0
- package/dist/source/lifecycle/diff-utils.d.ts +9 -0
- package/dist/source/lifecycle/diff-utils.js +107 -0
- package/dist/source/lifecycle/diff.d.ts +2 -0
- package/dist/source/lifecycle/diff.js +265 -0
- package/dist/source/lifecycle/mapping-helpers.d.ts +22 -0
- package/dist/source/lifecycle/mapping-helpers.js +327 -0
- package/dist/source/lifecycle/runtime-check.d.ts +2 -0
- package/dist/source/lifecycle/runtime-check.js +142 -0
- package/dist/source/lifecycle/trace.d.ts +2 -0
- package/dist/source/lifecycle/trace.js +231 -0
- package/dist/source/lifecycle.d.ts +4 -0
- package/dist/source/lifecycle.js +5 -0
- package/dist/source/search.d.ts +51 -0
- package/dist/source/search.js +676 -0
- package/dist/source/shared-utils.d.ts +6 -0
- package/dist/source/shared-utils.js +55 -0
- package/dist/source/state.d.ts +21 -0
- package/dist/source/state.js +19 -0
- package/dist/source/symbol-resolver.d.ts +3 -0
- package/dist/source/symbol-resolver.js +212 -0
- package/dist/source/validate-mixin/pipeline/mapping-health.d.ts +3 -0
- package/dist/source/validate-mixin/pipeline/mapping-health.js +41 -0
- package/dist/source/validate-mixin/pipeline/parse.d.ts +2 -0
- package/dist/source/validate-mixin/pipeline/parse.js +10 -0
- package/dist/source/validate-mixin/pipeline/resolve.d.ts +3 -0
- package/dist/source/validate-mixin/pipeline/resolve.js +78 -0
- package/dist/source/validate-mixin/pipeline/target-lookup.d.ts +6 -0
- package/dist/source/validate-mixin/pipeline/target-lookup.js +260 -0
- package/dist/source/validate-mixin/pipeline-context.d.ts +72 -0
- package/dist/source/validate-mixin/pipeline-context.js +93 -0
- package/dist/source/validate-mixin.d.ts +22 -0
- package/dist/source/validate-mixin.js +799 -0
- package/dist/source/workspace-target.d.ts +18 -0
- package/dist/source/workspace-target.js +305 -0
- package/dist/source-resolver.d.ts +9 -1
- package/dist/source-resolver.js +14 -6
- package/dist/source-service.d.ts +178 -105
- package/dist/source-service.js +72 -5312
- package/dist/stage-emitter.d.ts +13 -0
- package/dist/stage-emitter.js +30 -0
- package/dist/stdio-supervisor.d.ts +61 -0
- package/dist/stdio-supervisor.js +326 -9
- 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.d.ts +1 -1
- package/dist/tool-contract-manifest.js +23 -6
- package/dist/tool-guidance.d.ts +82 -0
- package/dist/tool-guidance.js +734 -0
- package/dist/tool-schema-registry.d.ts +16 -0
- package/dist/tool-schema-registry.js +37 -0
- package/dist/tool-schemas.d.ts +3518 -0
- package/dist/tool-schemas.js +813 -0
- package/dist/types.d.ts +39 -0
- package/dist/version-service.js +7 -6
- package/dist/workspace-context-cache.d.ts +32 -0
- package/dist/workspace-context-cache.js +66 -0
- package/dist/workspace-mapping-service.d.ts +16 -0
- package/dist/workspace-mapping-service.js +173 -1
- package/docs/README-ja.md +414 -0
- package/docs/examples.md +483 -0
- package/docs/tool-reference.md +459 -0
- package/package.json +5 -2
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function remapJvmDescriptor(descriptor: string, classMap: Map<string, string>): string;
|
|
2
|
+
export declare function rebuildJavaSignature(member: {
|
|
3
|
+
name: string;
|
|
4
|
+
ownerFqn: string;
|
|
5
|
+
accessFlags: number;
|
|
6
|
+
}, remappedDescriptor: string, isField: boolean): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { modifierPrefix, parseFieldType, parseMethodDescriptor } from "../minecraft-explorer-service.js";
|
|
2
|
+
export function remapJvmDescriptor(descriptor, classMap) {
|
|
3
|
+
if (classMap.size === 0) {
|
|
4
|
+
return descriptor;
|
|
5
|
+
}
|
|
6
|
+
return descriptor.replace(/L([^;]+);/g, (match, ref) => {
|
|
7
|
+
const dotFqn = ref.replace(/\//g, ".");
|
|
8
|
+
const remapped = classMap.get(dotFqn);
|
|
9
|
+
return remapped ? `L${remapped.replace(/\./g, "/")};` : match;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function rebuildJavaSignature(member, remappedDescriptor, isField) {
|
|
13
|
+
const modifiers = modifierPrefix(member.accessFlags, isField ? "field" : "method");
|
|
14
|
+
const prefix = modifiers ? `${modifiers} ` : "";
|
|
15
|
+
if (isField) {
|
|
16
|
+
try {
|
|
17
|
+
const { type } = parseFieldType(remappedDescriptor, 0, { allowVoid: false });
|
|
18
|
+
return `${prefix}${type} ${member.name}`.trim();
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return `${prefix}${member.name}`.trim();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const { args, returnType } = parseMethodDescriptor(remappedDescriptor);
|
|
26
|
+
const argStr = args.join(", ");
|
|
27
|
+
if (member.name === "<init>") {
|
|
28
|
+
const ownerSimple = member.ownerFqn.split(".").pop();
|
|
29
|
+
return `${prefix}${ownerSimple}(${argStr})`.trim();
|
|
30
|
+
}
|
|
31
|
+
return `${prefix}${returnType} ${member.name}(${argStr})`.trim();
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return `${prefix}${member.name}`.trim();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=descriptor-utils.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SourceService } from "../source-service.js";
|
|
2
|
+
import type { GetArtifactFileInput, GetArtifactFileOutput, ListArtifactFilesInput, ListArtifactFilesOutput } from "../source-service.js";
|
|
3
|
+
export declare function getArtifactFile(svc: SourceService, input: GetArtifactFileInput): Promise<GetArtifactFileOutput>;
|
|
4
|
+
export declare function listArtifactFiles(svc: SourceService, input: ListArtifactFilesInput): Promise<ListArtifactFilesOutput>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { ERROR_CODES, createError } from "../errors.js";
|
|
2
|
+
import { log } from "../logger.js";
|
|
3
|
+
import { normalizeOptionalString, normalizePathStyle } from "./shared-utils.js";
|
|
4
|
+
function clampLimit(limit, fallback, max) {
|
|
5
|
+
if (limit === undefined || limit === null) {
|
|
6
|
+
return fallback;
|
|
7
|
+
}
|
|
8
|
+
if (!Number.isFinite(limit) || limit <= 0) {
|
|
9
|
+
return fallback;
|
|
10
|
+
}
|
|
11
|
+
return Math.min(Math.floor(limit), max);
|
|
12
|
+
}
|
|
13
|
+
function truncateUtf8ToMaxBytes(content, maxBytes) {
|
|
14
|
+
if (Buffer.byteLength(content, "utf8") <= maxBytes) {
|
|
15
|
+
return content;
|
|
16
|
+
}
|
|
17
|
+
const buffer = Buffer.from(content, "utf8");
|
|
18
|
+
let cut = Math.min(maxBytes, buffer.length);
|
|
19
|
+
while (cut > 0 && (buffer[cut] & 0xc0) === 0x80) {
|
|
20
|
+
cut -= 1;
|
|
21
|
+
}
|
|
22
|
+
return buffer.slice(0, cut).toString("utf8");
|
|
23
|
+
}
|
|
24
|
+
export async function getArtifactFile(svc, input) {
|
|
25
|
+
const startedAt = Date.now();
|
|
26
|
+
try {
|
|
27
|
+
const artifact = svc.getArtifact(input.artifactId);
|
|
28
|
+
const row = svc.filesRepo.getFileContent(artifact.artifactId, normalizePathStyle(input.filePath));
|
|
29
|
+
if (!row) {
|
|
30
|
+
throw createError({
|
|
31
|
+
code: ERROR_CODES.FILE_NOT_FOUND,
|
|
32
|
+
message: `Source file "${input.filePath}" was not found.`,
|
|
33
|
+
details: { artifactId: input.artifactId, filePath: input.filePath }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const maxBytes = clampLimit(input.maxBytes, svc.config.maxContentBytes, Number.MAX_SAFE_INTEGER);
|
|
37
|
+
const fullBytes = Buffer.byteLength(row.content, "utf8");
|
|
38
|
+
const truncated = fullBytes > maxBytes;
|
|
39
|
+
const content = truncated ? truncateUtf8ToMaxBytes(row.content, maxBytes) : row.content;
|
|
40
|
+
if (truncated) {
|
|
41
|
+
log("warn", "source.get_file.truncated", {
|
|
42
|
+
artifactId: input.artifactId,
|
|
43
|
+
filePath: input.filePath,
|
|
44
|
+
maxBytes,
|
|
45
|
+
returnedBytes: Buffer.byteLength(content, "utf8"),
|
|
46
|
+
fullBytes
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
filePath: row.filePath,
|
|
51
|
+
content,
|
|
52
|
+
contentBytes: fullBytes,
|
|
53
|
+
truncated,
|
|
54
|
+
mappingApplied: artifact.mappingApplied ?? "obfuscated",
|
|
55
|
+
returnedNamespace: artifact.mappingApplied ?? "obfuscated",
|
|
56
|
+
artifactContents: svc.buildArtifactContentsSummary({
|
|
57
|
+
origin: artifact.origin,
|
|
58
|
+
sourceJarPath: artifact.sourceJarPath,
|
|
59
|
+
isDecompiled: artifact.isDecompiled,
|
|
60
|
+
qualityFlags: artifact.qualityFlags
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
svc.metrics.recordDuration("get_file_duration_ms", Date.now() - startedAt);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export async function listArtifactFiles(svc, input) {
|
|
69
|
+
const startedAt = Date.now();
|
|
70
|
+
try {
|
|
71
|
+
const artifact = svc.getArtifact(input.artifactId);
|
|
72
|
+
const limit = clampLimit(input.limit, 200, 2000);
|
|
73
|
+
const warnings = [];
|
|
74
|
+
const page = svc.filesRepo.listFiles(artifact.artifactId, {
|
|
75
|
+
limit,
|
|
76
|
+
cursor: input.cursor,
|
|
77
|
+
prefix: input.prefix
|
|
78
|
+
});
|
|
79
|
+
const normalizedPrefix = normalizeOptionalString(input.prefix);
|
|
80
|
+
if (normalizedPrefix &&
|
|
81
|
+
page.items.length === 0 &&
|
|
82
|
+
(normalizedPrefix.startsWith("assets/") || normalizedPrefix.startsWith("data/"))) {
|
|
83
|
+
warnings.push("Indexed artifacts currently include Java source only; non-Java resources are not indexed. Inspect the original jar on disk if you need assets or data files.");
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
items: page.items,
|
|
87
|
+
nextCursor: page.nextCursor,
|
|
88
|
+
mappingApplied: artifact.mappingApplied ?? "obfuscated",
|
|
89
|
+
artifactContents: svc.buildArtifactContentsSummary({
|
|
90
|
+
origin: artifact.origin,
|
|
91
|
+
sourceJarPath: artifact.sourceJarPath,
|
|
92
|
+
isDecompiled: artifact.isDecompiled,
|
|
93
|
+
qualityFlags: artifact.qualityFlags
|
|
94
|
+
}),
|
|
95
|
+
warnings
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
svc.metrics.recordDuration("list_files_duration_ms", Date.now() - startedAt);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=file-access.js.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { SourceService } from "../source-service.js";
|
|
2
|
+
import type { ArtifactIndexMetaRow } from "../storage/index-meta-repo.js";
|
|
3
|
+
import type { ArtifactRow, ResolvedSourceArtifact } from "../types.js";
|
|
4
|
+
export declare const INDEX_SCHEMA_VERSION = 1;
|
|
5
|
+
export type IndexRebuildReason = "force" | "missing_meta" | "schema_mismatch" | "signature_mismatch" | "already_current";
|
|
6
|
+
export interface IndexedFileRecord {
|
|
7
|
+
filePath: string;
|
|
8
|
+
content: string;
|
|
9
|
+
contentBytes: number;
|
|
10
|
+
contentHash: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RebuiltArtifactData {
|
|
13
|
+
files: IndexedFileRecord[];
|
|
14
|
+
symbols: Array<{
|
|
15
|
+
filePath: string;
|
|
16
|
+
symbolKind: string;
|
|
17
|
+
symbolName: string;
|
|
18
|
+
qualifiedName: string | undefined;
|
|
19
|
+
line: number;
|
|
20
|
+
}>;
|
|
21
|
+
indexedAt: string;
|
|
22
|
+
indexDurationMs: number;
|
|
23
|
+
totalContentBytes: number;
|
|
24
|
+
}
|
|
25
|
+
export type IndexArtifactInput = {
|
|
26
|
+
artifactId: string;
|
|
27
|
+
force?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type IndexArtifactOutput = {
|
|
30
|
+
artifactId: string;
|
|
31
|
+
reindexed: boolean;
|
|
32
|
+
reason: IndexRebuildReason;
|
|
33
|
+
counts: {
|
|
34
|
+
files: number;
|
|
35
|
+
symbols: number;
|
|
36
|
+
ftsRows: number;
|
|
37
|
+
};
|
|
38
|
+
indexedAt: string;
|
|
39
|
+
durationMs: number;
|
|
40
|
+
mappingApplied: import("../types.js").SourceMapping;
|
|
41
|
+
};
|
|
42
|
+
export declare function indexArtifact(svc: SourceService, input: IndexArtifactInput): Promise<IndexArtifactOutput>;
|
|
43
|
+
export declare function fallbackArtifactSignature(artifactId: string): string;
|
|
44
|
+
export declare function resolveIndexRebuildReason(input: {
|
|
45
|
+
force: boolean;
|
|
46
|
+
expectedSignature: string;
|
|
47
|
+
hasFiles: boolean;
|
|
48
|
+
meta: ArtifactIndexMetaRow | undefined;
|
|
49
|
+
}): IndexRebuildReason;
|
|
50
|
+
export declare function toResolvedArtifact(svc: SourceService, artifact: ArtifactRow): ResolvedSourceArtifact;
|
|
51
|
+
export declare function rebuildAndPersistArtifactIndex(svc: SourceService, resolved: ResolvedSourceArtifact, reason: Exclude<IndexRebuildReason, "already_current">): Promise<RebuiltArtifactData>;
|
|
52
|
+
export declare function buildRebuiltArtifactData(svc: SourceService, resolved: ResolvedSourceArtifact): Promise<RebuiltArtifactData>;
|
|
53
|
+
export declare function getArtifact(svc: SourceService, artifactId: string): ArtifactRow;
|
|
54
|
+
export declare function ingestIfNeeded(svc: SourceService, resolved: ResolvedSourceArtifact): Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* If the resolved artifact's transformChain promised an "obf -> mojang"
|
|
57
|
+
* binary remap, run tiny-remapper now and return the remapped jar path.
|
|
58
|
+
* Otherwise return the original binaryJarPath unchanged.
|
|
59
|
+
*
|
|
60
|
+
* Cache safety: writes to a per-attempt temp file then atomic-renames into
|
|
61
|
+
* <cacheDir>/remapped/<artifactId>.jar. A per-target inflight Promise map
|
|
62
|
+
* collapses concurrent calls so two simultaneous resolveArtifact calls for
|
|
63
|
+
* the same artifactId share one tiny-remapper run instead of racing on the
|
|
64
|
+
* same output path.
|
|
65
|
+
*/
|
|
66
|
+
export declare function maybeRemapBinaryForMojang(svc: SourceService, resolved: ResolvedSourceArtifact): Promise<string>;
|
|
67
|
+
export declare function recordRemappedJarBytesFromDisk(svc: SourceService, artifactId: string, path: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Best-effort structural check that `path` is a non-empty file beginning with
|
|
70
|
+
* the ZIP local-file-header magic (`50 4B 03 04`). Used to drop partial /
|
|
71
|
+
* corrupt remap-cache entries before they reach Vineflower. False positives
|
|
72
|
+
* are acceptable (Vineflower will surface a clearer error); false negatives
|
|
73
|
+
* are not (a corrupt cache hit must be evicted).
|
|
74
|
+
*/
|
|
75
|
+
export declare function isUsableJarFile(path: string): Promise<boolean>;
|
|
76
|
+
export declare function runBinaryRemap(svc: SourceService, input: {
|
|
77
|
+
version: string;
|
|
78
|
+
inputJar: string;
|
|
79
|
+
remappedDir: string;
|
|
80
|
+
remappedJarPath: string;
|
|
81
|
+
}): Promise<string>;
|
|
82
|
+
export declare function loadFromSourceJar(svc: SourceService, sourceJarPath: string): Promise<IndexedFileRecord[]>;
|