@adhisang/minecraft-modding-mcp 3.0.0 → 3.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 +20 -1
- package/README.md +212 -819
- package/dist/entry-tools/analyze-mod-service.d.ts +16 -16
- package/dist/entry-tools/analyze-mod-service.js +69 -13
- package/dist/entry-tools/analyze-symbol-service.d.ts +12 -12
- package/dist/entry-tools/analyze-symbol-service.js +59 -4
- package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
- package/dist/entry-tools/compare-minecraft-service.js +58 -26
- package/dist/entry-tools/inspect-minecraft-service.d.ts +19 -18
- package/dist/entry-tools/inspect-minecraft-service.js +165 -11
- package/dist/entry-tools/manage-cache-service.d.ts +6 -6
- package/dist/entry-tools/manage-cache-service.js +40 -5
- package/dist/entry-tools/response-contract.d.ts +1 -0
- package/dist/entry-tools/response-contract.js +3 -0
- package/dist/entry-tools/validate-project-service.d.ts +24 -24
- package/dist/entry-tools/validate-project-service.js +40 -7
- package/dist/index.js +80 -50
- package/dist/observability.d.ts +18 -2
- package/dist/observability.js +47 -10
- package/dist/source-service.d.ts +0 -1
- package/dist/source-service.js +44 -54
- package/dist/storage/files-repo.d.ts +1 -0
- package/dist/storage/files-repo.js +29 -5
- package/dist/tool-contract-manifest.d.ts +4 -0
- package/dist/tool-contract-manifest.js +139 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { PUBLIC_CACHE_KINDS } from "../cache-registry.js";
|
|
3
3
|
import { createError, ERROR_CODES } from "../errors.js";
|
|
4
4
|
import { buildIncludeSchema, detailSchema, executionModeSchema, positiveIntSchema } from "./entry-tool-schema.js";
|
|
5
|
-
import { buildEntryToolResult } from "./response-contract.js";
|
|
5
|
+
import { buildEntryToolResult, createNextAction, createSummarySubject } from "./response-contract.js";
|
|
6
6
|
import { normalizeReadOnlyExecutionMode, requireNonEmptyObject, resolveDetail, resolveInclude } from "./request-normalizers.js";
|
|
7
7
|
const nonEmptyString = z.string().trim().min(1);
|
|
8
8
|
const INCLUDE_GROUPS = ["warnings", "cacheEntries", "paths", "owners", "health", "preview", "timings"];
|
|
@@ -22,9 +22,9 @@ export const manageCacheShape = {
|
|
|
22
22
|
}).optional(),
|
|
23
23
|
detail: detailSchema.optional(),
|
|
24
24
|
include: buildIncludeSchema(INCLUDE_GROUPS),
|
|
25
|
-
limit: positiveIntSchema.
|
|
25
|
+
limit: positiveIntSchema.default(50),
|
|
26
26
|
cursor: nonEmptyString.optional(),
|
|
27
|
-
executionMode: executionModeSchema.
|
|
27
|
+
executionMode: executionModeSchema.default("preview")
|
|
28
28
|
};
|
|
29
29
|
export const manageCacheSchema = z.object(manageCacheShape);
|
|
30
30
|
export class ManageCacheService {
|
|
@@ -37,6 +37,12 @@ export class ManageCacheService {
|
|
|
37
37
|
const include = resolveInclude(input.include);
|
|
38
38
|
const executionMode = normalizeReadOnlyExecutionMode(input.action, input.executionMode);
|
|
39
39
|
const cacheKinds = input.cacheKinds?.length ? input.cacheKinds : [...PUBLIC_CACHE_KINDS];
|
|
40
|
+
const summarySubject = createSummarySubject({
|
|
41
|
+
action: input.action,
|
|
42
|
+
cacheKinds,
|
|
43
|
+
executionMode,
|
|
44
|
+
selector: input.selector
|
|
45
|
+
});
|
|
40
46
|
if (executionMode === "apply" &&
|
|
41
47
|
(input.action === "delete" || input.action === "prune" || input.action === "rebuild")) {
|
|
42
48
|
requireNonEmptyObject(input.selector, `${input.action} apply requires a non-empty selector.`);
|
|
@@ -58,6 +64,7 @@ export class ManageCacheService {
|
|
|
58
64
|
summary: {
|
|
59
65
|
status: hasUnhealthyKinds ? "partial" : "ok",
|
|
60
66
|
headline: `Summarized ${cacheKinds.length} cache kind(s).`,
|
|
67
|
+
subject: summarySubject,
|
|
61
68
|
counts: {
|
|
62
69
|
entries: entryCount,
|
|
63
70
|
bytes: totalBytes
|
|
@@ -100,6 +107,7 @@ export class ManageCacheService {
|
|
|
100
107
|
summary: {
|
|
101
108
|
status: hasUnhealthyEntries ? "partial" : "ok",
|
|
102
109
|
headline: `${input.action === "list" ? "Listed" : "Inspected"} ${page.entries.length} cache entr${page.entries.length === 1 ? "y" : "ies"}.`,
|
|
110
|
+
subject: summarySubject,
|
|
103
111
|
counts: {
|
|
104
112
|
entries: page.entries.length
|
|
105
113
|
}
|
|
@@ -137,6 +145,7 @@ export class ManageCacheService {
|
|
|
137
145
|
summary: {
|
|
138
146
|
status: output.unhealthyEntries > 0 ? "partial" : "ok",
|
|
139
147
|
headline: `Verified ${output.checkedEntries} cache entr${output.checkedEntries === 1 ? "y" : "ies"}.`,
|
|
148
|
+
subject: summarySubject,
|
|
140
149
|
counts: {
|
|
141
150
|
checkedEntries: output.checkedEntries,
|
|
142
151
|
unhealthyEntries: output.unhealthyEntries
|
|
@@ -173,10 +182,23 @@ export class ManageCacheService {
|
|
|
173
182
|
summary: {
|
|
174
183
|
status: output.deletedEntries > 0 && executionMode === "apply" ? "changed" : "unchanged",
|
|
175
184
|
headline: `${executionMode === "apply" ? "Applied" : "Previewed"} ${input.action} across ${cacheKinds.length} cache kind(s).`,
|
|
185
|
+
subject: summarySubject,
|
|
176
186
|
counts: {
|
|
177
187
|
deletedEntries: output.deletedEntries,
|
|
178
188
|
deletedBytes: output.deletedBytes
|
|
179
|
-
}
|
|
189
|
+
},
|
|
190
|
+
...(executionMode === "preview"
|
|
191
|
+
? {
|
|
192
|
+
nextActions: [
|
|
193
|
+
createNextAction("manage-cache", {
|
|
194
|
+
action: input.action,
|
|
195
|
+
cacheKinds,
|
|
196
|
+
executionMode: "apply",
|
|
197
|
+
selector: input.selector
|
|
198
|
+
})
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
: {})
|
|
180
202
|
},
|
|
181
203
|
blocks: {
|
|
182
204
|
operation: {
|
|
@@ -204,9 +226,22 @@ export class ManageCacheService {
|
|
|
204
226
|
summary: {
|
|
205
227
|
status: output.rebuiltEntries > 0 && executionMode === "apply" ? "changed" : "unchanged",
|
|
206
228
|
headline: `${executionMode === "apply" ? "Applied" : "Previewed"} rebuild for ${cacheKinds.length} cache kind(s).`,
|
|
229
|
+
subject: summarySubject,
|
|
207
230
|
counts: {
|
|
208
231
|
rebuiltEntries: output.rebuiltEntries
|
|
209
|
-
}
|
|
232
|
+
},
|
|
233
|
+
...(executionMode === "preview"
|
|
234
|
+
? {
|
|
235
|
+
nextActions: [
|
|
236
|
+
createNextAction("manage-cache", {
|
|
237
|
+
action: "rebuild",
|
|
238
|
+
cacheKinds,
|
|
239
|
+
executionMode: "apply",
|
|
240
|
+
selector: input.selector
|
|
241
|
+
})
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
: {})
|
|
210
245
|
},
|
|
211
246
|
blocks: {
|
|
212
247
|
operation: {
|
|
@@ -23,6 +23,7 @@ export type TruncationMeta = {
|
|
|
23
23
|
};
|
|
24
24
|
export declare function normalizeIncludeGroups(include: readonly string[] | undefined): string[];
|
|
25
25
|
export declare function createNextAction(tool: string, params: Record<string, unknown>): NextAction;
|
|
26
|
+
export declare function createSummarySubject(fields: Record<string, unknown>): Record<string, unknown>;
|
|
26
27
|
export declare function createTruncationMeta(input: {
|
|
27
28
|
omittedGroups?: string[];
|
|
28
29
|
nextActions?: NextAction[];
|
|
@@ -57,6 +57,9 @@ export function normalizeIncludeGroups(include) {
|
|
|
57
57
|
export function createNextAction(tool, params) {
|
|
58
58
|
return { tool, params };
|
|
59
59
|
}
|
|
60
|
+
export function createSummarySubject(fields) {
|
|
61
|
+
return Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));
|
|
62
|
+
}
|
|
60
63
|
export function createTruncationMeta(input) {
|
|
61
64
|
return {
|
|
62
65
|
didTruncate: true,
|
|
@@ -142,18 +142,18 @@ export declare const validateProjectShape: {
|
|
|
142
142
|
sourcePriority: z.ZodOptional<z.ZodEnum<["loom-first", "maven-first"]>>;
|
|
143
143
|
scope: z.ZodOptional<z.ZodEnum<["vanilla", "merged", "loader"]>>;
|
|
144
144
|
preferProjectVersion: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
-
preferProjectMapping: z.
|
|
145
|
+
preferProjectMapping: z.ZodDefault<z.ZodBoolean>;
|
|
146
146
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
147
147
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
148
148
|
sourceRoots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
149
149
|
configPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
150
|
-
minSeverity: z.
|
|
151
|
-
hideUncertain: z.
|
|
152
|
-
explain: z.
|
|
150
|
+
minSeverity: z.ZodDefault<z.ZodEnum<["error", "warning", "all"]>>;
|
|
151
|
+
hideUncertain: z.ZodDefault<z.ZodBoolean>;
|
|
152
|
+
explain: z.ZodDefault<z.ZodBoolean>;
|
|
153
153
|
warningMode: z.ZodOptional<z.ZodEnum<["full", "aggregated"]>>;
|
|
154
154
|
warningCategoryFilter: z.ZodOptional<z.ZodArray<z.ZodEnum<["mapping", "configuration", "validation", "resolution", "parse"]>, "many">>;
|
|
155
|
-
treatInfoAsWarning: z.
|
|
156
|
-
includeIssues: z.
|
|
155
|
+
treatInfoAsWarning: z.ZodDefault<z.ZodBoolean>;
|
|
156
|
+
includeIssues: z.ZodDefault<z.ZodBoolean>;
|
|
157
157
|
};
|
|
158
158
|
export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
159
159
|
task: z.ZodEnum<["project-summary", "mixin", "access-widener"]>;
|
|
@@ -298,19 +298,25 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
298
298
|
sourcePriority: z.ZodOptional<z.ZodEnum<["loom-first", "maven-first"]>>;
|
|
299
299
|
scope: z.ZodOptional<z.ZodEnum<["vanilla", "merged", "loader"]>>;
|
|
300
300
|
preferProjectVersion: z.ZodOptional<z.ZodBoolean>;
|
|
301
|
-
preferProjectMapping: z.
|
|
301
|
+
preferProjectMapping: z.ZodDefault<z.ZodBoolean>;
|
|
302
302
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
303
303
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
304
304
|
sourceRoots: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
305
305
|
configPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
306
|
-
minSeverity: z.
|
|
307
|
-
hideUncertain: z.
|
|
308
|
-
explain: z.
|
|
306
|
+
minSeverity: z.ZodDefault<z.ZodEnum<["error", "warning", "all"]>>;
|
|
307
|
+
hideUncertain: z.ZodDefault<z.ZodBoolean>;
|
|
308
|
+
explain: z.ZodDefault<z.ZodBoolean>;
|
|
309
309
|
warningMode: z.ZodOptional<z.ZodEnum<["full", "aggregated"]>>;
|
|
310
310
|
warningCategoryFilter: z.ZodOptional<z.ZodArray<z.ZodEnum<["mapping", "configuration", "validation", "resolution", "parse"]>, "many">>;
|
|
311
|
-
treatInfoAsWarning: z.
|
|
312
|
-
includeIssues: z.
|
|
311
|
+
treatInfoAsWarning: z.ZodDefault<z.ZodBoolean>;
|
|
312
|
+
includeIssues: z.ZodDefault<z.ZodBoolean>;
|
|
313
313
|
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
minSeverity: "all" | "error" | "warning";
|
|
315
|
+
hideUncertain: boolean;
|
|
316
|
+
explain: boolean;
|
|
317
|
+
preferProjectMapping: boolean;
|
|
318
|
+
treatInfoAsWarning: boolean;
|
|
319
|
+
includeIssues: boolean;
|
|
314
320
|
task: "mixin" | "access-widener" | "project-summary";
|
|
315
321
|
subject: {
|
|
316
322
|
kind: "workspace";
|
|
@@ -350,14 +356,8 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
350
356
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
351
357
|
sourceRoots?: string[] | undefined;
|
|
352
358
|
preferProjectVersion?: boolean | undefined;
|
|
353
|
-
minSeverity?: "all" | "error" | "warning" | undefined;
|
|
354
|
-
hideUncertain?: boolean | undefined;
|
|
355
|
-
explain?: boolean | undefined;
|
|
356
359
|
warningMode?: "full" | "aggregated" | undefined;
|
|
357
|
-
preferProjectMapping?: boolean | undefined;
|
|
358
360
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
359
|
-
treatInfoAsWarning?: boolean | undefined;
|
|
360
|
-
includeIssues?: boolean | undefined;
|
|
361
361
|
configPaths?: string[] | undefined;
|
|
362
362
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
363
363
|
include?: string[] | undefined;
|
|
@@ -413,6 +413,12 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
413
413
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
414
414
|
include?: string[] | undefined;
|
|
415
415
|
}>, {
|
|
416
|
+
minSeverity: "all" | "error" | "warning";
|
|
417
|
+
hideUncertain: boolean;
|
|
418
|
+
explain: boolean;
|
|
419
|
+
preferProjectMapping: boolean;
|
|
420
|
+
treatInfoAsWarning: boolean;
|
|
421
|
+
includeIssues: boolean;
|
|
416
422
|
task: "mixin" | "access-widener" | "project-summary";
|
|
417
423
|
subject: {
|
|
418
424
|
kind: "workspace";
|
|
@@ -452,14 +458,8 @@ export declare const validateProjectSchema: z.ZodEffects<z.ZodObject<{
|
|
|
452
458
|
sourcePriority?: "loom-first" | "maven-first" | undefined;
|
|
453
459
|
sourceRoots?: string[] | undefined;
|
|
454
460
|
preferProjectVersion?: boolean | undefined;
|
|
455
|
-
minSeverity?: "all" | "error" | "warning" | undefined;
|
|
456
|
-
hideUncertain?: boolean | undefined;
|
|
457
|
-
explain?: boolean | undefined;
|
|
458
461
|
warningMode?: "full" | "aggregated" | undefined;
|
|
459
|
-
preferProjectMapping?: boolean | undefined;
|
|
460
462
|
warningCategoryFilter?: ("mapping" | "parse" | "validation" | "configuration" | "resolution")[] | undefined;
|
|
461
|
-
treatInfoAsWarning?: boolean | undefined;
|
|
462
|
-
includeIssues?: boolean | undefined;
|
|
463
463
|
configPaths?: string[] | undefined;
|
|
464
464
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
465
465
|
include?: string[] | undefined;
|
|
@@ -4,7 +4,7 @@ import fastGlob from "fast-glob";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createError, ERROR_CODES } from "../errors.js";
|
|
6
6
|
import { buildIncludeSchema, detailSchema } from "./entry-tool-schema.js";
|
|
7
|
-
import { buildEntryToolResult } from "./response-contract.js";
|
|
7
|
+
import { buildEntryToolResult, createSummarySubject } from "./response-contract.js";
|
|
8
8
|
import { resolveDetail, resolveInclude } from "./request-normalizers.js";
|
|
9
9
|
const nonEmptyString = z.string().trim().min(1);
|
|
10
10
|
const INCLUDE_GROUPS = ["warnings", "issues", "workspace", "recovery"];
|
|
@@ -42,18 +42,18 @@ export const validateProjectShape = {
|
|
|
42
42
|
sourcePriority: z.enum(["loom-first", "maven-first"]).optional(),
|
|
43
43
|
scope: z.enum(["vanilla", "merged", "loader"]).optional(),
|
|
44
44
|
preferProjectVersion: z.boolean().optional(),
|
|
45
|
-
preferProjectMapping: z.boolean().
|
|
45
|
+
preferProjectMapping: z.boolean().default(false),
|
|
46
46
|
detail: detailSchema.optional(),
|
|
47
47
|
include: buildIncludeSchema(INCLUDE_GROUPS),
|
|
48
48
|
sourceRoots: z.array(nonEmptyString).optional(),
|
|
49
49
|
configPaths: z.array(nonEmptyString).optional(),
|
|
50
|
-
minSeverity: z.enum(["error", "warning", "all"]).
|
|
51
|
-
hideUncertain: z.boolean().
|
|
52
|
-
explain: z.boolean().
|
|
50
|
+
minSeverity: z.enum(["error", "warning", "all"]).default("all"),
|
|
51
|
+
hideUncertain: z.boolean().default(false),
|
|
52
|
+
explain: z.boolean().default(false),
|
|
53
53
|
warningMode: z.enum(["full", "aggregated"]).optional(),
|
|
54
54
|
warningCategoryFilter: z.array(z.enum(["mapping", "configuration", "validation", "resolution", "parse"])).optional(),
|
|
55
|
-
treatInfoAsWarning: z.boolean().
|
|
56
|
-
includeIssues: z.boolean().
|
|
55
|
+
treatInfoAsWarning: z.boolean().default(true),
|
|
56
|
+
includeIssues: z.boolean().default(true)
|
|
57
57
|
};
|
|
58
58
|
export const validateProjectSchema = z.object(validateProjectShape).superRefine((value, ctx) => {
|
|
59
59
|
if (value.task === "project-summary" && value.subject.kind !== "workspace") {
|
|
@@ -162,6 +162,15 @@ export class ValidateProjectService {
|
|
|
162
162
|
summary: {
|
|
163
163
|
status: invalidCount > 0 ? "invalid" : partialCount > 0 ? "partial" : "ok",
|
|
164
164
|
headline: `Validated ${summary?.total ?? 0} mixin input(s).`,
|
|
165
|
+
subject: createSummarySubject({
|
|
166
|
+
task: "mixin",
|
|
167
|
+
kind: input.subject.kind,
|
|
168
|
+
input: input.subject.input,
|
|
169
|
+
version: input.version,
|
|
170
|
+
mapping: input.mapping,
|
|
171
|
+
sourcePriority: input.sourcePriority,
|
|
172
|
+
scope: input.scope
|
|
173
|
+
}),
|
|
165
174
|
counts: {
|
|
166
175
|
valid: summary?.valid ?? 0,
|
|
167
176
|
partial: partialCount,
|
|
@@ -205,6 +214,14 @@ export class ValidateProjectService {
|
|
|
205
214
|
headline: output.valid
|
|
206
215
|
? "Access Widener is valid."
|
|
207
216
|
: "Access Widener contains validation issues.",
|
|
217
|
+
subject: createSummarySubject({
|
|
218
|
+
task: "access-widener",
|
|
219
|
+
kind: input.subject.kind,
|
|
220
|
+
input: input.subject.input,
|
|
221
|
+
version: input.version,
|
|
222
|
+
mapping: input.mapping,
|
|
223
|
+
sourcePriority: input.sourcePriority
|
|
224
|
+
}),
|
|
208
225
|
counts: {
|
|
209
226
|
valid: output.valid ? 1 : 0,
|
|
210
227
|
invalid: output.valid ? 0 : 1
|
|
@@ -241,6 +258,12 @@ export class ValidateProjectService {
|
|
|
241
258
|
summary: {
|
|
242
259
|
status: "blocked",
|
|
243
260
|
headline: "project-summary requires version or preferProjectVersion=true.",
|
|
261
|
+
subject: createSummarySubject({
|
|
262
|
+
task: "project-summary",
|
|
263
|
+
kind: input.subject.kind,
|
|
264
|
+
projectPath: input.subject.projectPath,
|
|
265
|
+
discover: input.subject.discover
|
|
266
|
+
}),
|
|
244
267
|
nextActions: [
|
|
245
268
|
{
|
|
246
269
|
tool: "validate-project",
|
|
@@ -350,6 +373,16 @@ export class ValidateProjectService {
|
|
|
350
373
|
summary: {
|
|
351
374
|
status,
|
|
352
375
|
headline: `Validated ${mixinConfigs.length} mixin config(s) and ${accessWideners.length} access widener(s).`,
|
|
376
|
+
subject: createSummarySubject({
|
|
377
|
+
task: "project-summary",
|
|
378
|
+
kind: input.subject.kind,
|
|
379
|
+
projectPath,
|
|
380
|
+
discover: input.subject.discover,
|
|
381
|
+
version: input.version,
|
|
382
|
+
mapping: input.mapping,
|
|
383
|
+
sourcePriority: input.sourcePriority,
|
|
384
|
+
scope: input.scope
|
|
385
|
+
}),
|
|
353
386
|
counts: {
|
|
354
387
|
valid: validMixins + validAw,
|
|
355
388
|
partial: partialCount,
|
package/dist/index.js
CHANGED
|
@@ -90,9 +90,28 @@ const sourceLookupTargetSchema = z.discriminatedUnion("type", [
|
|
|
90
90
|
const RESOLVE_ARTIFACT_TARGET_DESCRIPTION = "Object with kind and value. Example: {\"kind\":\"version\",\"value\":\"1.21.10\"}. Must be an object, not a string.";
|
|
91
91
|
const SOURCE_LOOKUP_TARGET_DESCRIPTION = "Object: {\"type\":\"resolve\",\"kind\":\"version\",\"value\":\"1.21.10\"} or {\"type\":\"artifact\",\"artifactId\":\"...\"}. Must be an object, not a string.";
|
|
92
92
|
const SOURCE_SCOPE_DESCRIPTION = 'vanilla = Mojang client jar only; merged = Loom cache discovery (default); loader = currently behaves the same as "merged".';
|
|
93
|
+
const SUGGESTED_CALL_DEFAULTS = {
|
|
94
|
+
allowDecompile: true,
|
|
95
|
+
preferProjectVersion: false,
|
|
96
|
+
strictVersion: false,
|
|
97
|
+
mode: "metadata",
|
|
98
|
+
access: "public",
|
|
99
|
+
includeSynthetic: false,
|
|
100
|
+
includeInherited: false,
|
|
101
|
+
hideUncertain: false,
|
|
102
|
+
explain: false,
|
|
103
|
+
preferProjectMapping: false,
|
|
104
|
+
minSeverity: "all",
|
|
105
|
+
reportMode: "full",
|
|
106
|
+
treatInfoAsWarning: true,
|
|
107
|
+
includeIssues: true
|
|
108
|
+
};
|
|
109
|
+
function isSuggestedCallDefault(field, value) {
|
|
110
|
+
return value === SUGGESTED_CALL_DEFAULTS[field];
|
|
111
|
+
}
|
|
93
112
|
const listVersionsShape = {
|
|
94
|
-
includeSnapshots: z.boolean().
|
|
95
|
-
limit: optionalPositiveInt.describe("
|
|
113
|
+
includeSnapshots: z.boolean().default(false),
|
|
114
|
+
limit: optionalPositiveInt.default(20).describe("max 200")
|
|
96
115
|
};
|
|
97
116
|
const listVersionsSchema = z.object(listVersionsShape);
|
|
98
117
|
const resolveArtifactShape = {
|
|
@@ -102,7 +121,7 @@ const resolveArtifactShape = {
|
|
|
102
121
|
}).describe(RESOLVE_ARTIFACT_TARGET_DESCRIPTION),
|
|
103
122
|
mapping: sourceMappingSchema.optional().describe("obfuscated | mojang | intermediary | yarn"),
|
|
104
123
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
105
|
-
allowDecompile: z.boolean().
|
|
124
|
+
allowDecompile: z.boolean().default(true),
|
|
106
125
|
projectPath: optionalNonEmptyString.describe("Optional workspace root path for Loom cache-assisted source resolution"),
|
|
107
126
|
scope: artifactScopeSchema.optional().describe(SOURCE_SCOPE_DESCRIPTION),
|
|
108
127
|
preferProjectVersion: z.boolean().optional().describe("When true, detect MC version from gradle.properties and override target.value"),
|
|
@@ -111,11 +130,11 @@ const resolveArtifactShape = {
|
|
|
111
130
|
const resolveArtifactSchema = z.object(resolveArtifactShape);
|
|
112
131
|
const getClassSourceShape = {
|
|
113
132
|
className: nonEmptyString,
|
|
114
|
-
mode: sourceModeSchema.
|
|
133
|
+
mode: sourceModeSchema.default("metadata").describe("metadata = symbol outline only; snippet = source with default maxLines=200; full = entire source"),
|
|
115
134
|
target: sourceLookupTargetSchema.describe(SOURCE_LOOKUP_TARGET_DESCRIPTION),
|
|
116
135
|
mapping: sourceMappingSchema.optional().describe("obfuscated | mojang | intermediary | yarn"),
|
|
117
136
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
118
|
-
allowDecompile: z.boolean().
|
|
137
|
+
allowDecompile: z.boolean().default(true),
|
|
119
138
|
projectPath: optionalNonEmptyString.describe("Optional workspace root path for Loom cache-assisted source resolution"),
|
|
120
139
|
scope: artifactScopeSchema.optional().describe(SOURCE_SCOPE_DESCRIPTION),
|
|
121
140
|
preferProjectVersion: z.boolean().optional().describe("When true, detect MC version from gradle.properties and override target.value"),
|
|
@@ -144,10 +163,10 @@ const getClassMembersShape = {
|
|
|
144
163
|
target: sourceLookupTargetSchema.describe(SOURCE_LOOKUP_TARGET_DESCRIPTION),
|
|
145
164
|
mapping: sourceMappingSchema.optional().describe("obfuscated | mojang | intermediary | yarn (default obfuscated)"),
|
|
146
165
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
147
|
-
allowDecompile: z.boolean().
|
|
148
|
-
access: memberAccessSchema.
|
|
149
|
-
includeSynthetic: z.boolean().
|
|
150
|
-
includeInherited: z.boolean().
|
|
166
|
+
allowDecompile: z.boolean().default(true),
|
|
167
|
+
access: memberAccessSchema.default("public").describe("public | all"),
|
|
168
|
+
includeSynthetic: z.boolean().default(false),
|
|
169
|
+
includeInherited: z.boolean().default(false),
|
|
151
170
|
memberPattern: optionalNonEmptyString,
|
|
152
171
|
maxMembers: optionalPositiveInt.describe("default 500, max 5000"),
|
|
153
172
|
projectPath: optionalNonEmptyString,
|
|
@@ -164,8 +183,8 @@ const searchClassSourceShape = {
|
|
|
164
183
|
packagePrefix: optionalNonEmptyString,
|
|
165
184
|
fileGlob: optionalNonEmptyString,
|
|
166
185
|
symbolKind: searchSymbolKindSchema.optional().describe("class | interface | enum | record | method | field"),
|
|
167
|
-
queryMode: z.enum(["auto", "token", "literal"]).
|
|
168
|
-
limit: optionalPositiveInt.
|
|
186
|
+
queryMode: z.enum(["auto", "token", "literal"]).default("auto").describe("auto: indexed search, including separator queries like foo.bar; token: indexed-only; literal: explicit substring scan only"),
|
|
187
|
+
limit: optionalPositiveInt.default(20),
|
|
169
188
|
cursor: optionalNonEmptyString
|
|
170
189
|
};
|
|
171
190
|
const searchClassSourceSchema = z.object(searchClassSourceShape).superRefine((value, ctx) => {
|
|
@@ -197,9 +216,9 @@ const traceSymbolLifecycleShape = {
|
|
|
197
216
|
toVersion: optionalNonEmptyString,
|
|
198
217
|
mapping: sourceMappingSchema.optional().describe("obfuscated | mojang | intermediary | yarn (default obfuscated)"),
|
|
199
218
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
200
|
-
includeSnapshots: z.boolean().
|
|
201
|
-
maxVersions: optionalPositiveInt.describe("
|
|
202
|
-
includeTimeline: z.boolean().
|
|
219
|
+
includeSnapshots: z.boolean().default(false),
|
|
220
|
+
maxVersions: optionalPositiveInt.default(120).describe("max 400"),
|
|
221
|
+
includeTimeline: z.boolean().default(false)
|
|
203
222
|
};
|
|
204
223
|
const traceSymbolLifecycleSchema = z.object(traceSymbolLifecycleShape);
|
|
205
224
|
const diffClassSignaturesShape = {
|
|
@@ -208,7 +227,7 @@ const diffClassSignaturesShape = {
|
|
|
208
227
|
toVersion: nonEmptyString,
|
|
209
228
|
mapping: sourceMappingSchema.optional().describe("obfuscated | mojang | intermediary | yarn (default obfuscated)"),
|
|
210
229
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
211
|
-
includeFullDiff: z.boolean().
|
|
230
|
+
includeFullDiff: z.boolean().default(true).describe("When false, omit from/to snapshots from modified entries and keep only key+changed")
|
|
212
231
|
};
|
|
213
232
|
const diffClassSignaturesSchema = z.object(diffClassSignaturesShape);
|
|
214
233
|
const findMappingShape = {
|
|
@@ -227,7 +246,7 @@ const findMappingShape = {
|
|
|
227
246
|
})
|
|
228
247
|
.partial()
|
|
229
248
|
.optional(),
|
|
230
|
-
maxCandidates: optionalPositiveInt.describe("Limit returned candidates (
|
|
249
|
+
maxCandidates: optionalPositiveInt.default(200).describe("Limit returned candidates (max 200)")
|
|
231
250
|
};
|
|
232
251
|
const findMappingSchema = z.object(findMappingShape).superRefine((value, ctx) => {
|
|
233
252
|
if (value.kind === "class") {
|
|
@@ -294,7 +313,7 @@ const resolveMethodMappingExactShape = {
|
|
|
294
313
|
sourceMapping: sourceMappingSchema.describe("obfuscated | mojang | intermediary | yarn"),
|
|
295
314
|
targetMapping: sourceMappingSchema.describe("obfuscated | mojang | intermediary | yarn"),
|
|
296
315
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
297
|
-
maxCandidates: optionalPositiveInt.describe("Limit returned candidates (
|
|
316
|
+
maxCandidates: optionalPositiveInt.default(200).describe("Limit returned candidates (max 200)")
|
|
298
317
|
};
|
|
299
318
|
const resolveMethodMappingExactSchema = z
|
|
300
319
|
.object(resolveMethodMappingExactShape)
|
|
@@ -345,7 +364,7 @@ const resolveWorkspaceSymbolShape = {
|
|
|
345
364
|
descriptor: optionalNonEmptyString,
|
|
346
365
|
sourceMapping: sourceMappingSchema.describe("obfuscated | mojang | intermediary | yarn"),
|
|
347
366
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
348
|
-
maxCandidates: optionalPositiveInt.describe("Limit returned candidates for field/method lookups (
|
|
367
|
+
maxCandidates: optionalPositiveInt.default(200).describe("Limit returned candidates for field/method lookups (max 200)")
|
|
349
368
|
};
|
|
350
369
|
const resolveWorkspaceSymbolSchema = z
|
|
351
370
|
.object(resolveWorkspaceSymbolShape)
|
|
@@ -414,10 +433,10 @@ const checkSymbolExistsShape = {
|
|
|
414
433
|
descriptor: optionalNonEmptyString.describe("required for kind=method unless signatureMode=name-only"),
|
|
415
434
|
sourceMapping: sourceMappingSchema.describe("obfuscated | mojang | intermediary | yarn"),
|
|
416
435
|
sourcePriority: mappingSourcePrioritySchema.optional().describe("loom-first | maven-first"),
|
|
417
|
-
nameMode: classNameModeSchema.
|
|
418
|
-
signatureMode: z.enum(["exact", "name-only"]).
|
|
419
|
-
.describe("exact
|
|
420
|
-
maxCandidates: optionalPositiveInt.describe("Limit returned candidates (
|
|
436
|
+
nameMode: classNameModeSchema.default("fqcn").describe("fqcn | auto"),
|
|
437
|
+
signatureMode: z.enum(["exact", "name-only"]).default("exact")
|
|
438
|
+
.describe("exact: require descriptor for methods; name-only: match by owner+name only"),
|
|
439
|
+
maxCandidates: optionalPositiveInt.default(200).describe("Limit returned candidates (max 200)")
|
|
421
440
|
};
|
|
422
441
|
const checkSymbolExistsSchema = z.object(checkSymbolExistsShape).superRefine((value, ctx) => {
|
|
423
442
|
if (value.kind === "class") {
|
|
@@ -478,7 +497,7 @@ const checkSymbolExistsSchema = z.object(checkSymbolExistsShape).superRefine((va
|
|
|
478
497
|
});
|
|
479
498
|
const nbtToJsonShape = {
|
|
480
499
|
nbtBase64: nonEmptyString,
|
|
481
|
-
compression: decodeCompressionSchema.
|
|
500
|
+
compression: decodeCompressionSchema.default("auto").describe("none | gzip | auto")
|
|
482
501
|
};
|
|
483
502
|
const nbtToJsonSchema = z.object(nbtToJsonShape);
|
|
484
503
|
const nbtPatchOperationSchema = z
|
|
@@ -495,12 +514,12 @@ const nbtApplyJsonPatchShape = {
|
|
|
495
514
|
const nbtApplyJsonPatchSchema = z.object(nbtApplyJsonPatchShape);
|
|
496
515
|
const jsonToNbtShape = {
|
|
497
516
|
typedJson: z.unknown(),
|
|
498
|
-
compression: encodeCompressionSchema.
|
|
517
|
+
compression: encodeCompressionSchema.default("none").describe("none | gzip")
|
|
499
518
|
};
|
|
500
519
|
const jsonToNbtSchema = z.object(jsonToNbtShape);
|
|
501
520
|
const indexArtifactShape = {
|
|
502
521
|
artifactId: nonEmptyString,
|
|
503
|
-
force: z.boolean().
|
|
522
|
+
force: z.boolean().default(false)
|
|
504
523
|
};
|
|
505
524
|
const indexArtifactSchema = z.object(indexArtifactShape);
|
|
506
525
|
const validateMixinShape = {
|
|
@@ -534,23 +553,23 @@ const validateMixinShape = {
|
|
|
534
553
|
scope: artifactScopeSchema.optional().describe(SOURCE_SCOPE_DESCRIPTION),
|
|
535
554
|
projectPath: optionalNonEmptyString.describe("Optional workspace root path for Loom cache-assisted source resolution"),
|
|
536
555
|
preferProjectVersion: z.boolean().optional().describe("When true, detect MC version from gradle.properties and override version"),
|
|
537
|
-
minSeverity: z.enum(["error", "warning", "all"]).
|
|
538
|
-
.describe("'error'=errors only, 'warning'=errors+warnings, 'all'=everything
|
|
539
|
-
hideUncertain: z.boolean().
|
|
540
|
-
.describe("Omit issues with confidence='uncertain'
|
|
541
|
-
explain: z.boolean().
|
|
542
|
-
.describe("When true, enrich each issue with explanation and suggestedCall for agent recovery
|
|
556
|
+
minSeverity: z.enum(["error", "warning", "all"]).default("all")
|
|
557
|
+
.describe("'error'=errors only, 'warning'=errors+warnings, 'all'=everything"),
|
|
558
|
+
hideUncertain: z.boolean().default(false)
|
|
559
|
+
.describe("Omit issues with confidence='uncertain'"),
|
|
560
|
+
explain: z.boolean().default(false)
|
|
561
|
+
.describe("When true, enrich each issue with explanation and suggestedCall for agent recovery"),
|
|
543
562
|
warningMode: z.enum(["full", "aggregated"]).optional()
|
|
544
|
-
.describe("'full'=all warnings
|
|
545
|
-
preferProjectMapping: z.boolean().
|
|
563
|
+
.describe("'full'=all warnings; 'aggregated'=group warnings by category with counts and samples. Single validation uses the provided value as-is; batch validation defaults to 'aggregated'"),
|
|
564
|
+
preferProjectMapping: z.boolean().default(false)
|
|
546
565
|
.describe("When true, auto-detect mapping from project config even if mapping is explicitly provided"),
|
|
547
|
-
reportMode: z.enum(["compact", "full", "summary-first"]).
|
|
548
|
-
.describe("'compact' omits heavy per-result detail, 'summary-first' hoists shared provenance/warnings/incomplete reasons, 'full'=everything
|
|
566
|
+
reportMode: z.enum(["compact", "full", "summary-first"]).default("full")
|
|
567
|
+
.describe("'compact' omits heavy per-result detail, 'summary-first' hoists shared provenance/warnings/incomplete reasons, 'full'=everything"),
|
|
549
568
|
warningCategoryFilter: z.array(z.enum(["mapping", "configuration", "validation", "resolution", "parse"])).optional()
|
|
550
569
|
.describe("Only include warnings/issues matching these categories (default: all)"),
|
|
551
|
-
treatInfoAsWarning: z.boolean().
|
|
552
|
-
.describe("When false, suppress info-severity structured warnings from output
|
|
553
|
-
includeIssues: z.boolean().
|
|
570
|
+
treatInfoAsWarning: z.boolean().default(true)
|
|
571
|
+
.describe("When false, suppress info-severity structured warnings from output"),
|
|
572
|
+
includeIssues: z.boolean().default(true)
|
|
554
573
|
.describe("When false, keep summary fields but omit per-result issues[] payloads")
|
|
555
574
|
};
|
|
556
575
|
const validateMixinSchema = z.object(validateMixinShape);
|
|
@@ -563,13 +582,13 @@ const validateAccessWidenerShape = {
|
|
|
563
582
|
const validateAccessWidenerSchema = z.object(validateAccessWidenerShape);
|
|
564
583
|
const analyzeModJarShape = {
|
|
565
584
|
jarPath: nonEmptyString.describe("Local path to the mod JAR file"),
|
|
566
|
-
includeClasses: z.boolean().
|
|
585
|
+
includeClasses: z.boolean().default(false).describe("Include full class listing")
|
|
567
586
|
};
|
|
568
587
|
const analyzeModJarSchema = z.object(analyzeModJarShape);
|
|
569
588
|
const getRegistryDataShape = {
|
|
570
589
|
version: nonEmptyString.describe("Minecraft version (e.g. 1.21)"),
|
|
571
590
|
registry: optionalNonEmptyString.describe('Optional registry name (e.g. "block", "item", "minecraft:biome"). Omit to list all registries.'),
|
|
572
|
-
includeData: z.boolean().
|
|
591
|
+
includeData: z.boolean().default(true).describe("When false, return registry names/counts without full entry bodies"),
|
|
573
592
|
maxEntriesPerRegistry: optionalPositiveInt.describe("Limit returned entries per registry body")
|
|
574
593
|
};
|
|
575
594
|
const getRegistryDataSchema = z.object(getRegistryDataShape);
|
|
@@ -578,15 +597,15 @@ const compareVersionsCategorySchema = z.enum(COMPARE_VERSIONS_CATEGORIES);
|
|
|
578
597
|
const compareVersionsShape = {
|
|
579
598
|
fromVersion: nonEmptyString.describe("Older Minecraft version (e.g. 1.20.4)"),
|
|
580
599
|
toVersion: nonEmptyString.describe("Newer Minecraft version (e.g. 1.21)"),
|
|
581
|
-
category: compareVersionsCategorySchema.
|
|
600
|
+
category: compareVersionsCategorySchema.default("all").describe("classes | registry | all"),
|
|
582
601
|
packageFilter: optionalNonEmptyString.describe("Filter classes to a package prefix (e.g. net.minecraft.world.item)"),
|
|
583
|
-
maxClassResults: optionalPositiveInt.describe("Max class results per direction (
|
|
602
|
+
maxClassResults: optionalPositiveInt.default(500).describe("Max class results per direction (max 5000)")
|
|
584
603
|
};
|
|
585
604
|
const compareVersionsSchema = z.object(compareVersionsShape);
|
|
586
605
|
const decompileModJarShape = {
|
|
587
606
|
jarPath: nonEmptyString.describe("Local path to the mod JAR file"),
|
|
588
607
|
className: optionalNonEmptyString.describe("Optional fully-qualified class name to view source. Omit to list all classes."),
|
|
589
|
-
includeFiles: z.boolean().
|
|
608
|
+
includeFiles: z.boolean().default(true).describe("When false, omit the full class list and return counts only"),
|
|
590
609
|
maxFiles: optionalPositiveInt.describe("Limit returned class names when files are included")
|
|
591
610
|
};
|
|
592
611
|
const decompileModJarSchema = z.object(decompileModJarShape);
|
|
@@ -603,8 +622,8 @@ const modSearchTypeSchema = z.enum(MOD_SEARCH_TYPES);
|
|
|
603
622
|
const searchModSourceShape = {
|
|
604
623
|
jarPath: nonEmptyString.describe("Local path to the mod JAR file"),
|
|
605
624
|
query: nonEmptyString.describe("Search pattern (regex or literal string)"),
|
|
606
|
-
searchType: modSearchTypeSchema.
|
|
607
|
-
limit: optionalPositiveInt.describe("Max results (
|
|
625
|
+
searchType: modSearchTypeSchema.default("all").describe("class | method | field | content | all"),
|
|
626
|
+
limit: optionalPositiveInt.default(50).describe("Max results (max 200)")
|
|
608
627
|
};
|
|
609
628
|
const searchModSourceSchema = z.object(searchModSourceShape);
|
|
610
629
|
const REMAP_TARGETS = ["yarn", "mojang"];
|
|
@@ -908,7 +927,10 @@ function copySourceLookupSuggestionFields(tool, source) {
|
|
|
908
927
|
: ["className", "mapping", "sourcePriority", "projectPath", "scope", "access", "memberPattern"];
|
|
909
928
|
for (const field of stringFields) {
|
|
910
929
|
const value = source[field];
|
|
911
|
-
if (typeof value === "string" &&
|
|
930
|
+
if (typeof value === "string" &&
|
|
931
|
+
value.trim() &&
|
|
932
|
+
(!Object.prototype.hasOwnProperty.call(SUGGESTED_CALL_DEFAULTS, field) ||
|
|
933
|
+
!isSuggestedCallDefault(field, value))) {
|
|
912
934
|
result[field] = value;
|
|
913
935
|
}
|
|
914
936
|
}
|
|
@@ -926,7 +948,9 @@ function copySourceLookupSuggestionFields(tool, source) {
|
|
|
926
948
|
: ["allowDecompile", "preferProjectVersion", "strictVersion", "includeSynthetic", "includeInherited"];
|
|
927
949
|
for (const field of booleanFields) {
|
|
928
950
|
const value = source[field];
|
|
929
|
-
if (typeof value === "boolean"
|
|
951
|
+
if (typeof value === "boolean" &&
|
|
952
|
+
(!Object.prototype.hasOwnProperty.call(SUGGESTED_CALL_DEFAULTS, field) ||
|
|
953
|
+
!isSuggestedCallDefault(field, value))) {
|
|
930
954
|
result[field] = value;
|
|
931
955
|
}
|
|
932
956
|
}
|
|
@@ -946,7 +970,10 @@ function copyValidateMixinSharedParams(source) {
|
|
|
946
970
|
];
|
|
947
971
|
for (const field of stringFields) {
|
|
948
972
|
const value = source[field];
|
|
949
|
-
if (typeof value === "string" &&
|
|
973
|
+
if (typeof value === "string" &&
|
|
974
|
+
value.trim() &&
|
|
975
|
+
(!Object.prototype.hasOwnProperty.call(SUGGESTED_CALL_DEFAULTS, field) ||
|
|
976
|
+
!isSuggestedCallDefault(field, value))) {
|
|
950
977
|
result[field] = value;
|
|
951
978
|
}
|
|
952
979
|
}
|
|
@@ -960,7 +987,9 @@ function copyValidateMixinSharedParams(source) {
|
|
|
960
987
|
];
|
|
961
988
|
for (const field of booleanFields) {
|
|
962
989
|
const value = source[field];
|
|
963
|
-
if (typeof value === "boolean"
|
|
990
|
+
if (typeof value === "boolean" &&
|
|
991
|
+
(!Object.prototype.hasOwnProperty.call(SUGGESTED_CALL_DEFAULTS, field) ||
|
|
992
|
+
!isSuggestedCallDefault(field, value))) {
|
|
964
993
|
result[field] = value;
|
|
965
994
|
}
|
|
966
995
|
}
|
|
@@ -1098,7 +1127,8 @@ function buildResolveArtifactSuggestedParams(normalizedInput) {
|
|
|
1098
1127
|
const booleanFields = ["allowDecompile", "preferProjectVersion", "strictVersion"];
|
|
1099
1128
|
for (const field of booleanFields) {
|
|
1100
1129
|
const value = record[field];
|
|
1101
|
-
if (typeof value === "boolean"
|
|
1130
|
+
if (typeof value === "boolean" &&
|
|
1131
|
+
!isSuggestedCallDefault(field, value)) {
|
|
1102
1132
|
result[field] = value;
|
|
1103
1133
|
}
|
|
1104
1134
|
}
|