@mandujs/mcp 0.38.6 → 0.38.7
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/README.md +3 -3
- package/package.json +2 -2
- package/src/executor/error-handler.ts +76 -2
- package/src/index.ts +5 -5
- package/src/prompts.ts +4 -4
- package/src/resources/handlers.ts +4 -6
- package/src/resources/skills/guides.ts +49 -49
- package/src/resources/skills/loader.ts +8 -8
- package/src/resources/skills/mandu-agent-workflow/SKILL.md +124 -124
- package/src/resources/skills/mandu-agent-workflow/metadata.json +7 -7
- package/src/resources/skills/mandu-composition/SKILL.md +47 -47
- package/src/resources/skills/mandu-deployment/SKILL.md +53 -53
- package/src/resources/skills/mandu-deployment/rules/db-provider-supabase.md +3 -3
- package/src/resources/skills/mandu-fs-routes/SKILL.md +47 -47
- package/src/resources/skills/mandu-guard/SKILL.md +58 -58
- package/src/resources/skills/mandu-hydration/SKILL.md +67 -67
- package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +54 -54
- package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +60 -60
- package/src/resources/skills/mandu-performance/SKILL.md +47 -47
- package/src/resources/skills/mandu-security/SKILL.md +47 -47
- package/src/resources/skills/mandu-slot/SKILL.md +48 -48
- package/src/resources/skills/mandu-styling/SKILL.md +52 -52
- package/src/resources/skills/mandu-testing/SKILL.md +55 -55
- package/src/resources/skills/mandu-ui/SKILL.md +52 -52
- package/src/resources/skills/recipes.ts +28 -28
- package/src/server.ts +2 -1
- package/src/tools/agent.ts +443 -443
- package/src/tools/ate.ts +37 -37
- package/src/tools/brain.ts +12 -11
- package/src/tools/composite.ts +13 -13
- package/src/tools/contract.ts +1 -1
- package/src/tools/deploy-plan.ts +1 -1
- package/src/tools/generate.ts +3 -1
- package/src/tools/guard.ts +36 -1
- package/src/tools/history.ts +1 -1
- package/src/tools/hydration.ts +1 -3
- package/src/tools/index.ts +14 -0
- package/src/tools/kitchen.ts +72 -72
- package/src/tools/runtime.ts +1 -1
- package/src/tools/slot-validation.ts +19 -19
- package/src/tools/transaction.ts +19 -5
- package/src/utils/withWarnings.ts +1 -1
package/src/tools/transaction.ts
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
rollbackChange,
|
|
6
6
|
getTransactionStatus,
|
|
7
7
|
hasActiveTransaction,
|
|
8
|
-
} from "@mandujs/core";
|
|
9
|
-
import { acquireLock, releaseLock, checkLock } from "../tx-lock.js";
|
|
8
|
+
} from "@mandujs/core/change";
|
|
9
|
+
import { acquireLock, releaseLock, checkLock, requireLock } from "../tx-lock.js";
|
|
10
10
|
|
|
11
11
|
export const transactionToolDefinitions: Tool[] = [
|
|
12
12
|
{
|
|
@@ -99,9 +99,15 @@ export function transactionTools(projectRoot: string) {
|
|
|
99
99
|
return { error: lock.error };
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
+
}
|
|
105
111
|
|
|
106
112
|
return {
|
|
107
113
|
success: true,
|
|
@@ -122,6 +128,10 @@ export function transactionTools(projectRoot: string) {
|
|
|
122
128
|
error: "No active transaction to commit",
|
|
123
129
|
};
|
|
124
130
|
}
|
|
131
|
+
const lockCheck = requireLock(lockId);
|
|
132
|
+
if (!lockCheck.allowed) {
|
|
133
|
+
return { error: lockCheck.error };
|
|
134
|
+
}
|
|
125
135
|
|
|
126
136
|
const result = await commitChange(projectRoot);
|
|
127
137
|
if (lockId) releaseLock(lockId);
|
|
@@ -142,6 +152,10 @@ export function transactionTools(projectRoot: string) {
|
|
|
142
152
|
error: "No active transaction to rollback. Provide a changeId to rollback a specific change.",
|
|
143
153
|
};
|
|
144
154
|
}
|
|
155
|
+
const lockCheck = requireLock(lockId);
|
|
156
|
+
if (!lockCheck.allowed) {
|
|
157
|
+
return { error: lockCheck.error };
|
|
158
|
+
}
|
|
145
159
|
|
|
146
160
|
const result = await rollbackChange(projectRoot, changeId);
|
|
147
161
|
if (lockId) releaseLock(lockId);
|