@adhisang/minecraft-modding-mcp 4.2.1 → 6.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.
Files changed (144) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +5 -4
  3. package/dist/access-transformer-parser.d.ts +2 -1
  4. package/dist/access-transformer-parser.js +10 -1
  5. package/dist/access-widener-parser.d.ts +1 -0
  6. package/dist/access-widener-parser.js +6 -3
  7. package/dist/build-suggested-call.js +31 -10
  8. package/dist/cache-registry.d.ts +8 -0
  9. package/dist/cache-registry.js +50 -32
  10. package/dist/config.d.ts +1 -0
  11. package/dist/config.js +4 -0
  12. package/dist/decompiler/vineflower.js +8 -2
  13. package/dist/entry-tools/analyze-mod-service.d.ts +24 -24
  14. package/dist/entry-tools/analyze-mod-service.js +2 -1
  15. package/dist/entry-tools/analyze-symbol-service.d.ts +57 -22
  16. package/dist/entry-tools/analyze-symbol-service.js +139 -34
  17. package/dist/entry-tools/batch-class-members-service.d.ts +3 -1
  18. package/dist/entry-tools/batch-class-members-service.js +6 -6
  19. package/dist/entry-tools/batch-class-source-service.d.ts +3 -1
  20. package/dist/entry-tools/batch-class-source-service.js +5 -6
  21. package/dist/entry-tools/batch-mappings-service.d.ts +3 -1
  22. package/dist/entry-tools/batch-mappings-service.js +4 -5
  23. package/dist/entry-tools/batch-symbol-exists-service.d.ts +3 -1
  24. package/dist/entry-tools/batch-symbol-exists-service.js +4 -5
  25. package/dist/entry-tools/compare-minecraft-service.d.ts +10 -10
  26. package/dist/entry-tools/compare-minecraft-service.js +1 -1
  27. package/dist/entry-tools/entry-tool-schema.d.ts +1 -1
  28. package/dist/entry-tools/inspect-minecraft/handlers/artifact.js +1 -3
  29. package/dist/entry-tools/inspect-minecraft/handlers/class-members.js +4 -3
  30. package/dist/entry-tools/inspect-minecraft/handlers/class-overview.js +0 -5
  31. package/dist/entry-tools/inspect-minecraft/handlers/class-source.js +0 -1
  32. package/dist/entry-tools/inspect-minecraft/handlers/file.js +26 -2
  33. package/dist/entry-tools/inspect-minecraft/handlers/list-files.js +0 -1
  34. package/dist/entry-tools/inspect-minecraft/handlers/search.d.ts +8 -0
  35. package/dist/entry-tools/inspect-minecraft/handlers/search.js +13 -2
  36. package/dist/entry-tools/inspect-minecraft/handlers/versions.d.ts +1 -1
  37. package/dist/entry-tools/inspect-minecraft/handlers/versions.js +3 -2
  38. package/dist/entry-tools/inspect-minecraft/internal.d.ts +90 -89
  39. package/dist/entry-tools/inspect-minecraft/internal.js +32 -14
  40. package/dist/entry-tools/inspect-minecraft-service.d.ts +218 -218
  41. package/dist/entry-tools/inspect-minecraft-service.js +1 -1
  42. package/dist/entry-tools/manage-cache-service.d.ts +4 -4
  43. package/dist/entry-tools/response-contract.d.ts +3 -1
  44. package/dist/entry-tools/response-contract.js +3 -2
  45. package/dist/entry-tools/validate-project/cases/mixin.js +2 -1
  46. package/dist/entry-tools/validate-project/cases/project-summary.js +5 -3
  47. package/dist/entry-tools/validate-project-service.d.ts +42 -36
  48. package/dist/entry-tools/validate-project-service.js +3 -1
  49. package/dist/entry-tools/verify-mixin-target-service.d.ts +30 -0
  50. package/dist/entry-tools/verify-mixin-target-service.js +120 -29
  51. package/dist/error-mapping.d.ts +51 -0
  52. package/dist/error-mapping.js +157 -2
  53. package/dist/index.js +147 -76
  54. package/dist/java-process.js +1 -1
  55. package/dist/json-rpc-framing.d.ts +4 -0
  56. package/dist/json-rpc-framing.js +23 -1
  57. package/dist/mapping/internal-types.d.ts +24 -0
  58. package/dist/mapping/loaders/tiny-maven.js +46 -20
  59. package/dist/mapping/lookup.d.ts +13 -2
  60. package/dist/mapping/lookup.js +60 -2
  61. package/dist/mapping/types.d.ts +6 -0
  62. package/dist/mapping-service.d.ts +26 -2
  63. package/dist/mapping-service.js +212 -55
  64. package/dist/mcp-helpers.d.ts +1 -0
  65. package/dist/mcp-helpers.js +25 -3
  66. package/dist/minecraft-explorer-service.js +24 -11
  67. package/dist/mixin/access-validators.js +33 -1
  68. package/dist/mixin/annotation-validators.js +73 -9
  69. package/dist/mixin/parsed-validator.js +3 -2
  70. package/dist/mixin-parser.js +119 -7
  71. package/dist/mod-decompile-service.d.ts +2 -0
  72. package/dist/mod-decompile-service.js +21 -3
  73. package/dist/mod-remap-service.d.ts +20 -1
  74. package/dist/mod-remap-service.js +101 -45
  75. package/dist/mojang-tiny-mapping-service.js +5 -2
  76. package/dist/nbt/java-nbt-codec.js +46 -16
  77. package/dist/nbt/json-patch.js +51 -12
  78. package/dist/nbt/typed-json.d.ts +1 -0
  79. package/dist/nbt/typed-json.js +12 -2
  80. package/dist/nbt/types.d.ts +2 -2
  81. package/dist/observability.d.ts +6 -0
  82. package/dist/observability.js +10 -0
  83. package/dist/page-cursor.d.ts +17 -0
  84. package/dist/page-cursor.js +0 -0
  85. package/dist/path-converter.js +10 -3
  86. package/dist/registry-service.d.ts +2 -0
  87. package/dist/registry-service.js +41 -2
  88. package/dist/repo-downloader.js +4 -3
  89. package/dist/resources.js +45 -9
  90. package/dist/response-utils.d.ts +29 -4
  91. package/dist/response-utils.js +95 -5
  92. package/dist/source/access-validate.js +12 -2
  93. package/dist/source/artifact-resolver.js +2 -2
  94. package/dist/source/class-source/members-builder.d.ts +44 -1
  95. package/dist/source/class-source/members-builder.js +51 -4
  96. package/dist/source/class-source/snippet-builder.d.ts +13 -0
  97. package/dist/source/class-source/snippet-builder.js +54 -4
  98. package/dist/source/class-source-helpers.d.ts +4 -4
  99. package/dist/source/class-source-helpers.js +77 -20
  100. package/dist/source/class-source.d.ts +19 -0
  101. package/dist/source/class-source.js +144 -40
  102. package/dist/source/file-access.js +3 -2
  103. package/dist/source/indexer.js +29 -9
  104. package/dist/source/lifecycle/mapping-helpers.js +28 -3
  105. package/dist/source/lifecycle/runtime-check.js +20 -6
  106. package/dist/source/search.d.ts +1 -1
  107. package/dist/source/search.js +117 -30
  108. package/dist/source/validate-mixin/pipeline/resolve.js +23 -3
  109. package/dist/source/validate-mixin.d.ts +2 -1
  110. package/dist/source/validate-mixin.js +45 -4
  111. package/dist/source/workspace-target.js +17 -10
  112. package/dist/source-jar-reader.d.ts +54 -1
  113. package/dist/source-jar-reader.js +121 -10
  114. package/dist/source-resolver.js +2 -2
  115. package/dist/source-service.d.ts +28 -7
  116. package/dist/source-service.js +9 -1
  117. package/dist/stdio-supervisor.d.ts +2 -2
  118. package/dist/stdio-supervisor.js +29 -9
  119. package/dist/storage/db.js +24 -1
  120. package/dist/storage/files-repo.d.ts +15 -0
  121. package/dist/storage/files-repo.js +67 -37
  122. package/dist/storage/symbols-repo.d.ts +15 -0
  123. package/dist/storage/symbols-repo.js +53 -19
  124. package/dist/symbols/symbol-extractor.js +35 -6
  125. package/dist/text-truncate.d.ts +7 -0
  126. package/dist/text-truncate.js +21 -0
  127. package/dist/tiny-remapper-resolver.js +10 -0
  128. package/dist/tool-contract-manifest.js +2 -2
  129. package/dist/tool-execution-gate.js +12 -1
  130. package/dist/tool-guidance.d.ts +6 -2
  131. package/dist/tool-guidance.js +63 -13
  132. package/dist/tool-schemas.d.ts +561 -496
  133. package/dist/tool-schemas.js +175 -139
  134. package/dist/types.d.ts +1 -0
  135. package/dist/version-diff-service.js +5 -0
  136. package/dist/version-service.d.ts +3 -0
  137. package/dist/version-service.js +18 -2
  138. package/dist/warning-details.d.ts +30 -0
  139. package/dist/warning-details.js +80 -0
  140. package/dist/workspace-mapping-service.js +9 -0
  141. package/docs/README-ja.md +2 -2
  142. package/docs/examples.md +26 -2
  143. package/docs/tool-reference.md +22 -17
  144. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { type ResponseDetailLevel } from "../response-utils.js";
1
2
  import type { GetClassMembersInput, GetClassMembersOutput, ResolveArtifactInput, ResolveArtifactOutput } from "../source-service.js";
2
3
  import type { ArtifactScope, MappingSourcePriority, ResolveArtifactTargetInput, SourceMapping } from "../types.js";
3
4
  import { type BatchOutput } from "./batch-runner.js";
@@ -25,7 +26,8 @@ export type BatchClassMembersInput = {
25
26
  strictVersion?: boolean;
26
27
  concurrency?: number;
27
28
  failFast?: boolean;
28
- compact?: boolean;
29
+ detail?: ResponseDetailLevel;
30
+ include?: readonly string[];
29
31
  entries: readonly BatchClassMembersEntry[];
30
32
  };
31
33
  export declare class BatchClassMembersService {
@@ -1,5 +1,5 @@
1
1
  import { buildSuggestedCall } from "../build-suggested-call.js";
2
- import { compactResponse, compactMembersResponse, TOOL_PRESERVE_PAYLOAD_KEYS } from "../response-utils.js";
2
+ import { projectByDetail } from "../response-utils.js";
3
3
  import { runBatch, splitEntryWarnings } from "./batch-runner.js";
4
4
  export class BatchClassMembersService {
5
5
  deps;
@@ -9,7 +9,8 @@ export class BatchClassMembersService {
9
9
  async execute(input) {
10
10
  const concurrency = input.concurrency ?? 4;
11
11
  const failFast = input.failFast ?? false;
12
- const compact = input.compact ?? true;
12
+ const detail = input.detail ?? "summary";
13
+ const include = new Set(input.include ?? []);
13
14
  return runBatch({
14
15
  entries: input.entries,
15
16
  concurrency,
@@ -53,6 +54,7 @@ export class BatchClassMembersService {
53
54
  includeInherited: entry.includeInherited,
54
55
  memberPattern: entry.memberPattern,
55
56
  maxMembers: entry.maxMembers,
57
+ includeDescriptors: include.has("descriptors"),
56
58
  mapping: input.mapping,
57
59
  sourcePriority: input.sourcePriority,
58
60
  allowDecompile: input.allowDecompile,
@@ -63,16 +65,14 @@ export class BatchClassMembersService {
63
65
  strictVersion: input.strictVersion
64
66
  }));
65
67
  const { result, warnings } = splitEntryWarnings(raw);
66
- const projected = compact
67
- ? compactResponse(compactMembersResponse(result), TOOL_PRESERVE_PAYLOAD_KEYS["get-class-members"])
68
- : result;
68
+ const projected = projectByDetail("get-class-members", result, detail, include);
69
69
  return { result: projected, warnings };
70
70
  },
71
71
  buildErrorSuggestedCall: (entry, sharedArtifact) => {
72
72
  if (!sharedArtifact)
73
73
  return undefined;
74
74
  const params = {
75
- target: { type: "artifact", artifactId: sharedArtifact.artifactId },
75
+ target: { kind: "artifact", artifactId: sharedArtifact.artifactId },
76
76
  className: entry.className
77
77
  };
78
78
  if (entry.access !== undefined)
@@ -1,3 +1,4 @@
1
+ import { type ResponseDetailLevel } from "../response-utils.js";
1
2
  import type { GetClassSourceInput, GetClassSourceOutput, ResolveArtifactInput, ResolveArtifactOutput } from "../source-service.js";
2
3
  import type { ArtifactScope, MappingSourcePriority, ResolveArtifactTargetInput, SourceMapping } from "../types.js";
3
4
  import { type BatchOutput } from "./batch-runner.js";
@@ -23,7 +24,8 @@ export type BatchClassSourceInput = {
23
24
  strictVersion?: boolean;
24
25
  concurrency?: number;
25
26
  failFast?: boolean;
26
- compact?: boolean;
27
+ detail?: ResponseDetailLevel;
28
+ include?: readonly string[];
27
29
  entries: readonly BatchClassSourceEntry[];
28
30
  };
29
31
  export type BatchClassSourceDeps = {
@@ -1,5 +1,5 @@
1
1
  import { buildSuggestedCall } from "../build-suggested-call.js";
2
- import { compactResponse, compactSourceResponse, TOOL_PRESERVE_PAYLOAD_KEYS } from "../response-utils.js";
2
+ import { projectByDetail } from "../response-utils.js";
3
3
  import { runBatch, splitEntryWarnings } from "./batch-runner.js";
4
4
  export class BatchClassSourceService {
5
5
  deps;
@@ -9,7 +9,8 @@ export class BatchClassSourceService {
9
9
  async execute(input) {
10
10
  const concurrency = input.concurrency ?? 4;
11
11
  const failFast = input.failFast ?? false;
12
- const compact = input.compact ?? true;
12
+ const detail = input.detail ?? "summary";
13
+ const include = new Set(input.include ?? []);
13
14
  return runBatch({
14
15
  entries: input.entries,
15
16
  concurrency,
@@ -64,16 +65,14 @@ export class BatchClassSourceService {
64
65
  strictVersion: input.strictVersion
65
66
  }));
66
67
  const { result, warnings } = splitEntryWarnings(raw);
67
- const projected = compact
68
- ? compactResponse(compactSourceResponse(result), TOOL_PRESERVE_PAYLOAD_KEYS["get-class-source"])
69
- : result;
68
+ const projected = projectByDetail("get-class-source", result, detail, include);
70
69
  return { result: projected, warnings };
71
70
  },
72
71
  buildErrorSuggestedCall: (entry, sharedArtifact) => {
73
72
  if (!sharedArtifact)
74
73
  return undefined;
75
74
  const params = {
76
- target: { type: "artifact", artifactId: sharedArtifact.artifactId },
75
+ target: { kind: "artifact", artifactId: sharedArtifact.artifactId },
77
76
  className: entry.className
78
77
  };
79
78
  if (entry.mode !== undefined)
@@ -1,3 +1,4 @@
1
+ import { type ResponseDetailLevel } from "../response-utils.js";
1
2
  import type { FindMappingInput, FindMappingOutput } from "../source-service.js";
2
3
  import type { MappingSourcePriority, SourceMapping } from "../types.js";
3
4
  export type BatchMappingsDeps = {
@@ -26,7 +27,8 @@ export type BatchMappingsInput = {
26
27
  gradleUserHome?: string;
27
28
  concurrency?: number;
28
29
  failFast?: boolean;
29
- compact?: boolean;
30
+ detail?: ResponseDetailLevel;
31
+ include?: readonly string[];
30
32
  entries: readonly BatchMappingsEntry[];
31
33
  };
32
34
  export declare class BatchMappingsService {
@@ -1,5 +1,5 @@
1
1
  import { buildSuggestedCall } from "../build-suggested-call.js";
2
- import { compactResponse, compactMappingResponse } from "../response-utils.js";
2
+ import { projectByDetail } from "../response-utils.js";
3
3
  import { runBatch, splitEntryWarnings } from "./batch-runner.js";
4
4
  export class BatchMappingsService {
5
5
  deps;
@@ -9,7 +9,8 @@ export class BatchMappingsService {
9
9
  async execute(input) {
10
10
  const concurrency = input.concurrency ?? 4;
11
11
  const failFast = input.failFast ?? false;
12
- const compact = input.compact ?? true;
12
+ const detail = input.detail ?? "summary";
13
+ const include = new Set(input.include ?? []);
13
14
  return runBatch({
14
15
  entries: input.entries,
15
16
  concurrency,
@@ -32,9 +33,7 @@ export class BatchMappingsService {
32
33
  maxCandidates: entry.maxCandidates
33
34
  }));
34
35
  const { result, warnings } = splitEntryWarnings(raw);
35
- const projected = compact
36
- ? compactResponse(compactMappingResponse(result))
37
- : result;
36
+ const projected = projectByDetail("find-mapping", result, detail, include);
38
37
  return { result: projected, warnings };
39
38
  },
40
39
  buildErrorSuggestedCall: (entry) => {
@@ -1,3 +1,4 @@
1
+ import { type ResponseDetailLevel } from "../response-utils.js";
1
2
  import type { CheckSymbolExistsInput, CheckSymbolExistsOutput, ResolveArtifactInput, ResolveArtifactOutput } from "../source-service.js";
2
3
  import type { ArtifactScope, MappingSourcePriority, SourceMapping, WorkspaceTargetInput, SourceTargetInput } from "../types.js";
3
4
  export type BatchSymbolExistsDeps = {
@@ -36,7 +37,8 @@ export type BatchSymbolExistsInput = {
36
37
  strictVersion?: boolean;
37
38
  concurrency?: number;
38
39
  failFast?: boolean;
39
- compact?: boolean;
40
+ detail?: ResponseDetailLevel;
41
+ include?: readonly string[];
40
42
  entries: readonly BatchSymbolExistsEntry[];
41
43
  };
42
44
  export declare class BatchSymbolExistsService {
@@ -1,6 +1,6 @@
1
1
  import { buildSuggestedCall } from "../build-suggested-call.js";
2
2
  import { createError, ERROR_CODES } from "../errors.js";
3
- import { compactResponse, compactMappingResponse } from "../response-utils.js";
3
+ import { projectByDetail } from "../response-utils.js";
4
4
  import { runBatch, splitEntryWarnings } from "./batch-runner.js";
5
5
  function deriveMinecraftVersion(resolvedVersion, workspaceVersion) {
6
6
  const candidate = resolvedVersion?.trim() || workspaceVersion?.trim();
@@ -23,7 +23,8 @@ export class BatchSymbolExistsService {
23
23
  async execute(input) {
24
24
  const concurrency = input.concurrency ?? 4;
25
25
  const failFast = input.failFast ?? false;
26
- const compact = input.compact ?? true;
26
+ const detail = input.detail ?? "summary";
27
+ const include = new Set(input.include ?? []);
27
28
  return runBatch({
28
29
  entries: input.entries,
29
30
  concurrency,
@@ -79,9 +80,7 @@ export class BatchSymbolExistsService {
79
80
  projectPath: input.projectPath
80
81
  }));
81
82
  const { result, warnings } = splitEntryWarnings(raw);
82
- const projected = compact
83
- ? compactResponse(compactMappingResponse(result))
84
- : result;
83
+ const projected = projectByDetail("check-symbol-exists", result, detail, include);
85
84
  return { result: projected, warnings };
86
85
  },
87
86
  buildErrorSuggestedCall: (entry, sharedArtifact) => {
@@ -33,16 +33,16 @@ export declare const compareMinecraftShape: {
33
33
  fromVersion: string;
34
34
  toVersion: string;
35
35
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
36
- gradleUserHome?: string | undefined;
37
36
  sourcePriority?: "loom-first" | "maven-first" | undefined;
37
+ gradleUserHome?: string | undefined;
38
38
  }, {
39
39
  kind: "class";
40
40
  className: string;
41
41
  fromVersion: string;
42
42
  toVersion: string;
43
43
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
44
- gradleUserHome?: string | undefined;
45
44
  sourcePriority?: "loom-first" | "maven-first" | undefined;
45
+ gradleUserHome?: string | undefined;
46
46
  }>, z.ZodObject<{
47
47
  kind: z.ZodLiteral<"registry">;
48
48
  fromVersion: z.ZodString;
@@ -97,16 +97,16 @@ export declare const compareMinecraftSchema: z.ZodObject<{
97
97
  fromVersion: string;
98
98
  toVersion: string;
99
99
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
100
- gradleUserHome?: string | undefined;
101
100
  sourcePriority?: "loom-first" | "maven-first" | undefined;
101
+ gradleUserHome?: string | undefined;
102
102
  }, {
103
103
  kind: "class";
104
104
  className: string;
105
105
  fromVersion: string;
106
106
  toVersion: string;
107
107
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
108
- gradleUserHome?: string | undefined;
109
108
  sourcePriority?: "loom-first" | "maven-first" | undefined;
109
+ gradleUserHome?: string | undefined;
110
110
  }>, z.ZodObject<{
111
111
  kind: z.ZodLiteral<"registry">;
112
112
  fromVersion: z.ZodString;
@@ -130,7 +130,6 @@ export declare const compareMinecraftSchema: z.ZodObject<{
130
130
  maxEntriesPerRegistry: z.ZodOptional<z.ZodNumber>;
131
131
  includeFullDiff: z.ZodDefault<z.ZodBoolean>;
132
132
  }, "strip", z.ZodTypeAny, {
133
- maxClassResults: number;
134
133
  subject: {
135
134
  kind: "version-pair";
136
135
  fromVersion: string;
@@ -142,18 +141,19 @@ export declare const compareMinecraftSchema: z.ZodObject<{
142
141
  fromVersion: string;
143
142
  toVersion: string;
144
143
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
145
- gradleUserHome?: string | undefined;
146
144
  sourcePriority?: "loom-first" | "maven-first" | undefined;
145
+ gradleUserHome?: string | undefined;
147
146
  } | {
148
147
  kind: "registry";
149
148
  fromVersion: string;
150
149
  toVersion: string;
151
150
  registry?: string | undefined;
152
151
  };
152
+ maxClassResults: number;
153
153
  includeFullDiff: boolean;
154
154
  limit?: number | undefined;
155
155
  task?: "auto" | "versions" | "class-diff" | "registry-diff" | "migration-overview" | undefined;
156
- detail?: "full" | "summary" | "standard" | undefined;
156
+ detail?: "summary" | "standard" | "full" | undefined;
157
157
  include?: string[] | undefined;
158
158
  maxEntriesPerRegistry?: number | undefined;
159
159
  }, {
@@ -168,8 +168,8 @@ export declare const compareMinecraftSchema: z.ZodObject<{
168
168
  fromVersion: string;
169
169
  toVersion: string;
170
170
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn" | undefined;
171
- gradleUserHome?: string | undefined;
172
171
  sourcePriority?: "loom-first" | "maven-first" | undefined;
172
+ gradleUserHome?: string | undefined;
173
173
  } | {
174
174
  kind: "registry";
175
175
  fromVersion: string;
@@ -177,10 +177,10 @@ export declare const compareMinecraftSchema: z.ZodObject<{
177
177
  registry?: string | undefined;
178
178
  };
179
179
  limit?: number | undefined;
180
- maxClassResults?: number | undefined;
181
180
  task?: "auto" | "versions" | "class-diff" | "registry-diff" | "migration-overview" | undefined;
182
- detail?: "full" | "summary" | "standard" | undefined;
181
+ detail?: "summary" | "standard" | "full" | undefined;
183
182
  include?: string[] | undefined;
183
+ maxClassResults?: number | undefined;
184
184
  maxEntriesPerRegistry?: number | undefined;
185
185
  includeFullDiff?: boolean | undefined;
186
186
  }>;
@@ -64,7 +64,7 @@ export class CompareMinecraftService {
64
64
  : {
65
65
  fromVersion: input.subject.fromVersion,
66
66
  toVersion: input.subject.toVersion,
67
- packageFilter: input.subject.kind === "class" ? undefined : input.subject.registry
67
+ packageFilter: undefined
68
68
  };
69
69
  const output = await this.deps.compareVersions({
70
70
  fromVersion: subject.fromVersion,
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export declare const detailSchema: z.ZodEnum<["summary", "standard", "full"]>;
3
- export declare const includeGroupSchema: z.ZodEnum<["warnings", "provenance", "candidates", "members", "source", "files", "samples", "diff", "issues", "timeline", "matrix", "entries", "workspace", "health", "recovery", "paths", "owners", "preview", "cacheEntries", "timings", "artifact", "classes", "registry"]>;
3
+ export declare const includeGroupSchema: z.ZodEnum<["warnings", "provenance", "candidates", "members", "descriptors", "source", "files", "samples", "diff", "issues", "timeline", "matrix", "entries", "workspace", "health", "recovery", "paths", "owners", "preview", "cacheEntries", "timings", "artifact", "classes", "registry"]>;
4
4
  export declare const executionModeSchema: z.ZodEnum<["preview", "apply"]>;
5
5
  export declare const positiveIntSchema: z.ZodNumber;
6
6
  export declare function buildIncludeSchema(allowed: readonly string[]): z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
@@ -8,8 +8,7 @@ export async function handleArtifact(deps, subject, detail, include) {
8
8
  status: "blocked",
9
9
  headline: "Could not resolve an artifact without a Minecraft version.",
10
10
  subject: createSummarySubject({
11
- task: "artifact",
12
- requested: subject
11
+ task: "artifact"
13
12
  }),
14
13
  nextActions: nextActionsOrUndefined([
15
14
  createNextAction("inspect-minecraft", {
@@ -42,7 +41,6 @@ export async function handleArtifact(deps, subject, detail, include) {
42
41
  headline: `Resolved artifact ${resolved.artifactId}.`,
43
42
  subject: createSummarySubject({
44
43
  task: "artifact",
45
- requested: subject,
46
44
  artifactId: resolved.artifactId,
47
45
  version: resolved.version
48
46
  }),
@@ -15,14 +15,14 @@ export async function handleClassMembers(deps, subject, detail, include, limit)
15
15
  gradleUserHome: classSubject.gradleUserHome,
16
16
  preferProjectVersion: classSubject.preferProjectVersion,
17
17
  strictVersion: classSubject.strictVersion,
18
- maxMembers: limit
18
+ maxMembers: limit,
19
+ includeDescriptors: include.includes("descriptors")
19
20
  });
20
21
  const summary = {
21
22
  status: members.truncated ? "partial" : "ok",
22
23
  headline: `Collected ${members.counts.total} members for ${members.className}.`,
23
24
  subject: createSummarySubject({
24
25
  task: "class-members",
25
- requested: subject,
26
26
  className: members.className,
27
27
  artifactId: members.artifactId
28
28
  }),
@@ -63,12 +63,13 @@ export async function handleClassMembers(deps, subject, detail, include, limit)
63
63
  include,
64
64
  warnings: [...artifact.warnings, ...members.warnings],
65
65
  truncated: createTruncationMeta({
66
- omittedGroups: ["members"],
66
+ omittedGroups: detail === "summary" ? ["members"] : [],
67
67
  nextActions: [
68
68
  createNextAction("inspect-minecraft", {
69
69
  task: "class-members",
70
70
  detail: "full",
71
71
  include: ["members"],
72
+ limit: Math.min(members.counts.total, 5000),
72
73
  subject
73
74
  })
74
75
  ]
@@ -14,7 +14,6 @@ export async function handleClassOverview(deps, subject, detail, include) {
14
14
  headline: `Could not resolve artifact context for ${className}.`,
15
15
  subject: createSummarySubject({
16
16
  task: "class-overview",
17
- requested: subject,
18
17
  className
19
18
  })
20
19
  };
@@ -64,7 +63,6 @@ export async function handleClassOverview(deps, subject, detail, include) {
64
63
  headline: `Resolved class overview for ${partialSourceFallback.className}.`,
65
64
  subject: createSummarySubject({
66
65
  task: "class-overview",
67
- requested: subject,
68
66
  className: partialSourceFallback.className,
69
67
  artifactId: metadata.artifactId
70
68
  }),
@@ -110,7 +108,6 @@ export async function handleClassOverview(deps, subject, detail, include) {
110
108
  headline: `No class match was found for ${className}.`,
111
109
  subject: createSummarySubject({
112
110
  task: "class-overview",
113
- requested: subject,
114
111
  className,
115
112
  artifactId: artifact.artifactId
116
113
  })
@@ -152,7 +149,6 @@ export async function handleClassOverview(deps, subject, detail, include) {
152
149
  headline: `Found ${matches.total} class matches for ${className}.`,
153
150
  subject: createSummarySubject({
154
151
  task: "class-overview",
155
- requested: subject,
156
152
  className,
157
153
  artifactId: artifact.artifactId
158
154
  }),
@@ -192,7 +188,6 @@ export async function handleClassOverview(deps, subject, detail, include) {
192
188
  headline: `Resolved class overview for ${match.qualifiedName}.`,
193
189
  subject: createSummarySubject({
194
190
  task: "class-overview",
195
- requested: subject,
196
191
  className: match.qualifiedName,
197
192
  artifactId: artifact.artifactId
198
193
  }),
@@ -23,7 +23,6 @@ export async function handleClassSource(deps, subject, detail, include) {
23
23
  headline: `Resolved source for ${source.className}.`,
24
24
  subject: createSummarySubject({
25
25
  task: "class-source",
26
- requested: subject,
27
26
  className: source.className,
28
27
  artifactId: source.artifactId
29
28
  }),
@@ -8,6 +8,31 @@ export async function handleFile(deps, subject, detail, include) {
8
8
  const artifact = subject.kind === "file"
9
9
  ? await resolveArtifactReference(deps, subject, "file")
10
10
  : await resolveWorkspaceArtifactReference(deps, subject, fileSubject.artifact);
11
+ if (!artifact.artifactId) {
12
+ const summary = {
13
+ status: "blocked",
14
+ headline: `Could not resolve artifact context for ${fileSubject.filePath}.`,
15
+ subject: createSummarySubject({
16
+ task: "file",
17
+ filePath: fileSubject.filePath
18
+ })
19
+ };
20
+ return {
21
+ ...buildEntryToolResult({
22
+ task: "file",
23
+ summary,
24
+ detail,
25
+ include,
26
+ blocks: {
27
+ subject: {
28
+ requested: subject
29
+ }
30
+ },
31
+ alwaysBlocks: ["subject"]
32
+ }),
33
+ warnings: artifact.warnings
34
+ };
35
+ }
11
36
  const file = await deps.getArtifactFile({
12
37
  artifactId: artifact.artifactId,
13
38
  filePath: fileSubject.filePath
@@ -17,7 +42,6 @@ export async function handleFile(deps, subject, detail, include) {
17
42
  headline: `Read ${file.filePath}.`,
18
43
  subject: createSummarySubject({
19
44
  task: "file",
20
- requested: subject,
21
45
  filePath: file.filePath,
22
46
  artifactId: artifact.artifactId
23
47
  }),
@@ -46,7 +70,7 @@ export async function handleFile(deps, subject, detail, include) {
46
70
  content: include.includes("source") || detail !== "summary" ? file.content : undefined
47
71
  }
48
72
  },
49
- alwaysBlocks: ["subject"]
73
+ alwaysBlocks: ["subject", "file"]
50
74
  }),
51
75
  warnings: [...artifact.warnings]
52
76
  };
@@ -52,7 +52,6 @@ export async function handleListFiles(deps, subject, detail, include, limit, cur
52
52
  headline: `Listed ${files.items.length} files for ${artifact.artifactId}.`,
53
53
  subject: createSummarySubject({
54
54
  task: "list-files",
55
- requested: subject,
56
55
  artifactId: artifact.artifactId
57
56
  }),
58
57
  counts: {
@@ -2,4 +2,12 @@ import { type DetailLevel } from "../../response-contract.js";
2
2
  import { type Subject, type InspectMinecraftDeps } from "../internal.js";
3
3
  export declare function handleSearch(deps: InspectMinecraftDeps, subject: Subject, detail: DetailLevel, include: string[], limit: number | undefined, cursor: string | undefined): Promise<{
4
4
  warnings: string[];
5
+ meta: {
6
+ pagination: {
7
+ cursorIgnored?: boolean | undefined;
8
+ nextCursor?: string | undefined;
9
+ returnedCount: number;
10
+ hasMore: boolean;
11
+ };
12
+ };
5
13
  }>;
@@ -82,7 +82,6 @@ export async function handleSearch(deps, subject, detail, include, limit, cursor
82
82
  : `No source hits were found for ${searchSubject.query}.`,
83
83
  subject: createSummarySubject({
84
84
  task: "search",
85
- requested: requestedSubject,
86
85
  query: searchSubject.query,
87
86
  artifactId: artifact.artifactId
88
87
  }),
@@ -129,6 +128,7 @@ export async function handleSearch(deps, subject, detail, include, limit, cursor
129
128
  }
130
129
  : {})
131
130
  };
131
+ const returnedCount = (detail === "summary" ? sampledHits.items : effectiveHits).length;
132
132
  return {
133
133
  ...buildEntryToolResult({
134
134
  task: "search",
@@ -150,7 +150,18 @@ export async function handleSearch(deps, subject, detail, include, limit, cursor
150
150
  },
151
151
  alwaysBlocks: ["subject"]
152
152
  }),
153
- warnings: [...artifact.warnings, ...(binaryBackedClassHit?.warnings ?? [])]
153
+ warnings: [...artifact.warnings, ...(binaryBackedClassHit?.warnings ?? [])],
154
+ // Always surface continuation state in meta, even in summary mode where the
155
+ // search block (and its nextCursor) is omitted, so callers never stop early
156
+ // believing they have all results.
157
+ meta: {
158
+ pagination: {
159
+ returnedCount,
160
+ hasMore: search.nextCursor != null,
161
+ ...(search.nextCursor != null ? { nextCursor: search.nextCursor } : {}),
162
+ ...(search.cursorIgnored ? { cursorIgnored: true } : {})
163
+ }
164
+ }
154
165
  };
155
166
  }
156
167
  //# sourceMappingURL=search.js.map
@@ -2,5 +2,5 @@ import { type DetailLevel } from "../../response-contract.js";
2
2
  import { type InspectMinecraftDeps } from "../internal.js";
3
3
  import { type InspectMinecraftInput } from "../../inspect-minecraft-service.js";
4
4
  export declare function handleVersions(deps: InspectMinecraftDeps, input: InspectMinecraftInput, detail: DetailLevel, include: string[]): Promise<{
5
- warnings: never[];
5
+ warnings: string[];
6
6
  }>;
@@ -41,9 +41,10 @@ export async function handleVersions(deps, input, detail, include) {
41
41
  snapshots: input.includeSnapshots ? versions.snapshots : undefined,
42
42
  cached: versions.cached
43
43
  }
44
- }
44
+ },
45
+ alwaysBlocks: ["versions"]
45
46
  }),
46
- warnings: []
47
+ warnings: versions.warnings ?? []
47
48
  };
48
49
  }
49
50
  //# sourceMappingURL=versions.js.map