@@ -19,10 +19,14 @@ type Toolset string
19
19
const (
20
20
ToolsetContext Toolset = "context"
21
21
ToolsetRepos Toolset = "repos"
22
+ ToolsetContents Toolset = "contents"
23
+ ToolsetReleases Toolset = "releases"
22
24
ToolsetIssues Toolset = "issues"
25
+ ToolsetSubIssues Toolset = "sub_issues"
23
26
ToolsetUsers Toolset = "users"
24
27
ToolsetOrgs Toolset = "orgs"
25
28
ToolsetPullRequests Toolset = "pull_requests"
29
+ ToolsetPullRequestReviews Toolset = "pull_request_reviews"
26
30
ToolsetCodeSecurity Toolset = "code_security"
27
31
ToolsetSecretProtection Toolset = "secret_protection"
28
32
ToolsetDependabot Toolset = "dependabot"
@@ -37,35 +41,33 @@ const (
37
41
ToolsetDynamic Toolset = "dynamic"
38
42
)
39
43
40
- // DefaultTools contains the default toolsets to enable
41
- var DefaultTools = []Toolset {ToolsetContext ,ToolsetRepos ,ToolsetIssues ,ToolsetPullRequests }
44
+ // DefaultToolsets contains the default toolsets to enable
45
+ var DefaultToolsets = []Toolset {ToolsetContext ,ToolsetRepos ,ToolsetIssues ,ToolsetPullRequests }
46
+
47
+ // DefaultTools returns the default toolset names as strings for CLI flags
48
+ func DefaultTools () []string {
49
+ return []string {string (ToolsetContext ),string (ToolsetRepos ),string (ToolsetIssues ),string (ToolsetPullRequests )}
50
+ }
42
51
43
52
func DefaultToolsetGroup (readOnly bool ,getClient GetClientFn ,getGQLClient GetGQLClientFn ,getRawClient raw.GetRawClientFn ,t translations.TranslationHelperFunc ,contentWindowSize int )* toolsets.ToolsetGroup {
44
53
tsg := toolsets .NewToolsetGroup (readOnly )
45
54
46
55
// Define all available features with their default state (disabled)
47
56
// Create toolsets
48
- repos := toolsets .NewToolset (string (ToolsetRepos ),"GitHub Repositoryrelated tools " ).
57
+ repos := toolsets .NewToolset (string (ToolsetRepos ),"GitHub Repositorymanagement - search, create, fork, branches, commits, tags " ).
49
58
AddReadTools (
50
59
toolsets .NewServerTool (SearchRepositories (getClient ,t )),
51
- toolsets .NewServerTool (GetFileContents (getClient ,getRawClient ,t )),
52
60
toolsets .NewServerTool (ListCommits (getClient ,t )),
53
61
toolsets .NewServerTool (SearchCode (getClient ,t )),
54
62
toolsets .NewServerTool (GetCommit (getClient ,t )),
55
63
toolsets .NewServerTool (ListBranches (getClient ,t )),
56
64
toolsets .NewServerTool (ListTags (getClient ,t )),
57
65
toolsets .NewServerTool (GetTag (getClient ,t )),
58
- toolsets .NewServerTool (ListReleases (getClient ,t )),
59
- toolsets .NewServerTool (GetLatestRelease (getClient ,t )),
60
- toolsets .NewServerTool (GetReleaseByTag (getClient ,t )),
61
66
).
62
67
AddWriteTools (
63
- toolsets .NewServerTool (CreateOrUpdateFile (getClient ,t )),
64
68
toolsets .NewServerTool (CreateRepository (getClient ,t )),
65
69
toolsets .NewServerTool (ForkRepository (getClient ,t )),
66
70
toolsets .NewServerTool (CreateBranch (getClient ,t )),
67
- toolsets .NewServerTool (PushFiles (getClient ,t )),
68
- toolsets .NewServerTool (DeleteFile (getClient ,t )),
69
71
).
70
72
AddResourceTemplates (
71
73
toolsets .NewServerResourceTemplate (GetRepositoryResourceContent (getClient ,getRawClient ,t )),
@@ -74,27 +76,51 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
74
76
toolsets .NewServerResourceTemplate (GetRepositoryResourceTagContent (getClient ,getRawClient ,t )),
75
77
toolsets .NewServerResourceTemplate (GetRepositoryResourcePrContent (getClient ,getRawClient ,t )),
76
78
)
77
- issues := toolsets .NewToolset (string (ToolsetIssues ),"GitHub Issues related tools" ).
79
+
80
+ contents := toolsets .NewToolset (string (ToolsetContents ),"Repository contents - get, create, update, delete files and directories" ).
81
+ AddReadTools (
82
+ toolsets .NewServerTool (GetFileContents (getClient ,getRawClient ,t )),
83
+ ).
84
+ AddWriteTools (
85
+ toolsets .NewServerTool (CreateOrUpdateFile (getClient ,t )),
86
+ toolsets .NewServerTool (PushFiles (getClient ,t )),
87
+ toolsets .NewServerTool (DeleteFile (getClient ,t )),
88
+ )
89
+
90
+ releases := toolsets .NewToolset (string (ToolsetReleases ),"GitHub Repository releases - list, get, and manage releases" ).
91
+ AddReadTools (
92
+ toolsets .NewServerTool (ListReleases (getClient ,t )),
93
+ toolsets .NewServerTool (GetLatestRelease (getClient ,t )),
94
+ toolsets .NewServerTool (GetReleaseByTag (getClient ,t )),
95
+ )
96
+
97
+ issues := toolsets .NewToolset (string (ToolsetIssues ),"GitHub Issues - create, read, update, comment on issues" ).
78
98
AddReadTools (
79
99
toolsets .NewServerTool (GetIssue (getClient ,t )),
80
100
toolsets .NewServerTool (SearchIssues (getClient ,t )),
81
101
toolsets .NewServerTool (ListIssues (getGQLClient ,t )),
82
102
toolsets .NewServerTool (GetIssueComments (getClient ,t )),
83
103
toolsets .NewServerTool (ListIssueTypes (getClient ,t )),
84
- toolsets .NewServerTool (ListSubIssues (getClient ,t )),
85
104
).
86
105
AddWriteTools (
87
106
toolsets .NewServerTool (CreateIssue (getClient ,t )),
88
107
toolsets .NewServerTool (AddIssueComment (getClient ,t )),
89
108
toolsets .NewServerTool (UpdateIssue (getClient ,getGQLClient ,t )),
90
109
toolsets .NewServerTool (AssignCopilotToIssue (getGQLClient ,t )),
91
- toolsets .NewServerTool (AddSubIssue (getClient ,t )),
92
- toolsets .NewServerTool (RemoveSubIssue (getClient ,t )),
93
- toolsets .NewServerTool (ReprioritizeSubIssue (getClient ,t )),
94
110
).AddPrompts (
95
111
toolsets .NewServerPrompt (AssignCodingAgentPrompt (t )),
96
112
toolsets .NewServerPrompt (IssueToFixWorkflowPrompt (t )),
97
113
)
114
+
115
+ subIssues := toolsets .NewToolset (string (ToolsetSubIssues ),"Sub-issue management - create, manage, and organize sub-issues" ).
116
+ AddReadTools (
117
+ toolsets .NewServerTool (ListSubIssues (getClient ,t )),
118
+ ).
119
+ AddWriteTools (
120
+ toolsets .NewServerTool (AddSubIssue (getClient ,t )),
121
+ toolsets .NewServerTool (RemoveSubIssue (getClient ,t )),
122
+ toolsets .NewServerTool (ReprioritizeSubIssue (getClient ,t )),
123
+ )
98
124
users := toolsets .NewToolset (string (ToolsetUsers ),"GitHub User related tools" ).
99
125
AddReadTools (
100
126
toolsets .NewServerTool (SearchUsers (getClient ,t )),
@@ -103,25 +129,29 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
103
129
AddReadTools (
104
130
toolsets .NewServerTool (SearchOrgs (getClient ,t )),
105
131
)
106
- pullRequests := toolsets .NewToolset (string (ToolsetPullRequests ),"GitHub Pull Requestrelated tools " ).
132
+ pullRequests := toolsets .NewToolset (string (ToolsetPullRequests ),"GitHub Pull Requestoperations - create, read, update, merge " ).
107
133
AddReadTools (
108
134
toolsets .NewServerTool (GetPullRequest (getClient ,t )),
109
135
toolsets .NewServerTool (ListPullRequests (getClient ,t )),
110
136
toolsets .NewServerTool (GetPullRequestFiles (getClient ,t )),
111
137
toolsets .NewServerTool (SearchPullRequests (getClient ,t )),
112
138
toolsets .NewServerTool (GetPullRequestStatus (getClient ,t )),
113
- toolsets .NewServerTool (GetPullRequestReviewComments (getClient ,t )),
114
- toolsets .NewServerTool (GetPullRequestReviews (getClient ,t )),
115
139
toolsets .NewServerTool (GetPullRequestDiff (getClient ,t )),
116
140
).
117
141
AddWriteTools (
118
- toolsets .NewServerTool (MergePullRequest (getClient ,t )),
119
- toolsets .NewServerTool (UpdatePullRequestBranch (getClient ,t )),
120
142
toolsets .NewServerTool (CreatePullRequest (getClient ,t )),
121
143
toolsets .NewServerTool (UpdatePullRequest (getClient ,getGQLClient ,t )),
122
- toolsets .NewServerTool (RequestCopilotReview (getClient ,t )),
144
+ toolsets .NewServerTool (MergePullRequest (getClient ,t )),
145
+ toolsets .NewServerTool (UpdatePullRequestBranch (getClient ,t )),
146
+ )
123
147
124
- // Reviews
148
+ pullRequestReviews := toolsets .NewToolset (string (ToolsetPullRequestReviews ),"Pull request review operations - create, submit, manage reviews" ).
149
+ AddReadTools (
150
+ toolsets .NewServerTool (GetPullRequestReviewComments (getClient ,t )),
151
+ toolsets .NewServerTool (GetPullRequestReviews (getClient ,t )),
152
+ ).
153
+ AddWriteTools (
154
+ toolsets .NewServerTool (RequestCopilotReview (getClient ,t )),
125
155
toolsets .NewServerTool (CreateAndSubmitPullRequestReview (getGQLClient ,t )),
126
156
toolsets .NewServerTool (CreatePendingPullRequestReview (getGQLClient ,t )),
127
157
toolsets .NewServerTool (AddCommentToPendingReview (getGQLClient ,t )),
@@ -225,10 +255,14 @@ func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetG
225
255
// Add toolsets to the group
226
256
tsg .AddToolset (contextTools )
227
257
tsg .AddToolset (repos )
258
+ tsg .AddToolset (contents )
259
+ tsg .AddToolset (releases )
228
260
tsg .AddToolset (issues )
261
+ tsg .AddToolset (subIssues )
229
262
tsg .AddToolset (orgs )
230
263
tsg .AddToolset (users )
231
264
tsg .AddToolset (pullRequests )
265
+ tsg .AddToolset (pullRequestReviews )
232
266
tsg .AddToolset (actions )
233
267
tsg .AddToolset (codeSecurity )
234
268
tsg .AddToolset (secretProtection )