@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,208 @@
|
|
|
1
|
+
import type { SignatureMember } from "../minecraft-explorer-service.js";
|
|
2
|
+
import type { AccessWidenerEntry } from "../access-widener-parser.js";
|
|
3
|
+
import type { AccessTransformerEntry } from "../access-transformer-parser.js";
|
|
4
|
+
import type { AccessTransformerNamespace, RuntimeValidationProvenance, SourceMapping } from "../types.js";
|
|
5
|
+
export type MappingHealthReport = {
|
|
6
|
+
jarAvailable: boolean;
|
|
7
|
+
jarPath: string;
|
|
8
|
+
mojangMappingsAvailable: boolean;
|
|
9
|
+
tinyMappingsAvailable: boolean;
|
|
10
|
+
memberRemapAvailable: boolean;
|
|
11
|
+
overallHealthy: boolean;
|
|
12
|
+
degradations: string[];
|
|
13
|
+
};
|
|
14
|
+
export type IssueConfidence = "definite" | "likely" | "uncertain";
|
|
15
|
+
export type ValidationStatus = "full" | "partial" | "invalid";
|
|
16
|
+
export type ResolutionPath = "member-remap-failed" | "target-mapping-failed" | "target-class-missing" | "source-signature-unavailable";
|
|
17
|
+
export type IssueCategory = "mapping" | "configuration" | "validation" | "resolution" | "parse";
|
|
18
|
+
export type ValidationIssue = {
|
|
19
|
+
severity: "error" | "warning";
|
|
20
|
+
kind: "target-not-found" | "validation-incomplete" | "target-mapping-failed" | "method-not-found" | "field-not-found" | "descriptor-mismatch" | "access-mismatch" | "unknown-annotation";
|
|
21
|
+
annotation: string;
|
|
22
|
+
target: string;
|
|
23
|
+
message: string;
|
|
24
|
+
suggestions?: string[];
|
|
25
|
+
line?: number;
|
|
26
|
+
confidence?: IssueConfidence;
|
|
27
|
+
confidenceReason?: string;
|
|
28
|
+
category?: IssueCategory;
|
|
29
|
+
resolutionPath?: ResolutionPath;
|
|
30
|
+
explanation?: string;
|
|
31
|
+
suggestedCall?: {
|
|
32
|
+
tool: string;
|
|
33
|
+
params: Record<string, unknown>;
|
|
34
|
+
};
|
|
35
|
+
falsePositiveRisk?: "high" | "medium" | "low";
|
|
36
|
+
issueOrigin?: "code_issue" | "tool_issue" | "parser_limitation";
|
|
37
|
+
};
|
|
38
|
+
export type ValidationSummary = {
|
|
39
|
+
injections: number;
|
|
40
|
+
shadows: number;
|
|
41
|
+
accessors: number;
|
|
42
|
+
total: number;
|
|
43
|
+
membersValidated: number;
|
|
44
|
+
membersSkipped: number;
|
|
45
|
+
membersMissing: number;
|
|
46
|
+
errors: number;
|
|
47
|
+
warnings: number;
|
|
48
|
+
definiteErrors: number;
|
|
49
|
+
uncertainErrors: number;
|
|
50
|
+
resolutionErrors: number;
|
|
51
|
+
parseWarnings: number;
|
|
52
|
+
/** Number of targets deferred because target-lookup stage budget was exhausted mid-loop. */
|
|
53
|
+
targetsDeferredBudget?: number;
|
|
54
|
+
/** Reason this run produced a partial result. Only set when budget caused degradation. */
|
|
55
|
+
degradedReason?: "stage-budget" | "stage-budget-pre-target";
|
|
56
|
+
};
|
|
57
|
+
export type TargetOutcome = {
|
|
58
|
+
targetClass: string;
|
|
59
|
+
status: "ok" | "deferred-budget" | "tool-issue";
|
|
60
|
+
reason?: string;
|
|
61
|
+
budgetMs?: number;
|
|
62
|
+
elapsedMs?: number;
|
|
63
|
+
/** Per-target soft cap exceeded but the target still completed. */
|
|
64
|
+
slowTarget?: boolean;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Per-stage soft-deadline budgets (ms) for validate-mixin. Each stage uses
|
|
68
|
+
* an independent timer; budgets do not accumulate across stages. `perTarget`
|
|
69
|
+
* is an observability cap — it flags `slowTarget: true` on completed targets
|
|
70
|
+
* but never aborts an in-flight one.
|
|
71
|
+
*/
|
|
72
|
+
export type MixinStageBudgets = {
|
|
73
|
+
inputValidation: number;
|
|
74
|
+
resolve: number;
|
|
75
|
+
mappingHealth: number;
|
|
76
|
+
parse: number;
|
|
77
|
+
targetLookup: number;
|
|
78
|
+
perTarget: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Load the stage-budget table. `MIXIN_STAGE_BUDGETS_OFF=1` overrides
|
|
82
|
+
* everything to `Number.POSITIVE_INFINITY`; otherwise `override` patches
|
|
83
|
+
* specific stages on top of the defaults.
|
|
84
|
+
*/
|
|
85
|
+
export declare function loadMixinStageBudgets(override?: Partial<MixinStageBudgets>): MixinStageBudgets;
|
|
86
|
+
export type MixinValidationProvenance = {
|
|
87
|
+
version: string;
|
|
88
|
+
jarPath: string;
|
|
89
|
+
requestedMapping: SourceMapping;
|
|
90
|
+
mappingApplied: SourceMapping;
|
|
91
|
+
requestedScope?: "vanilla" | "merged" | "loader";
|
|
92
|
+
appliedScope?: "vanilla" | "merged" | "loader";
|
|
93
|
+
requestedSourcePriority?: "loom-first" | "maven-first";
|
|
94
|
+
appliedSourcePriority?: "loom-first" | "maven-first";
|
|
95
|
+
resolutionNotes?: string[];
|
|
96
|
+
jarType?: "vanilla-client" | "merged" | "loader" | "unknown";
|
|
97
|
+
mappingChain?: string[];
|
|
98
|
+
remapFailures?: number;
|
|
99
|
+
mappingAutoDetected?: boolean;
|
|
100
|
+
scopeFallback?: {
|
|
101
|
+
requested: string;
|
|
102
|
+
applied: string;
|
|
103
|
+
reason: string;
|
|
104
|
+
};
|
|
105
|
+
resolutionTrace?: Array<{
|
|
106
|
+
target: string;
|
|
107
|
+
step: "mapping" | "signature" | "remap" | "fallback-check";
|
|
108
|
+
input: string;
|
|
109
|
+
output: string;
|
|
110
|
+
success: boolean;
|
|
111
|
+
detail?: string;
|
|
112
|
+
}>;
|
|
113
|
+
};
|
|
114
|
+
export type StructuredWarning = {
|
|
115
|
+
severity: "info" | "warning";
|
|
116
|
+
message: string;
|
|
117
|
+
category?: IssueCategory;
|
|
118
|
+
};
|
|
119
|
+
export type ResolvedMember = {
|
|
120
|
+
annotation: string;
|
|
121
|
+
name: string;
|
|
122
|
+
line?: number;
|
|
123
|
+
resolvedTo?: string;
|
|
124
|
+
status: "resolved" | "not-found" | "skipped";
|
|
125
|
+
};
|
|
126
|
+
export type AggregatedWarningGroup = {
|
|
127
|
+
category: IssueCategory;
|
|
128
|
+
count: number;
|
|
129
|
+
samples: string[];
|
|
130
|
+
};
|
|
131
|
+
export type ConfidencePenalty = {
|
|
132
|
+
reason: string;
|
|
133
|
+
points: number;
|
|
134
|
+
};
|
|
135
|
+
export type ConfidenceBreakdown = {
|
|
136
|
+
baseScore: number;
|
|
137
|
+
score: number;
|
|
138
|
+
penalties: ConfidencePenalty[];
|
|
139
|
+
};
|
|
140
|
+
export type MixinValidationResult = {
|
|
141
|
+
className: string;
|
|
142
|
+
targets: string[];
|
|
143
|
+
priority?: number;
|
|
144
|
+
/** Legacy coarse pass/fail flag. Prefer validationStatus for the primary outcome. */
|
|
145
|
+
valid: boolean;
|
|
146
|
+
/** full = fully validated, partial = tool-limited/incomplete, invalid = definite validation errors. */
|
|
147
|
+
validationStatus: ValidationStatus;
|
|
148
|
+
issues: ValidationIssue[];
|
|
149
|
+
summary: ValidationSummary;
|
|
150
|
+
unfilteredSummary?: ValidationSummary;
|
|
151
|
+
provenance?: MixinValidationProvenance;
|
|
152
|
+
warnings: string[];
|
|
153
|
+
structuredWarnings?: StructuredWarning[];
|
|
154
|
+
aggregatedWarnings?: AggregatedWarningGroup[];
|
|
155
|
+
resolvedMembers?: ResolvedMember[];
|
|
156
|
+
toolHealth?: MappingHealthReport;
|
|
157
|
+
confidenceScore?: number;
|
|
158
|
+
confidenceBreakdown?: ConfidenceBreakdown;
|
|
159
|
+
quickSummary?: string;
|
|
160
|
+
targetOutcomes?: TargetOutcome[];
|
|
161
|
+
};
|
|
162
|
+
export type ResolvedTargetMembers = {
|
|
163
|
+
className: string;
|
|
164
|
+
classAccessFlags?: number;
|
|
165
|
+
constructors: SignatureMember[];
|
|
166
|
+
methods: SignatureMember[];
|
|
167
|
+
fields: SignatureMember[];
|
|
168
|
+
};
|
|
169
|
+
export type AccessWidenerValidationResult = {
|
|
170
|
+
headerVersion: string;
|
|
171
|
+
namespace: string;
|
|
172
|
+
valid: boolean;
|
|
173
|
+
entries: Array<AccessWidenerEntry & {
|
|
174
|
+
valid: boolean;
|
|
175
|
+
issue?: string;
|
|
176
|
+
suggestions?: string[];
|
|
177
|
+
resolvedInRuntime?: boolean;
|
|
178
|
+
resolvedRuntimeAccess?: "public" | "protected" | "private" | "package-private";
|
|
179
|
+
resolvedRuntimeJvmDescriptor?: string;
|
|
180
|
+
resolvedRuntimeJavaSignature?: string;
|
|
181
|
+
}>;
|
|
182
|
+
summary: {
|
|
183
|
+
total: number;
|
|
184
|
+
valid: number;
|
|
185
|
+
invalid: number;
|
|
186
|
+
};
|
|
187
|
+
provenance?: RuntimeValidationProvenance<SourceMapping>;
|
|
188
|
+
warnings: string[];
|
|
189
|
+
};
|
|
190
|
+
export type AccessTransformerValidationResult = {
|
|
191
|
+
valid: boolean;
|
|
192
|
+
entries: Array<AccessTransformerEntry & {
|
|
193
|
+
valid: boolean;
|
|
194
|
+
issue?: string;
|
|
195
|
+
suggestions?: string[];
|
|
196
|
+
resolvedInRuntime?: boolean;
|
|
197
|
+
resolvedRuntimeAccess?: "public" | "protected" | "private" | "package-private";
|
|
198
|
+
resolvedRuntimeJvmDescriptor?: string;
|
|
199
|
+
resolvedRuntimeJavaSignature?: string;
|
|
200
|
+
}>;
|
|
201
|
+
summary: {
|
|
202
|
+
total: number;
|
|
203
|
+
valid: number;
|
|
204
|
+
invalid: number;
|
|
205
|
+
};
|
|
206
|
+
provenance?: RuntimeValidationProvenance<AccessTransformerNamespace>;
|
|
207
|
+
warnings: string[];
|
|
208
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const DEFAULT_MIXIN_STAGE_BUDGETS = {
|
|
2
|
+
inputValidation: 5_000,
|
|
3
|
+
resolve: 15_000,
|
|
4
|
+
mappingHealth: 10_000,
|
|
5
|
+
parse: 10_000,
|
|
6
|
+
targetLookup: 60_000,
|
|
7
|
+
perTarget: 8_000
|
|
8
|
+
};
|
|
9
|
+
const INFINITE_MIXIN_STAGE_BUDGETS = {
|
|
10
|
+
inputValidation: Number.POSITIVE_INFINITY,
|
|
11
|
+
resolve: Number.POSITIVE_INFINITY,
|
|
12
|
+
mappingHealth: Number.POSITIVE_INFINITY,
|
|
13
|
+
parse: Number.POSITIVE_INFINITY,
|
|
14
|
+
targetLookup: Number.POSITIVE_INFINITY,
|
|
15
|
+
perTarget: Number.POSITIVE_INFINITY
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Load the stage-budget table. `MIXIN_STAGE_BUDGETS_OFF=1` overrides
|
|
19
|
+
* everything to `Number.POSITIVE_INFINITY`; otherwise `override` patches
|
|
20
|
+
* specific stages on top of the defaults.
|
|
21
|
+
*/
|
|
22
|
+
export function loadMixinStageBudgets(override) {
|
|
23
|
+
if (process.env.MIXIN_STAGE_BUDGETS_OFF === "1") {
|
|
24
|
+
return { ...INFINITE_MIXIN_STAGE_BUDGETS };
|
|
25
|
+
}
|
|
26
|
+
return { ...DEFAULT_MIXIN_STAGE_BUDGETS, ...(override ?? {}) };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1,203 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Public barrel for the mixin validation engine. The implementation lives
|
|
3
|
+
* under `src/mixin/`; this file preserves the historical entry point used
|
|
4
|
+
* by source-service, entry tools, and tests.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
jarAvailable: boolean;
|
|
12
|
-
jarPath: string;
|
|
13
|
-
mojangMappingsAvailable: boolean;
|
|
14
|
-
tinyMappingsAvailable: boolean;
|
|
15
|
-
memberRemapAvailable: boolean;
|
|
16
|
-
overallHealthy: boolean;
|
|
17
|
-
degradations: string[];
|
|
18
|
-
};
|
|
19
|
-
export type IssueConfidence = "definite" | "likely" | "uncertain";
|
|
20
|
-
export type ValidationStatus = "full" | "partial" | "invalid";
|
|
21
|
-
export type ResolutionPath = "member-remap-failed" | "target-mapping-failed" | "target-class-missing" | "source-signature-unavailable";
|
|
22
|
-
export type ValidationIssue = {
|
|
23
|
-
severity: "error" | "warning";
|
|
24
|
-
kind: "target-not-found" | "validation-incomplete" | "target-mapping-failed" | "method-not-found" | "field-not-found" | "descriptor-mismatch" | "access-mismatch" | "unknown-annotation";
|
|
25
|
-
annotation: string;
|
|
26
|
-
target: string;
|
|
27
|
-
message: string;
|
|
28
|
-
suggestions?: string[];
|
|
29
|
-
line?: number;
|
|
30
|
-
confidence?: IssueConfidence;
|
|
31
|
-
confidenceReason?: string;
|
|
32
|
-
category?: IssueCategory;
|
|
33
|
-
resolutionPath?: ResolutionPath;
|
|
34
|
-
explanation?: string;
|
|
35
|
-
suggestedCall?: {
|
|
36
|
-
tool: string;
|
|
37
|
-
params: Record<string, unknown>;
|
|
38
|
-
};
|
|
39
|
-
falsePositiveRisk?: "high" | "medium" | "low";
|
|
40
|
-
issueOrigin?: "code_issue" | "tool_issue" | "parser_limitation";
|
|
41
|
-
};
|
|
42
|
-
export type ValidationSummary = {
|
|
43
|
-
injections: number;
|
|
44
|
-
shadows: number;
|
|
45
|
-
accessors: number;
|
|
46
|
-
total: number;
|
|
47
|
-
membersValidated: number;
|
|
48
|
-
membersSkipped: number;
|
|
49
|
-
membersMissing: number;
|
|
50
|
-
errors: number;
|
|
51
|
-
warnings: number;
|
|
52
|
-
definiteErrors: number;
|
|
53
|
-
uncertainErrors: number;
|
|
54
|
-
resolutionErrors: number;
|
|
55
|
-
parseWarnings: number;
|
|
56
|
-
};
|
|
57
|
-
export type MixinValidationProvenance = {
|
|
58
|
-
version: string;
|
|
59
|
-
jarPath: string;
|
|
60
|
-
requestedMapping: SourceMapping;
|
|
61
|
-
mappingApplied: SourceMapping;
|
|
62
|
-
requestedScope?: "vanilla" | "merged" | "loader";
|
|
63
|
-
appliedScope?: "vanilla" | "merged" | "loader";
|
|
64
|
-
requestedSourcePriority?: "loom-first" | "maven-first";
|
|
65
|
-
appliedSourcePriority?: "loom-first" | "maven-first";
|
|
66
|
-
resolutionNotes?: string[];
|
|
67
|
-
jarType?: "vanilla-client" | "merged" | "loader" | "unknown";
|
|
68
|
-
mappingChain?: string[];
|
|
69
|
-
remapFailures?: number;
|
|
70
|
-
mappingAutoDetected?: boolean;
|
|
71
|
-
scopeFallback?: {
|
|
72
|
-
requested: string;
|
|
73
|
-
applied: string;
|
|
74
|
-
reason: string;
|
|
75
|
-
};
|
|
76
|
-
resolutionTrace?: Array<{
|
|
77
|
-
target: string;
|
|
78
|
-
step: "mapping" | "signature" | "remap" | "fallback-check";
|
|
79
|
-
input: string;
|
|
80
|
-
output: string;
|
|
81
|
-
success: boolean;
|
|
82
|
-
detail?: string;
|
|
83
|
-
}>;
|
|
84
|
-
};
|
|
85
|
-
export type IssueCategory = "mapping" | "configuration" | "validation" | "resolution" | "parse";
|
|
86
|
-
export type StructuredWarning = {
|
|
87
|
-
severity: "info" | "warning";
|
|
88
|
-
message: string;
|
|
89
|
-
category?: IssueCategory;
|
|
90
|
-
};
|
|
91
|
-
export type ResolvedMember = {
|
|
92
|
-
annotation: string;
|
|
93
|
-
name: string;
|
|
94
|
-
line?: number;
|
|
95
|
-
resolvedTo?: string;
|
|
96
|
-
status: "resolved" | "not-found" | "skipped";
|
|
97
|
-
};
|
|
98
|
-
export type AggregatedWarningGroup = {
|
|
99
|
-
category: IssueCategory;
|
|
100
|
-
count: number;
|
|
101
|
-
samples: string[];
|
|
102
|
-
};
|
|
103
|
-
export type ConfidencePenalty = {
|
|
104
|
-
reason: string;
|
|
105
|
-
points: number;
|
|
106
|
-
};
|
|
107
|
-
export type ConfidenceBreakdown = {
|
|
108
|
-
baseScore: number;
|
|
109
|
-
score: number;
|
|
110
|
-
penalties: ConfidencePenalty[];
|
|
111
|
-
};
|
|
112
|
-
export type MixinValidationResult = {
|
|
113
|
-
className: string;
|
|
114
|
-
targets: string[];
|
|
115
|
-
priority?: number;
|
|
116
|
-
/** Legacy coarse pass/fail flag. Prefer validationStatus for the primary outcome. */
|
|
117
|
-
valid: boolean;
|
|
118
|
-
/** full = fully validated, partial = tool-limited/incomplete, invalid = definite validation errors. */
|
|
119
|
-
validationStatus: ValidationStatus;
|
|
120
|
-
issues: ValidationIssue[];
|
|
121
|
-
summary: ValidationSummary;
|
|
122
|
-
unfilteredSummary?: ValidationSummary;
|
|
123
|
-
provenance?: MixinValidationProvenance;
|
|
124
|
-
warnings: string[];
|
|
125
|
-
structuredWarnings?: StructuredWarning[];
|
|
126
|
-
aggregatedWarnings?: AggregatedWarningGroup[];
|
|
127
|
-
resolvedMembers?: ResolvedMember[];
|
|
128
|
-
toolHealth?: MappingHealthReport;
|
|
129
|
-
confidenceScore?: number;
|
|
130
|
-
confidenceBreakdown?: ConfidenceBreakdown;
|
|
131
|
-
quickSummary?: string;
|
|
132
|
-
};
|
|
133
|
-
export type ResolvedTargetMembers = {
|
|
134
|
-
className: string;
|
|
135
|
-
classAccessFlags?: number;
|
|
136
|
-
constructors: SignatureMember[];
|
|
137
|
-
methods: SignatureMember[];
|
|
138
|
-
fields: SignatureMember[];
|
|
139
|
-
};
|
|
140
|
-
export type AccessWidenerValidationResult = {
|
|
141
|
-
headerVersion: string;
|
|
142
|
-
namespace: string;
|
|
143
|
-
valid: boolean;
|
|
144
|
-
entries: Array<AccessWidenerEntry & {
|
|
145
|
-
valid: boolean;
|
|
146
|
-
issue?: string;
|
|
147
|
-
suggestions?: string[];
|
|
148
|
-
resolvedInRuntime?: boolean;
|
|
149
|
-
resolvedRuntimeAccess?: "public" | "protected" | "private" | "package-private";
|
|
150
|
-
resolvedRuntimeJvmDescriptor?: string;
|
|
151
|
-
resolvedRuntimeJavaSignature?: string;
|
|
152
|
-
}>;
|
|
153
|
-
summary: {
|
|
154
|
-
total: number;
|
|
155
|
-
valid: number;
|
|
156
|
-
invalid: number;
|
|
157
|
-
};
|
|
158
|
-
provenance?: RuntimeValidationProvenance<SourceMapping>;
|
|
159
|
-
warnings: string[];
|
|
160
|
-
};
|
|
161
|
-
export type AccessTransformerValidationResult = {
|
|
162
|
-
valid: boolean;
|
|
163
|
-
entries: Array<AccessTransformerEntry & {
|
|
164
|
-
valid: boolean;
|
|
165
|
-
issue?: string;
|
|
166
|
-
suggestions?: string[];
|
|
167
|
-
resolvedInRuntime?: boolean;
|
|
168
|
-
resolvedRuntimeAccess?: "public" | "protected" | "private" | "package-private";
|
|
169
|
-
resolvedRuntimeJvmDescriptor?: string;
|
|
170
|
-
resolvedRuntimeJavaSignature?: string;
|
|
171
|
-
}>;
|
|
172
|
-
summary: {
|
|
173
|
-
total: number;
|
|
174
|
-
valid: number;
|
|
175
|
-
invalid: number;
|
|
176
|
-
};
|
|
177
|
-
provenance?: RuntimeValidationProvenance<AccessTransformerNamespace>;
|
|
178
|
-
warnings: string[];
|
|
179
|
-
};
|
|
180
|
-
export declare function levenshteinDistance(a: string, b: string): number;
|
|
181
|
-
export declare function suggestSimilar(name: string, candidates: string[], maxDistance?: number, maxResults?: number): string[];
|
|
182
|
-
export declare function extractMethodName(ref: string): string;
|
|
183
|
-
/**
|
|
184
|
-
* Extract the JVM descriptor portion from a method reference, if present.
|
|
185
|
-
*
|
|
186
|
-
* Examples:
|
|
187
|
-
* "playerTouch(Lnet/minecraft/world/entity/player/Player;)V" → "(Lnet/minecraft/world/entity/player/Player;)V"
|
|
188
|
-
* "tick" → undefined
|
|
189
|
-
*/
|
|
190
|
-
export declare function extractMethodDescriptor(ref: string): string | undefined;
|
|
191
|
-
export declare function refreshMixinValidationOutcome(result: MixinValidationResult): MixinValidationResult;
|
|
192
|
-
export declare function validateParsedMixin(parsed: ParsedMixin, targetMembers: Map<string, ResolvedTargetMembers>, warnings: string[], provenance?: MixinValidationProvenance, confidence?: IssueConfidence, mappingFailedTargets?: Set<string>, explain?: boolean, remapFailedMembers?: Map<string, Set<string>>, signatureFailedTargets?: Set<string>, suggestedCallContext?: {
|
|
193
|
-
scope?: string;
|
|
194
|
-
sourcePriority?: string;
|
|
195
|
-
projectPath?: string;
|
|
196
|
-
mapping?: string;
|
|
197
|
-
}, warningMode?: "full" | "aggregated", healthReport?: MappingHealthReport, symbolExistsButSignatureFailed?: Set<string>): MixinValidationResult;
|
|
198
|
-
export declare function validateParsedAccessWidener(parsed: ParsedAccessWidener, membersByClass: Map<string, ResolvedTargetMembers>, warnings: string[], options?: {
|
|
199
|
-
includeRuntimeEvidence?: boolean;
|
|
200
|
-
}): AccessWidenerValidationResult;
|
|
201
|
-
export declare function validateParsedAccessTransformer(parsed: ParsedAccessTransformer, membersByClass: Map<string, ResolvedTargetMembers>, warnings: string[], options?: {
|
|
202
|
-
includeRuntimeEvidence?: boolean;
|
|
203
|
-
}): AccessTransformerValidationResult;
|
|
6
|
+
export type { AccessTransformerValidationResult, AccessWidenerValidationResult, AggregatedWarningGroup, ConfidenceBreakdown, ConfidencePenalty, IssueCategory, IssueConfidence, MappingHealthReport, MixinStageBudgets, MixinValidationProvenance, MixinValidationResult, ResolutionPath, ResolvedMember, ResolvedTargetMembers, StructuredWarning, TargetOutcome, ValidationIssue, ValidationStatus, ValidationSummary } from "./mixin/types.js";
|
|
7
|
+
export { loadMixinStageBudgets } from "./mixin/types.js";
|
|
8
|
+
export { accessLevelFromFlags, buildQuickSummary, computeConfidenceBreakdown, computeFalsePositiveRisk, computeValidationStatus, extractMethodDescriptor, extractMethodName, levenshteinDistance, refreshMixinValidationOutcome, suggestSimilar, summarizeResolvedMembers } from "./mixin/helpers.js";
|
|
9
|
+
export { validateAccessor, validateInjection, validateShadow } from "./mixin/annotation-validators.js";
|
|
10
|
+
export { validateParsedMixin } from "./mixin/parsed-validator.js";
|
|
11
|
+
export { validateParsedAccessTransformer, validateParsedAccessWidener } from "./mixin/access-validators.js";
|