@arii/boomtick-mcp 0.5.0 → 0.6.0
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/boomtick.health.json +5 -0
- package/.mcp/schemas/boomtick_health.json +5 -0
- package/.mcp/schemas/github.checkout_branch.json +5 -0
- package/.mcp/schemas/github.comment_triage_summary.json +5 -0
- package/.mcp/schemas/github.create_issue.json +5 -0
- package/.mcp/schemas/github.create_pull_request.json +5 -0
- package/.mcp/schemas/github.get_merge_conflict_files.json +5 -0
- package/.mcp/schemas/github.get_pr.json +5 -0
- package/.mcp/schemas/github.get_pr_commits.json +5 -0
- package/.mcp/schemas/github.get_pr_diff.json +5 -0
- package/.mcp/schemas/github.get_pr_reviews.json +5 -0
- package/.mcp/schemas/github.issue_comment.json +5 -0
- package/.mcp/schemas/github.issue_update.json +5 -0
- package/.mcp/schemas/github.issue_view.json +5 -0
- package/.mcp/schemas/github.open_replacement_pr.json +5 -0
- package/.mcp/schemas/github.search_open_prs.json +5 -0
- package/.mcp/schemas/github_checkout_branch.json +5 -0
- package/.mcp/schemas/github_comment_triage_summary.json +5 -0
- package/.mcp/schemas/github_create_issue.json +5 -0
- package/.mcp/schemas/github_create_pull_request.json +5 -0
- package/.mcp/schemas/github_get_merge_conflict_files.json +5 -0
- package/.mcp/schemas/github_get_pr.json +5 -0
- package/.mcp/schemas/github_get_pr_commits.json +5 -0
- package/.mcp/schemas/github_get_pr_diff.json +5 -0
- package/.mcp/schemas/github_get_pr_reviews.json +5 -0
- package/.mcp/schemas/github_issue_comment.json +5 -0
- package/.mcp/schemas/github_issue_update.json +5 -0
- package/.mcp/schemas/github_issue_view.json +5 -0
- package/.mcp/schemas/github_open_replacement_pr.json +5 -0
- package/.mcp/schemas/github_search_open_prs.json +5 -0
- package/.mcp/schemas/jules.cancel_session.json +5 -0
- package/.mcp/schemas/jules.create_session.json +5 -0
- package/.mcp/schemas/jules.get_messages.json +5 -0
- package/.mcp/schemas/jules.get_pr.json +5 -0
- package/.mcp/schemas/jules.get_session.json +5 -0
- package/.mcp/schemas/jules.list_sessions.json +5 -0
- package/.mcp/schemas/jules.send_message.json +5 -0
- package/.mcp/schemas/jules.trigger_feedback.json +5 -0
- package/.mcp/schemas/jules_cancel_session.json +5 -0
- package/.mcp/schemas/jules_create_session.json +5 -0
- package/.mcp/schemas/jules_get_messages.json +5 -0
- package/.mcp/schemas/jules_get_pr.json +5 -0
- package/.mcp/schemas/jules_get_session.json +5 -0
- package/.mcp/schemas/jules_list_sessions.json +5 -0
- package/.mcp/schemas/jules_send_message.json +5 -0
- package/.mcp/schemas/jules_trigger_feedback.json +5 -0
- package/.mcp/schemas/repo.commit_patch.json +5 -0
- package/.mcp/schemas/repo.create_branch.json +5 -0
- package/.mcp/schemas/repo.create_repair_branch.json +5 -0
- package/.mcp/schemas/repo.get_changed_files.json +5 -0
- package/.mcp/schemas/repo.get_command_schema.json +6 -1
- package/.mcp/schemas/repo.get_package_scripts.json +5 -0
- package/.mcp/schemas/repo.get_workflow_runs.json +5 -0
- package/.mcp/schemas/repo.logs.json +5 -0
- package/.mcp/schemas/repo.read_agent_context.json +5 -0
- package/.mcp/schemas/repo.read_ci_logs.json +5 -0
- package/.mcp/schemas/repo.run_tests.json +5 -0
- package/.mcp/schemas/repo_commit_patch.json +5 -0
- package/.mcp/schemas/repo_create_branch.json +5 -0
- package/.mcp/schemas/repo_create_repair_branch.json +5 -0
- package/.mcp/schemas/repo_get_changed_files.json +5 -0
- package/.mcp/schemas/repo_get_command_schema.json +6 -1
- package/.mcp/schemas/repo_get_package_scripts.json +5 -0
- package/.mcp/schemas/repo_get_workflow_runs.json +5 -0
- package/.mcp/schemas/repo_logs.json +5 -0
- package/.mcp/schemas/repo_read_agent_context.json +5 -0
- package/.mcp/schemas/repo_read_ci_logs.json +5 -0
- package/.mcp/schemas/repo_run_tests.json +5 -0
- package/CHANGELOG.md +7 -0
- package/actions/ai-review/action.yml +2 -2
- package/actions/audit/action.yml +1 -1
- package/actions/ci-validate/action.yml +2 -2
- package/actions/impact-analysis/action.yml +3 -3
- package/actions/run-project-gate/action.yml +5 -5
- package/actions/setup/action.yml +1 -1
- package/actions/test-build/action.yml +1 -1
- package/dist/config.js +1 -1
- package/dist/config.test.js +3 -3
- package/dist/lib/result.js +4 -0
- package/dist/lib/result.test.js +4 -2
- package/dist/lib/shell.js +6 -6
- package/dist/mcp/definitions.js +73 -2
- package/dist/mcp/http.js +91 -0
- package/dist/mcp/http.test.js +58 -0
- package/dist/mcp/server.js +53 -13
- package/dist/mcp/server.test.js +20 -0
- package/dist/tools/contract.js +109 -1
- package/dist/tools/github.checkout_branch.js +1 -1
- package/dist/tools/github.comment_triage_summary.js +1 -1
- package/dist/tools/github.create_issue.js +1 -1
- package/dist/tools/github.create_issue.test.js +6 -6
- package/dist/tools/github.create_pull_request.js +1 -1
- package/dist/tools/github.create_pull_request.test.js +4 -4
- package/dist/tools/github.get_pr.js +1 -1
- package/dist/tools/github.get_pr_commits.js +1 -1
- package/dist/tools/github.get_pr_diff.js +1 -1
- package/dist/tools/github.get_pr_reviews.js +1 -1
- package/dist/tools/github.get_pr_reviews.test.js +9 -9
- package/dist/tools/github.issue_comment.js +1 -1
- package/dist/tools/github.issue_update.js +1 -1
- package/dist/tools/github.issue_view.js +1 -1
- package/dist/tools/github.search_open_prs.js +1 -1
- package/dist/tools/jules/cancel-session.js +1 -1
- package/dist/tools/jules/create-session.test.js +11 -11
- package/dist/tools/jules/get-messages.js +1 -1
- package/dist/tools/jules/get-messages.test.js +3 -3
- package/dist/tools/jules/get-pr.test.js +3 -3
- package/dist/tools/jules/list-sessions.js +1 -1
- package/dist/tools/jules/send-message.js +1 -1
- package/dist/tools/jules/send-message.test.js +5 -5
- package/dist/tools/jules/shared.js +4 -4
- package/dist/tools/jules/trigger-feedback.js +1 -1
- package/dist/tools/jules/trigger-feedback.test.js +5 -5
- package/dist/tools/repo.get_command_schema.js +2 -2
- package/dist/tools/repo.get_workflow_runs.js +1 -1
- package/package.json +1 -1
- package/scripts/sync-mcp-schemas.ts +2 -0
- package/src/config.test.ts +3 -3
- package/src/config.ts +1 -1
- package/src/lib/result.test.ts +4 -2
- package/src/lib/result.ts +6 -0
- package/src/lib/shell.ts +6 -6
- package/src/mcp/definitions.ts +76 -3
- package/src/mcp/http.test.ts +72 -0
- package/src/mcp/http.ts +118 -0
- package/src/mcp/server.test.ts +24 -0
- package/src/mcp/server.ts +63 -12
- package/src/tools/contract.ts +109 -1
- package/src/tools/github.checkout_branch.ts +1 -1
- package/src/tools/github.comment_triage_summary.ts +1 -1
- package/src/tools/github.create_issue.test.ts +6 -6
- package/src/tools/github.create_issue.ts +1 -1
- package/src/tools/github.create_pull_request.test.ts +4 -4
- package/src/tools/github.create_pull_request.ts +1 -1
- package/src/tools/github.get_pr.ts +1 -1
- package/src/tools/github.get_pr_commits.ts +1 -1
- package/src/tools/github.get_pr_diff.ts +1 -1
- package/src/tools/github.get_pr_reviews.test.ts +9 -9
- package/src/tools/github.get_pr_reviews.ts +1 -1
- package/src/tools/github.issue_comment.ts +1 -1
- package/src/tools/github.issue_update.ts +1 -1
- package/src/tools/github.issue_view.ts +1 -1
- package/src/tools/github.search_open_prs.ts +1 -1
- package/src/tools/jules/cancel-session.ts +1 -1
- package/src/tools/jules/create-session.test.ts +11 -11
- package/src/tools/jules/get-messages.test.ts +3 -3
- package/src/tools/jules/get-messages.ts +1 -1
- package/src/tools/jules/get-pr.test.ts +3 -3
- package/src/tools/jules/list-sessions.ts +1 -1
- package/src/tools/jules/send-message.test.ts +5 -5
- package/src/tools/jules/send-message.ts +1 -1
- package/src/tools/jules/shared.ts +4 -4
- package/src/tools/jules/trigger-feedback.test.ts +5 -5
- package/src/tools/jules/trigger-feedback.ts +1 -1
- package/src/tools/repo.get_command_schema.ts +2 -2
- package/src/tools/repo.get_workflow_runs.ts +1 -1
package/dist/tools/contract.js
CHANGED
|
@@ -815,6 +815,30 @@ export const CodeReviewResultJsonSchema = {
|
|
|
815
815
|
"default": null,
|
|
816
816
|
"title": "Line"
|
|
817
817
|
},
|
|
818
|
+
"startLine": {
|
|
819
|
+
"anyOf": [
|
|
820
|
+
{
|
|
821
|
+
"type": "integer"
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
"type": "null"
|
|
825
|
+
}
|
|
826
|
+
],
|
|
827
|
+
"default": null,
|
|
828
|
+
"title": "Startline"
|
|
829
|
+
},
|
|
830
|
+
"endLine": {
|
|
831
|
+
"anyOf": [
|
|
832
|
+
{
|
|
833
|
+
"type": "integer"
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
"type": "null"
|
|
837
|
+
}
|
|
838
|
+
],
|
|
839
|
+
"default": null,
|
|
840
|
+
"title": "Endline"
|
|
841
|
+
},
|
|
818
842
|
"snippet": {
|
|
819
843
|
"anyOf": [
|
|
820
844
|
{
|
|
@@ -850,6 +874,18 @@ export const CodeReviewResultJsonSchema = {
|
|
|
850
874
|
],
|
|
851
875
|
"default": null,
|
|
852
876
|
"title": "Counterexample"
|
|
877
|
+
},
|
|
878
|
+
"suggestion": {
|
|
879
|
+
"anyOf": [
|
|
880
|
+
{
|
|
881
|
+
"type": "string"
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
"type": "null"
|
|
885
|
+
}
|
|
886
|
+
],
|
|
887
|
+
"default": null,
|
|
888
|
+
"title": "Suggestion"
|
|
853
889
|
}
|
|
854
890
|
},
|
|
855
891
|
"required": [
|
|
@@ -1041,6 +1077,30 @@ export const CodeReviewStateJsonSchema = {
|
|
|
1041
1077
|
"default": null,
|
|
1042
1078
|
"title": "Line"
|
|
1043
1079
|
},
|
|
1080
|
+
"startLine": {
|
|
1081
|
+
"anyOf": [
|
|
1082
|
+
{
|
|
1083
|
+
"type": "integer"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
"type": "null"
|
|
1087
|
+
}
|
|
1088
|
+
],
|
|
1089
|
+
"default": null,
|
|
1090
|
+
"title": "Startline"
|
|
1091
|
+
},
|
|
1092
|
+
"endLine": {
|
|
1093
|
+
"anyOf": [
|
|
1094
|
+
{
|
|
1095
|
+
"type": "integer"
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"type": "null"
|
|
1099
|
+
}
|
|
1100
|
+
],
|
|
1101
|
+
"default": null,
|
|
1102
|
+
"title": "Endline"
|
|
1103
|
+
},
|
|
1044
1104
|
"snippet": {
|
|
1045
1105
|
"anyOf": [
|
|
1046
1106
|
{
|
|
@@ -1076,6 +1136,18 @@ export const CodeReviewStateJsonSchema = {
|
|
|
1076
1136
|
],
|
|
1077
1137
|
"default": null,
|
|
1078
1138
|
"title": "Counterexample"
|
|
1139
|
+
},
|
|
1140
|
+
"suggestion": {
|
|
1141
|
+
"anyOf": [
|
|
1142
|
+
{
|
|
1143
|
+
"type": "string"
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
"type": "null"
|
|
1147
|
+
}
|
|
1148
|
+
],
|
|
1149
|
+
"default": null,
|
|
1150
|
+
"title": "Suggestion"
|
|
1079
1151
|
}
|
|
1080
1152
|
},
|
|
1081
1153
|
"required": [
|
|
@@ -2575,7 +2647,7 @@ export const ReviewCommentJsonSchema = {
|
|
|
2575
2647
|
"title": "ReviewComment",
|
|
2576
2648
|
"type": "object"
|
|
2577
2649
|
};
|
|
2578
|
-
export const ReviewFindingSchema = z.object({ "id": z.string(), "file": z.string(), "issue": z.string(), "status": z.enum(["open", "resolved"]), "confidence": z.enum(["high", "medium", "low"]), "severity": z.union([z.enum(["HIGH", "MEDIUM", "LOW"]), z.null()]).default(null), "line": z.union([z.number().int(), z.null()]).default(null), "snippet": z.union([z.string(), z.null()]).default(null), "fixSummary": z.union([z.string(), z.null()]).default(null), "counterexample": z.union([z.string(), z.null()]).default(null) });
|
|
2650
|
+
export const ReviewFindingSchema = z.object({ "id": z.string(), "file": z.string(), "issue": z.string(), "status": z.enum(["open", "resolved"]), "confidence": z.enum(["high", "medium", "low"]), "severity": z.union([z.enum(["HIGH", "MEDIUM", "LOW"]), z.null()]).default(null), "line": z.union([z.number().int(), z.null()]).default(null), "startLine": z.union([z.number().int(), z.null()]).default(null), "endLine": z.union([z.number().int(), z.null()]).default(null), "snippet": z.union([z.string(), z.null()]).default(null), "fixSummary": z.union([z.string(), z.null()]).default(null), "counterexample": z.union([z.string(), z.null()]).default(null), "suggestion": z.union([z.string(), z.null()]).default(null) });
|
|
2579
2651
|
export const ReviewFindingJsonSchema = {
|
|
2580
2652
|
"properties": {
|
|
2581
2653
|
"id": {
|
|
@@ -2636,6 +2708,30 @@ export const ReviewFindingJsonSchema = {
|
|
|
2636
2708
|
"default": null,
|
|
2637
2709
|
"title": "Line"
|
|
2638
2710
|
},
|
|
2711
|
+
"startLine": {
|
|
2712
|
+
"anyOf": [
|
|
2713
|
+
{
|
|
2714
|
+
"type": "integer"
|
|
2715
|
+
},
|
|
2716
|
+
{
|
|
2717
|
+
"type": "null"
|
|
2718
|
+
}
|
|
2719
|
+
],
|
|
2720
|
+
"default": null,
|
|
2721
|
+
"title": "Startline"
|
|
2722
|
+
},
|
|
2723
|
+
"endLine": {
|
|
2724
|
+
"anyOf": [
|
|
2725
|
+
{
|
|
2726
|
+
"type": "integer"
|
|
2727
|
+
},
|
|
2728
|
+
{
|
|
2729
|
+
"type": "null"
|
|
2730
|
+
}
|
|
2731
|
+
],
|
|
2732
|
+
"default": null,
|
|
2733
|
+
"title": "Endline"
|
|
2734
|
+
},
|
|
2639
2735
|
"snippet": {
|
|
2640
2736
|
"anyOf": [
|
|
2641
2737
|
{
|
|
@@ -2671,6 +2767,18 @@ export const ReviewFindingJsonSchema = {
|
|
|
2671
2767
|
],
|
|
2672
2768
|
"default": null,
|
|
2673
2769
|
"title": "Counterexample"
|
|
2770
|
+
},
|
|
2771
|
+
"suggestion": {
|
|
2772
|
+
"anyOf": [
|
|
2773
|
+
{
|
|
2774
|
+
"type": "string"
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
"type": "null"
|
|
2778
|
+
}
|
|
2779
|
+
],
|
|
2780
|
+
"default": null,
|
|
2781
|
+
"title": "Suggestion"
|
|
2674
2782
|
}
|
|
2675
2783
|
},
|
|
2676
2784
|
"required": [
|
|
@@ -5,7 +5,7 @@ export const CheckoutBranchInputSchema = z.object({
|
|
|
5
5
|
worktreePath: z.string().optional(),
|
|
6
6
|
});
|
|
7
7
|
export async function checkoutBranchHandler(args) {
|
|
8
|
-
const result = await runCommand("td
|
|
8
|
+
const result = await runCommand("td", ["gh", "checkout", args.branch], { cwd: args.worktreePath });
|
|
9
9
|
if (result.exitCode !== 0) {
|
|
10
10
|
throw new Error(`Failed to checkout branch ${args.branch}: ${result.stderr}`);
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ export const CommentTriageSummaryInputSchema = z.object({
|
|
|
5
5
|
body: z.string(),
|
|
6
6
|
});
|
|
7
7
|
export async function commentTriageSummaryHandler(args) {
|
|
8
|
-
const result = await runCommand("td
|
|
8
|
+
const result = await runCommand("td", [
|
|
9
9
|
"gh",
|
|
10
10
|
"post-comment",
|
|
11
11
|
"--pr", args.prNumber.toString(),
|
|
@@ -12,7 +12,7 @@ export async function createIssueHandler(args) {
|
|
|
12
12
|
if (params.file)
|
|
13
13
|
cmdArgs.push("--file", params.file);
|
|
14
14
|
cmdArgs.push("--repo", targetRepo);
|
|
15
|
-
const result = await runCommand("td
|
|
15
|
+
const result = await runCommand("td", cmdArgs);
|
|
16
16
|
if (result.exitCode !== 0) {
|
|
17
17
|
throw new Error(`Failed to create issue: ${sanitizeError(result.stderr)}`);
|
|
18
18
|
}
|
|
@@ -20,10 +20,10 @@ describe("github.create_issue", () => {
|
|
|
20
20
|
stderr: "",
|
|
21
21
|
exitCode: 0,
|
|
22
22
|
durationMs: 10,
|
|
23
|
-
command: "td
|
|
23
|
+
command: "td gh create-issue --title 'Test Issue' --body 'Test Body'"
|
|
24
24
|
});
|
|
25
25
|
const result = await createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null });
|
|
26
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
26
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
27
27
|
"gh",
|
|
28
28
|
"create-issue",
|
|
29
29
|
"--title",
|
|
@@ -52,7 +52,7 @@ describe("github.create_issue", () => {
|
|
|
52
52
|
stderr: "",
|
|
53
53
|
exitCode: 0,
|
|
54
54
|
durationMs: 10,
|
|
55
|
-
command: "td
|
|
55
|
+
command: "td gh create-issue --title 'Cross Repo Issue' --body 'Body' --repo 'org/other-repo'"
|
|
56
56
|
});
|
|
57
57
|
const result = await createIssueHandler({
|
|
58
58
|
title: "Cross Repo Issue",
|
|
@@ -60,7 +60,7 @@ describe("github.create_issue", () => {
|
|
|
60
60
|
file: null,
|
|
61
61
|
repo: "org/other-repo"
|
|
62
62
|
});
|
|
63
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
63
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
64
64
|
"gh",
|
|
65
65
|
"create-issue",
|
|
66
66
|
"--title",
|
|
@@ -79,7 +79,7 @@ describe("github.create_issue", () => {
|
|
|
79
79
|
stderr: "Auth failed",
|
|
80
80
|
exitCode: 1,
|
|
81
81
|
durationMs: 10,
|
|
82
|
-
command: "td
|
|
82
|
+
command: "td gh create-issue"
|
|
83
83
|
});
|
|
84
84
|
await expect(createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null })).rejects.toThrow("Failed to create issue: Auth failed");
|
|
85
85
|
});
|
|
@@ -93,7 +93,7 @@ describe("github.create_issue", () => {
|
|
|
93
93
|
stderr: "",
|
|
94
94
|
exitCode: 0,
|
|
95
95
|
durationMs: 10,
|
|
96
|
-
command: "td
|
|
96
|
+
command: "td gh create-issue"
|
|
97
97
|
});
|
|
98
98
|
await expect(createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null })).rejects.toThrow("Failed to create issue: Repo not found");
|
|
99
99
|
});
|
|
@@ -17,7 +17,7 @@ export async function createPullRequestHandler(args) {
|
|
|
17
17
|
if (params.draft) {
|
|
18
18
|
tdArgs.push("--draft");
|
|
19
19
|
}
|
|
20
|
-
const result = await runCommand("td
|
|
20
|
+
const result = await runCommand("td", tdArgs);
|
|
21
21
|
if (result.exitCode !== 0) {
|
|
22
22
|
// Attempt to parse stdout as JSON to see if there's a structured error message
|
|
23
23
|
try {
|
|
@@ -18,7 +18,7 @@ describe("github.create_pull_request", () => {
|
|
|
18
18
|
stderr: "",
|
|
19
19
|
exitCode: 0,
|
|
20
20
|
durationMs: 10,
|
|
21
|
-
command: "td
|
|
21
|
+
command: "td gh create-pr --title 'PR' --body 'Body' --head 'feature' --base 'main'"
|
|
22
22
|
});
|
|
23
23
|
const result = await createPullRequestHandler({
|
|
24
24
|
title: "PR",
|
|
@@ -43,7 +43,7 @@ describe("github.create_pull_request", () => {
|
|
|
43
43
|
stderr: "",
|
|
44
44
|
exitCode: 0,
|
|
45
45
|
durationMs: 10,
|
|
46
|
-
command: "td
|
|
46
|
+
command: "td gh create-pr --title 'PR' --body 'Body' --head 'feature' --base 'main' --repo 'org/other-repo'"
|
|
47
47
|
});
|
|
48
48
|
const result = await createPullRequestHandler({
|
|
49
49
|
title: "PR",
|
|
@@ -53,7 +53,7 @@ describe("github.create_pull_request", () => {
|
|
|
53
53
|
draft: false,
|
|
54
54
|
repo: "org/other-repo"
|
|
55
55
|
});
|
|
56
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
56
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
57
57
|
"gh",
|
|
58
58
|
"create-pr",
|
|
59
59
|
"--title",
|
|
@@ -80,7 +80,7 @@ describe("github.create_pull_request", () => {
|
|
|
80
80
|
stderr: "",
|
|
81
81
|
exitCode: 0,
|
|
82
82
|
durationMs: 10,
|
|
83
|
-
command: "td
|
|
83
|
+
command: "td gh create-pr"
|
|
84
84
|
});
|
|
85
85
|
await expect(createPullRequestHandler({
|
|
86
86
|
title: "PR",
|
|
@@ -9,7 +9,7 @@ export const GetPrInputSchema = z.object({
|
|
|
9
9
|
export async function getPrHandler(args) {
|
|
10
10
|
const params = GetPrInputSchema.parse(args);
|
|
11
11
|
const targetRepo = resolveRepo(params.repo);
|
|
12
|
-
const result = await runCommand("td
|
|
12
|
+
const result = await runCommand("td", ["gh", "view", params.prNumber.toString(), "--repo", targetRepo]);
|
|
13
13
|
if (result.exitCode !== 0) {
|
|
14
14
|
throw new Error(`Failed to get PR details: ${sanitizeError(result.stderr)}`);
|
|
15
15
|
}
|
|
@@ -9,7 +9,7 @@ const GetPrCommitsInputSchema = z.object({
|
|
|
9
9
|
export async function getPrCommitsHandler(args) {
|
|
10
10
|
const params = GetPrCommitsInputSchema.parse(args);
|
|
11
11
|
const targetRepo = resolveRepo(params.repo);
|
|
12
|
-
const result = await runCommand("td
|
|
12
|
+
const result = await runCommand("td", ["gh", "list-pr-commits", "--pr-number", params.prNumber.toString(), "--repo", targetRepo]);
|
|
13
13
|
if (result.exitCode !== 0) {
|
|
14
14
|
throw new Error(`Failed to list PR commits: ${sanitizeError(result.stderr)}`);
|
|
15
15
|
}
|
|
@@ -8,7 +8,7 @@ export const GetPrDiffInputSchema = z.object({
|
|
|
8
8
|
export async function getPrDiffHandler(args) {
|
|
9
9
|
const params = GetPrDiffInputSchema.parse(args);
|
|
10
10
|
const targetRepo = resolveRepo(params.repo);
|
|
11
|
-
const result = await runCommand("td
|
|
11
|
+
const result = await runCommand("td", [
|
|
12
12
|
"gh", "pr-diff", params.prNumber.toString(), "--repo", targetRepo
|
|
13
13
|
]);
|
|
14
14
|
if (result.exitCode !== 0) {
|
|
@@ -9,7 +9,7 @@ const GetPrReviewsInputSchema = z.object({
|
|
|
9
9
|
export async function getPrReviewsHandler(args) {
|
|
10
10
|
const params = GetPrReviewsInputSchema.parse(args);
|
|
11
11
|
const targetRepo = resolveRepo(params.repo);
|
|
12
|
-
const result = await runCommand("td
|
|
12
|
+
const result = await runCommand("td", ["gh", "read-pr-reviews", "--pr-number", params.prNumber.toString(), "--repo", targetRepo]);
|
|
13
13
|
if (result.exitCode !== 0) {
|
|
14
14
|
throw new Error(`Failed to read PR reviews: ${sanitizeError(result.stderr)}`);
|
|
15
15
|
}
|
|
@@ -11,7 +11,7 @@ describe("MCP GitHub tools", () => {
|
|
|
11
11
|
vi.clearAllMocks();
|
|
12
12
|
});
|
|
13
13
|
describe("getPrReviewsHandler", () => {
|
|
14
|
-
it("should fetch PR reviews via td
|
|
14
|
+
it("should fetch PR reviews via td gh read-pr-reviews", async () => {
|
|
15
15
|
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
16
16
|
stdout: JSON.stringify({
|
|
17
17
|
status: "success",
|
|
@@ -21,10 +21,10 @@ describe("MCP GitHub tools", () => {
|
|
|
21
21
|
stderr: "",
|
|
22
22
|
exitCode: 0,
|
|
23
23
|
durationMs: 10,
|
|
24
|
-
command: "td
|
|
24
|
+
command: "td gh read-pr-reviews",
|
|
25
25
|
});
|
|
26
26
|
const res = await getPrReviewsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
27
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
27
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
28
28
|
"gh",
|
|
29
29
|
"read-pr-reviews",
|
|
30
30
|
"--pr-number",
|
|
@@ -39,7 +39,7 @@ describe("MCP GitHub tools", () => {
|
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
describe("getPrCommitsHandler", () => {
|
|
42
|
-
it("should list PR commits via td
|
|
42
|
+
it("should list PR commits via td gh list-pr-commits", async () => {
|
|
43
43
|
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
44
44
|
stdout: JSON.stringify({
|
|
45
45
|
status: "success",
|
|
@@ -48,10 +48,10 @@ describe("MCP GitHub tools", () => {
|
|
|
48
48
|
stderr: "",
|
|
49
49
|
exitCode: 0,
|
|
50
50
|
durationMs: 10,
|
|
51
|
-
command: "td
|
|
51
|
+
command: "td gh list-pr-commits",
|
|
52
52
|
});
|
|
53
53
|
const res = await getPrCommitsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
54
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
54
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
55
55
|
"gh",
|
|
56
56
|
"list-pr-commits",
|
|
57
57
|
"--pr-number",
|
|
@@ -65,7 +65,7 @@ describe("MCP GitHub tools", () => {
|
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
describe("getWorkflowRunsHandler", () => {
|
|
68
|
-
it("should fetch workflow runs via td
|
|
68
|
+
it("should fetch workflow runs via td repo workflow-runs", async () => {
|
|
69
69
|
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
70
70
|
stdout: JSON.stringify({
|
|
71
71
|
status: "success",
|
|
@@ -74,14 +74,14 @@ describe("MCP GitHub tools", () => {
|
|
|
74
74
|
stderr: "",
|
|
75
75
|
exitCode: 0,
|
|
76
76
|
durationMs: 10,
|
|
77
|
-
command: "td
|
|
77
|
+
command: "td repo workflow-runs",
|
|
78
78
|
});
|
|
79
79
|
const res = await getWorkflowRunsHandler({
|
|
80
80
|
branch: "main",
|
|
81
81
|
event: "push",
|
|
82
82
|
repo: "arii/boomtick",
|
|
83
83
|
});
|
|
84
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
84
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
85
85
|
"repo",
|
|
86
86
|
"workflow-runs",
|
|
87
87
|
"--repo",
|
|
@@ -15,7 +15,7 @@ const IssueCommentOutputSchema = z.object({
|
|
|
15
15
|
export async function issueCommentHandler(args) {
|
|
16
16
|
const params = IssueCommentInputSchema.parse(args);
|
|
17
17
|
const targetRepo = resolveRepo(params.repo);
|
|
18
|
-
const result = await runCommand("td
|
|
18
|
+
const result = await runCommand("td", [
|
|
19
19
|
"gh", "issue-comment", params.issueNumber.toString(),
|
|
20
20
|
"--body", params.body,
|
|
21
21
|
"--repo", targetRepo
|
|
@@ -20,7 +20,7 @@ export async function issueUpdateHandler(args) {
|
|
|
20
20
|
if (params.state)
|
|
21
21
|
cmdArgs.push("--state", params.state);
|
|
22
22
|
cmdArgs.push("--repo", targetRepo);
|
|
23
|
-
const result = await runCommand("td
|
|
23
|
+
const result = await runCommand("td", cmdArgs);
|
|
24
24
|
if (result.exitCode !== 0) {
|
|
25
25
|
throw new Error(`Failed to update issue: ${sanitizeError(result.stderr)}`);
|
|
26
26
|
}
|
|
@@ -19,7 +19,7 @@ const IssueViewOutputSchema = z.object({
|
|
|
19
19
|
export async function issueViewHandler(args) {
|
|
20
20
|
const params = IssueViewInputSchema.parse(args);
|
|
21
21
|
const targetRepo = resolveRepo(params.repo);
|
|
22
|
-
const result = await runCommand("td
|
|
22
|
+
const result = await runCommand("td", ["gh", "issue-view", params.issueNumber.toString(), "--repo", targetRepo]);
|
|
23
23
|
if (result.exitCode !== 0) {
|
|
24
24
|
throw new Error(`Failed to view issue: ${sanitizeError(result.stderr)}`);
|
|
25
25
|
}
|
|
@@ -23,7 +23,7 @@ export async function searchOpenPrsHandler(args) {
|
|
|
23
23
|
if (params.labels && params.labels.length > 0) {
|
|
24
24
|
tdArgs.push("--labels", params.labels.join(","));
|
|
25
25
|
}
|
|
26
|
-
const result = await runCommand("td
|
|
26
|
+
const result = await runCommand("td", tdArgs);
|
|
27
27
|
if (result.exitCode !== 0) {
|
|
28
28
|
throw new Error(`Failed to list PRs: ${result.stderr}`);
|
|
29
29
|
}
|
|
@@ -4,7 +4,7 @@ export const CancelJulesSessionInputSchema = z.object({
|
|
|
4
4
|
sessionId: z.string(),
|
|
5
5
|
});
|
|
6
6
|
export async function cancelJulesSessionHandler(input) {
|
|
7
|
-
const result = await runCommand("td
|
|
7
|
+
const result = await runCommand("td", ["agent", "cancel", input.sessionId]);
|
|
8
8
|
if (result.exitCode !== 0) {
|
|
9
9
|
throw new Error(`Failed to cancel session: ${result.stderr}`);
|
|
10
10
|
}
|
|
@@ -18,7 +18,7 @@ describe("createJulesSessionHandler", () => {
|
|
|
18
18
|
stderr: "",
|
|
19
19
|
exitCode: 0,
|
|
20
20
|
durationMs: 10,
|
|
21
|
-
command: "td
|
|
21
|
+
command: "td agent dispatch"
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
afterEach(() => {
|
|
@@ -30,14 +30,14 @@ describe("createJulesSessionHandler", () => {
|
|
|
30
30
|
expect(result.id).toBe("1234567890");
|
|
31
31
|
expect(result.status).toBe("IN_PROGRESS");
|
|
32
32
|
expect(result.createdAt).toBeInstanceOf(Date);
|
|
33
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
33
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
34
34
|
"agent", "dispatch", "main", "do work"
|
|
35
35
|
]);
|
|
36
36
|
});
|
|
37
37
|
it("should create a session with specific branch", async () => {
|
|
38
38
|
const result = await createJulesSessionHandler({ task: "do work", branch: "feature-x" });
|
|
39
39
|
expect(result.id).toBe("1234567890");
|
|
40
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
40
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
41
41
|
"agent", "dispatch", "feature-x", "do work"
|
|
42
42
|
]);
|
|
43
43
|
});
|
|
@@ -49,7 +49,7 @@ describe("createJulesSessionHandler", () => {
|
|
|
49
49
|
stderr: "",
|
|
50
50
|
exitCode: 0,
|
|
51
51
|
durationMs: 10,
|
|
52
|
-
command: "td
|
|
52
|
+
command: "td gh view"
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
return {
|
|
@@ -62,15 +62,15 @@ describe("createJulesSessionHandler", () => {
|
|
|
62
62
|
stderr: "",
|
|
63
63
|
exitCode: 0,
|
|
64
64
|
durationMs: 10,
|
|
65
|
-
command: "td
|
|
65
|
+
command: "td agent dispatch"
|
|
66
66
|
};
|
|
67
67
|
});
|
|
68
68
|
const result = await createJulesSessionHandler({ task: "do work", pr: 42 });
|
|
69
69
|
expect(result.id).toBe("1234567890");
|
|
70
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
70
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
71
71
|
"gh", "view", "42"
|
|
72
72
|
]);
|
|
73
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
73
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
74
74
|
"agent", "dispatch", "pr-branch", "do work"
|
|
75
75
|
]);
|
|
76
76
|
});
|
|
@@ -80,10 +80,10 @@ describe("createJulesSessionHandler", () => {
|
|
|
80
80
|
stderr: "Original error",
|
|
81
81
|
exitCode: 1,
|
|
82
82
|
durationMs: 10,
|
|
83
|
-
command: "td
|
|
83
|
+
command: "td gh view"
|
|
84
84
|
});
|
|
85
85
|
await expect(createJulesSessionHandler({ task: "do work", pr: 999 }))
|
|
86
|
-
.rejects.toThrow("td
|
|
86
|
+
.rejects.toThrow("td returned error: PR not found");
|
|
87
87
|
});
|
|
88
88
|
it("should throw descriptive error if PR JSON is invalid", async () => {
|
|
89
89
|
vi.mocked(shell.runCommand).mockResolvedValue({
|
|
@@ -91,9 +91,9 @@ describe("createJulesSessionHandler", () => {
|
|
|
91
91
|
stderr: "",
|
|
92
92
|
exitCode: 0,
|
|
93
93
|
durationMs: 10,
|
|
94
|
-
command: "td
|
|
94
|
+
command: "td gh view"
|
|
95
95
|
});
|
|
96
96
|
await expect(createJulesSessionHandler({ task: "do work", pr: 42 }))
|
|
97
|
-
.rejects.toThrow("td
|
|
97
|
+
.rejects.toThrow("td returned non-JSON output with exit code 0: invalid json");
|
|
98
98
|
});
|
|
99
99
|
});
|
|
@@ -4,7 +4,7 @@ export const GetJulesMessagesInputSchema = z.object({
|
|
|
4
4
|
sessionId: z.string(),
|
|
5
5
|
});
|
|
6
6
|
export async function getJulesMessagesHandler(input) {
|
|
7
|
-
const result = await runCommand("td
|
|
7
|
+
const result = await runCommand("td", ["agent", "messages", input.sessionId]);
|
|
8
8
|
if (result.exitCode !== 0) {
|
|
9
9
|
throw new Error(`Failed to get messages: ${result.stderr}`);
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ describe("getJulesMessagesHandler", () => {
|
|
|
13
13
|
teardownTestEnv();
|
|
14
14
|
vi.clearAllMocks();
|
|
15
15
|
});
|
|
16
|
-
it("should return messages from td
|
|
16
|
+
it("should return messages from td", async () => {
|
|
17
17
|
const mockMessages = [
|
|
18
18
|
{
|
|
19
19
|
role: "user",
|
|
@@ -31,14 +31,14 @@ describe("getJulesMessagesHandler", () => {
|
|
|
31
31
|
stderr: "",
|
|
32
32
|
exitCode: 0,
|
|
33
33
|
durationMs: 0,
|
|
34
|
-
command: "td
|
|
34
|
+
command: "td agent messages"
|
|
35
35
|
});
|
|
36
36
|
const result = await getJulesMessagesHandler({ sessionId: "123" });
|
|
37
37
|
expect(result.id).toBe("123");
|
|
38
38
|
expect(result.messages.length).toBe(2);
|
|
39
39
|
expect(result.messages[0].role).toBe("user");
|
|
40
40
|
expect(result.messages[0].content).toBe("Hello Jules");
|
|
41
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
41
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
42
42
|
"agent", "messages", "123"
|
|
43
43
|
]);
|
|
44
44
|
});
|
|
@@ -13,7 +13,7 @@ describe("getJulesPullRequestHandler", () => {
|
|
|
13
13
|
teardownTestEnv();
|
|
14
14
|
vi.clearAllMocks();
|
|
15
15
|
});
|
|
16
|
-
it("should get PR from td
|
|
16
|
+
it("should get PR from td", async () => {
|
|
17
17
|
vi.mocked(shell.runCommand).mockResolvedValue({
|
|
18
18
|
stdout: JSON.stringify({
|
|
19
19
|
status: "success",
|
|
@@ -25,12 +25,12 @@ describe("getJulesPullRequestHandler", () => {
|
|
|
25
25
|
stderr: "",
|
|
26
26
|
exitCode: 0,
|
|
27
27
|
durationMs: 0,
|
|
28
|
-
command: "td
|
|
28
|
+
command: "td agent get-session"
|
|
29
29
|
});
|
|
30
30
|
const result = await getJulesPullRequestHandler({ sessionId: "123" });
|
|
31
31
|
expect(result.id).toBe("123");
|
|
32
32
|
expect(result.pullRequestUrl).toBe("https://github.com/pr/1");
|
|
33
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
33
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
34
34
|
"agent", "get-session", "123"
|
|
35
35
|
]);
|
|
36
36
|
});
|
|
@@ -5,7 +5,7 @@ export const ListJulesSessionsInputSchema = z.object({
|
|
|
5
5
|
pageToken: z.string().optional(),
|
|
6
6
|
});
|
|
7
7
|
export async function listJulesSessionsHandler(input) {
|
|
8
|
-
const result = await runCommand("td
|
|
8
|
+
const result = await runCommand("td", ["agent", "sync"]);
|
|
9
9
|
if (result.exitCode !== 0) {
|
|
10
10
|
throw new Error(`Failed to list sessions: ${result.stderr}`);
|
|
11
11
|
}
|
|
@@ -6,7 +6,7 @@ export const SendJulesMessageInputSchema = z.object({
|
|
|
6
6
|
});
|
|
7
7
|
export async function sendJulesMessageHandler(input) {
|
|
8
8
|
const sessionIds = Array.isArray(input.sessionId) ? input.sessionId.join(",") : input.sessionId;
|
|
9
|
-
const result = await runCommand("td
|
|
9
|
+
const result = await runCommand("td", ["agent", "send", sessionIds, input.message]);
|
|
10
10
|
if (result.exitCode !== 0) {
|
|
11
11
|
throw new Error(`Failed to send message: ${result.stderr}`);
|
|
12
12
|
}
|
|
@@ -13,18 +13,18 @@ describe("sendJulesMessageHandler", () => {
|
|
|
13
13
|
teardownTestEnv();
|
|
14
14
|
vi.clearAllMocks();
|
|
15
15
|
});
|
|
16
|
-
it("should send a message via td
|
|
16
|
+
it("should send a message via td", async () => {
|
|
17
17
|
vi.mocked(shell.runCommand).mockResolvedValue({
|
|
18
18
|
stdout: JSON.stringify({ status: "success", message: "Message sent successfully" }),
|
|
19
19
|
stderr: "",
|
|
20
20
|
exitCode: 0,
|
|
21
21
|
durationMs: 0,
|
|
22
|
-
command: "td
|
|
22
|
+
command: "td agent send"
|
|
23
23
|
});
|
|
24
24
|
const result = await sendJulesMessageHandler({ sessionId: "123", message: "hi" });
|
|
25
25
|
expect(result.id).toBe("123");
|
|
26
26
|
expect(result.status).toBe("success");
|
|
27
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
27
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
28
28
|
"agent", "send", "123", "hi"
|
|
29
29
|
]);
|
|
30
30
|
});
|
|
@@ -41,7 +41,7 @@ describe("sendJulesMessageHandler", () => {
|
|
|
41
41
|
stderr: "",
|
|
42
42
|
exitCode: 0,
|
|
43
43
|
durationMs: 0,
|
|
44
|
-
command: "td
|
|
44
|
+
command: "td agent send"
|
|
45
45
|
});
|
|
46
46
|
const result = await sendJulesMessageHandler({
|
|
47
47
|
sessionId: ["sessions/s1", "sessions/s2"],
|
|
@@ -49,7 +49,7 @@ describe("sendJulesMessageHandler", () => {
|
|
|
49
49
|
});
|
|
50
50
|
expect(result.id).toEqual(["s1", "s2"]);
|
|
51
51
|
expect(result.status).toBe("success");
|
|
52
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
52
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
53
53
|
"agent", "send", "sessions/s1,sessions/s2", "hi batch"
|
|
54
54
|
]);
|
|
55
55
|
});
|