@mandujs/mcp 0.38.4 → 0.38.6

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
@@ -1,13 +1,13 @@
1
- import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
- import {
3
- DEFAULT_SLOT_CONSTRAINTS,
4
- API_SLOT_CONSTRAINTS,
5
- READONLY_SLOT_CONSTRAINTS,
6
- } from "@mandujs/core";
7
-
8
- export const slotValidationToolDefinitions: Tool[] = [
9
- {
10
- name: "mandu.slot.constraints",
1
+ import type { Tool } from "@modelcontextprotocol/sdk/types.js";
2
+ import {
3
+ DEFAULT_SLOT_CONSTRAINTS,
4
+ API_SLOT_CONSTRAINTS,
5
+ READONLY_SLOT_CONSTRAINTS,
6
+ } from "@mandujs/core";
7
+
8
+ export const slotValidationToolDefinitions: Tool[] = [
9
+ {
10
+ name: "mandu.slot.constraints",
11
11
  description:
12
12
  "Get recommended slot constraint presets (default, api, readonly).",
13
13
  annotations: {
@@ -27,10 +27,10 @@ export const slotValidationToolDefinitions: Tool[] = [
27
27
  },
28
28
  ];
29
29
 
30
- export function slotValidationTools(projectRoot: string) {
31
- void projectRoot;
32
- const handlers: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {
33
- "mandu.slot.constraints": async (args: Record<string, unknown>) => {
30
+ export function slotValidationTools(projectRoot: string) {
31
+ void projectRoot;
32
+ const handlers: Record<string, (args: Record<string, unknown>) => Promise<unknown>> = {
33
+ "mandu.slot.constraints": async (args: Record<string, unknown>) => {
34
34
  const { preset } = args as { preset?: "default" | "api" | "readonly" };
35
35
 
36
36
  const presets = {
@@ -84,10 +84,10 @@ Mandu.filling()
84
84
  `.trim(),
85
85
  };
86
86
  },
87
- };
88
-
89
- // Backward-compatible aliases
90
- handlers["mandu_get_slot_constraints"] = handlers["mandu.slot.constraints"];
91
-
87
+ };
88
+
89
+ // Backward-compatible aliases
90
+ handlers["mandu_get_slot_constraints"] = handlers["mandu.slot.constraints"];
91
+
92
92
  return handlers;
93
93
  }
@@ -6,7 +6,7 @@ import {
6
6
  getTransactionStatus,
7
7
  hasActiveTransaction,
8
8
  } from "@mandujs/core";
9
- import { acquireLock, releaseLock, checkLock, requireLock } from "../tx-lock.js";
9
+ import { acquireLock, releaseLock, checkLock } from "../tx-lock.js";
10
10
 
11
11
  export const transactionToolDefinitions: Tool[] = [
12
12
  {
@@ -99,15 +99,9 @@ export function transactionTools(projectRoot: string) {
99
99
  return { error: lock.error };
100
100
  }
101
101
 
102
- let change: Awaited<ReturnType<typeof beginChange>>;
103
- try {
104
- change = await beginChange(projectRoot, {
105
- message: message || "MCP transaction",
106
- });
107
- } catch (error) {
108
- if (lock.lockId) releaseLock(lock.lockId);
109
- return { error: error instanceof Error ? error.message : String(error) };
110
- }
102
+ const change = await beginChange(projectRoot, {
103
+ message: message || "MCP transaction",
104
+ });
111
105
 
112
106
  return {
113
107
  success: true,
@@ -128,10 +122,6 @@ export function transactionTools(projectRoot: string) {
128
122
  error: "No active transaction to commit",
129
123
  };
130
124
  }
131
- const lockCheck = requireLock(lockId);
132
- if (!lockCheck.allowed) {
133
- return { error: lockCheck.error };
134
- }
135
125
 
136
126
  const result = await commitChange(projectRoot);
137
127
  if (lockId) releaseLock(lockId);
@@ -152,10 +142,6 @@ export function transactionTools(projectRoot: string) {
152
142
  error: "No active transaction to rollback. Provide a changeId to rollback a specific change.",
153
143
  };
154
144
  }
155
- const lockCheck = requireLock(lockId);
156
- if (!lockCheck.allowed) {
157
- return { error: lockCheck.error };
158
- }
159
145
 
160
146
  const result = await rollbackChange(projectRoot, changeId);
161
147
  if (lockId) releaseLock(lockId);