@arii/boomtick-mcp 0.7.0 → 0.7.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.
- package/.mcp/schemas/github.get_merge_conflict_files.json +55 -5
- package/.mcp/schemas/github_get_merge_conflict_files.json +55 -5
- package/.mcp/schemas/repo.create_branch.json +63 -0
- package/.mcp/schemas/repo.create_repair_branch.json +63 -0
- package/.mcp/schemas/repo.get_changed_files.json +39 -0
- package/.mcp/schemas/repo_create_branch.json +63 -0
- package/.mcp/schemas/repo_create_repair_branch.json +63 -0
- package/.mcp/schemas/repo_get_changed_files.json +39 -0
- package/CHANGELOG.md +8 -0
- package/dist/lib/git.js +78 -6
- package/dist/lib/git.test.js +34 -1
- package/dist/tools/contract.js +226 -11
- package/dist/tools/github.get_merge_conflict_files.js +10 -2
- package/dist/tools/repo.create_branch.js +18 -4
- package/dist/tools/repo.create_branch.test.js +41 -5
- package/dist/tools/repo.create_repair_branch.js +26 -9
- package/dist/tools/repo.get_changed_files.js +10 -2
- package/package.json +1 -1
- package/src/lib/git.test.ts +45 -1
- package/src/lib/git.ts +94 -6
- package/src/tools/contract.ts +226 -11
- package/src/tools/github.get_merge_conflict_files.ts +11 -2
- package/src/tools/repo.create_branch.test.ts +73 -5
- package/src/tools/repo.create_branch.ts +30 -4
- package/src/tools/repo.create_repair_branch.ts +31 -9
- package/src/tools/repo.get_changed_files.ts +10 -2
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { runCommand } from "../lib/shell.js";
|
|
3
|
-
import { createWorktree } from "../lib/git.js";
|
|
3
|
+
import { createWorktree, resolveRepoPath } from "../lib/git.js";
|
|
4
4
|
|
|
5
5
|
export const CreateRepairBranchInputSchema = z.object({
|
|
6
6
|
prNumber: z.number(),
|
|
7
7
|
repairBranchName: z.string().optional(),
|
|
8
8
|
writeMode: z.boolean().optional().default(false),
|
|
9
|
+
repo: z.string().optional().describe("Target repository override (e.g. org/repo or repo)."),
|
|
10
|
+
path: z.string().optional().describe("Local filesystem path to target repository root."),
|
|
11
|
+
repoPath: z.string().optional().describe("Alias for path to target repository root."),
|
|
9
12
|
});
|
|
10
13
|
|
|
11
14
|
export async function createRepairBranchHandler(args: z.infer<typeof CreateRepairBranchInputSchema>) {
|
|
12
15
|
if (!args.writeMode) {
|
|
13
16
|
throw new Error("writeMode must be true to create a repair branch.");
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
|
|
19
|
+
const targetCwd = resolveRepoPath({
|
|
20
|
+
path: args.path,
|
|
21
|
+
repoPath: args.repoPath,
|
|
22
|
+
repo: args.repo,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const ghArgs = [
|
|
16
26
|
"pr",
|
|
17
27
|
"view",
|
|
18
28
|
args.prNumber.toString(),
|
|
19
29
|
"--json", "headRefName,baseRefName,title"
|
|
20
|
-
]
|
|
30
|
+
];
|
|
31
|
+
if (args.repo) {
|
|
32
|
+
ghArgs.push("--repo", args.repo);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const prResult = await runCommand("gh", ghArgs, { cwd: targetCwd });
|
|
21
36
|
|
|
22
37
|
if (prResult.exitCode !== 0) {
|
|
23
38
|
throw new Error(`Failed to get PR info: ${prResult.stderr}`);
|
|
@@ -28,20 +43,27 @@ export async function createRepairBranchHandler(args: z.infer<typeof CreateRepai
|
|
|
28
43
|
const sanitizedTitle = title.toLowerCase().replace(/[^a-z0-9]/g, "-").substring(0, 30);
|
|
29
44
|
const repairBranch = args.repairBranchName || `agent/repair-pr-${args.prNumber}-${sanitizedTitle}`;
|
|
30
45
|
|
|
31
|
-
// Ensure latest
|
|
32
|
-
await runCommand("git", ["fetch", "origin", headRefName]);
|
|
33
|
-
await runCommand("git", ["fetch", "origin", baseRefName]);
|
|
46
|
+
// Ensure latest in target repo
|
|
47
|
+
await runCommand("git", ["fetch", "origin", headRefName], { cwd: targetCwd });
|
|
48
|
+
await runCommand("git", ["fetch", "origin", baseRefName], { cwd: targetCwd });
|
|
34
49
|
|
|
35
|
-
const worktreePath = await createWorktree(`origin/${headRefName}`, args.prNumber);
|
|
50
|
+
const worktreePath = await createWorktree(`origin/${headRefName}`, args.prNumber, targetCwd);
|
|
36
51
|
|
|
37
52
|
// Create the actual repair branch in the worktree
|
|
38
53
|
await runCommand("git", ["checkout", "-b", repairBranch], { cwd: worktreePath });
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
const response: Record<string, unknown> = {
|
|
41
56
|
prNumber: args.prNumber,
|
|
42
57
|
originalBranch: headRefName,
|
|
43
58
|
repairBranch,
|
|
44
59
|
baseBranch: baseRefName,
|
|
45
|
-
worktreePath
|
|
60
|
+
worktreePath,
|
|
61
|
+
path: targetCwd,
|
|
46
62
|
};
|
|
63
|
+
|
|
64
|
+
if (args.repo) {
|
|
65
|
+
response.repo = args.repo;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return response;
|
|
47
69
|
}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { getChangedFiles } from "../lib/git.js";
|
|
2
|
+
import { getChangedFiles, resolveRepoPath } from "../lib/git.js";
|
|
3
3
|
|
|
4
4
|
export const GetChangedFilesInputSchema = z.object({
|
|
5
5
|
base: z.string().optional().default("main"),
|
|
6
6
|
head: z.string().optional().default("HEAD"),
|
|
7
|
+
repo: z.string().optional().describe("Target GitHub repository override."),
|
|
8
|
+
path: z.string().optional().describe("Local filesystem path to target repository root."),
|
|
9
|
+
repoPath: z.string().optional().describe("Alias for path to target repository root."),
|
|
7
10
|
});
|
|
8
11
|
|
|
9
12
|
export async function getChangedFilesHandler(args: z.infer<typeof GetChangedFilesInputSchema>) {
|
|
10
|
-
const
|
|
13
|
+
const targetCwd = resolveRepoPath({
|
|
14
|
+
path: args.path,
|
|
15
|
+
repoPath: args.repoPath,
|
|
16
|
+
repo: args.repo,
|
|
17
|
+
});
|
|
18
|
+
const files = await getChangedFiles(args.base || "main", args.head || "HEAD", targetCwd);
|
|
11
19
|
return { files };
|
|
12
20
|
}
|