@adhisang/minecraft-modding-mcp 3.0.0 → 3.1.1

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.
@@ -36,9 +36,9 @@ export declare const manageCacheShape: {
36
36
  }>>;
37
37
  detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
38
38
  include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
39
- limit: z.ZodOptional<z.ZodNumber>;
39
+ limit: z.ZodDefault<z.ZodNumber>;
40
40
  cursor: z.ZodOptional<z.ZodString>;
41
- executionMode: z.ZodOptional<z.ZodEnum<["preview", "apply"]>>;
41
+ executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
42
42
  };
43
43
  export declare const manageCacheSchema: z.ZodObject<{
44
44
  action: z.ZodEnum<["summary", "list", "inspect", "delete", "prune", "rebuild", "verify"]>;
@@ -76,16 +76,16 @@ export declare const manageCacheSchema: z.ZodObject<{
76
76
  }>>;
77
77
  detail: z.ZodOptional<z.ZodEnum<["summary", "standard", "full"]>>;
78
78
  include: z.ZodOptional<z.ZodArray<z.ZodEnum<[string, ...string[]]>, "many">>;
79
- limit: z.ZodOptional<z.ZodNumber>;
79
+ limit: z.ZodDefault<z.ZodNumber>;
80
80
  cursor: z.ZodOptional<z.ZodString>;
81
- executionMode: z.ZodOptional<z.ZodEnum<["preview", "apply"]>>;
81
+ executionMode: z.ZodDefault<z.ZodEnum<["preview", "apply"]>>;
82
82
  }, "strip", z.ZodTypeAny, {
83
+ limit: number;
84
+ executionMode: "preview" | "apply";
83
85
  action: "list" | "summary" | "inspect" | "verify" | "delete" | "prune" | "rebuild";
84
- limit?: number | undefined;
85
86
  cursor?: string | undefined;
86
87
  detail?: "full" | "summary" | "standard" | undefined;
87
88
  include?: string[] | undefined;
88
- executionMode?: "preview" | "apply" | undefined;
89
89
  cacheKinds?: ("artifact-index" | "downloads" | "mapping" | "registry" | "decompiled-source" | "mod-remap")[] | undefined;
90
90
  selector?: {
91
91
  mapping?: string | undefined;
@@ -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.optional(),
25
+ limit: positiveIntSchema.default(50),
26
26
  cursor: nonEmptyString.optional(),
27
- executionMode: executionModeSchema.optional()
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.ZodOptional<z.ZodBoolean>;
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.ZodOptional<z.ZodEnum<["error", "warning", "all"]>>;
151
- hideUncertain: z.ZodOptional<z.ZodBoolean>;
152
- explain: z.ZodOptional<z.ZodBoolean>;
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.ZodOptional<z.ZodBoolean>;
156
- includeIssues: z.ZodOptional<z.ZodBoolean>;
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.ZodOptional<z.ZodBoolean>;
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.ZodOptional<z.ZodEnum<["error", "warning", "all"]>>;
307
- hideUncertain: z.ZodOptional<z.ZodBoolean>;
308
- explain: z.ZodOptional<z.ZodBoolean>;
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.ZodOptional<z.ZodBoolean>;
312
- includeIssues: z.ZodOptional<z.ZodBoolean>;
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().optional(),
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"]).optional(),
51
- hideUncertain: z.boolean().optional(),
52
- explain: z.boolean().optional(),
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().optional(),
56
- includeIssues: z.boolean().optional()
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,