@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/src/tools/contract.ts
CHANGED
|
@@ -847,6 +847,30 @@ export const CodeReviewResultJsonSchema = {
|
|
|
847
847
|
"default": null,
|
|
848
848
|
"title": "Line"
|
|
849
849
|
},
|
|
850
|
+
"startLine": {
|
|
851
|
+
"anyOf": [
|
|
852
|
+
{
|
|
853
|
+
"type": "integer"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"type": "null"
|
|
857
|
+
}
|
|
858
|
+
],
|
|
859
|
+
"default": null,
|
|
860
|
+
"title": "Startline"
|
|
861
|
+
},
|
|
862
|
+
"endLine": {
|
|
863
|
+
"anyOf": [
|
|
864
|
+
{
|
|
865
|
+
"type": "integer"
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"type": "null"
|
|
869
|
+
}
|
|
870
|
+
],
|
|
871
|
+
"default": null,
|
|
872
|
+
"title": "Endline"
|
|
873
|
+
},
|
|
850
874
|
"snippet": {
|
|
851
875
|
"anyOf": [
|
|
852
876
|
{
|
|
@@ -882,6 +906,18 @@ export const CodeReviewResultJsonSchema = {
|
|
|
882
906
|
],
|
|
883
907
|
"default": null,
|
|
884
908
|
"title": "Counterexample"
|
|
909
|
+
},
|
|
910
|
+
"suggestion": {
|
|
911
|
+
"anyOf": [
|
|
912
|
+
{
|
|
913
|
+
"type": "string"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"type": "null"
|
|
917
|
+
}
|
|
918
|
+
],
|
|
919
|
+
"default": null,
|
|
920
|
+
"title": "Suggestion"
|
|
885
921
|
}
|
|
886
922
|
},
|
|
887
923
|
"required": [
|
|
@@ -1077,6 +1113,30 @@ export const CodeReviewStateJsonSchema = {
|
|
|
1077
1113
|
"default": null,
|
|
1078
1114
|
"title": "Line"
|
|
1079
1115
|
},
|
|
1116
|
+
"startLine": {
|
|
1117
|
+
"anyOf": [
|
|
1118
|
+
{
|
|
1119
|
+
"type": "integer"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
"type": "null"
|
|
1123
|
+
}
|
|
1124
|
+
],
|
|
1125
|
+
"default": null,
|
|
1126
|
+
"title": "Startline"
|
|
1127
|
+
},
|
|
1128
|
+
"endLine": {
|
|
1129
|
+
"anyOf": [
|
|
1130
|
+
{
|
|
1131
|
+
"type": "integer"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
"type": "null"
|
|
1135
|
+
}
|
|
1136
|
+
],
|
|
1137
|
+
"default": null,
|
|
1138
|
+
"title": "Endline"
|
|
1139
|
+
},
|
|
1080
1140
|
"snippet": {
|
|
1081
1141
|
"anyOf": [
|
|
1082
1142
|
{
|
|
@@ -1112,6 +1172,18 @@ export const CodeReviewStateJsonSchema = {
|
|
|
1112
1172
|
],
|
|
1113
1173
|
"default": null,
|
|
1114
1174
|
"title": "Counterexample"
|
|
1175
|
+
},
|
|
1176
|
+
"suggestion": {
|
|
1177
|
+
"anyOf": [
|
|
1178
|
+
{
|
|
1179
|
+
"type": "string"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
"type": "null"
|
|
1183
|
+
}
|
|
1184
|
+
],
|
|
1185
|
+
"default": null,
|
|
1186
|
+
"title": "Suggestion"
|
|
1115
1187
|
}
|
|
1116
1188
|
},
|
|
1117
1189
|
"required": [
|
|
@@ -1597,6 +1669,39 @@ export const GetPackageScriptsInputJsonSchema = {
|
|
|
1597
1669
|
"type": "object"
|
|
1598
1670
|
} as const;
|
|
1599
1671
|
|
|
1672
|
+
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) });
|
|
1673
|
+
|
|
1674
|
+
export type GetPrCommitsInput = z.infer<typeof GetPrCommitsInputSchema>;
|
|
1675
|
+
|
|
1676
|
+
export const GetPrCommitsInputJsonSchema = {
|
|
1677
|
+
"properties": {
|
|
1678
|
+
"prNumber": {
|
|
1679
|
+
"description": "The number of the PR to list commits for.",
|
|
1680
|
+
"title": "Prnumber",
|
|
1681
|
+
"type": "integer"
|
|
1682
|
+
},
|
|
1683
|
+
"repo": {
|
|
1684
|
+
"anyOf": [
|
|
1685
|
+
{
|
|
1686
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1687
|
+
"type": "string"
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
"type": "null"
|
|
1691
|
+
}
|
|
1692
|
+
],
|
|
1693
|
+
"default": null,
|
|
1694
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1695
|
+
"title": "Repo"
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
"required": [
|
|
1699
|
+
"prNumber"
|
|
1700
|
+
],
|
|
1701
|
+
"title": "GetPrCommitsInput",
|
|
1702
|
+
"type": "object"
|
|
1703
|
+
} as const;
|
|
1704
|
+
|
|
1600
1705
|
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) });
|
|
1601
1706
|
|
|
1602
1707
|
export type GetPrDiffInput = z.infer<typeof GetPrDiffInputSchema>;
|
|
@@ -1663,6 +1768,39 @@ export const GetPrInputJsonSchema = {
|
|
|
1663
1768
|
"type": "object"
|
|
1664
1769
|
} as const;
|
|
1665
1770
|
|
|
1771
|
+
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) });
|
|
1772
|
+
|
|
1773
|
+
export type GetPrReviewsInput = z.infer<typeof GetPrReviewsInputSchema>;
|
|
1774
|
+
|
|
1775
|
+
export const GetPrReviewsInputJsonSchema = {
|
|
1776
|
+
"properties": {
|
|
1777
|
+
"prNumber": {
|
|
1778
|
+
"description": "The number of the PR to view reviews for.",
|
|
1779
|
+
"title": "Prnumber",
|
|
1780
|
+
"type": "integer"
|
|
1781
|
+
},
|
|
1782
|
+
"repo": {
|
|
1783
|
+
"anyOf": [
|
|
1784
|
+
{
|
|
1785
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1786
|
+
"type": "string"
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
"type": "null"
|
|
1790
|
+
}
|
|
1791
|
+
],
|
|
1792
|
+
"default": null,
|
|
1793
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1794
|
+
"title": "Repo"
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
"required": [
|
|
1798
|
+
"prNumber"
|
|
1799
|
+
],
|
|
1800
|
+
"title": "GetPrReviewsInput",
|
|
1801
|
+
"type": "object"
|
|
1802
|
+
} as const;
|
|
1803
|
+
|
|
1666
1804
|
export const GetRouteMapInputSchema = z.object({ "includeStatic": z.union([z.boolean(), z.null()]).describe("Whether to include static assets in the route map.").default(null) });
|
|
1667
1805
|
|
|
1668
1806
|
export type GetRouteMapInput = z.infer<typeof GetRouteMapInputSchema>;
|
|
@@ -1687,6 +1825,57 @@ export const GetRouteMapInputJsonSchema = {
|
|
|
1687
1825
|
"type": "object"
|
|
1688
1826
|
} as const;
|
|
1689
1827
|
|
|
1828
|
+
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) });
|
|
1829
|
+
|
|
1830
|
+
export type GetWorkflowRunsInput = z.infer<typeof GetWorkflowRunsInputSchema>;
|
|
1831
|
+
|
|
1832
|
+
export const GetWorkflowRunsInputJsonSchema = {
|
|
1833
|
+
"properties": {
|
|
1834
|
+
"branch": {
|
|
1835
|
+
"anyOf": [
|
|
1836
|
+
{
|
|
1837
|
+
"type": "string"
|
|
1838
|
+
},
|
|
1839
|
+
{
|
|
1840
|
+
"type": "null"
|
|
1841
|
+
}
|
|
1842
|
+
],
|
|
1843
|
+
"default": null,
|
|
1844
|
+
"description": "Filter workflow runs by branch name.",
|
|
1845
|
+
"title": "Branch"
|
|
1846
|
+
},
|
|
1847
|
+
"event": {
|
|
1848
|
+
"anyOf": [
|
|
1849
|
+
{
|
|
1850
|
+
"type": "string"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"type": "null"
|
|
1854
|
+
}
|
|
1855
|
+
],
|
|
1856
|
+
"default": null,
|
|
1857
|
+
"description": "Filter workflow runs by event (e.g. push, pull_request).",
|
|
1858
|
+
"title": "Event"
|
|
1859
|
+
},
|
|
1860
|
+
"repo": {
|
|
1861
|
+
"anyOf": [
|
|
1862
|
+
{
|
|
1863
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
1864
|
+
"type": "string"
|
|
1865
|
+
},
|
|
1866
|
+
{
|
|
1867
|
+
"type": "null"
|
|
1868
|
+
}
|
|
1869
|
+
],
|
|
1870
|
+
"default": null,
|
|
1871
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
1872
|
+
"title": "Repo"
|
|
1873
|
+
}
|
|
1874
|
+
},
|
|
1875
|
+
"title": "GetWorkflowRunsInput",
|
|
1876
|
+
"type": "object"
|
|
1877
|
+
} as const;
|
|
1878
|
+
|
|
1690
1879
|
export const HealthCheckInputSchema = z.object({ "checkDeep": z.boolean().describe("Whether to perform a deep health check including external dependencies.").default(false) });
|
|
1691
1880
|
|
|
1692
1881
|
export type HealthCheckInput = z.infer<typeof HealthCheckInputSchema>;
|
|
@@ -2342,7 +2531,7 @@ export const ReadAgentContextInputJsonSchema = {
|
|
|
2342
2531
|
"type": "object"
|
|
2343
2532
|
} as const;
|
|
2344
2533
|
|
|
2345
|
-
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) });
|
|
2534
|
+
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) });
|
|
2346
2535
|
|
|
2347
2536
|
export type ReadCiLogsInput = z.infer<typeof ReadCiLogsInputSchema>;
|
|
2348
2537
|
|
|
@@ -2358,6 +2547,20 @@ export const ReadCiLogsInputJsonSchema = {
|
|
|
2358
2547
|
"description": "Include logs for successful runs (default: false).",
|
|
2359
2548
|
"title": "All",
|
|
2360
2549
|
"type": "boolean"
|
|
2550
|
+
},
|
|
2551
|
+
"repo": {
|
|
2552
|
+
"anyOf": [
|
|
2553
|
+
{
|
|
2554
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
2555
|
+
"type": "string"
|
|
2556
|
+
},
|
|
2557
|
+
{
|
|
2558
|
+
"type": "null"
|
|
2559
|
+
}
|
|
2560
|
+
],
|
|
2561
|
+
"default": null,
|
|
2562
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
2563
|
+
"title": "Repo"
|
|
2361
2564
|
}
|
|
2362
2565
|
},
|
|
2363
2566
|
"required": [
|
|
@@ -2538,7 +2741,7 @@ export const ReadPRCommentsResponseJsonSchema = {
|
|
|
2538
2741
|
"type": "object"
|
|
2539
2742
|
} as const;
|
|
2540
2743
|
|
|
2541
|
-
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) });
|
|
2744
|
+
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) });
|
|
2542
2745
|
|
|
2543
2746
|
export type RepoLogsInput = z.infer<typeof RepoLogsInputSchema>;
|
|
2544
2747
|
|
|
@@ -2561,6 +2764,20 @@ export const RepoLogsInputJsonSchema = {
|
|
|
2561
2764
|
"default": null,
|
|
2562
2765
|
"description": "Optional pattern to filter log lines.",
|
|
2563
2766
|
"title": "Grep"
|
|
2767
|
+
},
|
|
2768
|
+
"repo": {
|
|
2769
|
+
"anyOf": [
|
|
2770
|
+
{
|
|
2771
|
+
"pattern": "^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$",
|
|
2772
|
+
"type": "string"
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
"type": "null"
|
|
2776
|
+
}
|
|
2777
|
+
],
|
|
2778
|
+
"default": null,
|
|
2779
|
+
"description": "The target repository override (e.g. org/repo).",
|
|
2780
|
+
"title": "Repo"
|
|
2564
2781
|
}
|
|
2565
2782
|
},
|
|
2566
2783
|
"required": [
|
|
@@ -2615,7 +2832,7 @@ export const ReviewCommentJsonSchema = {
|
|
|
2615
2832
|
"type": "object"
|
|
2616
2833
|
} as const;
|
|
2617
2834
|
|
|
2618
|
-
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) });
|
|
2835
|
+
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) });
|
|
2619
2836
|
|
|
2620
2837
|
export type ReviewFinding = z.infer<typeof ReviewFindingSchema>;
|
|
2621
2838
|
|
|
@@ -2679,6 +2896,30 @@ export const ReviewFindingJsonSchema = {
|
|
|
2679
2896
|
"default": null,
|
|
2680
2897
|
"title": "Line"
|
|
2681
2898
|
},
|
|
2899
|
+
"startLine": {
|
|
2900
|
+
"anyOf": [
|
|
2901
|
+
{
|
|
2902
|
+
"type": "integer"
|
|
2903
|
+
},
|
|
2904
|
+
{
|
|
2905
|
+
"type": "null"
|
|
2906
|
+
}
|
|
2907
|
+
],
|
|
2908
|
+
"default": null,
|
|
2909
|
+
"title": "Startline"
|
|
2910
|
+
},
|
|
2911
|
+
"endLine": {
|
|
2912
|
+
"anyOf": [
|
|
2913
|
+
{
|
|
2914
|
+
"type": "integer"
|
|
2915
|
+
},
|
|
2916
|
+
{
|
|
2917
|
+
"type": "null"
|
|
2918
|
+
}
|
|
2919
|
+
],
|
|
2920
|
+
"default": null,
|
|
2921
|
+
"title": "Endline"
|
|
2922
|
+
},
|
|
2682
2923
|
"snippet": {
|
|
2683
2924
|
"anyOf": [
|
|
2684
2925
|
{
|
|
@@ -2714,6 +2955,18 @@ export const ReviewFindingJsonSchema = {
|
|
|
2714
2955
|
],
|
|
2715
2956
|
"default": null,
|
|
2716
2957
|
"title": "Counterexample"
|
|
2958
|
+
},
|
|
2959
|
+
"suggestion": {
|
|
2960
|
+
"anyOf": [
|
|
2961
|
+
{
|
|
2962
|
+
"type": "string"
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
"type": "null"
|
|
2966
|
+
}
|
|
2967
|
+
],
|
|
2968
|
+
"default": null,
|
|
2969
|
+
"title": "Suggestion"
|
|
2717
2970
|
}
|
|
2718
2971
|
},
|
|
2719
2972
|
"required": [
|
|
@@ -7,7 +7,7 @@ export const CheckoutBranchInputSchema = z.object({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export async function checkoutBranchHandler(args: z.infer<typeof CheckoutBranchInputSchema>) {
|
|
10
|
-
const result = await runCommand("td
|
|
10
|
+
const result = await runCommand("td", ["gh", "checkout", args.branch], { cwd: args.worktreePath });
|
|
11
11
|
|
|
12
12
|
if (result.exitCode !== 0) {
|
|
13
13
|
throw new Error(`Failed to checkout branch ${args.branch}: ${result.stderr}`);
|
|
@@ -7,7 +7,7 @@ export const CommentTriageSummaryInputSchema = z.object({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export async function commentTriageSummaryHandler(args: z.infer<typeof CommentTriageSummaryInputSchema>) {
|
|
10
|
-
const result = await runCommand("td
|
|
10
|
+
const result = await runCommand("td", [
|
|
11
11
|
"gh",
|
|
12
12
|
"post-comment",
|
|
13
13
|
"--pr", args.prNumber.toString(),
|
|
@@ -23,11 +23,11 @@ describe("github.create_issue", () => {
|
|
|
23
23
|
stderr: "",
|
|
24
24
|
exitCode: 0,
|
|
25
25
|
durationMs: 10,
|
|
26
|
-
command: "td
|
|
26
|
+
command: "td gh create-issue --title 'Test Issue' --body 'Test Body'"
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
const result = await createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null });
|
|
30
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
30
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
31
31
|
"gh",
|
|
32
32
|
"create-issue",
|
|
33
33
|
"--title",
|
|
@@ -58,7 +58,7 @@ describe("github.create_issue", () => {
|
|
|
58
58
|
stderr: "",
|
|
59
59
|
exitCode: 0,
|
|
60
60
|
durationMs: 10,
|
|
61
|
-
command: "td
|
|
61
|
+
command: "td gh create-issue --title 'Cross Repo Issue' --body 'Body' --repo 'org/other-repo'"
|
|
62
62
|
});
|
|
63
63
|
|
|
64
64
|
const result = await createIssueHandler({
|
|
@@ -68,7 +68,7 @@ describe("github.create_issue", () => {
|
|
|
68
68
|
repo: "org/other-repo"
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
71
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
72
72
|
"gh",
|
|
73
73
|
"create-issue",
|
|
74
74
|
"--title",
|
|
@@ -88,7 +88,7 @@ describe("github.create_issue", () => {
|
|
|
88
88
|
stderr: "Auth failed",
|
|
89
89
|
exitCode: 1,
|
|
90
90
|
durationMs: 10,
|
|
91
|
-
command: "td
|
|
91
|
+
command: "td gh create-issue"
|
|
92
92
|
});
|
|
93
93
|
|
|
94
94
|
await expect(createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null })).rejects.toThrow("Failed to create issue: Auth failed");
|
|
@@ -105,7 +105,7 @@ describe("github.create_issue", () => {
|
|
|
105
105
|
stderr: "",
|
|
106
106
|
exitCode: 0,
|
|
107
107
|
durationMs: 10,
|
|
108
|
-
command: "td
|
|
108
|
+
command: "td gh create-issue"
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
await expect(createIssueHandler({ title: "Test Issue", body: "Test Body", file: null, repo: null })).rejects.toThrow("Failed to create issue: Repo not found");
|
|
@@ -15,7 +15,7 @@ export async function createIssueHandler(args: z.input<typeof CreateIssueInputSc
|
|
|
15
15
|
if (params.file) cmdArgs.push("--file", params.file);
|
|
16
16
|
cmdArgs.push("--repo", targetRepo);
|
|
17
17
|
|
|
18
|
-
const result = await runCommand("td
|
|
18
|
+
const result = await runCommand("td", cmdArgs);
|
|
19
19
|
|
|
20
20
|
if (result.exitCode !== 0) {
|
|
21
21
|
throw new Error(`Failed to create issue: ${sanitizeError(result.stderr)}`);
|
|
@@ -21,7 +21,7 @@ describe("github.create_pull_request", () => {
|
|
|
21
21
|
stderr: "",
|
|
22
22
|
exitCode: 0,
|
|
23
23
|
durationMs: 10,
|
|
24
|
-
command: "td
|
|
24
|
+
command: "td gh create-pr --title 'PR' --body 'Body' --head 'feature' --base 'main'"
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const result = await createPullRequestHandler({
|
|
@@ -50,7 +50,7 @@ describe("github.create_pull_request", () => {
|
|
|
50
50
|
stderr: "",
|
|
51
51
|
exitCode: 0,
|
|
52
52
|
durationMs: 10,
|
|
53
|
-
command: "td
|
|
53
|
+
command: "td gh create-pr --title 'PR' --body 'Body' --head 'feature' --base 'main' --repo 'org/other-repo'"
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
const result = await createPullRequestHandler({
|
|
@@ -62,7 +62,7 @@ describe("github.create_pull_request", () => {
|
|
|
62
62
|
repo: "org/other-repo"
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
expect(shell.runCommand).toHaveBeenCalledWith("td
|
|
65
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
66
66
|
"gh",
|
|
67
67
|
"create-pr",
|
|
68
68
|
"--title",
|
|
@@ -91,7 +91,7 @@ describe("github.create_pull_request", () => {
|
|
|
91
91
|
stderr: "",
|
|
92
92
|
exitCode: 0,
|
|
93
93
|
durationMs: 10,
|
|
94
|
-
command: "td
|
|
94
|
+
command: "td gh create-pr"
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
await expect(createPullRequestHandler({
|
|
@@ -23,7 +23,7 @@ export async function createPullRequestHandler(args: z.input<typeof CreatePullRe
|
|
|
23
23
|
tdArgs.push("--draft");
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const result = await runCommand("td
|
|
26
|
+
const result = await runCommand("td", tdArgs);
|
|
27
27
|
|
|
28
28
|
if (result.exitCode !== 0) {
|
|
29
29
|
// Attempt to parse stdout as JSON to see if there's a structured error message
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { getMergeConflictFiles } from "../lib/git.js";
|
|
3
3
|
|
|
4
4
|
export const GetMergeConflictFilesInputSchema = z.object({
|
|
5
|
-
prNumber: z.number(),
|
|
5
|
+
prNumber: z.number().optional(),
|
|
6
6
|
baseBranch: z.string().optional().default("main"),
|
|
7
|
+
headRef: z.string().optional().default("HEAD"),
|
|
7
8
|
});
|
|
8
9
|
|
|
9
10
|
export async function getMergeConflictFilesHandler(args: z.infer<typeof GetMergeConflictFilesInputSchema>) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]);
|
|
14
|
-
|
|
15
|
-
if (result.exitCode !== 0) {
|
|
16
|
-
throw new Error(`Failed to get merge conflicts: ${result.stderr}`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const output = JSON.parse(result.stdout);
|
|
20
|
-
if (output.status === "error") {
|
|
21
|
-
throw new Error(`Failed to get merge conflicts: ${output.message}`);
|
|
22
|
-
}
|
|
11
|
+
const baseBranch = args.baseBranch || "main";
|
|
12
|
+
const headRef = args.headRef || "HEAD";
|
|
13
|
+
const conflictFiles = await getMergeConflictFiles(baseBranch, headRef);
|
|
23
14
|
|
|
24
15
|
return {
|
|
25
|
-
prNumber:
|
|
26
|
-
baseBranch
|
|
27
|
-
headRef
|
|
28
|
-
conflictFiles
|
|
29
|
-
commandLog: output.commandLog
|
|
16
|
+
prNumber: args.prNumber,
|
|
17
|
+
baseBranch,
|
|
18
|
+
headRef,
|
|
19
|
+
conflictFiles,
|
|
30
20
|
};
|
|
31
21
|
}
|
|
@@ -12,7 +12,7 @@ export async function getPrHandler(args: z.infer<typeof GetPrInputSchema>) {
|
|
|
12
12
|
const params = GetPrInputSchema.parse(args);
|
|
13
13
|
const targetRepo = resolveRepo(params.repo);
|
|
14
14
|
|
|
15
|
-
const result = await runCommand("td
|
|
15
|
+
const result = await runCommand("td", ["gh", "view", params.prNumber.toString(), "--repo", targetRepo]);
|
|
16
16
|
|
|
17
17
|
if (result.exitCode !== 0) {
|
|
18
18
|
throw new Error(`Failed to get PR details: ${sanitizeError(result.stderr)}`);
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
6
|
+
const GetPrCommitsInputSchema = z.object({
|
|
7
|
+
prNumber: z.number().describe("The number of the PR to list commits for."),
|
|
8
|
+
repo: z.string().optional().describe("The target repository override (e.g. org/repo)."),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export async function getPrCommitsHandler(args: z.infer<typeof GetPrCommitsInputSchema>) {
|
|
12
|
+
const params = GetPrCommitsInputSchema.parse(args);
|
|
13
|
+
const targetRepo = resolveRepo(params.repo);
|
|
14
|
+
|
|
15
|
+
const result = await runCommand("td", ["gh", "list-pr-commits", "--pr-number", params.prNumber.toString(), "--repo", targetRepo]);
|
|
16
|
+
|
|
17
|
+
if (result.exitCode !== 0) {
|
|
18
|
+
throw new Error(`Failed to list PR commits: ${sanitizeError(result.stderr)}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const output = JSON.parse(result.stdout);
|
|
22
|
+
if (output.status === "error") {
|
|
23
|
+
throw new Error(`Failed to list PR commits: ${output.message}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return { commits: output.commits };
|
|
27
|
+
}
|
|
@@ -11,7 +11,7 @@ export async function getPrDiffHandler(args: z.infer<typeof GetPrDiffInputSchema
|
|
|
11
11
|
const params = GetPrDiffInputSchema.parse(args);
|
|
12
12
|
const targetRepo = resolveRepo(params.repo);
|
|
13
13
|
|
|
14
|
-
const result = await runCommand("td
|
|
14
|
+
const result = await runCommand("td", [
|
|
15
15
|
"gh", "pr-diff", params.prNumber.toString(), "--repo", targetRepo
|
|
16
16
|
]);
|
|
17
17
|
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
|
|
7
|
+
vi.mock("../lib/shell.js", () => ({
|
|
8
|
+
runCommand: vi.fn(),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
describe("MCP GitHub tools", () => {
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
vi.clearAllMocks();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe("getPrReviewsHandler", () => {
|
|
17
|
+
it("should fetch PR reviews via td gh read-pr-reviews", async () => {
|
|
18
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
19
|
+
stdout: JSON.stringify({
|
|
20
|
+
status: "success",
|
|
21
|
+
reviews: [{ id: 1, state: "APPROVED", body: "LGTM" }],
|
|
22
|
+
review_count: 1,
|
|
23
|
+
}),
|
|
24
|
+
stderr: "",
|
|
25
|
+
exitCode: 0,
|
|
26
|
+
durationMs: 10,
|
|
27
|
+
command: "td gh read-pr-reviews",
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const res = await getPrReviewsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
31
|
+
|
|
32
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
33
|
+
"gh",
|
|
34
|
+
"read-pr-reviews",
|
|
35
|
+
"--pr-number",
|
|
36
|
+
"819",
|
|
37
|
+
"--repo",
|
|
38
|
+
"arii/boomtick",
|
|
39
|
+
]);
|
|
40
|
+
expect(res).toEqual({
|
|
41
|
+
reviews: [{ id: 1, state: "APPROVED", body: "LGTM" }],
|
|
42
|
+
reviewCount: 1,
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe("getPrCommitsHandler", () => {
|
|
48
|
+
it("should list PR commits via td gh list-pr-commits", async () => {
|
|
49
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
50
|
+
stdout: JSON.stringify({
|
|
51
|
+
status: "success",
|
|
52
|
+
commits: [{ sha: "abc1234", author: "Dev", message: "feat: test" }],
|
|
53
|
+
}),
|
|
54
|
+
stderr: "",
|
|
55
|
+
exitCode: 0,
|
|
56
|
+
durationMs: 10,
|
|
57
|
+
command: "td gh list-pr-commits",
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const res = await getPrCommitsHandler({ prNumber: 819, repo: "arii/boomtick" });
|
|
61
|
+
|
|
62
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
63
|
+
"gh",
|
|
64
|
+
"list-pr-commits",
|
|
65
|
+
"--pr-number",
|
|
66
|
+
"819",
|
|
67
|
+
"--repo",
|
|
68
|
+
"arii/boomtick",
|
|
69
|
+
]);
|
|
70
|
+
expect(res).toEqual({
|
|
71
|
+
commits: [{ sha: "abc1234", author: "Dev", message: "feat: test" }],
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe("getWorkflowRunsHandler", () => {
|
|
77
|
+
it("should fetch workflow runs via td repo workflow-runs", async () => {
|
|
78
|
+
vi.mocked(shell.runCommand).mockResolvedValueOnce({
|
|
79
|
+
stdout: JSON.stringify({
|
|
80
|
+
status: "success",
|
|
81
|
+
workflow_runs: [{ id: 10, name: "CI" }],
|
|
82
|
+
}),
|
|
83
|
+
stderr: "",
|
|
84
|
+
exitCode: 0,
|
|
85
|
+
durationMs: 10,
|
|
86
|
+
command: "td repo workflow-runs",
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const res = await getWorkflowRunsHandler({
|
|
90
|
+
branch: "main",
|
|
91
|
+
event: "push",
|
|
92
|
+
repo: "arii/boomtick",
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
expect(shell.runCommand).toHaveBeenCalledWith("td", [
|
|
96
|
+
"repo",
|
|
97
|
+
"workflow-runs",
|
|
98
|
+
"--repo",
|
|
99
|
+
"arii/boomtick",
|
|
100
|
+
"--branch",
|
|
101
|
+
"main",
|
|
102
|
+
"--event",
|
|
103
|
+
"push",
|
|
104
|
+
]);
|
|
105
|
+
expect(res).toEqual({
|
|
106
|
+
workflowRuns: [{ id: 10, name: "CI" }],
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
});
|