@mandujs/mcp 0.38.4 → 0.38.5

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 (35) hide show
  1. package/README.md +3 -3
  2. package/package.json +2 -2
  3. package/src/executor/error-handler.ts +2 -76
  4. package/src/index.ts +5 -5
  5. package/src/prompts.ts +4 -4
  6. package/src/resources/skills/guides.ts +49 -49
  7. package/src/resources/skills/loader.ts +8 -8
  8. package/src/resources/skills/mandu-agent-workflow/SKILL.md +124 -124
  9. package/src/resources/skills/mandu-agent-workflow/metadata.json +7 -7
  10. package/src/resources/skills/mandu-composition/SKILL.md +47 -47
  11. package/src/resources/skills/mandu-deployment/SKILL.md +53 -53
  12. package/src/resources/skills/mandu-deployment/rules/db-provider-supabase.md +3 -3
  13. package/src/resources/skills/mandu-fs-routes/SKILL.md +47 -47
  14. package/src/resources/skills/mandu-guard/SKILL.md +58 -58
  15. package/src/resources/skills/mandu-hydration/SKILL.md +67 -67
  16. package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +54 -54
  17. package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +60 -60
  18. package/src/resources/skills/mandu-performance/SKILL.md +47 -47
  19. package/src/resources/skills/mandu-security/SKILL.md +47 -47
  20. package/src/resources/skills/mandu-slot/SKILL.md +48 -48
  21. package/src/resources/skills/mandu-styling/SKILL.md +52 -52
  22. package/src/resources/skills/mandu-testing/SKILL.md +55 -55
  23. package/src/resources/skills/mandu-ui/SKILL.md +52 -52
  24. package/src/resources/skills/recipes.ts +28 -28
  25. package/src/server.ts +3 -3
  26. package/src/tools/agent.ts +443 -443
  27. package/src/tools/ate.ts +37 -37
  28. package/src/tools/composite.ts +13 -13
  29. package/src/tools/guard.ts +0 -35
  30. package/src/tools/hydration.ts +197 -197
  31. package/src/tools/index.ts +4 -18
  32. package/src/tools/kitchen.ts +72 -72
  33. package/src/tools/runtime.ts +579 -579
  34. package/src/tools/slot-validation.ts +19 -19
  35. package/src/tools/transaction.ts +4 -18
package/src/tools/ate.ts CHANGED
@@ -105,11 +105,11 @@ export const ateToolDefinitions: Tool[] = [
105
105
  type: "string",
106
106
  description: "Dev server URL (default: http://localhost:3333). Must match the running mandu dev server.",
107
107
  },
108
- ci: { type: "boolean", description: "CI mode: stricter timeouts, no interactive prompts" },
109
- timeoutMs: {
110
- type: "number",
111
- description: "Hard timeout for the whole Playwright process in milliseconds (default: 600000).",
112
- },
108
+ ci: { type: "boolean", description: "CI mode: stricter timeouts, no interactive prompts" },
109
+ timeoutMs: {
110
+ type: "number",
111
+ description: "Hard timeout for the whole Playwright process in milliseconds (default: 600000).",
112
+ },
113
113
  headless: { type: "boolean", description: "Run browsers headlessly (default: true)" },
114
114
  browsers: {
115
115
  type: "array",
@@ -264,11 +264,11 @@ export const ateToolDefinitions: Tool[] = [
264
264
  enum: ["L0", "L1", "L2", "L3"],
265
265
  description: "Assertion depth: L0=smoke, L1=HTTP status, L2=contract schema, L3=full behavioral",
266
266
  },
267
- ci: { type: "boolean", description: "CI mode: stricter timeouts" },
268
- timeoutMs: {
269
- type: "number",
270
- description: "Hard timeout for the whole Playwright process in milliseconds (default: 600000).",
271
- },
267
+ ci: { type: "boolean", description: "CI mode: stricter timeouts" },
268
+ timeoutMs: {
269
+ type: "number",
270
+ description: "Hard timeout for the whole Playwright process in milliseconds (default: 600000).",
271
+ },
272
272
  useImpactAnalysis: {
273
273
  type: "boolean",
274
274
  description: "Run impact analysis first and only test changed routes (faster in CI)",
@@ -386,7 +386,7 @@ export function ateTools(projectRoot: string, server?: Server) {
386
386
  return await ateRun(input);
387
387
  } catch (err) {
388
388
  const message = err instanceof Error ? err.message : String(err);
389
- const isTimeout = /timeout|timed out|타임아웃/i.test(message);
389
+ const isTimeout = /timeout|timed out|타임아웃/i.test(message);
390
390
  const snap = tracker.snapshot();
391
391
  const partial: PartialRunResults = {
392
392
  runId: snap.runId ?? `unknown-${Date.now()}`,
@@ -447,21 +447,21 @@ export function ateTools(projectRoot: string, server?: Server) {
447
447
  browsers,
448
448
  onlyFiles,
449
449
  onlyRoutes,
450
- grep,
451
- timeoutMs,
452
- progressToken,
453
- } = args as {
450
+ grep,
451
+ timeoutMs,
452
+ progressToken,
453
+ } = args as {
454
454
  repoRoot: string;
455
455
  baseURL?: string;
456
456
  ci?: boolean;
457
457
  headless?: boolean;
458
458
  browsers?: ("chromium" | "firefox" | "webkit")[];
459
459
  onlyFiles?: string[];
460
- onlyRoutes?: string[];
461
- grep?: string;
462
- timeoutMs?: number;
463
- progressToken?: string | number;
464
- };
460
+ onlyRoutes?: string[];
461
+ grep?: string;
462
+ timeoutMs?: number;
463
+ progressToken?: string | number;
464
+ };
465
465
  return await runWithObservability(
466
466
  {
467
467
  repoRoot,
@@ -469,11 +469,11 @@ export function ateTools(projectRoot: string, server?: Server) {
469
469
  ci,
470
470
  headless,
471
471
  browsers,
472
- onlyFiles,
473
- onlyRoutes,
474
- grep,
475
- timeoutMs,
476
- },
472
+ onlyFiles,
473
+ onlyRoutes,
474
+ grep,
475
+ timeoutMs,
476
+ },
477
477
  { progressToken },
478
478
  );
479
479
  },
@@ -529,10 +529,10 @@ export function ateTools(projectRoot: string, server?: Server) {
529
529
  },
530
530
  "mandu.ate.auto_pipeline": async (args: Record<string, unknown>) => {
531
531
  const {
532
- repoRoot, baseURL, oracleLevel, ci, useImpactAnalysis,
533
- base, head, autoHeal, tsconfigPath, routeGlobs, buildSalt,
534
- timeoutMs,
535
- } = args as {
532
+ repoRoot, baseURL, oracleLevel, ci, useImpactAnalysis,
533
+ base, head, autoHeal, tsconfigPath, routeGlobs, buildSalt,
534
+ timeoutMs,
535
+ } = args as {
536
536
  repoRoot: string;
537
537
  baseURL?: string;
538
538
  oracleLevel?: OracleLevel;
@@ -542,14 +542,14 @@ export function ateTools(projectRoot: string, server?: Server) {
542
542
  head?: string;
543
543
  autoHeal?: boolean;
544
544
  tsconfigPath?: string;
545
- routeGlobs?: string[];
546
- buildSalt?: string;
547
- timeoutMs?: number;
548
- };
549
- return await runFullPipeline({
550
- repoRoot, baseURL, oracleLevel, ci, useImpactAnalysis,
551
- base, head, autoHeal, tsconfigPath, routeGlobs, buildSalt, timeoutMs,
552
- });
545
+ routeGlobs?: string[];
546
+ buildSalt?: string;
547
+ timeoutMs?: number;
548
+ };
549
+ return await runFullPipeline({
550
+ repoRoot, baseURL, oracleLevel, ci, useImpactAnalysis,
551
+ base, head, autoHeal, tsconfigPath, routeGlobs, buildSalt, timeoutMs,
552
+ });
553
553
  },
554
554
  "mandu.ate.feedback": async (args: Record<string, unknown>) => {
555
555
  const { repoRoot, runId, autoApply } = args as {
@@ -60,10 +60,10 @@ export const compositeToolDefinitions: Tool[] = [
60
60
  },
61
61
  },
62
62
  {
63
- name: "mandu.island.add",
64
- description:
65
- "Create an island component with correct @mandujs/core/client imports and hydration strategy. " +
66
- "Generates a .island.tsx file in app/{route}/ with the wrapComponent() island definition.",
63
+ name: "mandu.island.add",
64
+ description:
65
+ "Create an island component with correct @mandujs/core/client imports and hydration strategy. " +
66
+ "Generates a .island.tsx file in app/{route}/ with the wrapComponent() island definition.",
67
67
  annotations: {
68
68
  destructiveHint: true,
69
69
  readOnlyHint: false,
@@ -474,10 +474,10 @@ function generateMiddlewareSource(preset: string, options: Record<string, string
474
474
  return templates[preset] ?? templates.default;
475
475
  }
476
476
 
477
- function generateIslandSource(name: string, strategy: string): string {
478
- return `"use client";
479
- import { wrapComponent } from "@mandujs/core/client";
480
- import { useState } from "react";
477
+ function generateIslandSource(name: string, strategy: string): string {
478
+ return `"use client";
479
+ import { wrapComponent } from "@mandujs/core/client";
480
+ import { useState } from "react";
481
481
 
482
482
  interface ${name}Props {
483
483
  [key: string]: unknown;
@@ -493,8 +493,8 @@ function ${name}Inner(props: ${name}Props) {
493
493
  );
494
494
  }
495
495
 
496
- // Route hydration priority should be set on the page/manifest route.
497
- // Suggested priority for this island: "${strategy}".
498
- export default wrapComponent(${name}Inner);
499
- `;
500
- }
496
+ // Route hydration priority should be set on the page/manifest route.
497
+ // Suggested priority for this island: "${strategy}".
498
+ export default wrapComponent(${name}Inner);
499
+ `;
500
+ }
@@ -138,25 +138,7 @@ export function guardTools(projectRoot: string) {
138
138
  }
139
139
  };
140
140
 
141
- const guardViolationCode = (ruleId: string | undefined, type?: string) =>
142
- `MANDU_GUARD_${(ruleId || type || "VIOLATION").toUpperCase().replace(/[^A-Z0-9]+/g, "_")}`;
143
-
144
- const explainViolation = (input: {
145
- type?: string;
146
- ruleId?: string;
147
- fromLayer?: string;
148
- toLayer?: string;
149
- suggestion?: string;
150
- }): string => {
151
- const source = input.fromLayer ? ` from ${input.fromLayer}` : "";
152
- const target = input.toLayer ? ` to ${input.toLayer}` : "";
153
- const rule = input.ruleId ?? input.type ?? "architecture rule";
154
- const fix = input.suggestion ? ` Suggested fix: ${input.suggestion}` : "";
155
- return `Violation of ${rule}${source}${target}.${fix}`.trim();
156
- };
157
-
158
141
  const summarizeArchitectureViolation = (violation: Violation) => ({
159
- code: guardViolationCode(violation.ruleName, violation.type),
160
142
  ruleId: violation.ruleName,
161
143
  type: violation.type,
162
144
  file: path.relative(projectRoot, violation.filePath).replace(/\\/g, "/") || violation.filePath,
@@ -164,25 +146,16 @@ export function guardTools(projectRoot: string) {
164
146
  column: violation.column,
165
147
  message: violation.ruleDescription,
166
148
  suggestion: violation.suggestions[0],
167
- explanation: explainViolation({
168
- type: violation.type,
169
- ruleId: violation.ruleName,
170
- fromLayer: violation.fromLayer,
171
- toLayer: violation.toLayer,
172
- suggestion: violation.suggestions[0],
173
- }),
174
149
  fromLayer: violation.fromLayer,
175
150
  toLayer: violation.toLayer,
176
151
  importStatement: violation.importStatement,
177
152
  });
178
153
 
179
154
  const summarizeLegacyViolation = (v: Awaited<ReturnType<typeof runGuardCheck>>["violations"][number]) => ({
180
- code: guardViolationCode(v.ruleId),
181
155
  ruleId: v.ruleId,
182
156
  file: v.file,
183
157
  message: v.message,
184
158
  suggestion: v.suggestion,
185
- explanation: explainViolation({ ruleId: v.ruleId, suggestion: v.suggestion }),
186
159
  });
187
160
 
188
161
  const handlers: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {
@@ -548,18 +521,10 @@ export function guardTools(projectRoot: string) {
548
521
  preset: config.preset,
549
522
  violations: items.map((item) => ({
550
523
  // Violation info
551
- code: guardViolationCode(item.violation.ruleName, item.violation.type),
552
524
  type: item.violation.type,
553
525
  file: item.violation.filePath,
554
526
  line: item.violation.line,
555
527
  message: item.violation.ruleDescription,
556
- explanation: explainViolation({
557
- type: item.violation.type,
558
- ruleId: item.violation.ruleName,
559
- fromLayer: item.violation.fromLayer,
560
- toLayer: item.violation.toLayer,
561
- suggestion: item.healing.primary.explanation,
562
- }),
563
528
  fromLayer: item.violation.fromLayer,
564
529
  toLayer: item.violation.toLayer,
565
530
  importStatement: item.violation.importStatement,