@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
|
@@ -25,15 +25,15 @@ export declare const analyzeModShape: {
|
|
|
25
25
|
className: string;
|
|
26
26
|
}>]>;
|
|
27
27
|
query: z.ZodOptional<z.ZodString>;
|
|
28
|
-
searchType: z.
|
|
29
|
-
limit: z.
|
|
30
|
-
includeFiles: z.
|
|
28
|
+
searchType: z.ZodDefault<z.ZodEnum<["class", "method", "field", "content", "all"]>>;
|
|
29
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
includeFiles: z.ZodDefault<z.ZodBoolean>;
|
|
31
31
|
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
maxLines: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
targetMapping: z.ZodOptional<z.ZodEnum<["yarn", "mojang"]>>;
|
|
35
35
|
outputJar: z.ZodOptional<z.ZodString>;
|
|
36
|
-
executionMode: z.
|
|
36
|
+
executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
|
|
37
37
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
38
38
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
39
39
|
};
|
|
@@ -62,18 +62,20 @@ export declare const analyzeModSchema: z.ZodEffects<z.ZodObject<{
|
|
|
62
62
|
className: string;
|
|
63
63
|
}>]>;
|
|
64
64
|
query: z.ZodOptional<z.ZodString>;
|
|
65
|
-
searchType: z.
|
|
66
|
-
limit: z.
|
|
67
|
-
includeFiles: z.
|
|
65
|
+
searchType: z.ZodDefault<z.ZodEnum<["class", "method", "field", "content", "all"]>>;
|
|
66
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
includeFiles: z.ZodDefault<z.ZodBoolean>;
|
|
68
68
|
maxFiles: z.ZodOptional<z.ZodNumber>;
|
|
69
69
|
maxLines: z.ZodOptional<z.ZodNumber>;
|
|
70
70
|
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
71
71
|
targetMapping: z.ZodOptional<z.ZodEnum<["yarn", "mojang"]>>;
|
|
72
72
|
outputJar: z.ZodOptional<z.ZodString>;
|
|
73
|
-
executionMode: z.
|
|
73
|
+
executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
|
|
74
74
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
75
75
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
76
76
|
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
limit: number;
|
|
78
|
+
searchType: "class" | "method" | "field" | "all" | "content";
|
|
77
79
|
task: "search" | "remap" | "summary" | "class-source" | "decompile";
|
|
78
80
|
subject: {
|
|
79
81
|
kind: "jar";
|
|
@@ -83,18 +85,16 @@ export declare const analyzeModSchema: z.ZodEffects<z.ZodObject<{
|
|
|
83
85
|
jarPath: string;
|
|
84
86
|
className: string;
|
|
85
87
|
};
|
|
86
|
-
|
|
88
|
+
includeFiles: boolean;
|
|
89
|
+
executionMode: "preview" | "apply";
|
|
87
90
|
maxLines?: number | undefined;
|
|
88
91
|
maxChars?: number | undefined;
|
|
89
92
|
targetMapping?: "mojang" | "yarn" | undefined;
|
|
90
93
|
outputJar?: string | undefined;
|
|
91
94
|
query?: string | undefined;
|
|
92
|
-
searchType?: "class" | "method" | "field" | "all" | "content" | undefined;
|
|
93
95
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
94
96
|
include?: string[] | undefined;
|
|
95
|
-
includeFiles?: boolean | undefined;
|
|
96
97
|
maxFiles?: number | undefined;
|
|
97
|
-
executionMode?: "preview" | "apply" | undefined;
|
|
98
98
|
}, {
|
|
99
99
|
task: "search" | "remap" | "summary" | "class-source" | "decompile";
|
|
100
100
|
subject: {
|
|
@@ -118,6 +118,8 @@ export declare const analyzeModSchema: z.ZodEffects<z.ZodObject<{
|
|
|
118
118
|
maxFiles?: number | undefined;
|
|
119
119
|
executionMode?: "preview" | "apply" | undefined;
|
|
120
120
|
}>, {
|
|
121
|
+
limit: number;
|
|
122
|
+
searchType: "class" | "method" | "field" | "all" | "content";
|
|
121
123
|
task: "search" | "remap" | "summary" | "class-source" | "decompile";
|
|
122
124
|
subject: {
|
|
123
125
|
kind: "jar";
|
|
@@ -127,18 +129,16 @@ export declare const analyzeModSchema: z.ZodEffects<z.ZodObject<{
|
|
|
127
129
|
jarPath: string;
|
|
128
130
|
className: string;
|
|
129
131
|
};
|
|
130
|
-
|
|
132
|
+
includeFiles: boolean;
|
|
133
|
+
executionMode: "preview" | "apply";
|
|
131
134
|
maxLines?: number | undefined;
|
|
132
135
|
maxChars?: number | undefined;
|
|
133
136
|
targetMapping?: "mojang" | "yarn" | undefined;
|
|
134
137
|
outputJar?: string | undefined;
|
|
135
138
|
query?: string | undefined;
|
|
136
|
-
searchType?: "class" | "method" | "field" | "all" | "content" | undefined;
|
|
137
139
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
138
140
|
include?: string[] | undefined;
|
|
139
|
-
includeFiles?: boolean | undefined;
|
|
140
141
|
maxFiles?: number | undefined;
|
|
141
|
-
executionMode?: "preview" | "apply" | undefined;
|
|
142
142
|
}, {
|
|
143
143
|
task: "search" | "remap" | "summary" | "class-source" | "decompile";
|
|
144
144
|
subject: {
|
|
@@ -4,7 +4,7 @@ import { normalizePathForHost } from "../path-converter.js";
|
|
|
4
4
|
import { createError, ERROR_CODES } from "../errors.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { buildIncludeSchema, detailSchema, executionModeSchema, positiveIntSchema } from "./entry-tool-schema.js";
|
|
7
|
-
import { buildEntryToolResult } from "./response-contract.js";
|
|
7
|
+
import { buildEntryToolResult, createNextAction, 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", "files", "source", "samples", "timings"];
|
|
@@ -23,15 +23,15 @@ export const analyzeModShape = {
|
|
|
23
23
|
task: z.enum(["summary", "decompile", "search", "class-source", "remap"]),
|
|
24
24
|
subject: subjectSchema,
|
|
25
25
|
query: nonEmptyString.optional(),
|
|
26
|
-
searchType: z.enum(["class", "method", "field", "content", "all"]).
|
|
27
|
-
limit: positiveIntSchema.
|
|
28
|
-
includeFiles: z.boolean().
|
|
26
|
+
searchType: z.enum(["class", "method", "field", "content", "all"]).default("all"),
|
|
27
|
+
limit: positiveIntSchema.default(50),
|
|
28
|
+
includeFiles: z.boolean().default(true),
|
|
29
29
|
maxFiles: positiveIntSchema.optional(),
|
|
30
30
|
maxLines: positiveIntSchema.optional(),
|
|
31
31
|
maxChars: positiveIntSchema.optional(),
|
|
32
32
|
targetMapping: z.enum(["yarn", "mojang"]).optional(),
|
|
33
33
|
outputJar: nonEmptyString.optional(),
|
|
34
|
-
executionMode: executionModeSchema.
|
|
34
|
+
executionMode: executionModeSchema.default("preview"),
|
|
35
35
|
detail: detailSchema.optional(),
|
|
36
36
|
include: buildIncludeSchema(INCLUDE_GROUPS)
|
|
37
37
|
};
|
|
@@ -89,6 +89,11 @@ export class AnalyzeModService {
|
|
|
89
89
|
summary: {
|
|
90
90
|
status: "ok",
|
|
91
91
|
headline: `Summarized ${analysis.loader} mod metadata.`,
|
|
92
|
+
subject: createSummarySubject({
|
|
93
|
+
task: "summary",
|
|
94
|
+
kind: input.subject.kind,
|
|
95
|
+
jarPath: input.subject.jarPath
|
|
96
|
+
}),
|
|
92
97
|
counts: {
|
|
93
98
|
classes: analysis.classCount,
|
|
94
99
|
dependencies: analysis.dependencies?.length ?? 0
|
|
@@ -102,9 +107,10 @@ export class AnalyzeModService {
|
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
109
|
case "decompile": {
|
|
110
|
+
const includeFiles = input.includeFiles ?? true;
|
|
105
111
|
const output = await this.deps.decompileModJar({
|
|
106
112
|
jarPath: input.subject.jarPath,
|
|
107
|
-
includeFiles
|
|
113
|
+
includeFiles,
|
|
108
114
|
maxFiles: input.maxFiles
|
|
109
115
|
});
|
|
110
116
|
return {
|
|
@@ -114,7 +120,14 @@ export class AnalyzeModService {
|
|
|
114
120
|
include,
|
|
115
121
|
summary: {
|
|
116
122
|
status: "ok",
|
|
117
|
-
headline: `Decompiled ${input.subject.jarPath}
|
|
123
|
+
headline: `Decompiled ${input.subject.jarPath}.`,
|
|
124
|
+
subject: createSummarySubject({
|
|
125
|
+
task: "decompile",
|
|
126
|
+
kind: input.subject.kind,
|
|
127
|
+
jarPath: input.subject.jarPath,
|
|
128
|
+
includeFiles: includeFiles === true ? undefined : includeFiles,
|
|
129
|
+
maxFiles: input.maxFiles
|
|
130
|
+
})
|
|
118
131
|
},
|
|
119
132
|
blocks: {
|
|
120
133
|
decompile: output
|
|
@@ -124,11 +137,13 @@ export class AnalyzeModService {
|
|
|
124
137
|
};
|
|
125
138
|
}
|
|
126
139
|
case "search": {
|
|
140
|
+
const searchType = input.searchType ?? "all";
|
|
141
|
+
const limit = input.limit ?? 50;
|
|
127
142
|
const output = await this.deps.searchModSource({
|
|
128
143
|
jarPath: input.subject.jarPath,
|
|
129
144
|
query: input.query,
|
|
130
|
-
searchType
|
|
131
|
-
limit
|
|
145
|
+
searchType,
|
|
146
|
+
limit
|
|
132
147
|
});
|
|
133
148
|
return {
|
|
134
149
|
...buildEntryToolResult({
|
|
@@ -137,7 +152,15 @@ export class AnalyzeModService {
|
|
|
137
152
|
include,
|
|
138
153
|
summary: {
|
|
139
154
|
status: "ok",
|
|
140
|
-
headline: `Searched ${input.subject.jarPath} for ${input.query}
|
|
155
|
+
headline: `Searched ${input.subject.jarPath} for ${input.query}.`,
|
|
156
|
+
subject: createSummarySubject({
|
|
157
|
+
task: "search",
|
|
158
|
+
kind: input.subject.kind,
|
|
159
|
+
jarPath: input.subject.jarPath,
|
|
160
|
+
query: input.query,
|
|
161
|
+
searchType: searchType === "all" ? undefined : searchType,
|
|
162
|
+
limit: limit === 50 ? undefined : limit
|
|
163
|
+
})
|
|
141
164
|
},
|
|
142
165
|
blocks: {
|
|
143
166
|
hits: output
|
|
@@ -166,7 +189,15 @@ export class AnalyzeModService {
|
|
|
166
189
|
include,
|
|
167
190
|
summary: {
|
|
168
191
|
status: "ok",
|
|
169
|
-
headline: `Loaded class source for ${input.subject.className}
|
|
192
|
+
headline: `Loaded class source for ${input.subject.className}.`,
|
|
193
|
+
subject: createSummarySubject({
|
|
194
|
+
task: "class-source",
|
|
195
|
+
kind: input.subject.kind,
|
|
196
|
+
jarPath: input.subject.jarPath,
|
|
197
|
+
className: input.subject.className,
|
|
198
|
+
maxLines: input.maxLines,
|
|
199
|
+
maxChars: input.maxChars
|
|
200
|
+
})
|
|
170
201
|
},
|
|
171
202
|
blocks: {
|
|
172
203
|
source: output
|
|
@@ -201,7 +232,25 @@ export class AnalyzeModService {
|
|
|
201
232
|
include,
|
|
202
233
|
summary: {
|
|
203
234
|
status: "unchanged",
|
|
204
|
-
headline: `Previewed remap output for ${normalizedInputJar}
|
|
235
|
+
headline: `Previewed remap output for ${normalizedInputJar}.`,
|
|
236
|
+
subject: createSummarySubject({
|
|
237
|
+
task: "remap",
|
|
238
|
+
kind: input.subject.kind,
|
|
239
|
+
jarPath: normalizedInputJar,
|
|
240
|
+
executionMode: "preview",
|
|
241
|
+
targetMapping: input.targetMapping
|
|
242
|
+
}),
|
|
243
|
+
nextActions: [
|
|
244
|
+
createNextAction("analyze-mod", {
|
|
245
|
+
task: "remap",
|
|
246
|
+
subject: {
|
|
247
|
+
kind: input.subject.kind,
|
|
248
|
+
jarPath: input.subject.jarPath
|
|
249
|
+
},
|
|
250
|
+
executionMode: "apply",
|
|
251
|
+
targetMapping: input.targetMapping
|
|
252
|
+
})
|
|
253
|
+
]
|
|
205
254
|
},
|
|
206
255
|
blocks: {
|
|
207
256
|
metadata: {
|
|
@@ -232,7 +281,14 @@ export class AnalyzeModService {
|
|
|
232
281
|
include,
|
|
233
282
|
summary: {
|
|
234
283
|
status: "changed",
|
|
235
|
-
headline: `Remapped ${normalizedInputJar} to ${input.targetMapping}
|
|
284
|
+
headline: `Remapped ${normalizedInputJar} to ${input.targetMapping}.`,
|
|
285
|
+
subject: createSummarySubject({
|
|
286
|
+
task: "remap",
|
|
287
|
+
kind: input.subject.kind,
|
|
288
|
+
jarPath: normalizedInputJar,
|
|
289
|
+
executionMode: "apply",
|
|
290
|
+
targetMapping: input.targetMapping
|
|
291
|
+
})
|
|
236
292
|
},
|
|
237
293
|
blocks: {
|
|
238
294
|
operation: {
|
|
@@ -23,11 +23,11 @@ export declare const analyzeSymbolShape: {
|
|
|
23
23
|
targetMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
|
|
24
24
|
classNameMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
|
|
25
25
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
26
|
-
signatureMode: z.
|
|
27
|
-
nameMode: z.
|
|
26
|
+
signatureMode: z.ZodDefault<z.ZodEnum<["exact", "name-only"]>>;
|
|
27
|
+
nameMode: z.ZodDefault<z.ZodEnum<["fqcn", "auto"]>>;
|
|
28
28
|
includeKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["class", "field", "method"]>, "many">>;
|
|
29
29
|
maxRows: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
maxCandidates: z.
|
|
30
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
31
31
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
32
32
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
33
33
|
};
|
|
@@ -54,14 +54,15 @@ export declare const analyzeSymbolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
54
54
|
targetMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
|
|
55
55
|
classNameMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
|
|
56
56
|
projectPath: z.ZodOptional<z.ZodString>;
|
|
57
|
-
signatureMode: z.
|
|
58
|
-
nameMode: z.
|
|
57
|
+
signatureMode: z.ZodDefault<z.ZodEnum<["exact", "name-only"]>>;
|
|
58
|
+
nameMode: z.ZodDefault<z.ZodEnum<["fqcn", "auto"]>>;
|
|
59
59
|
includeKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["class", "field", "method"]>, "many">>;
|
|
60
60
|
maxRows: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
maxCandidates: z.
|
|
61
|
+
maxCandidates: z.ZodDefault<z.ZodNumber>;
|
|
62
62
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
63
63
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
64
64
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
nameMode: "auto" | "fqcn";
|
|
65
66
|
task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
|
|
66
67
|
subject: {
|
|
67
68
|
kind: "symbol" | "class" | "method" | "field";
|
|
@@ -69,18 +70,17 @@ export declare const analyzeSymbolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
69
70
|
owner?: string | undefined;
|
|
70
71
|
descriptor?: string | undefined;
|
|
71
72
|
};
|
|
73
|
+
signatureMode: "exact" | "name-only";
|
|
74
|
+
maxCandidates: number;
|
|
72
75
|
projectPath?: string | undefined;
|
|
73
76
|
version?: string | undefined;
|
|
74
77
|
sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
75
78
|
targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
76
79
|
classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
77
|
-
nameMode?: "auto" | "fqcn" | undefined;
|
|
78
80
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
79
81
|
include?: string[] | undefined;
|
|
80
|
-
signatureMode?: "exact" | "name-only" | undefined;
|
|
81
82
|
includeKinds?: ("class" | "method" | "field")[] | undefined;
|
|
82
83
|
maxRows?: number | undefined;
|
|
83
|
-
maxCandidates?: number | undefined;
|
|
84
84
|
}, {
|
|
85
85
|
task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
|
|
86
86
|
subject: {
|
|
@@ -102,6 +102,7 @@ export declare const analyzeSymbolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
102
102
|
maxRows?: number | undefined;
|
|
103
103
|
maxCandidates?: number | undefined;
|
|
104
104
|
}>, {
|
|
105
|
+
nameMode: "auto" | "fqcn";
|
|
105
106
|
task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
|
|
106
107
|
subject: {
|
|
107
108
|
kind: "symbol" | "class" | "method" | "field";
|
|
@@ -109,18 +110,17 @@ export declare const analyzeSymbolSchema: z.ZodEffects<z.ZodObject<{
|
|
|
109
110
|
owner?: string | undefined;
|
|
110
111
|
descriptor?: string | undefined;
|
|
111
112
|
};
|
|
113
|
+
signatureMode: "exact" | "name-only";
|
|
114
|
+
maxCandidates: number;
|
|
112
115
|
projectPath?: string | undefined;
|
|
113
116
|
version?: string | undefined;
|
|
114
117
|
sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
115
118
|
targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
116
119
|
classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
|
|
117
|
-
nameMode?: "auto" | "fqcn" | undefined;
|
|
118
120
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
119
121
|
include?: string[] | undefined;
|
|
120
|
-
signatureMode?: "exact" | "name-only" | undefined;
|
|
121
122
|
includeKinds?: ("class" | "method" | "field")[] | undefined;
|
|
122
123
|
maxRows?: number | undefined;
|
|
123
|
-
maxCandidates?: number | undefined;
|
|
124
124
|
}, {
|
|
125
125
|
task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
|
|
126
126
|
subject: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createError, ERROR_CODES } from "../errors.js";
|
|
3
3
|
import { buildIncludeSchema, detailSchema, positiveIntSchema } from "./entry-tool-schema.js";
|
|
4
|
-
import { buildEntryToolResult } from "./response-contract.js";
|
|
4
|
+
import { buildEntryToolResult, createSummarySubject } from "./response-contract.js";
|
|
5
5
|
import { resolveDetail, resolveInclude } from "./request-normalizers.js";
|
|
6
6
|
const nonEmptyString = z.string().trim().min(1);
|
|
7
7
|
const INCLUDE_GROUPS = ["warnings", "candidates", "matrix", "workspace", "timings"];
|
|
@@ -19,11 +19,11 @@ export const analyzeSymbolShape = {
|
|
|
19
19
|
targetMapping: z.enum(["obfuscated", "mojang", "intermediary", "yarn"]).optional(),
|
|
20
20
|
classNameMapping: z.enum(["obfuscated", "mojang", "intermediary", "yarn"]).optional(),
|
|
21
21
|
projectPath: nonEmptyString.optional(),
|
|
22
|
-
signatureMode: z.enum(["exact", "name-only"]).
|
|
23
|
-
nameMode: z.enum(["fqcn", "auto"]).
|
|
22
|
+
signatureMode: z.enum(["exact", "name-only"]).default("exact"),
|
|
23
|
+
nameMode: z.enum(["fqcn", "auto"]).default("fqcn"),
|
|
24
24
|
includeKinds: z.array(z.enum(["class", "field", "method"])).optional(),
|
|
25
25
|
maxRows: positiveIntSchema.optional(),
|
|
26
|
-
maxCandidates: positiveIntSchema.
|
|
26
|
+
maxCandidates: positiveIntSchema.default(200),
|
|
27
27
|
detail: detailSchema.optional(),
|
|
28
28
|
include: buildIncludeSchema(INCLUDE_GROUPS)
|
|
29
29
|
};
|
|
@@ -110,6 +110,15 @@ export class AnalyzeSymbolService {
|
|
|
110
110
|
headline: output.resolved
|
|
111
111
|
? `The symbol exists in ${output.mappingContext.version}.`
|
|
112
112
|
: `The symbol could not be resolved in ${output.mappingContext.version}.`,
|
|
113
|
+
subject: createSummarySubject({
|
|
114
|
+
task: "exists",
|
|
115
|
+
kind: input.subject.kind,
|
|
116
|
+
name: input.subject.name,
|
|
117
|
+
owner: input.subject.owner,
|
|
118
|
+
descriptor: input.subject.descriptor,
|
|
119
|
+
version: input.version,
|
|
120
|
+
sourceMapping: input.sourceMapping ?? "obfuscated"
|
|
121
|
+
}),
|
|
113
122
|
counts: {
|
|
114
123
|
candidates: output.candidateCount
|
|
115
124
|
}
|
|
@@ -145,6 +154,16 @@ export class AnalyzeSymbolService {
|
|
|
145
154
|
headline: output.resolved
|
|
146
155
|
? `Mapped the symbol into ${output.mappingContext.targetMapping}.`
|
|
147
156
|
: `Found ${output.candidateCount} candidate mappings.`,
|
|
157
|
+
subject: createSummarySubject({
|
|
158
|
+
task: "map",
|
|
159
|
+
kind: input.subject.kind,
|
|
160
|
+
name: input.subject.name,
|
|
161
|
+
owner: input.subject.owner,
|
|
162
|
+
descriptor: input.subject.descriptor,
|
|
163
|
+
version: input.version,
|
|
164
|
+
sourceMapping: input.sourceMapping ?? "obfuscated",
|
|
165
|
+
targetMapping: input.targetMapping ?? "mojang"
|
|
166
|
+
}),
|
|
148
167
|
counts: {
|
|
149
168
|
candidates: output.candidateCount
|
|
150
169
|
}
|
|
@@ -184,6 +203,16 @@ export class AnalyzeSymbolService {
|
|
|
184
203
|
headline: output.resolved
|
|
185
204
|
? "Resolved the exact method mapping."
|
|
186
205
|
: "Could not resolve the exact method mapping.",
|
|
206
|
+
subject: createSummarySubject({
|
|
207
|
+
task: "exact-map",
|
|
208
|
+
kind: input.subject.kind,
|
|
209
|
+
name: input.subject.name,
|
|
210
|
+
owner: input.subject.owner,
|
|
211
|
+
descriptor: input.subject.descriptor,
|
|
212
|
+
version: input.version,
|
|
213
|
+
sourceMapping: input.sourceMapping ?? "obfuscated",
|
|
214
|
+
targetMapping: input.targetMapping ?? "mojang"
|
|
215
|
+
}),
|
|
187
216
|
counts: {
|
|
188
217
|
candidates: output.candidateCount
|
|
189
218
|
}
|
|
@@ -214,6 +243,15 @@ export class AnalyzeSymbolService {
|
|
|
214
243
|
headline: output.presence.firstSeen
|
|
215
244
|
? `Tracked the symbol from ${output.range.fromVersion} to ${output.range.toVersion}.`
|
|
216
245
|
: "The symbol was not found in the scanned version range.",
|
|
246
|
+
subject: createSummarySubject({
|
|
247
|
+
task: "lifecycle",
|
|
248
|
+
kind: input.subject.kind,
|
|
249
|
+
name: input.subject.name,
|
|
250
|
+
owner: input.subject.owner,
|
|
251
|
+
descriptor: input.subject.descriptor,
|
|
252
|
+
version: input.version,
|
|
253
|
+
sourceMapping: input.sourceMapping ?? "obfuscated"
|
|
254
|
+
}),
|
|
217
255
|
counts: {
|
|
218
256
|
scannedVersions: output.range.scannedCount
|
|
219
257
|
}
|
|
@@ -247,6 +285,16 @@ export class AnalyzeSymbolService {
|
|
|
247
285
|
headline: output.workspaceDetection.resolved
|
|
248
286
|
? `Resolved compile-visible symbol using ${output.workspaceDetection.mappingApplied} workspace mappings.`
|
|
249
287
|
: "Workspace compile mapping could not be detected confidently.",
|
|
288
|
+
subject: createSummarySubject({
|
|
289
|
+
task: "workspace",
|
|
290
|
+
kind: input.subject.kind,
|
|
291
|
+
name: input.subject.name,
|
|
292
|
+
owner: input.subject.owner,
|
|
293
|
+
descriptor: input.subject.descriptor,
|
|
294
|
+
projectPath: input.projectPath,
|
|
295
|
+
version: input.version ?? "unknown",
|
|
296
|
+
sourceMapping: input.sourceMapping ?? "obfuscated"
|
|
297
|
+
}),
|
|
250
298
|
counts: {
|
|
251
299
|
candidates: output.candidateCount
|
|
252
300
|
}
|
|
@@ -276,6 +324,13 @@ export class AnalyzeSymbolService {
|
|
|
276
324
|
summary: {
|
|
277
325
|
status: "ok",
|
|
278
326
|
headline: `Built an API overview for ${output.className}.`,
|
|
327
|
+
subject: createSummarySubject({
|
|
328
|
+
task: "api-overview",
|
|
329
|
+
kind: input.subject.kind,
|
|
330
|
+
name: input.subject.name,
|
|
331
|
+
version: input.version,
|
|
332
|
+
classNameMapping: input.classNameMapping ?? "obfuscated"
|
|
333
|
+
}),
|
|
279
334
|
counts: {
|
|
280
335
|
rows: output.rowCount,
|
|
281
336
|
ambiguousRows: output.ambiguousRowCount ?? 0
|
|
@@ -59,9 +59,9 @@ export declare const compareMinecraftShape: {
|
|
|
59
59
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
60
60
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
61
61
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
62
|
-
maxClassResults: z.
|
|
62
|
+
maxClassResults: z.ZodDefault<z.ZodNumber>;
|
|
63
63
|
maxEntriesPerRegistry: z.ZodOptional<z.ZodNumber>;
|
|
64
|
-
includeFullDiff: z.
|
|
64
|
+
includeFullDiff: z.ZodDefault<z.ZodBoolean>;
|
|
65
65
|
};
|
|
66
66
|
export declare const compareMinecraftSchema: z.ZodObject<{
|
|
67
67
|
task: z.ZodOptional<z.ZodEnum<["auto", "versions", "class-diff", "registry-diff", "migration-overview"]>>;
|
|
@@ -120,10 +120,11 @@ export declare const compareMinecraftSchema: z.ZodObject<{
|
|
|
120
120
|
detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
|
|
121
121
|
include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
|
|
122
122
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
123
|
-
maxClassResults: z.
|
|
123
|
+
maxClassResults: z.ZodDefault<z.ZodNumber>;
|
|
124
124
|
maxEntriesPerRegistry: z.ZodOptional<z.ZodNumber>;
|
|
125
|
-
includeFullDiff: z.
|
|
125
|
+
includeFullDiff: z.ZodDefault<z.ZodBoolean>;
|
|
126
126
|
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
maxClassResults: number;
|
|
127
128
|
subject: {
|
|
128
129
|
kind: "version-pair";
|
|
129
130
|
fromVersion: string;
|
|
@@ -142,13 +143,12 @@ export declare const compareMinecraftSchema: z.ZodObject<{
|
|
|
142
143
|
toVersion: string;
|
|
143
144
|
registry?: string | undefined;
|
|
144
145
|
};
|
|
146
|
+
includeFullDiff: boolean;
|
|
145
147
|
limit?: number | undefined;
|
|
146
|
-
maxClassResults?: number | undefined;
|
|
147
148
|
task?: "auto" | "versions" | "class-diff" | "registry-diff" | "migration-overview" | undefined;
|
|
148
149
|
detail?: "full" | "summary" | "standard" | undefined;
|
|
149
150
|
include?: string[] | undefined;
|
|
150
151
|
maxEntriesPerRegistry?: number | undefined;
|
|
151
|
-
includeFullDiff?: boolean | undefined;
|
|
152
152
|
}, {
|
|
153
153
|
subject: {
|
|
154
154
|
kind: "version-pair";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { createError, ERROR_CODES } from "../errors.js";
|
|
3
3
|
import { buildIncludeSchema, detailSchema, positiveIntSchema } from "./entry-tool-schema.js";
|
|
4
|
-
import { buildEntryToolMeta, buildEntryToolResult, createNextAction, createTruncationMeta } from "./response-contract.js";
|
|
4
|
+
import { buildEntryToolMeta, buildEntryToolResult, createNextAction, createSummarySubject, createTruncationMeta } from "./response-contract.js";
|
|
5
5
|
import { capArray, resolveDetail, resolveInclude } from "./request-normalizers.js";
|
|
6
6
|
const nonEmptyString = z.string().trim().min(1);
|
|
7
7
|
const INCLUDE_GROUPS = ["warnings", "classes", "registry", "diff", "samples", "timings"];
|
|
@@ -33,9 +33,9 @@ export const compareMinecraftShape = {
|
|
|
33
33
|
detail: detailSchema.optional(),
|
|
34
34
|
include: buildIncludeSchema(INCLUDE_GROUPS),
|
|
35
35
|
limit: positiveIntSchema.optional(),
|
|
36
|
-
maxClassResults: positiveIntSchema.
|
|
36
|
+
maxClassResults: positiveIntSchema.default(500),
|
|
37
37
|
maxEntriesPerRegistry: positiveIntSchema.optional(),
|
|
38
|
-
includeFullDiff: z.boolean().
|
|
38
|
+
includeFullDiff: z.boolean().default(true)
|
|
39
39
|
};
|
|
40
40
|
export const compareMinecraftSchema = z.object(compareMinecraftShape);
|
|
41
41
|
function compareStatusFromCounts(changedCount) {
|
|
@@ -93,6 +93,14 @@ export class CompareMinecraftService {
|
|
|
93
93
|
summary: {
|
|
94
94
|
status: compareStatusFromCounts(changedCount),
|
|
95
95
|
headline: `Compared ${output.fromVersion} to ${output.toVersion}.`,
|
|
96
|
+
subject: createSummarySubject({
|
|
97
|
+
task: "versions",
|
|
98
|
+
kind: input.subject.kind,
|
|
99
|
+
fromVersion: input.subject.fromVersion,
|
|
100
|
+
toVersion: input.subject.toVersion,
|
|
101
|
+
packageFilter: "packageFilter" in input.subject ? input.subject.packageFilter : undefined,
|
|
102
|
+
registry: input.subject.kind === "registry" ? input.subject.registry : undefined
|
|
103
|
+
}),
|
|
96
104
|
counts: {
|
|
97
105
|
addedClasses: output.classes?.addedCount ?? 0,
|
|
98
106
|
removedClasses: output.classes?.removedCount ?? 0,
|
|
@@ -180,6 +188,15 @@ export class CompareMinecraftService {
|
|
|
180
188
|
summary: {
|
|
181
189
|
status: compareStatusFromCounts(changedCount),
|
|
182
190
|
headline: `Compared ${output.query.className} between ${output.range.fromVersion} and ${output.range.toVersion}.`,
|
|
191
|
+
subject: createSummarySubject({
|
|
192
|
+
task: "class-diff",
|
|
193
|
+
kind: "class",
|
|
194
|
+
className: input.subject.className,
|
|
195
|
+
fromVersion: input.subject.fromVersion,
|
|
196
|
+
toVersion: input.subject.toVersion,
|
|
197
|
+
mapping: input.subject.mapping,
|
|
198
|
+
sourcePriority: input.subject.sourcePriority
|
|
199
|
+
}),
|
|
183
200
|
counts: output.summary.total
|
|
184
201
|
},
|
|
185
202
|
blocks: {
|
|
@@ -264,6 +281,13 @@ export class CompareMinecraftService {
|
|
|
264
281
|
headline: partialDetail
|
|
265
282
|
? `Compared registry changes between ${subject.fromVersion} and ${subject.toVersion} with partial detail.`
|
|
266
283
|
: `Compared registry changes between ${subject.fromVersion} and ${subject.toVersion}.`,
|
|
284
|
+
subject: createSummarySubject({
|
|
285
|
+
task: "registry-diff",
|
|
286
|
+
kind: "registry",
|
|
287
|
+
fromVersion: subject.fromVersion,
|
|
288
|
+
toVersion: subject.toVersion,
|
|
289
|
+
registry: subject.registry
|
|
290
|
+
}),
|
|
267
291
|
counts: {
|
|
268
292
|
changedRegistries: registrySummary.registriesChanged,
|
|
269
293
|
addedEntries: registrySummary.totalAdded,
|
|
@@ -335,6 +359,28 @@ export class CompareMinecraftService {
|
|
|
335
359
|
const classSignals = (compare.classes?.addedCount ?? 0) + (compare.classes?.removedCount ?? 0);
|
|
336
360
|
const registrySignals = compare.registry?.summary.registriesChanged ?? 0;
|
|
337
361
|
const status = compareStatusFromCounts(classSignals + registrySignals);
|
|
362
|
+
const representativeClassName = compare.classes?.added[0] ?? compare.classes?.removed[0];
|
|
363
|
+
const nextActions = representativeClassName
|
|
364
|
+
? [
|
|
365
|
+
createNextAction("compare-minecraft", {
|
|
366
|
+
task: "class-diff",
|
|
367
|
+
subject: {
|
|
368
|
+
kind: "class",
|
|
369
|
+
className: representativeClassName,
|
|
370
|
+
fromVersion: subject.fromVersion,
|
|
371
|
+
toVersion: subject.toVersion
|
|
372
|
+
}
|
|
373
|
+
})
|
|
374
|
+
]
|
|
375
|
+
: [
|
|
376
|
+
createNextAction("inspect-minecraft", {
|
|
377
|
+
task: "artifact",
|
|
378
|
+
subject: {
|
|
379
|
+
kind: "version",
|
|
380
|
+
version: subject.toVersion
|
|
381
|
+
}
|
|
382
|
+
})
|
|
383
|
+
];
|
|
338
384
|
return {
|
|
339
385
|
...buildEntryToolResult({
|
|
340
386
|
task: "migration-overview",
|
|
@@ -343,10 +389,17 @@ export class CompareMinecraftService {
|
|
|
343
389
|
summary: {
|
|
344
390
|
status,
|
|
345
391
|
headline: `Summarized migration impact from ${subject.fromVersion} to ${subject.toVersion}.`,
|
|
392
|
+
subject: createSummarySubject({
|
|
393
|
+
task: "migration-overview",
|
|
394
|
+
kind: "version-pair",
|
|
395
|
+
fromVersion: subject.fromVersion,
|
|
396
|
+
toVersion: subject.toVersion
|
|
397
|
+
}),
|
|
346
398
|
counts: {
|
|
347
399
|
classSignals,
|
|
348
400
|
registrySignals
|
|
349
|
-
}
|
|
401
|
+
},
|
|
402
|
+
nextActions
|
|
350
403
|
},
|
|
351
404
|
blocks: {
|
|
352
405
|
comparison: subject,
|
|
@@ -358,28 +411,7 @@ export class CompareMinecraftService {
|
|
|
358
411
|
: registrySignals > 0
|
|
359
412
|
? "registry"
|
|
360
413
|
: "minimal",
|
|
361
|
-
nextActions
|
|
362
|
-
{
|
|
363
|
-
tool: classSignals > 0 ? "compare-minecraft" : "inspect-minecraft",
|
|
364
|
-
params: classSignals > 0
|
|
365
|
-
? {
|
|
366
|
-
task: "class-diff",
|
|
367
|
-
subject: {
|
|
368
|
-
kind: "class",
|
|
369
|
-
className: "net.minecraft.world.item.ItemStack",
|
|
370
|
-
fromVersion: subject.fromVersion,
|
|
371
|
-
toVersion: subject.toVersion
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
: {
|
|
375
|
-
task: "artifact",
|
|
376
|
-
subject: {
|
|
377
|
-
kind: "version",
|
|
378
|
-
version: subject.toVersion
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
]
|
|
414
|
+
nextActions
|
|
383
415
|
}
|
|
384
416
|
}
|
|
385
417
|
}),
|