@adhisang/minecraft-modding-mcp 4.0.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +36 -23
  3. package/dist/build-suggested-call.d.ts +29 -0
  4. package/dist/build-suggested-call.js +58 -0
  5. package/dist/cache-registry.d.ts +3 -1
  6. package/dist/cache-registry.js +50 -6
  7. package/dist/entry-tools/analyze-symbol-service.d.ts +16 -16
  8. package/dist/entry-tools/batch-class-members-service.d.ts +34 -0
  9. package/dist/entry-tools/batch-class-members-service.js +97 -0
  10. package/dist/entry-tools/batch-class-source-service.d.ts +37 -0
  11. package/dist/entry-tools/batch-class-source-service.js +100 -0
  12. package/dist/entry-tools/batch-mappings-service.d.ts +36 -0
  13. package/dist/entry-tools/batch-mappings-service.js +66 -0
  14. package/dist/entry-tools/batch-runner.d.ts +72 -0
  15. package/dist/entry-tools/batch-runner.js +90 -0
  16. package/dist/entry-tools/batch-symbol-exists-service.d.ts +46 -0
  17. package/dist/entry-tools/batch-symbol-exists-service.js +113 -0
  18. package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
  19. package/dist/entry-tools/inspect-minecraft/handlers/artifact.d.ts +5 -0
  20. package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +83 -0
  21. package/dist/entry-tools/inspect-minecraft/handlers/class-members.d.ts +6 -0
  22. package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +80 -0
  23. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.d.ts +5 -0
  24. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +248 -0
  25. package/dist/entry-tools/inspect-minecraft/handlers/class-source.d.ts +5 -0
  26. package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +60 -0
  27. package/dist/entry-tools/inspect-minecraft/handlers/file.d.ts +5 -0
  28. package/dist/entry-tools/inspect-minecraft/handlers/file.js +54 -0
  29. package/dist/entry-tools/inspect-minecraft/handlers/list-files.d.ts +5 -0
  30. package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +100 -0
  31. package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +5 -0
  32. package/dist/entry-tools/inspect-minecraft/handlers/search.js +155 -0
  33. package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +6 -0
  34. package/dist/entry-tools/inspect-minecraft/handlers/versions.js +49 -0
  35. package/dist/entry-tools/inspect-minecraft/internal.d.ts +1042 -0
  36. package/dist/entry-tools/inspect-minecraft/internal.js +448 -0
  37. package/dist/entry-tools/inspect-minecraft-service.d.ts +193 -308
  38. package/dist/entry-tools/inspect-minecraft-service.js +20 -1244
  39. package/dist/entry-tools/manage-cache-service.d.ts +16 -16
  40. package/dist/entry-tools/validate-project/cases/access-transformer.d.ts +6 -0
  41. package/dist/entry-tools/validate-project/cases/access-transformer.js +106 -0
  42. package/dist/entry-tools/validate-project/cases/access-widener.d.ts +6 -0
  43. package/dist/entry-tools/validate-project/cases/access-widener.js +86 -0
  44. package/dist/entry-tools/validate-project/cases/mixin.d.ts +6 -0
  45. package/dist/entry-tools/validate-project/cases/mixin.js +90 -0
  46. package/dist/entry-tools/validate-project/cases/project-summary.d.ts +97 -0
  47. package/dist/entry-tools/validate-project/cases/project-summary.js +346 -0
  48. package/dist/entry-tools/validate-project/internal.d.ts +135 -0
  49. package/dist/entry-tools/validate-project/internal.js +287 -0
  50. package/dist/entry-tools/validate-project-service.d.ts +63 -47
  51. package/dist/entry-tools/validate-project-service.js +12 -562
  52. package/dist/entry-tools/verify-mixin-target-service.d.ts +133 -0
  53. package/dist/entry-tools/verify-mixin-target-service.js +323 -0
  54. package/dist/error-mapping.d.ts +40 -0
  55. package/dist/error-mapping.js +139 -0
  56. package/dist/errors.d.ts +6 -0
  57. package/dist/errors.js +6 -0
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.js +142 -1352
  60. package/dist/mapping/internal-types.d.ts +54 -0
  61. package/dist/mapping/internal-types.js +14 -0
  62. package/dist/mapping/loaders/mojang.d.ts +2 -0
  63. package/dist/mapping/loaders/mojang.js +64 -0
  64. package/dist/mapping/loaders/tiny-loom.d.ts +2 -0
  65. package/dist/mapping/loaders/tiny-loom.js +73 -0
  66. package/dist/mapping/loaders/tiny-maven.d.ts +2 -0
  67. package/dist/mapping/loaders/tiny-maven.js +104 -0
  68. package/dist/mapping/loaders/types.d.ts +14 -0
  69. package/dist/mapping/loaders/types.js +2 -0
  70. package/dist/mapping/lookup.d.ts +52 -0
  71. package/dist/mapping/lookup.js +496 -0
  72. package/dist/mapping/parsers/normalize.d.ts +10 -0
  73. package/dist/mapping/parsers/normalize.js +52 -0
  74. package/dist/mapping/parsers/proguard.d.ts +20 -0
  75. package/dist/mapping/parsers/proguard.js +138 -0
  76. package/dist/mapping/parsers/symbol-records.d.ts +27 -0
  77. package/dist/mapping/parsers/symbol-records.js +216 -0
  78. package/dist/mapping/parsers/tiny.d.ts +9 -0
  79. package/dist/mapping/parsers/tiny.js +96 -0
  80. package/dist/mapping/types.d.ts +147 -0
  81. package/dist/mapping/types.js +2 -0
  82. package/dist/mapping-pipeline-service.js +3 -2
  83. package/dist/mapping-service.d.ts +3 -144
  84. package/dist/mapping-service.js +19 -1201
  85. package/dist/mixin/access-validators.d.ts +9 -0
  86. package/dist/mixin/access-validators.js +257 -0
  87. package/dist/mixin/annotation-validators.d.ts +5 -0
  88. package/dist/mixin/annotation-validators.js +162 -0
  89. package/dist/mixin/helpers.d.ts +28 -0
  90. package/dist/mixin/helpers.js +315 -0
  91. package/dist/mixin/parsed-validator.d.ts +8 -0
  92. package/dist/mixin/parsed-validator.js +337 -0
  93. package/dist/mixin/types.d.ts +208 -0
  94. package/dist/mixin/types.js +28 -0
  95. package/dist/mixin-validator.d.ts +9 -201
  96. package/dist/mixin-validator.js +8 -1020
  97. package/dist/source/access-validate.d.ts +4 -0
  98. package/dist/source/access-validate.js +254 -0
  99. package/dist/source/artifact-resolver.d.ts +110 -0
  100. package/dist/source/artifact-resolver.js +1174 -0
  101. package/dist/source/cache-metrics.d.ts +26 -0
  102. package/dist/source/cache-metrics.js +172 -0
  103. package/dist/source/class-source/members-builder.d.ts +34 -0
  104. package/dist/source/class-source/members-builder.js +46 -0
  105. package/dist/source/class-source/snippet-builder.d.ts +19 -0
  106. package/dist/source/class-source/snippet-builder.js +46 -0
  107. package/dist/source/class-source-helpers.d.ts +34 -0
  108. package/dist/source/class-source-helpers.js +140 -0
  109. package/dist/source/class-source.d.ts +42 -0
  110. package/dist/source/class-source.js +883 -0
  111. package/dist/source/descriptor-utils.d.ts +6 -0
  112. package/dist/source/descriptor-utils.js +37 -0
  113. package/dist/source/file-access.d.ts +4 -0
  114. package/dist/source/file-access.js +102 -0
  115. package/dist/source/indexer.d.ts +82 -0
  116. package/dist/source/indexer.js +505 -0
  117. package/dist/source/lifecycle/diff-utils.d.ts +9 -0
  118. package/dist/source/lifecycle/diff-utils.js +107 -0
  119. package/dist/source/lifecycle/diff.d.ts +2 -0
  120. package/dist/source/lifecycle/diff.js +265 -0
  121. package/dist/source/lifecycle/mapping-helpers.d.ts +22 -0
  122. package/dist/source/lifecycle/mapping-helpers.js +327 -0
  123. package/dist/source/lifecycle/runtime-check.d.ts +2 -0
  124. package/dist/source/lifecycle/runtime-check.js +142 -0
  125. package/dist/source/lifecycle/trace.d.ts +2 -0
  126. package/dist/source/lifecycle/trace.js +231 -0
  127. package/dist/source/lifecycle.d.ts +4 -0
  128. package/dist/source/lifecycle.js +5 -0
  129. package/dist/source/search.d.ts +51 -0
  130. package/dist/source/search.js +676 -0
  131. package/dist/source/shared-utils.d.ts +6 -0
  132. package/dist/source/shared-utils.js +55 -0
  133. package/dist/source/state.d.ts +21 -0
  134. package/dist/source/state.js +19 -0
  135. package/dist/source/symbol-resolver.d.ts +3 -0
  136. package/dist/source/symbol-resolver.js +212 -0
  137. package/dist/source/validate-mixin/pipeline/mapping-health.d.ts +3 -0
  138. package/dist/source/validate-mixin/pipeline/mapping-health.js +41 -0
  139. package/dist/source/validate-mixin/pipeline/parse.d.ts +2 -0
  140. package/dist/source/validate-mixin/pipeline/parse.js +10 -0
  141. package/dist/source/validate-mixin/pipeline/resolve.d.ts +3 -0
  142. package/dist/source/validate-mixin/pipeline/resolve.js +78 -0
  143. package/dist/source/validate-mixin/pipeline/target-lookup.d.ts +6 -0
  144. package/dist/source/validate-mixin/pipeline/target-lookup.js +260 -0
  145. package/dist/source/validate-mixin/pipeline-context.d.ts +72 -0
  146. package/dist/source/validate-mixin/pipeline-context.js +93 -0
  147. package/dist/source/validate-mixin.d.ts +22 -0
  148. package/dist/source/validate-mixin.js +799 -0
  149. package/dist/source/workspace-target.d.ts +18 -0
  150. package/dist/source/workspace-target.js +305 -0
  151. package/dist/source-service.d.ts +147 -170
  152. package/dist/source-service.js +67 -6116
  153. package/dist/stage-emitter.d.ts +13 -0
  154. package/dist/stage-emitter.js +30 -0
  155. package/dist/stdio-supervisor.d.ts +61 -0
  156. package/dist/stdio-supervisor.js +326 -9
  157. package/dist/tool-contract-manifest.d.ts +1 -1
  158. package/dist/tool-contract-manifest.js +23 -6
  159. package/dist/tool-guidance.d.ts +82 -0
  160. package/dist/tool-guidance.js +734 -0
  161. package/dist/tool-schema-registry.d.ts +16 -0
  162. package/dist/tool-schema-registry.js +37 -0
  163. package/dist/tool-schemas.d.ts +3518 -0
  164. package/dist/tool-schemas.js +813 -0
  165. package/dist/types.d.ts +36 -0
  166. package/dist/version-service.js +7 -6
  167. package/dist/workspace-context-cache.d.ts +32 -0
  168. package/dist/workspace-context-cache.js +66 -0
  169. package/dist/workspace-mapping-service.d.ts +16 -0
  170. package/dist/workspace-mapping-service.js +173 -1
  171. package/docs/README-ja.md +414 -0
  172. package/docs/examples.md +483 -0
  173. package/docs/tool-reference.md +459 -0
  174. package/package.json +3 -2
@@ -1,16 +1,27 @@
1
- import { type ResponseContext as ExplorerResponseContext, type SignatureMember } from "./minecraft-explorer-service.js";
2
- import { type MixinValidationResult, type MixinValidationProvenance, type MappingHealthReport, type AccessWidenerValidationResult, type AccessTransformerValidationResult } from "./mixin-validator.js";
3
- import { type ClassApiMatrixInput as MappingClassApiMatrixInput, type ClassApiMatrixOutput as MappingClassApiMatrixOutput, type FindMappingInput as MappingFindMappingInput, type FindMappingOutput as MappingFindMappingOutput, type ResolveMethodMappingExactInput as MappingResolveMethodMappingExactInput, type ResolveMethodMappingExactOutput as MappingResolveMethodMappingExactOutput, type SymbolResolutionOutput as MappingSymbolResolutionOutput, type SymbolExistenceInput as MappingSymbolExistenceInput, type SymbolExistenceOutput as MappingSymbolExistenceOutput } from "./mapping-service.js";
1
+ import { MinecraftExplorerService, type ResponseContext as ExplorerResponseContext, type SignatureMember } from "./minecraft-explorer-service.js";
2
+ import { type MixinValidationResult, type MixinValidationProvenance, type MappingHealthReport, type AccessWidenerValidationResult, type AccessTransformerValidationResult, type MixinStageBudgets } from "./mixin-validator.js";
3
+ import { MappingService, type ClassApiMatrixInput as MappingClassApiMatrixInput, type ClassApiMatrixOutput as MappingClassApiMatrixOutput, type FindMappingInput as MappingFindMappingInput, type FindMappingOutput as MappingFindMappingOutput, type ResolveMethodMappingExactInput as MappingResolveMethodMappingExactInput, type ResolveMethodMappingExactOutput as MappingResolveMethodMappingExactOutput, type SymbolResolutionOutput as MappingSymbolResolutionOutput, type SymbolExistenceInput as MappingSymbolExistenceInput, type SymbolExistenceOutput as MappingSymbolExistenceOutput } from "./mapping-service.js";
4
+ import { ArtifactsRepo } from "./storage/artifacts-repo.js";
5
+ import { FilesRepo } from "./storage/files-repo.js";
6
+ import { IndexMetaRepo } from "./storage/index-meta-repo.js";
7
+ import { SymbolsRepo } from "./storage/symbols-repo.js";
4
8
  import { RuntimeMetrics, type RuntimeMetricSnapshot } from "./observability.js";
5
- import { type WorkspaceCompileMappingOutput } from "./workspace-mapping-service.js";
6
- import type { AccessTransformerNamespace, ArtifactProvenance, ArtifactRow, ArtifactScope, Config, MappingSourcePriority, ResolvedSourceArtifact, SourceMapping, SourceTargetInput } from "./types.js";
7
- import { type ListVersionsInput, type ListVersionsOutput } from "./version-service.js";
8
- import { type GetRegistryDataInput, type GetRegistryDataOutput } from "./registry-service.js";
9
- import { type CompareVersionsInput, type CompareVersionsOutput } from "./version-diff-service.js";
10
- import { type DecompileModJarInput, type DecompileModJarOutput, type GetModClassSourceInput, type GetModClassSourceOutput } from "./mod-decompile-service.js";
11
- import { type SearchModSourceInput, type SearchModSourceOutput } from "./mod-search-service.js";
9
+ import { SourceServiceState } from "./source/state.js";
10
+ import * as indexer from "./source/indexer.js";
11
+ import * as workspaceTarget from "./source/workspace-target.js";
12
+ import * as validateMixinModule from "./source/validate-mixin.js";
13
+ import * as artifactResolver from "./source/artifact-resolver.js";
14
+ import { type StageEmitter } from "./stage-emitter.js";
15
+ import { WorkspaceMappingService, type WorkspaceCompileMappingOutput } from "./workspace-mapping-service.js";
16
+ import { type WorkspaceContextCache } from "./workspace-context-cache.js";
17
+ import type { AccessTransformerNamespace, ArtifactProvenance, ArtifactRow, ArtifactScope, Config, MappingSourcePriority, ResolveArtifactTargetInput, ResolvedSourceArtifact, RuntimeValidationProvenance, SourceMapping } from "./types.js";
18
+ import { VersionService, type ListVersionsInput, type ListVersionsOutput } from "./version-service.js";
19
+ import { RegistryService, type GetRegistryDataInput, type GetRegistryDataOutput } from "./registry-service.js";
20
+ import { VersionDiffService, type CompareVersionsInput, type CompareVersionsOutput } from "./version-diff-service.js";
21
+ import { ModDecompileService, type DecompileModJarInput, type DecompileModJarOutput, type GetModClassSourceInput, type GetModClassSourceOutput } from "./mod-decompile-service.js";
22
+ import { ModSearchService, type SearchModSourceInput, type SearchModSourceOutput } from "./mod-search-service.js";
12
23
  export type ResolveArtifactInput = {
13
- target: SourceTargetInput;
24
+ target: ResolveArtifactTargetInput;
14
25
  mapping?: SourceMapping;
15
26
  sourcePriority?: MappingSourcePriority;
16
27
  allowDecompile?: boolean;
@@ -45,7 +56,7 @@ export type ArtifactContentsSummary = {
45
56
  resourcesIncluded: boolean;
46
57
  sourceCoverage: "full" | "partial";
47
58
  };
48
- type SymbolKind = "class" | "interface" | "enum" | "record" | "method" | "field";
59
+ export type SymbolKind = "class" | "interface" | "enum" | "record" | "method" | "field";
49
60
  type SearchIntent = "symbol" | "text" | "path";
50
61
  type SearchMatch = "exact" | "prefix" | "contains" | "regex";
51
62
  export type SearchScope = {
@@ -146,7 +157,7 @@ export type ResolveWorkspaceSymbolOutput = MappingSymbolResolutionOutput & {
146
157
  export type SourceMode = "metadata" | "snippet" | "full";
147
158
  export type GetClassSourceInput = {
148
159
  artifactId?: string;
149
- target?: SourceTargetInput;
160
+ target?: ResolveArtifactTargetInput;
150
161
  className: string;
151
162
  mode?: SourceMode;
152
163
  mapping?: SourceMapping;
@@ -203,7 +214,7 @@ export type FindClassOutput = {
203
214
  type MemberAccess = "public" | "all";
204
215
  export type GetClassMembersInput = {
205
216
  artifactId?: string;
206
- target?: SourceTargetInput;
217
+ target?: ResolveArtifactTargetInput;
207
218
  className: string;
208
219
  mapping?: SourceMapping;
209
220
  sourcePriority?: MappingSourcePriority;
@@ -229,6 +240,7 @@ export type DecompiledFallback = {
229
240
  methods: DecompiledMember[];
230
241
  origin: "source-extracted";
231
242
  };
243
+ export type GetClassMembersStatus = "ok" | "members_unavailable" | "partial";
232
244
  export type GetClassMembersOutput = {
233
245
  className: string;
234
246
  members: {
@@ -259,6 +271,12 @@ export type GetClassMembersOutput = {
259
271
  methods: number;
260
272
  total: number;
261
273
  };
274
+ status?: GetClassMembersStatus;
275
+ unavailableReason?: string;
276
+ suggestedCall?: {
277
+ tool: string;
278
+ params: Record<string, unknown>;
279
+ };
262
280
  warnings: string[];
263
281
  };
264
282
  export type TraceSymbolLifecycleInput = {
@@ -298,7 +316,7 @@ export type TraceSymbolLifecycleOutput = {
298
316
  timeline?: TraceSymbolLifecycleTimelineEntry[];
299
317
  warnings: string[];
300
318
  };
301
- type DiffClassChange = "added" | "removed" | "present_in_both" | "absent_in_both";
319
+ export type DiffClassChange = "added" | "removed" | "present_in_both" | "absent_in_both";
302
320
  type DiffMemberChangedField = "accessFlags" | "isSynthetic" | "javaSignature" | "jvmDescriptor";
303
321
  export type DiffMember = SignatureMember;
304
322
  export type DiffMemberChange = {
@@ -359,24 +377,7 @@ export type DiffClassSignaturesOutput = {
359
377
  };
360
378
  warnings: string[];
361
379
  };
362
- export type IndexArtifactInput = {
363
- artifactId: string;
364
- force?: boolean;
365
- };
366
- type IndexRebuildReason = "force" | "missing_meta" | "schema_mismatch" | "signature_mismatch" | "already_current";
367
- export type IndexArtifactOutput = {
368
- artifactId: string;
369
- reindexed: boolean;
370
- reason: IndexRebuildReason;
371
- counts: {
372
- files: number;
373
- symbols: number;
374
- ftsRows: number;
375
- };
376
- indexedAt: string;
377
- durationMs: number;
378
- mappingApplied: SourceMapping;
379
- };
380
+ export type { IndexArtifactInput, IndexArtifactOutput } from "./source/indexer.js";
380
381
  export type ValidateMixinInput = {
381
382
  input: {
382
383
  mode: "inline";
@@ -411,6 +412,19 @@ export type ValidateMixinInput = {
411
412
  treatInfoAsWarning?: boolean;
412
413
  includeIssues?: boolean;
413
414
  };
415
+ export type ValidateMixinOptions = {
416
+ stageEmitter?: StageEmitter;
417
+ /** Test-only override for stage budgets. Production code uses defaults. */
418
+ __stageBudgets?: Partial<MixinStageBudgets>;
419
+ /** Test-only hooks injected at stage boundaries to simulate slow work. */
420
+ __testHooks?: {
421
+ afterResolve?: () => Promise<void>;
422
+ afterMappingHealth?: () => Promise<void>;
423
+ afterParse?: () => Promise<void>;
424
+ beforeTargetLoop?: () => Promise<void>;
425
+ beforeTargetIter?: (targetIndex: number) => Promise<void>;
426
+ };
427
+ };
414
428
  export type ValidateMixinResultSource = {
415
429
  kind: "inline" | "path" | "config";
416
430
  label: string;
@@ -421,6 +435,10 @@ export type ValidateMixinBatchResult = {
421
435
  source: ValidateMixinResultSource;
422
436
  result?: MixinValidationResult;
423
437
  error?: string;
438
+ /** Stable error code from AppError when the entry failed with a typed error (e.g. ERR_STAGE_BUDGET_PRE_PARSE). */
439
+ errorCode?: string;
440
+ /** AppError details (failedStage, stageBudgetExhausted, budgetMs, elapsedMs, …) preserved across batch aggregation. */
441
+ errorDetails?: Record<string, unknown>;
424
442
  };
425
443
  export type ValidateMixinBatchIssueSummaryItem = {
426
444
  kind: string;
@@ -469,52 +487,77 @@ export type ValidateAccessTransformerInput = {
469
487
  };
470
488
  export type ValidateAccessTransformerOutput = AccessTransformerValidationResult;
471
489
  export declare class SourceService {
472
- private readonly config;
473
- private readonly db;
474
- private readonly artifactsRepo;
475
- private readonly filesRepo;
476
- private readonly indexMetaRepo;
477
- private readonly symbolsRepo;
478
- private readonly metrics;
479
- private readonly versionService;
480
- private readonly mappingService;
481
- private readonly workspaceMappingService;
482
- private readonly explorerService;
483
- private readonly registryService;
484
- private readonly versionDiffService;
485
- private readonly modDecompileService;
486
- private readonly modSearchService;
487
- private readonly lru;
488
- private cacheTotalContentBytes;
489
- private readonly remappedJarBytes;
490
- /** In-flight binary-remap jobs keyed by remapped jar path so concurrent
491
- * resolveArtifact calls for the same artifactId share a single tiny-remapper run. */
492
- private readonly inflightRemaps;
493
- constructor(explicitConfig?: Config, metrics?: RuntimeMetrics);
494
- private discoverVersionSourceJar;
495
- private discoverAccessWidenerRuntimeCandidates;
496
- private discoverAccessTransformerRuntimeCandidates;
497
- private resolveAccessWidenerRuntimeArtifact;
498
- private resolveAccessTransformerNamespace;
499
- private resolveAccessTransformerRuntimeArtifact;
500
- private buildVersionSourceRecoveryCommand;
501
- /**
502
- * Decide whether the upcoming resolveArtifact call may transparently remap a
503
- * binary-only artifact (obfuscated -> mojang) and decompile it. The gate
504
- * succeeds only when:
505
- * - the requested mapping is "mojang" on a still-obfuscated runtime
506
- * - tiny-remapper jar is downloadable / available locally
507
- * - the version's Mojang tiny mapping file can be produced
508
- * - checkMappingHealth reports mojang mappings are usable
509
- * On any failure the variant defaults to "pass" so the legacy
510
- * MAPPING_NOT_APPLIED fallback (or the existing source-backed flow) keeps
511
- * its existing artifactId hash.
512
- */
513
- private computeBinaryRemapGate;
514
- private buildArtifactContentsSummary;
515
- private inferVersionFromContext;
516
- private resolveVersionContext;
490
+ readonly config: Config;
491
+ readonly db: import("./storage/sqlite.js").default;
492
+ readonly artifactsRepo: ArtifactsRepo;
493
+ readonly filesRepo: FilesRepo;
494
+ readonly indexMetaRepo: IndexMetaRepo;
495
+ readonly symbolsRepo: SymbolsRepo;
496
+ readonly metrics: RuntimeMetrics;
497
+ readonly versionService: VersionService;
498
+ readonly mappingService: MappingService;
499
+ readonly workspaceMappingService: WorkspaceMappingService;
500
+ readonly workspaceContextCache: WorkspaceContextCache;
501
+ readonly explorerService: MinecraftExplorerService;
502
+ readonly registryService: RegistryService;
503
+ readonly versionDiffService: VersionDiffService;
504
+ readonly modDecompileService: ModDecompileService;
505
+ readonly modSearchService: ModSearchService;
506
+ readonly state: SourceServiceState;
507
+ constructor(explicitConfig?: Config, metrics?: RuntimeMetrics, deps?: {
508
+ workspaceContextCache?: WorkspaceContextCache;
509
+ });
517
510
  resolveArtifact(input: ResolveArtifactInput): Promise<ResolveArtifactOutput>;
511
+ synthesizeWorkspaceTarget(input: ResolveArtifactInput, workspace: import("./types.js").WorkspaceTargetInput): ReturnType<typeof workspaceTarget.synthesizeWorkspaceTarget>;
512
+ synthesizeDependencyTarget(input: ResolveArtifactInput, dep: import("./types.js").DependencyTargetInput): ReturnType<typeof workspaceTarget.synthesizeDependencyTarget>;
513
+ loadOrDetectWorkspaceContext(projectPath: string): ReturnType<typeof workspaceTarget.loadOrDetectWorkspaceContext>;
514
+ resolveAccessWidenerRuntimeArtifact(input: {
515
+ version: string;
516
+ awNamespace: SourceMapping;
517
+ projectPath?: string;
518
+ scope?: ArtifactScope;
519
+ preferProjectVersion?: boolean;
520
+ }): Promise<RuntimeValidationProvenance<SourceMapping>>;
521
+ resolveAccessTransformerNamespace(input: {
522
+ atNamespace?: AccessTransformerNamespace;
523
+ projectPath?: string;
524
+ }): Promise<AccessTransformerNamespace>;
525
+ resolveAccessTransformerRuntimeArtifact(input: {
526
+ version: string;
527
+ atNamespace: AccessTransformerNamespace;
528
+ projectPath?: string;
529
+ scope?: ArtifactScope;
530
+ preferProjectVersion?: boolean;
531
+ }): Promise<RuntimeValidationProvenance<AccessTransformerNamespace>>;
532
+ buildArtifactContentsSummary(input: {
533
+ origin: ResolvedSourceArtifact["origin"];
534
+ sourceJarPath?: string;
535
+ isDecompiled?: boolean;
536
+ qualityFlags: string[];
537
+ }): ArtifactContentsSummary;
538
+ discoverVersionSourceJar(input: {
539
+ version: string;
540
+ projectPath?: string;
541
+ }): ReturnType<typeof artifactResolver.discoverVersionSourceJar>;
542
+ discoverAccessWidenerRuntimeCandidates(input: {
543
+ version: string;
544
+ projectPath?: string;
545
+ requestedScope: ArtifactScope;
546
+ }): ReturnType<typeof artifactResolver.discoverAccessWidenerRuntimeCandidates>;
547
+ discoverAccessTransformerRuntimeCandidates(input: {
548
+ version: string;
549
+ projectPath?: string;
550
+ requestedScope: ArtifactScope;
551
+ atNamespace: AccessTransformerNamespace;
552
+ loader: import("./workspace-mapping-service.js").WorkspaceProjectLoader | "unknown";
553
+ }): ReturnType<typeof artifactResolver.discoverAccessTransformerRuntimeCandidates>;
554
+ buildMappingFallbackSuggestedCall(args: {
555
+ input: ResolveArtifactInput;
556
+ kind: import("./types.js").ArtifactTargetKind;
557
+ value: string;
558
+ scope: ArtifactScope | undefined;
559
+ effectiveMapping: SourceMapping;
560
+ }): ReturnType<typeof artifactResolver.buildMappingFallbackSuggestedCall>;
518
561
  searchClassSource(input: SearchClassSourceInput): Promise<SearchClassSourceOutput>;
519
562
  getArtifactFile(input: GetArtifactFileInput): Promise<GetArtifactFileOutput>;
520
563
  listArtifactFiles(input: ListArtifactFilesInput): Promise<ListArtifactFilesOutput>;
@@ -535,103 +578,37 @@ export declare class SourceService {
535
578
  findClass(input: FindClassInput): FindClassOutput;
536
579
  getClassSource(input: GetClassSourceInput): Promise<GetClassSourceOutput>;
537
580
  getClassMembers(input: GetClassMembersInput): Promise<GetClassMembersOutput>;
538
- private buildDecompiledFallback;
539
- validateMixin(input: ValidateMixinInput): Promise<ValidateMixinOutput>;
540
- private runValidateMixinDispatcher;
541
- private createProjectValidateMixinConfigInput;
542
- private shouldRetryValidateMixinWithMavenFirst;
543
- private findValidateMixinClassMapping;
544
- private validateMixinSingle;
545
- private runValidateMixinPipeline;
546
- private resolveMixinInputPath;
547
- private resolveMixinConfigSources;
548
- private validateMixinMany;
549
- private applyValidateMixinOutputCompaction;
550
- private buildValidateMixinOutput;
581
+ validateMixin(input: ValidateMixinInput, options?: ValidateMixinOptions): Promise<ValidateMixinOutput>;
582
+ validateMixinSingle(input: validateMixinModule.ValidateMixinSingleInput): Promise<MixinValidationResult>;
583
+ remapSignatureMembers(members: SignatureMember[], kind: "field" | "method", version: string, sourceMapping: SourceMapping, targetMapping: SourceMapping, sourcePriority: MappingSourcePriority | undefined, warnings: string[], projectPath?: string): Promise<{
584
+ members: SignatureMember[];
585
+ failedNames: Set<string>;
586
+ }>;
551
587
  validateAccessWidener(input: ValidateAccessWidenerInput): Promise<ValidateAccessWidenerOutput>;
552
588
  validateAccessTransformer(input: ValidateAccessTransformerInput): Promise<ValidateAccessTransformerOutput>;
553
589
  recordToolCall(tool: string, durationMs: number): void;
554
590
  getRuntimeMetrics(): RuntimeMetricSnapshot;
555
- indexArtifact(input: IndexArtifactInput): Promise<IndexArtifactOutput>;
556
- private searchSymbolIntent;
557
- private searchTextIntentIndexed;
558
- private searchPathIntentIndexed;
559
- private searchTextIntent;
560
- private searchPathIntent;
561
- private findSymbolHits;
562
- private indexedCandidateLimit;
563
- private indexedCandidateLimitForMatch;
564
- private extractClassMetadata;
565
- private extractDecompiledMembers;
566
- private computeLineBraceDepths;
567
- private computeBraceRange;
568
- private scanBraceRange;
569
- private computeNestedTypeRanges;
570
- private resolveClassFilePath;
571
- private resolveBinaryFallbackArtifact;
572
- private buildProvenance;
573
- private buildFallbackProvenance;
574
- private resolveClassNameForLookup;
575
- private buildClassSourceNotFoundError;
576
- private rejectLifecycleClassLikeInput;
577
- private releaseLifecycleMappingGraph;
578
- private resolveToObfuscatedClassName;
579
- private resolveToObfuscatedMemberName;
580
- private remapSignatureMembers;
581
- private fallbackArtifactSignature;
582
- private resolveIndexRebuildReason;
583
- private toResolvedArtifact;
584
- private rebuildAndPersistArtifactIndex;
585
- private buildRebuiltArtifactData;
591
+ indexArtifact(input: indexer.IndexArtifactInput): Promise<indexer.IndexArtifactOutput>;
592
+ resolveClassNameForLookup(input: {
593
+ className: string;
594
+ version?: string;
595
+ sourceMapping: SourceMapping;
596
+ targetMapping: SourceMapping;
597
+ sourcePriority: MappingSourcePriority | undefined;
598
+ warnings: string[];
599
+ context: string;
600
+ }): Promise<string>;
601
+ resolveBinaryFallbackArtifact(input: {
602
+ binaryJarPath?: string;
603
+ version?: string;
604
+ coordinate?: string;
605
+ requestedMapping: SourceMapping;
606
+ mappingApplied: SourceMapping;
607
+ provenance?: ArtifactProvenance;
608
+ qualityFlags: string[];
609
+ }): Promise<ResolvedSourceArtifact | undefined>;
586
610
  getArtifact(artifactId: string): ArtifactRow;
587
- private ingestIfNeeded;
588
- /**
589
- * If the resolved artifact's transformChain promised an "obf -> mojang"
590
- * binary remap, run tiny-remapper now and return the remapped jar path.
591
- * Otherwise return the original binaryJarPath unchanged.
592
- *
593
- * Cache safety: writes to a per-attempt temp file then atomic-renames into
594
- * <cacheDir>/remapped/<artifactId>.jar. A per-target inflight Promise map
595
- * collapses concurrent calls so two simultaneous resolveArtifact calls for
596
- * the same artifactId share one tiny-remapper run instead of racing on the
597
- * same output path.
598
- */
599
- private maybeRemapBinaryForMojang;
600
- private recordRemappedJarBytesFromDisk;
601
- /**
602
- * Best-effort structural check that `path` is a non-empty file beginning with
603
- * the ZIP local-file-header magic (`50 4B 03 04`). Used to drop partial /
604
- * corrupt remap-cache entries before they reach Vineflower. False positives
605
- * are acceptable (Vineflower will surface a clearer error); false negatives
606
- * are not (a corrupt cache hit must be evicted).
607
- */
608
- private isUsableJarFile;
609
- private runBinaryRemap;
610
- private loadFromSourceJar;
611
- private hasAnyFiles;
612
- /**
613
- * Best-effort cleanup of `<cacheDir>/remapped/<artifactId>.jar` written by
614
- * `maybeRemapBinaryForMojang`. Called from cache-eviction paths so the
615
- * Mojang-remapped binary jar does not outlive the artifact row that owns it.
616
- * Also releases the jar's bytes from `cacheTotalContentBytes`. Errors are
617
- * swallowed: orphaned jars remain visible to `manage-cache` under the
618
- * `binary-remap` cache kind and can be reclaimed there.
619
- */
620
- private unlinkRemappedJarForArtifact;
621
- /**
622
- * Add the remapped jar's on-disk size to `cacheTotalContentBytes` so the
623
- * `enforceCacheLimits` byte gate sees the jar before deciding to evict.
624
- * Without this, a Mojang-remapped client jar (tens of MB) can accumulate
625
- * silently while the indexed-source byte total stays below `maxCacheBytes`.
626
- */
627
- private recordRemappedJarBytes;
628
- private releaseRemappedJarBytes;
629
- private enforceCacheLimits;
611
+ ingestIfNeeded(resolved: ResolvedSourceArtifact): Promise<void>;
630
612
  private refreshCacheMetrics;
631
- private touchCacheMetrics;
632
- private upsertCacheMetrics;
633
- private removeCacheMetrics;
634
- private publishCacheMetrics;
635
613
  private snapshotLruAccounting;
636
614
  }
637
- export {};