@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.
@@ -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
- const prResult = await runCommand("gh", [
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
- return {
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 files = await getChangedFiles(args.base || "main", args.head || "HEAD");
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
  }