@adhisang/minecraft-modding-mcp 2.1.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +38 -1
  2. package/README.md +224 -802
  3. package/dist/cache-registry.d.ts +95 -0
  4. package/dist/cache-registry.js +541 -0
  5. package/dist/entry-tools/analyze-mod-service.d.ts +207 -0
  6. package/dist/entry-tools/analyze-mod-service.js +309 -0
  7. package/dist/entry-tools/analyze-symbol-service.d.ts +209 -0
  8. package/dist/entry-tools/analyze-symbol-service.js +359 -0
  9. package/dist/entry-tools/compare-minecraft-service.d.ts +210 -0
  10. package/dist/entry-tools/compare-minecraft-service.js +429 -0
  11. package/dist/entry-tools/entry-tool-schema.d.ts +6 -0
  12. package/dist/entry-tools/entry-tool-schema.js +10 -0
  13. package/dist/entry-tools/inspect-minecraft-service.d.ts +1954 -0
  14. package/dist/entry-tools/inspect-minecraft-service.js +1030 -0
  15. package/dist/entry-tools/manage-cache-service.d.ts +130 -0
  16. package/dist/entry-tools/manage-cache-service.js +264 -0
  17. package/dist/entry-tools/request-normalizers.d.ts +10 -0
  18. package/dist/entry-tools/request-normalizers.js +36 -0
  19. package/dist/entry-tools/response-contract.d.ts +45 -0
  20. package/dist/entry-tools/response-contract.js +99 -0
  21. package/dist/entry-tools/validate-project-service.d.ts +543 -0
  22. package/dist/entry-tools/validate-project-service.js +414 -0
  23. package/dist/index.js +183 -59
  24. package/dist/observability.d.ts +18 -2
  25. package/dist/observability.js +47 -10
  26. package/dist/source-service.d.ts +0 -1
  27. package/dist/source-service.js +44 -54
  28. package/dist/storage/files-repo.d.ts +1 -0
  29. package/dist/storage/files-repo.js +29 -5
  30. package/dist/tool-contract-manifest.d.ts +4 -0
  31. package/dist/tool-contract-manifest.js +139 -0
  32. package/package.json +1 -1
@@ -0,0 +1,209 @@
1
+ import { z } from "zod";
2
+ import type { CheckSymbolExistsOutput, FindMappingOutput, GetClassApiMatrixOutput, ResolveMethodMappingExactOutput, ResolveWorkspaceSymbolOutput, TraceSymbolLifecycleOutput } from "../source-service.js";
3
+ export declare const analyzeSymbolShape: {
4
+ task: z.ZodEnum<["exists", "map", "exact-map", "lifecycle", "workspace", "api-overview"]>;
5
+ subject: z.ZodObject<{
6
+ kind: z.ZodEnum<["class", "method", "field", "symbol"]>;
7
+ name: z.ZodString;
8
+ owner: z.ZodOptional<z.ZodString>;
9
+ descriptor: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ kind: "symbol" | "class" | "method" | "field";
12
+ name: string;
13
+ owner?: string | undefined;
14
+ descriptor?: string | undefined;
15
+ }, {
16
+ kind: "symbol" | "class" | "method" | "field";
17
+ name: string;
18
+ owner?: string | undefined;
19
+ descriptor?: string | undefined;
20
+ }>;
21
+ version: z.ZodOptional<z.ZodString>;
22
+ sourceMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
23
+ targetMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
24
+ classNameMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
25
+ projectPath: z.ZodOptional<z.ZodString>;
26
+ signatureMode: z.ZodDefault<z.ZodEnum<["exact", "name-only"]>>;
27
+ nameMode: z.ZodDefault<z.ZodEnum<["fqcn", "auto"]>>;
28
+ includeKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["class", "field", "method"]>, "many">>;
29
+ maxRows: z.ZodOptional<z.ZodNumber>;
30
+ maxCandidates: z.ZodDefault<z.ZodNumber>;
31
+ detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
32
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
33
+ };
34
+ export declare const analyzeSymbolSchema: z.ZodEffects<z.ZodObject<{
35
+ task: z.ZodEnum<["exists", "map", "exact-map", "lifecycle", "workspace", "api-overview"]>;
36
+ subject: z.ZodObject<{
37
+ kind: z.ZodEnum<["class", "method", "field", "symbol"]>;
38
+ name: z.ZodString;
39
+ owner: z.ZodOptional<z.ZodString>;
40
+ descriptor: z.ZodOptional<z.ZodString>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ kind: "symbol" | "class" | "method" | "field";
43
+ name: string;
44
+ owner?: string | undefined;
45
+ descriptor?: string | undefined;
46
+ }, {
47
+ kind: "symbol" | "class" | "method" | "field";
48
+ name: string;
49
+ owner?: string | undefined;
50
+ descriptor?: string | undefined;
51
+ }>;
52
+ version: z.ZodOptional<z.ZodString>;
53
+ sourceMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
54
+ targetMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
55
+ classNameMapping: z.ZodOptional<z.ZodEnum<["obfuscated", "mojang", "intermediary", "yarn"]>>;
56
+ projectPath: z.ZodOptional<z.ZodString>;
57
+ signatureMode: z.ZodDefault<z.ZodEnum<["exact", "name-only"]>>;
58
+ nameMode: z.ZodDefault<z.ZodEnum<["fqcn", "auto"]>>;
59
+ includeKinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["class", "field", "method"]>, "many">>;
60
+ maxRows: z.ZodOptional<z.ZodNumber>;
61
+ maxCandidates: z.ZodDefault<z.ZodNumber>;
62
+ detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
63
+ include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ nameMode: "auto" | "fqcn";
66
+ task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
67
+ subject: {
68
+ kind: "symbol" | "class" | "method" | "field";
69
+ name: string;
70
+ owner?: string | undefined;
71
+ descriptor?: string | undefined;
72
+ };
73
+ signatureMode: "exact" | "name-only";
74
+ maxCandidates: number;
75
+ projectPath?: string | undefined;
76
+ version?: string | undefined;
77
+ sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
78
+ targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
79
+ classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
80
+ detail?: "full" | "summary" | "standard" | undefined;
81
+ include?: string[] | undefined;
82
+ includeKinds?: ("class" | "method" | "field")[] | undefined;
83
+ maxRows?: number | undefined;
84
+ }, {
85
+ task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
86
+ subject: {
87
+ kind: "symbol" | "class" | "method" | "field";
88
+ name: string;
89
+ owner?: string | undefined;
90
+ descriptor?: string | undefined;
91
+ };
92
+ projectPath?: string | undefined;
93
+ version?: string | undefined;
94
+ sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
95
+ targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
96
+ classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
97
+ nameMode?: "auto" | "fqcn" | undefined;
98
+ detail?: "full" | "summary" | "standard" | undefined;
99
+ include?: string[] | undefined;
100
+ signatureMode?: "exact" | "name-only" | undefined;
101
+ includeKinds?: ("class" | "method" | "field")[] | undefined;
102
+ maxRows?: number | undefined;
103
+ maxCandidates?: number | undefined;
104
+ }>, {
105
+ nameMode: "auto" | "fqcn";
106
+ task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
107
+ subject: {
108
+ kind: "symbol" | "class" | "method" | "field";
109
+ name: string;
110
+ owner?: string | undefined;
111
+ descriptor?: string | undefined;
112
+ };
113
+ signatureMode: "exact" | "name-only";
114
+ maxCandidates: number;
115
+ projectPath?: string | undefined;
116
+ version?: string | undefined;
117
+ sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
118
+ targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
119
+ classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
120
+ detail?: "full" | "summary" | "standard" | undefined;
121
+ include?: string[] | undefined;
122
+ includeKinds?: ("class" | "method" | "field")[] | undefined;
123
+ maxRows?: number | undefined;
124
+ }, {
125
+ task: "map" | "workspace" | "exists" | "exact-map" | "lifecycle" | "api-overview";
126
+ subject: {
127
+ kind: "symbol" | "class" | "method" | "field";
128
+ name: string;
129
+ owner?: string | undefined;
130
+ descriptor?: string | undefined;
131
+ };
132
+ projectPath?: string | undefined;
133
+ version?: string | undefined;
134
+ sourceMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
135
+ targetMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
136
+ classNameMapping?: "intermediary" | "mojang" | "yarn" | "obfuscated" | undefined;
137
+ nameMode?: "auto" | "fqcn" | undefined;
138
+ detail?: "full" | "summary" | "standard" | undefined;
139
+ include?: string[] | undefined;
140
+ signatureMode?: "exact" | "name-only" | undefined;
141
+ includeKinds?: ("class" | "method" | "field")[] | undefined;
142
+ maxRows?: number | undefined;
143
+ maxCandidates?: number | undefined;
144
+ }>;
145
+ export type AnalyzeSymbolInput = z.infer<typeof analyzeSymbolSchema>;
146
+ type AnalyzeSymbolDeps = {
147
+ checkSymbolExists: (input: {
148
+ version: string;
149
+ kind: "class" | "field" | "method";
150
+ name: string;
151
+ owner?: string;
152
+ descriptor?: string;
153
+ sourceMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
154
+ sourcePriority?: "loom-first" | "maven-first";
155
+ nameMode?: "fqcn" | "auto";
156
+ signatureMode?: "exact" | "name-only";
157
+ maxCandidates?: number;
158
+ }) => Promise<CheckSymbolExistsOutput>;
159
+ findMapping: (input: {
160
+ version: string;
161
+ kind: "class" | "field" | "method";
162
+ name: string;
163
+ owner?: string;
164
+ descriptor?: string;
165
+ sourceMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
166
+ targetMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
167
+ signatureMode?: "exact" | "name-only";
168
+ maxCandidates?: number;
169
+ }) => Promise<FindMappingOutput>;
170
+ resolveMethodMappingExact: (input: {
171
+ version: string;
172
+ owner: string;
173
+ name: string;
174
+ descriptor: string;
175
+ sourceMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
176
+ targetMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
177
+ maxCandidates?: number;
178
+ }) => Promise<ResolveMethodMappingExactOutput>;
179
+ traceSymbolLifecycle: (input: {
180
+ symbol: string;
181
+ descriptor?: string;
182
+ mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
183
+ }) => Promise<TraceSymbolLifecycleOutput>;
184
+ resolveWorkspaceSymbol: (input: {
185
+ projectPath: string;
186
+ version: string;
187
+ kind: "class" | "field" | "method";
188
+ name: string;
189
+ owner?: string;
190
+ descriptor?: string;
191
+ sourceMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
192
+ maxCandidates?: number;
193
+ }) => Promise<ResolveWorkspaceSymbolOutput>;
194
+ getClassApiMatrix: (input: {
195
+ version: string;
196
+ className: string;
197
+ classNameMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
198
+ includeKinds?: ("class" | "field" | "method")[];
199
+ maxRows?: number;
200
+ }) => Promise<GetClassApiMatrixOutput>;
201
+ };
202
+ export declare class AnalyzeSymbolService {
203
+ private readonly deps;
204
+ constructor(deps: AnalyzeSymbolDeps);
205
+ execute(input: AnalyzeSymbolInput): Promise<Record<string, unknown> & {
206
+ warnings?: string[];
207
+ }>;
208
+ }
209
+ export {};
@@ -0,0 +1,359 @@
1
+ import { z } from "zod";
2
+ import { createError, ERROR_CODES } from "../errors.js";
3
+ import { buildIncludeSchema, detailSchema, positiveIntSchema } from "./entry-tool-schema.js";
4
+ import { buildEntryToolResult, createSummarySubject } from "./response-contract.js";
5
+ import { resolveDetail, resolveInclude } from "./request-normalizers.js";
6
+ const nonEmptyString = z.string().trim().min(1);
7
+ const INCLUDE_GROUPS = ["warnings", "candidates", "matrix", "workspace", "timings"];
8
+ const TASKS = ["exists", "map", "exact-map", "lifecycle", "workspace", "api-overview"];
9
+ export const analyzeSymbolShape = {
10
+ task: z.enum(TASKS),
11
+ subject: z.object({
12
+ kind: z.enum(["class", "method", "field", "symbol"]),
13
+ name: nonEmptyString,
14
+ owner: nonEmptyString.optional(),
15
+ descriptor: nonEmptyString.optional()
16
+ }),
17
+ version: nonEmptyString.optional(),
18
+ sourceMapping: z.enum(["obfuscated", "mojang", "intermediary", "yarn"]).optional(),
19
+ targetMapping: z.enum(["obfuscated", "mojang", "intermediary", "yarn"]).optional(),
20
+ classNameMapping: z.enum(["obfuscated", "mojang", "intermediary", "yarn"]).optional(),
21
+ projectPath: nonEmptyString.optional(),
22
+ signatureMode: z.enum(["exact", "name-only"]).default("exact"),
23
+ nameMode: z.enum(["fqcn", "auto"]).default("fqcn"),
24
+ includeKinds: z.array(z.enum(["class", "field", "method"])).optional(),
25
+ maxRows: positiveIntSchema.optional(),
26
+ maxCandidates: positiveIntSchema.default(200),
27
+ detail: detailSchema.optional(),
28
+ include: buildIncludeSchema(INCLUDE_GROUPS)
29
+ };
30
+ export const analyzeSymbolSchema = z.object(analyzeSymbolShape).superRefine((value, ctx) => {
31
+ if (value.task !== "workspace" && !value.version) {
32
+ ctx.addIssue({
33
+ code: z.ZodIssueCode.custom,
34
+ path: ["version"],
35
+ message: "version is required for non-workspace tasks."
36
+ });
37
+ }
38
+ if (value.task === "workspace" && !value.projectPath) {
39
+ ctx.addIssue({
40
+ code: z.ZodIssueCode.custom,
41
+ path: ["projectPath"],
42
+ message: "projectPath is required for task=workspace."
43
+ });
44
+ }
45
+ if (value.task === "api-overview" && value.subject.kind !== "class") {
46
+ ctx.addIssue({
47
+ code: z.ZodIssueCode.custom,
48
+ path: ["subject", "kind"],
49
+ message: "task=api-overview requires subject.kind=class."
50
+ });
51
+ }
52
+ if (value.task === "api-overview" && value.subject.owner) {
53
+ ctx.addIssue({
54
+ code: z.ZodIssueCode.custom,
55
+ path: ["subject", "owner"],
56
+ message: "task=api-overview does not accept owner or descriptor selectors."
57
+ });
58
+ }
59
+ if (value.task === "api-overview" && value.subject.descriptor) {
60
+ ctx.addIssue({
61
+ code: z.ZodIssueCode.custom,
62
+ path: ["subject", "descriptor"],
63
+ message: "task=api-overview does not accept owner or descriptor selectors."
64
+ });
65
+ }
66
+ });
67
+ function summaryStatusFromResolution(status) {
68
+ switch (status) {
69
+ case "resolved":
70
+ return "ok";
71
+ case "not_found":
72
+ return "not_found";
73
+ case "ambiguous":
74
+ return "ambiguous";
75
+ case "mapping_unavailable":
76
+ return "partial";
77
+ }
78
+ }
79
+ export class AnalyzeSymbolService {
80
+ deps;
81
+ constructor(deps) {
82
+ this.deps = deps;
83
+ }
84
+ async execute(input) {
85
+ const detail = resolveDetail(input.detail);
86
+ const include = resolveInclude(input.include);
87
+ const subjectKind = input.subject.kind === "symbol"
88
+ ? "class"
89
+ : input.subject.kind;
90
+ switch (input.task) {
91
+ case "exists": {
92
+ const output = await this.deps.checkSymbolExists({
93
+ version: input.version,
94
+ kind: subjectKind,
95
+ name: input.subject.name,
96
+ owner: input.subject.owner,
97
+ descriptor: input.subject.descriptor,
98
+ sourceMapping: input.sourceMapping ?? "obfuscated",
99
+ nameMode: input.nameMode,
100
+ signatureMode: input.signatureMode,
101
+ maxCandidates: input.maxCandidates
102
+ });
103
+ return {
104
+ ...buildEntryToolResult({
105
+ task: "exists",
106
+ detail,
107
+ include,
108
+ summary: {
109
+ status: summaryStatusFromResolution(output.status),
110
+ headline: output.resolved
111
+ ? `The symbol exists in ${output.mappingContext.version}.`
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
+ }),
122
+ counts: {
123
+ candidates: output.candidateCount
124
+ }
125
+ },
126
+ blocks: {
127
+ match: output.resolvedSymbol ?? output.querySymbol,
128
+ candidates: output.candidates,
129
+ ambiguity: output.ambiguityReasons ? { reasons: output.ambiguityReasons } : undefined
130
+ }
131
+ }),
132
+ warnings: output.warnings
133
+ };
134
+ }
135
+ case "map": {
136
+ const output = await this.deps.findMapping({
137
+ version: input.version,
138
+ kind: subjectKind,
139
+ name: input.subject.name,
140
+ owner: input.subject.owner,
141
+ descriptor: input.subject.descriptor,
142
+ sourceMapping: input.sourceMapping ?? "obfuscated",
143
+ targetMapping: input.targetMapping ?? "mojang",
144
+ signatureMode: input.signatureMode,
145
+ maxCandidates: input.maxCandidates
146
+ });
147
+ return {
148
+ ...buildEntryToolResult({
149
+ task: "map",
150
+ detail,
151
+ include,
152
+ summary: {
153
+ status: summaryStatusFromResolution(output.status),
154
+ headline: output.resolved
155
+ ? `Mapped the symbol into ${output.mappingContext.targetMapping}.`
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
+ }),
167
+ counts: {
168
+ candidates: output.candidateCount
169
+ }
170
+ },
171
+ blocks: {
172
+ match: output.resolvedSymbol,
173
+ candidates: output.candidates,
174
+ ambiguity: output.ambiguityReasons ? { reasons: output.ambiguityReasons } : undefined
175
+ }
176
+ }),
177
+ warnings: output.warnings
178
+ };
179
+ }
180
+ case "exact-map": {
181
+ if (!input.subject.owner || !input.subject.descriptor) {
182
+ throw createError({
183
+ code: ERROR_CODES.INVALID_INPUT,
184
+ message: "task=exact-map requires owner and descriptor."
185
+ });
186
+ }
187
+ const output = await this.deps.resolveMethodMappingExact({
188
+ version: input.version,
189
+ owner: input.subject.owner,
190
+ name: input.subject.name,
191
+ descriptor: input.subject.descriptor,
192
+ sourceMapping: input.sourceMapping ?? "obfuscated",
193
+ targetMapping: input.targetMapping ?? "mojang",
194
+ maxCandidates: input.maxCandidates
195
+ });
196
+ return {
197
+ ...buildEntryToolResult({
198
+ task: "exact-map",
199
+ detail,
200
+ include,
201
+ summary: {
202
+ status: summaryStatusFromResolution(output.status),
203
+ headline: output.resolved
204
+ ? "Resolved the exact method mapping."
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
+ }),
216
+ counts: {
217
+ candidates: output.candidateCount
218
+ }
219
+ },
220
+ blocks: {
221
+ match: output.resolvedSymbol,
222
+ candidates: output.candidates
223
+ }
224
+ }),
225
+ warnings: output.warnings
226
+ };
227
+ }
228
+ case "lifecycle": {
229
+ const output = await this.deps.traceSymbolLifecycle({
230
+ symbol: input.subject.owner
231
+ ? `${input.subject.owner}.${input.subject.name}`
232
+ : input.subject.name,
233
+ descriptor: input.subject.descriptor,
234
+ mapping: input.sourceMapping
235
+ });
236
+ return {
237
+ ...buildEntryToolResult({
238
+ task: "lifecycle",
239
+ detail,
240
+ include,
241
+ summary: {
242
+ status: output.presence.firstSeen ? "ok" : "not_found",
243
+ headline: output.presence.firstSeen
244
+ ? `Tracked the symbol from ${output.range.fromVersion} to ${output.range.toVersion}.`
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
+ }),
255
+ counts: {
256
+ scannedVersions: output.range.scannedCount
257
+ }
258
+ },
259
+ blocks: {
260
+ match: output.query,
261
+ timeline: output.timeline
262
+ }
263
+ }),
264
+ warnings: output.warnings
265
+ };
266
+ }
267
+ case "workspace": {
268
+ const output = await this.deps.resolveWorkspaceSymbol({
269
+ projectPath: input.projectPath,
270
+ version: input.version ?? "unknown",
271
+ kind: subjectKind,
272
+ name: input.subject.name,
273
+ owner: input.subject.owner,
274
+ descriptor: input.subject.descriptor,
275
+ sourceMapping: input.sourceMapping ?? "obfuscated",
276
+ maxCandidates: input.maxCandidates
277
+ });
278
+ return {
279
+ ...buildEntryToolResult({
280
+ task: "workspace",
281
+ detail,
282
+ include,
283
+ summary: {
284
+ status: summaryStatusFromResolution(output.status),
285
+ headline: output.workspaceDetection.resolved
286
+ ? `Resolved compile-visible symbol using ${output.workspaceDetection.mappingApplied} workspace mappings.`
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
+ }),
298
+ counts: {
299
+ candidates: output.candidateCount
300
+ }
301
+ },
302
+ blocks: {
303
+ match: output.resolvedSymbol,
304
+ candidates: output.candidates,
305
+ workspace: output.workspaceDetection
306
+ }
307
+ }),
308
+ warnings: [...output.warnings, ...output.workspaceDetection.warnings]
309
+ };
310
+ }
311
+ case "api-overview": {
312
+ const output = await this.deps.getClassApiMatrix({
313
+ version: input.version,
314
+ className: input.subject.name,
315
+ classNameMapping: input.classNameMapping ?? "obfuscated",
316
+ includeKinds: input.includeKinds,
317
+ maxRows: input.maxRows
318
+ });
319
+ return {
320
+ ...buildEntryToolResult({
321
+ task: "api-overview",
322
+ detail,
323
+ include,
324
+ summary: {
325
+ status: "ok",
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
+ }),
334
+ counts: {
335
+ rows: output.rowCount,
336
+ ambiguousRows: output.ambiguousRowCount ?? 0
337
+ }
338
+ },
339
+ blocks: {
340
+ match: {
341
+ className: output.className,
342
+ classIdentity: output.classIdentity
343
+ },
344
+ matrix: include.includes("matrix") || detail !== "summary"
345
+ ? {
346
+ rowCount: output.rowCount,
347
+ rowsTruncated: output.rowsTruncated,
348
+ rows: output.rows.slice(0, 25)
349
+ }
350
+ : undefined
351
+ }
352
+ }),
353
+ warnings: output.warnings
354
+ };
355
+ }
356
+ }
357
+ }
358
+ }
359
+ //# sourceMappingURL=analyze-symbol-service.js.map