@arii/boomtick-mcp 0.4.2 → 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 +37 -0
- package/.mcp/schemas/github.get_pr_diff.json +5 -0
- package/.mcp/schemas/github.get_pr_reviews.json +37 -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 +37 -0
- package/.mcp/schemas/github_get_pr_diff.json +5 -0
- package/.mcp/schemas/github_get_pr_reviews.json +37 -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 +55 -0
- package/.mcp/schemas/repo.logs.json +19 -0
- package/.mcp/schemas/repo.read_agent_context.json +5 -0
- package/.mcp/schemas/repo.read_ci_logs.json +19 -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 +55 -0
- package/.mcp/schemas/repo_logs.json +19 -0
- package/.mcp/schemas/repo_read_agent_context.json +5 -0
- package/.mcp/schemas/repo_read_ci_logs.json +19 -0
- package/.mcp/schemas/repo_run_tests.json +5 -0
- package/CHANGELOG.md +14 -0
- package/README.md +0 -1
- 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 +7 -19
- package/actions/run-project-gate/action.yml +7 -14
- package/actions/setup/action.yml +1 -1
- package/actions/test-build/action.yml +2 -20
- package/dist/config.js +1 -1
- package/dist/config.test.js +3 -3
- package/dist/lib/git.js +44 -0
- package/dist/lib/git.test.js +82 -0
- 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 +86 -38
- package/dist/mcp/http.js +91 -0
- package/dist/mcp/http.test.js +58 -0
- package/dist/mcp/server.js +51 -57
- package/dist/mcp/server.test.js +19 -32
- package/dist/tools/contract.js +244 -3
- 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_merge_conflict_files.js +10 -18
- package/dist/tools/github.get_pr.js +1 -1
- package/dist/tools/github.get_pr_commits.js +21 -0
- package/dist/tools/github.get_pr_diff.js +1 -1
- package/dist/tools/github.get_pr_reviews.js +21 -0
- package/dist/tools/github.get_pr_reviews.test.js +99 -0
- 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.js +1 -2
- 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.js +1 -2
- package/dist/tools/jules/get-pr.test.js +3 -3
- package/dist/tools/jules/get-session.js +1 -2
- 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 +24 -0
- package/dist/tools/jules/trigger-feedback.js +1 -1
- package/dist/tools/jules/trigger-feedback.test.js +5 -5
- package/dist/tools/repo.get_changed_files.js +2 -13
- package/dist/tools/repo.get_command_schema.js +2 -2
- package/dist/tools/repo.get_workflow_runs.js +29 -0
- package/dist/tools/repo.logs.js +5 -1
- package/dist/tools/repo.read_agent_context.js +27 -1
- package/dist/tools/repo.read_agent_context.test.js +1 -1
- package/dist/tools/repo.read_ci_logs.js +5 -1
- package/dist/tools/repo.run_tests.js +1 -1
- package/package.json +3 -6
- package/scripts/sync-mcp-schemas.ts +2 -0
- package/src/agents/verifier-agent.prompt.md +0 -4
- package/src/config.test.ts +3 -3
- package/src/config.ts +1 -1
- package/src/lib/git.test.ts +110 -0
- package/src/lib/git.ts +75 -0
- 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 +91 -42
- package/src/mcp/http.test.ts +72 -0
- package/src/mcp/http.ts +118 -0
- package/src/mcp/server.test.ts +20 -38
- package/src/mcp/server.ts +60 -54
- package/src/tools/contract.ts +256 -3
- 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_merge_conflict_files.ts +10 -20
- package/src/tools/github.get_pr.ts +1 -1
- package/src/tools/github.get_pr_commits.ts +27 -0
- package/src/tools/github.get_pr_diff.ts +1 -1
- package/src/tools/github.get_pr_reviews.test.ts +110 -0
- package/src/tools/github.get_pr_reviews.ts +27 -0
- 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/create-session.ts +1 -2
- 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/get-pr.ts +1 -2
- package/src/tools/jules/get-session.ts +1 -2
- 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 +35 -0
- package/src/tools/jules/trigger-feedback.test.ts +5 -5
- package/src/tools/jules/trigger-feedback.ts +1 -1
- package/src/tools/repo.get_changed_files.ts +2 -16
- package/src/tools/repo.get_command_schema.ts +2 -2
- package/src/tools/repo.get_workflow_runs.ts +36 -0
- package/src/tools/repo.logs.ts +5 -1
- package/src/tools/repo.read_agent_context.test.ts +1 -1
- package/src/tools/repo.read_agent_context.ts +35 -1
- package/src/tools/repo.read_ci_logs.ts +5 -1
- package/src/tools/repo.run_tests.ts +1 -1
- package/.mcp/schemas/agent.search_ddgs.json +0 -31
- package/.mcp/schemas/agent_search_ddgs.json +0 -31
- package/.mcp/schemas/repo.get_route_map.json +0 -23
- package/.mcp/schemas/repo.run_lighthouse.json +0 -29
- package/.mcp/schemas/repo.run_playwright.json +0 -36
- package/.mcp/schemas/repo_get_route_map.json +0 -23
- package/.mcp/schemas/repo_run_lighthouse.json +0 -29
- package/.mcp/schemas/repo_run_playwright.json +0 -36
- package/dist/lib/td-cli.js +0 -54
- package/dist/tools/ddgs.search.js +0 -50
- package/dist/tools/ddgs.search.test.js +0 -67
- package/dist/tools/ddgs_search.py +0 -23
- package/dist/tools/repo.get_route_map.js +0 -37
- package/dist/tools/repo.run_lighthouse.js +0 -37
- package/dist/tools/repo.run_playwright.js +0 -34
- package/scripts/export-mcp-schema.ts +0 -7
- package/src/lib/td-cli.ts +0 -73
- package/src/tools/ddgs.search.test.ts +0 -92
- package/src/tools/ddgs.search.ts +0 -58
- package/src/tools/ddgs_search.py +0 -23
- package/src/tools/repo.get_route_map.ts +0 -41
- package/src/tools/repo.run_lighthouse.ts +0 -40
- package/src/tools/repo.run_playwright.ts +0 -42
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": [
|
|
@@ -1512,6 +1584,35 @@ export const GetPackageScriptsInputJsonSchema = {
|
|
|
1512
1584
|
"title": "GetPackageScriptsInput",
|
|
1513
1585
|
"type": "object"
|
|
1514
1586
|
};
|
|
1587
|
+
export const GetPrCommitsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the PR to list commits for."), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
1588
|
+
export const GetPrCommitsInputJsonSchema = {
|
|
1589
|
+
"properties": {
|
|
1590
|
+
"prNumber": {
|
|
1591
|
+
"description": "The number of the PR to list commits for.",
|
|
1592
|
+
"title": "Prnumber",
|
|
1593
|
+
"type": "integer"
|
|
1594
|
+
},
|
|
1595
|
+
"repo": {
|
|
1596
|
+
"anyOf": [
|
|
1597
|
+
{
|
|
1598
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1599
|
+
"type": "string"
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
"type": "null"
|
|
1603
|
+
}
|
|
1604
|
+
],
|
|
1605
|
+
"default": null,
|
|
1606
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1607
|
+
"title": "Repo"
|
|
1608
|
+
}
|
|
1609
|
+
},
|
|
1610
|
+
"required": [
|
|
1611
|
+
"prNumber"
|
|
1612
|
+
],
|
|
1613
|
+
"title": "GetPrCommitsInput",
|
|
1614
|
+
"type": "object"
|
|
1615
|
+
};
|
|
1515
1616
|
export const GetPrDiffInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the pull request to get the diff for."), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
1516
1617
|
export const GetPrDiffInputJsonSchema = {
|
|
1517
1618
|
"properties": {
|
|
@@ -1570,6 +1671,35 @@ export const GetPrInputJsonSchema = {
|
|
|
1570
1671
|
"title": "GetPrInput",
|
|
1571
1672
|
"type": "object"
|
|
1572
1673
|
};
|
|
1674
|
+
export const GetPrReviewsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the PR to view reviews for."), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
1675
|
+
export const GetPrReviewsInputJsonSchema = {
|
|
1676
|
+
"properties": {
|
|
1677
|
+
"prNumber": {
|
|
1678
|
+
"description": "The number of the PR to view reviews for.",
|
|
1679
|
+
"title": "Prnumber",
|
|
1680
|
+
"type": "integer"
|
|
1681
|
+
},
|
|
1682
|
+
"repo": {
|
|
1683
|
+
"anyOf": [
|
|
1684
|
+
{
|
|
1685
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1686
|
+
"type": "string"
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
"type": "null"
|
|
1690
|
+
}
|
|
1691
|
+
],
|
|
1692
|
+
"default": null,
|
|
1693
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1694
|
+
"title": "Repo"
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
"required": [
|
|
1698
|
+
"prNumber"
|
|
1699
|
+
],
|
|
1700
|
+
"title": "GetPrReviewsInput",
|
|
1701
|
+
"type": "object"
|
|
1702
|
+
};
|
|
1573
1703
|
export const GetRouteMapInputSchema = z.object({ "includeStatic": z.union([z.boolean(), z.null()]).describe("Whether to include static assets in the route map.").default(null) });
|
|
1574
1704
|
export const GetRouteMapInputJsonSchema = {
|
|
1575
1705
|
"properties": {
|
|
@@ -1590,6 +1720,53 @@ export const GetRouteMapInputJsonSchema = {
|
|
|
1590
1720
|
"title": "GetRouteMapInput",
|
|
1591
1721
|
"type": "object"
|
|
1592
1722
|
};
|
|
1723
|
+
export const GetWorkflowRunsInputSchema = z.object({ "branch": z.union([z.string(), z.null()]).describe("Filter workflow runs by branch name.").default(null), "event": z.union([z.string(), z.null()]).describe("Filter workflow runs by event (e.g. push, pull_request).").default(null), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
1724
|
+
export const GetWorkflowRunsInputJsonSchema = {
|
|
1725
|
+
"properties": {
|
|
1726
|
+
"branch": {
|
|
1727
|
+
"anyOf": [
|
|
1728
|
+
{
|
|
1729
|
+
"type": "string"
|
|
1730
|
+
},
|
|
1731
|
+
{
|
|
1732
|
+
"type": "null"
|
|
1733
|
+
}
|
|
1734
|
+
],
|
|
1735
|
+
"default": null,
|
|
1736
|
+
"description": "Filter workflow runs by branch name.",
|
|
1737
|
+
"title": "Branch"
|
|
1738
|
+
},
|
|
1739
|
+
"event": {
|
|
1740
|
+
"anyOf": [
|
|
1741
|
+
{
|
|
1742
|
+
"type": "string"
|
|
1743
|
+
},
|
|
1744
|
+
{
|
|
1745
|
+
"type": "null"
|
|
1746
|
+
}
|
|
1747
|
+
],
|
|
1748
|
+
"default": null,
|
|
1749
|
+
"description": "Filter workflow runs by event (e.g. push, pull_request).",
|
|
1750
|
+
"title": "Event"
|
|
1751
|
+
},
|
|
1752
|
+
"repo": {
|
|
1753
|
+
"anyOf": [
|
|
1754
|
+
{
|
|
1755
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1756
|
+
"type": "string"
|
|
1757
|
+
},
|
|
1758
|
+
{
|
|
1759
|
+
"type": "null"
|
|
1760
|
+
}
|
|
1761
|
+
],
|
|
1762
|
+
"default": null,
|
|
1763
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1764
|
+
"title": "Repo"
|
|
1765
|
+
}
|
|
1766
|
+
},
|
|
1767
|
+
"title": "GetWorkflowRunsInput",
|
|
1768
|
+
"type": "object"
|
|
1769
|
+
};
|
|
1593
1770
|
export const HealthCheckInputSchema = z.object({ "checkDeep": z.boolean().describe("Whether to perform a deep health check including external dependencies.").default(false) });
|
|
1594
1771
|
export const HealthCheckInputJsonSchema = {
|
|
1595
1772
|
"properties": {
|
|
@@ -2189,7 +2366,7 @@ export const ReadAgentContextInputJsonSchema = {
|
|
|
2189
2366
|
"title": "ReadAgentContextInput",
|
|
2190
2367
|
"type": "object"
|
|
2191
2368
|
};
|
|
2192
|
-
export const ReadCiLogsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the pull request to read logs for."), "all": z.boolean().describe("Include logs for successful runs (default: false).").default(false) });
|
|
2369
|
+
export const ReadCiLogsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the pull request to read logs for."), "all": z.boolean().describe("Include logs for successful runs (default: false).").default(false), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
2193
2370
|
export const ReadCiLogsInputJsonSchema = {
|
|
2194
2371
|
"properties": {
|
|
2195
2372
|
"prNumber": {
|
|
@@ -2202,6 +2379,20 @@ export const ReadCiLogsInputJsonSchema = {
|
|
|
2202
2379
|
"description": "Include logs for successful runs (default: false).",
|
|
2203
2380
|
"title": "All",
|
|
2204
2381
|
"type": "boolean"
|
|
2382
|
+
},
|
|
2383
|
+
"repo": {
|
|
2384
|
+
"anyOf": [
|
|
2385
|
+
{
|
|
2386
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
2387
|
+
"type": "string"
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
"type": "null"
|
|
2391
|
+
}
|
|
2392
|
+
],
|
|
2393
|
+
"default": null,
|
|
2394
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
2395
|
+
"title": "Repo"
|
|
2205
2396
|
}
|
|
2206
2397
|
},
|
|
2207
2398
|
"required": [
|
|
@@ -2373,7 +2564,7 @@ export const ReadPRCommentsResponseJsonSchema = {
|
|
|
2373
2564
|
"title": "ReadPRCommentsResponse",
|
|
2374
2565
|
"type": "object"
|
|
2375
2566
|
};
|
|
2376
|
-
export const RepoLogsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the pull request to stream logs for."), "grep": z.union([z.string(), z.null()]).describe("Optional pattern to filter log lines.").default(null) });
|
|
2567
|
+
export const RepoLogsInputSchema = z.object({ "prNumber": z.number().int().describe("The number of the pull request to stream logs for."), "grep": z.union([z.string(), z.null()]).describe("Optional pattern to filter log lines.").default(null), "repo": z.union([z.string().regex(new RegExp("^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$")), z.null()]).describe("The target repository override (e.g. org/repo).").default(null) });
|
|
2377
2568
|
export const RepoLogsInputJsonSchema = {
|
|
2378
2569
|
"properties": {
|
|
2379
2570
|
"prNumber": {
|
|
@@ -2393,6 +2584,20 @@ export const RepoLogsInputJsonSchema = {
|
|
|
2393
2584
|
"default": null,
|
|
2394
2585
|
"description": "Optional pattern to filter log lines.",
|
|
2395
2586
|
"title": "Grep"
|
|
2587
|
+
},
|
|
2588
|
+
"repo": {
|
|
2589
|
+
"anyOf": [
|
|
2590
|
+
{
|
|
2591
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
2592
|
+
"type": "string"
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
"type": "null"
|
|
2596
|
+
}
|
|
2597
|
+
],
|
|
2598
|
+
"default": null,
|
|
2599
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
2600
|
+
"title": "Repo"
|
|
2396
2601
|
}
|
|
2397
2602
|
},
|
|
2398
2603
|
"required": [
|
|
@@ -2442,7 +2647,7 @@ export const ReviewCommentJsonSchema = {
|
|
|
2442
2647
|
"title": "ReviewComment",
|
|
2443
2648
|
"type": "object"
|
|
2444
2649
|
};
|
|
2445
|
-
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) });
|
|
2446
2651
|
export const ReviewFindingJsonSchema = {
|
|
2447
2652
|
"properties": {
|
|
2448
2653
|
"id": {
|
|
@@ -2503,6 +2708,30 @@ export const ReviewFindingJsonSchema = {
|
|
|
2503
2708
|
"default": null,
|
|
2504
2709
|
"title": "Line"
|
|
2505
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
|
+
},
|
|
2506
2735
|
"snippet": {
|
|
2507
2736
|
"anyOf": [
|
|
2508
2737
|
{
|
|
@@ -2538,6 +2767,18 @@ export const ReviewFindingJsonSchema = {
|
|
|
2538
2767
|
],
|
|
2539
2768
|
"default": null,
|
|
2540
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"
|
|
2541
2782
|
}
|
|
2542
2783
|
},
|
|
2543
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",
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { getMergeConflictFiles } from "../lib/git.js";
|
|
3
3
|
export const GetMergeConflictFilesInputSchema = z.object({
|
|
4
|
-
prNumber: z.number(),
|
|
4
|
+
prNumber: z.number().optional(),
|
|
5
5
|
baseBranch: z.string().optional().default("main"),
|
|
6
|
+
headRef: z.string().optional().default("HEAD"),
|
|
6
7
|
});
|
|
7
8
|
export async function getMergeConflictFilesHandler(args) {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]);
|
|
12
|
-
if (result.exitCode !== 0) {
|
|
13
|
-
throw new Error(`Failed to get merge conflicts: ${result.stderr}`);
|
|
14
|
-
}
|
|
15
|
-
const output = JSON.parse(result.stdout);
|
|
16
|
-
if (output.status === "error") {
|
|
17
|
-
throw new Error(`Failed to get merge conflicts: ${output.message}`);
|
|
18
|
-
}
|
|
9
|
+
const baseBranch = args.baseBranch || "main";
|
|
10
|
+
const headRef = args.headRef || "HEAD";
|
|
11
|
+
const conflictFiles = await getMergeConflictFiles(baseBranch, headRef);
|
|
19
12
|
return {
|
|
20
|
-
prNumber:
|
|
21
|
-
baseBranch
|
|
22
|
-
headRef
|
|
23
|
-
conflictFiles
|
|
24
|
-
commandLog: output.commandLog
|
|
13
|
+
prNumber: args.prNumber,
|
|
14
|
+
baseBranch,
|
|
15
|
+
headRef,
|
|
16
|
+
conflictFiles,
|
|
25
17
|
};
|
|
26
18
|
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runCommand } from "../lib/shell.js";
|
|
3
|
+
import { resolveRepo } from "../lib/git.js";
|
|
4
|
+
import { sanitizeError } from "../lib/error_utils.js";
|
|
5
|
+
const GetPrCommitsInputSchema = z.object({
|
|
6
|
+
prNumber: z.number().describe("The number of the PR to list commits for."),
|
|
7
|
+
repo: z.string().optional().describe("The target repository override (e.g. org/repo)."),
|
|
8
|
+
});
|
|
9
|
+
export async function getPrCommitsHandler(args) {
|
|
10
|
+
const params = GetPrCommitsInputSchema.parse(args);
|
|
11
|
+
const targetRepo = resolveRepo(params.repo);
|
|
12
|
+
const result = await runCommand("td", ["gh", "list-pr-commits", "--pr-number", params.prNumber.toString(), "--repo", targetRepo]);
|
|
13
|
+
if (result.exitCode !== 0) {
|
|
14
|
+
throw new Error(`Failed to list PR commits: ${sanitizeError(result.stderr)}`);
|
|
15
|
+
}
|
|
16
|
+
const output = JSON.parse(result.stdout);
|
|
17
|
+
if (output.status === "error") {
|
|
18
|
+
throw new Error(`Failed to list PR commits: ${output.message}`);
|
|
19
|
+
}
|
|
20
|
+
return { commits: output.commits };
|
|
21
|
+
}
|
|
@@ -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) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { runCommand } from "../lib/shell.js";
|
|
3
|
+
import { resolveRepo } from "../lib/git.js";
|
|
4
|
+
import { sanitizeError } from "../lib/error_utils.js";
|
|
5
|
+
const GetPrReviewsInputSchema = z.object({
|
|
6
|
+
prNumber: z.number().describe("The number of the PR to view reviews for."),
|
|
7
|
+
repo: z.string().optional().describe("The target repository override (e.g. org/repo)."),
|
|
8
|
+
});
|
|
9
|
+
export async function getPrReviewsHandler(args) {
|
|
10
|
+
const params = GetPrReviewsInputSchema.parse(args);
|
|
11
|
+
const targetRepo = resolveRepo(params.repo);
|
|
12
|
+
const result = await runCommand("td", ["gh", "read-pr-reviews", "--pr-number", params.prNumber.toString(), "--repo", targetRepo]);
|
|
13
|
+
if (result.exitCode !== 0) {
|
|
14
|
+
throw new Error(`Failed to read PR reviews: ${sanitizeError(result.stderr)}`);
|
|
15
|
+
}
|
|
16
|
+
const output = JSON.parse(result.stdout);
|
|
17
|
+
if (output.status === "error") {
|
|
18
|
+
throw new Error(`Failed to read PR reviews: ${output.message}`);
|
|
19
|
+
}
|
|
20
|
+
return { reviews: output.reviews, reviewCount: output.review_count };
|
|
21
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
+
import { getPrReviewsHandler } from "./github.get_pr_reviews.js";
|
|
3
|
+
import { getPrCommitsHandler } from "./github.get_pr_commits.js";
|
|
4
|
+
import { getWorkflowRunsHandler } from "./repo.get_workflow_runs.js";
|
|
5
|
+
import * as shell from "../lib/shell.js";
|
|
6
|
+
vi.mock("../lib/shell.js", () => ({
|
|
7
|
+
runCommand: vi.fn(),
|
|
8
|
+
}));
|
|
9
|
+
describe("MCP GitHub tools", () => {
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
vi.clearAllMocks();
|
|
12
|
+
});
|
|
13
|
+
describe("getPrReviewsHandler", () => {
|
|
14
|
+
it("should fetch PR reviews via td gh read-pr-reviews", async () => {
|
|
15
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
16
|
+
stdout: JSON.stringify({
|
|
17
|
+
status: "success",
|
|
18
|
+
reviews: [{ id: 1, state: "APPROVED", body: "LGTM" }],
|
|
19
|
+
review_count: 1,
|
|
20
|
+
}),
|
|
21
|
+
stderr: "",
|
|
22
|
+
exitCode: 0,
|
|
23
|
+
durationMs: 10,
|
|
24
|
+
command: "td gh read-pr-reviews",
|
|
25
|
+
});
|
|
26
|
+
const res = await getPrReviewsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
27
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
28
|
+
"gh",
|
|
29
|
+
"read-pr-reviews",
|
|
30
|
+
"--pr-number",
|
|
31
|
+
"819",
|
|
32
|
+
"--repo",
|
|
33
|
+
"arii/boomtick",
|
|
34
|
+
]);
|
|
35
|
+
expect(res).toEqual({
|
|
36
|
+
reviews: [{ id: 1, state: "APPROVED", body: "LGTM" }],
|
|
37
|
+
reviewCount: 1,
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe("getPrCommitsHandler", () => {
|
|
42
|
+
it("should list PR commits via td gh list-pr-commits", async () => {
|
|
43
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
44
|
+
stdout: JSON.stringify({
|
|
45
|
+
status: "success",
|
|
46
|
+
commits: [{ sha: "abc1234", author: "Dev", message: "feat: test" }],
|
|
47
|
+
}),
|
|
48
|
+
stderr: "",
|
|
49
|
+
exitCode: 0,
|
|
50
|
+
durationMs: 10,
|
|
51
|
+
command: "td gh list-pr-commits",
|
|
52
|
+
});
|
|
53
|
+
const res = await getPrCommitsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
54
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
55
|
+
"gh",
|
|
56
|
+
"list-pr-commits",
|
|
57
|
+
"--pr-number",
|
|
58
|
+
"819",
|
|
59
|
+
"--repo",
|
|
60
|
+
"arii/boomtick",
|
|
61
|
+
]);
|
|
62
|
+
expect(res).toEqual({
|
|
63
|
+
commits: [{ sha: "abc1234", author: "Dev", message: "feat: test" }],
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe("getWorkflowRunsHandler", () => {
|
|
68
|
+
it("should fetch workflow runs via td repo workflow-runs", async () => {
|
|
69
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
70
|
+
stdout: JSON.stringify({
|
|
71
|
+
status: "success",
|
|
72
|
+
workflow_runs: [{ id: 10, name: "CI" }],
|
|
73
|
+
}),
|
|
74
|
+
stderr: "",
|
|
75
|
+
exitCode: 0,
|
|
76
|
+
durationMs: 10,
|
|
77
|
+
command: "td repo workflow-runs",
|
|
78
|
+
});
|
|
79
|
+
const res = await getWorkflowRunsHandler({
|
|
80
|
+
branch: "main",
|
|
81
|
+
event: "push",
|
|
82
|
+
repo: "arii/boomtick",
|
|
83
|
+
});
|
|
84
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
85
|
+
"repo",
|
|
86
|
+
"workflow-runs",
|
|
87
|
+
"--repo",
|
|
88
|
+
"arii/boomtick",
|
|
89
|
+
"--branch",
|
|
90
|
+
"main",
|
|
91
|
+
"--event",
|
|
92
|
+
"push",
|
|
93
|
+
]);
|
|
94
|
+
expect(res).toEqual({
|
|
95
|
+
workflowRuns: [{ id: 10, name: "CI" }],
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|