@ldraney/github-mcp 0.1.0 → 0.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -2
- package/dist/prompts/activity-summary.d.ts +10 -0
- package/dist/prompts/activity-summary.js +154 -0
- package/dist/prompts/code-review.d.ts +9 -0
- package/dist/prompts/code-review.js +145 -0
- package/dist/prompts/issue-triage.d.ts +9 -0
- package/dist/prompts/issue-triage.js +202 -0
- package/dist/prompts/release-notes.d.ts +9 -0
- package/dist/prompts/release-notes.js +236 -0
- package/dist/server.d.ts +8 -1
- package/dist/server.js +36 -210
- package/dist/tools/categories/actions.d.ts +2 -5
- package/dist/tools/categories/actions.js +640 -369
- package/dist/tools/categories/activity.d.ts +2 -0
- package/dist/tools/categories/activity.js +534 -0
- package/dist/tools/categories/apps.d.ts +2 -0
- package/dist/tools/categories/apps.js +224 -0
- package/dist/tools/categories/billing.d.ts +2 -0
- package/dist/tools/categories/billing.js +145 -0
- package/dist/tools/categories/checks.d.ts +2 -0
- package/dist/tools/categories/checks.js +554 -0
- package/dist/tools/categories/codeScanning.d.ts +2 -0
- package/dist/tools/categories/codeScanning.js +375 -0
- package/dist/tools/categories/codeSecurity.d.ts +2 -0
- package/dist/tools/categories/codeSecurity.js +463 -0
- package/dist/tools/categories/codesOfConduct.d.ts +2 -0
- package/dist/tools/categories/codesOfConduct.js +45 -0
- package/dist/tools/categories/codespaces.d.ts +2 -0
- package/dist/tools/categories/codespaces.js +259 -0
- package/dist/tools/categories/copilot.d.ts +2 -0
- package/dist/tools/categories/copilot.js +187 -0
- package/dist/tools/categories/dependabot.d.ts +2 -0
- package/dist/tools/categories/dependabot.js +454 -0
- package/dist/tools/categories/emojis.d.ts +2 -0
- package/dist/tools/categories/emojis.js +22 -0
- package/dist/tools/categories/gists.d.ts +2 -5
- package/dist/tools/categories/gists.js +474 -285
- package/dist/tools/categories/git.d.ts +2 -0
- package/dist/tools/categories/git.js +520 -0
- package/dist/tools/categories/gitignore.d.ts +2 -0
- package/dist/tools/categories/gitignore.js +45 -0
- package/dist/tools/categories/index.d.ts +33 -0
- package/dist/tools/categories/index.js +33 -0
- package/dist/tools/categories/interactions.d.ts +2 -0
- package/dist/tools/categories/interactions.js +184 -0
- package/dist/tools/categories/issues.d.ts +2 -5
- package/dist/tools/categories/issues.js +692 -390
- package/dist/tools/categories/licenses.d.ts +2 -0
- package/dist/tools/categories/licenses.js +95 -0
- package/dist/tools/categories/markdown.d.ts +2 -0
- package/dist/tools/categories/markdown.js +64 -0
- package/dist/tools/categories/meta.d.ts +2 -0
- package/dist/tools/categories/meta.js +74 -0
- package/dist/tools/categories/migrations.d.ts +2 -0
- package/dist/tools/categories/migrations.js +290 -0
- package/dist/tools/categories/orgs.d.ts +2 -5
- package/dist/tools/categories/orgs.js +585 -417
- package/dist/tools/categories/packages.d.ts +2 -0
- package/dist/tools/categories/packages.js +918 -0
- package/dist/tools/categories/projects.d.ts +2 -0
- package/dist/tools/categories/projects.js +692 -0
- package/dist/tools/categories/pulls.d.ts +2 -5
- package/dist/tools/categories/pulls.js +715 -332
- package/dist/tools/categories/rateLimit.d.ts +2 -0
- package/dist/tools/categories/rateLimit.js +22 -0
- package/dist/tools/categories/reactions.d.ts +2 -0
- package/dist/tools/categories/reactions.js +385 -0
- package/dist/tools/categories/repos.d.ts +2 -5
- package/dist/tools/categories/repos.js +844 -366
- package/dist/tools/categories/search.d.ts +2 -5
- package/dist/tools/categories/search.js +294 -196
- package/dist/tools/categories/secretScanning.d.ts +2 -0
- package/dist/tools/categories/secretScanning.js +324 -0
- package/dist/tools/categories/securityAdvisories.d.ts +2 -0
- package/dist/tools/categories/securityAdvisories.js +407 -0
- package/dist/tools/categories/teams.d.ts +2 -0
- package/dist/tools/categories/teams.js +614 -0
- package/dist/tools/categories/users.d.ts +2 -5
- package/dist/tools/categories/users.js +474 -247
- package/dist/tools/generator.d.ts +35 -15
- package/dist/tools/generator.js +113 -57
- package/dist/tools/types.d.ts +63 -0
- package/dist/tools/types.js +17 -0
- package/package.json +1 -1
|
@@ -1,452 +1,620 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { successResult } from '../types.js';
|
|
2
|
+
export const orgsCategory = {
|
|
3
|
+
name: 'orgs',
|
|
4
|
+
description: 'GitHub organization tools',
|
|
5
|
+
tools: [
|
|
6
|
+
// list - List organizations for authenticated user
|
|
7
|
+
{
|
|
8
|
+
definition: {
|
|
9
|
+
name: 'github_orgs_list',
|
|
10
|
+
description: 'List organizations for the authenticated user',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
per_page: {
|
|
15
|
+
type: 'number',
|
|
16
|
+
description: 'Results per page (max 100)',
|
|
17
|
+
},
|
|
18
|
+
page: {
|
|
19
|
+
type: 'number',
|
|
20
|
+
description: 'Page number',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
handler: async (octokit, args) => {
|
|
26
|
+
const { data } = await octokit.orgs.listForAuthenticatedUser({
|
|
27
|
+
per_page: args.per_page,
|
|
28
|
+
page: args.page,
|
|
29
|
+
});
|
|
30
|
+
return successResult(data);
|
|
10
31
|
},
|
|
11
32
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
required: ['org'],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'github_orgs_update',
|
|
39
|
-
description: 'Update an organization',
|
|
40
|
-
inputSchema: {
|
|
41
|
-
type: 'object',
|
|
42
|
-
properties: {
|
|
43
|
-
org: { type: 'string', description: 'Organization name' },
|
|
44
|
-
billing_email: { type: 'string', description: 'Billing email address' },
|
|
45
|
-
company: { type: 'string', description: 'Company name' },
|
|
46
|
-
email: { type: 'string', description: 'Public email' },
|
|
47
|
-
twitter_username: { type: 'string', description: 'Twitter username' },
|
|
48
|
-
location: { type: 'string', description: 'Location' },
|
|
49
|
-
name: { type: 'string', description: 'Display name' },
|
|
50
|
-
description: { type: 'string', description: 'Organization description' },
|
|
51
|
-
default_repository_permission: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
enum: ['read', 'write', 'admin', 'none'],
|
|
54
|
-
description: 'Default permission for new repos',
|
|
33
|
+
// list_for_user - List organizations for a user
|
|
34
|
+
{
|
|
35
|
+
definition: {
|
|
36
|
+
name: 'github_orgs_list_for_user',
|
|
37
|
+
description: 'List public organizations for a user',
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: 'object',
|
|
40
|
+
properties: {
|
|
41
|
+
username: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'GitHub username',
|
|
44
|
+
},
|
|
45
|
+
per_page: {
|
|
46
|
+
type: 'number',
|
|
47
|
+
description: 'Results per page (max 100)',
|
|
48
|
+
},
|
|
49
|
+
page: {
|
|
50
|
+
type: 'number',
|
|
51
|
+
description: 'Page number',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ['username'],
|
|
55
55
|
},
|
|
56
|
-
members_can_create_repositories: { type: 'boolean' },
|
|
57
56
|
},
|
|
58
|
-
|
|
57
|
+
handler: async (octokit, args) => {
|
|
58
|
+
const { data } = await octokit.orgs.listForUser({
|
|
59
|
+
username: args.username,
|
|
60
|
+
per_page: args.per_page,
|
|
61
|
+
page: args.page,
|
|
62
|
+
});
|
|
63
|
+
return successResult(data);
|
|
64
|
+
},
|
|
59
65
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
// get - Get an organization
|
|
67
|
+
{
|
|
68
|
+
definition: {
|
|
69
|
+
name: 'github_orgs_get',
|
|
70
|
+
description: 'Get an organization by name',
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
org: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'Organization name',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['org'],
|
|
72
80
|
},
|
|
73
|
-
role: {
|
|
74
|
-
type: 'string',
|
|
75
|
-
enum: ['all', 'admin', 'member'],
|
|
76
|
-
description: 'Filter by role',
|
|
77
|
-
},
|
|
78
|
-
per_page: { type: 'number' },
|
|
79
|
-
page: { type: 'number' },
|
|
80
81
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
inputSchema: {
|
|
88
|
-
type: 'object',
|
|
89
|
-
properties: {
|
|
90
|
-
org: { type: 'string', description: 'Organization name' },
|
|
91
|
-
username: { type: 'string', description: 'GitHub username' },
|
|
92
|
-
},
|
|
93
|
-
required: ['org', 'username'],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: 'github_orgs_getMembership',
|
|
98
|
-
description: 'Get organization membership for a user',
|
|
99
|
-
inputSchema: {
|
|
100
|
-
type: 'object',
|
|
101
|
-
properties: {
|
|
102
|
-
org: { type: 'string', description: 'Organization name' },
|
|
103
|
-
username: { type: 'string', description: 'GitHub username' },
|
|
104
|
-
},
|
|
105
|
-
required: ['org', 'username'],
|
|
82
|
+
handler: async (octokit, args) => {
|
|
83
|
+
const { data } = await octokit.orgs.get({
|
|
84
|
+
org: args.org,
|
|
85
|
+
});
|
|
86
|
+
return successResult(data);
|
|
87
|
+
},
|
|
106
88
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
89
|
+
// update - Update an organization
|
|
90
|
+
{
|
|
91
|
+
definition: {
|
|
92
|
+
name: 'github_orgs_update',
|
|
93
|
+
description: 'Update an organization',
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: {
|
|
97
|
+
org: {
|
|
98
|
+
type: 'string',
|
|
99
|
+
description: 'Organization name',
|
|
100
|
+
},
|
|
101
|
+
billing_email: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
description: 'Billing email address',
|
|
104
|
+
},
|
|
105
|
+
company: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
description: 'Company name',
|
|
108
|
+
},
|
|
109
|
+
email: {
|
|
110
|
+
type: 'string',
|
|
111
|
+
description: 'Public email address',
|
|
112
|
+
},
|
|
113
|
+
location: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
description: 'Location',
|
|
116
|
+
},
|
|
117
|
+
name: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
description: 'Display name',
|
|
120
|
+
},
|
|
121
|
+
description: {
|
|
122
|
+
type: 'string',
|
|
123
|
+
description: 'Organization description',
|
|
124
|
+
},
|
|
125
|
+
default_repository_permission: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
enum: ['read', 'write', 'admin', 'none'],
|
|
128
|
+
description: 'Default repository permission for members',
|
|
129
|
+
},
|
|
130
|
+
members_can_create_repositories: {
|
|
131
|
+
type: 'string',
|
|
132
|
+
enum: ['true', 'false'],
|
|
133
|
+
description: 'Whether members can create repositories',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
required: ['org'],
|
|
120
137
|
},
|
|
121
138
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: 'github_orgs_listTeams',
|
|
139
|
-
description: 'List teams in an organization',
|
|
140
|
-
inputSchema: {
|
|
141
|
-
type: 'object',
|
|
142
|
-
properties: {
|
|
143
|
-
org: { type: 'string', description: 'Organization name' },
|
|
144
|
-
per_page: { type: 'number' },
|
|
145
|
-
page: { type: 'number' },
|
|
146
|
-
},
|
|
147
|
-
required: ['org'],
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'github_orgs_getTeam',
|
|
152
|
-
description: 'Get a team by slug',
|
|
153
|
-
inputSchema: {
|
|
154
|
-
type: 'object',
|
|
155
|
-
properties: {
|
|
156
|
-
org: { type: 'string', description: 'Organization name' },
|
|
157
|
-
team_slug: { type: 'string', description: 'Team slug' },
|
|
158
|
-
},
|
|
159
|
-
required: ['org', 'team_slug'],
|
|
139
|
+
handler: async (octokit, args) => {
|
|
140
|
+
const { data } = await octokit.orgs.update({
|
|
141
|
+
org: args.org,
|
|
142
|
+
billing_email: args.billing_email,
|
|
143
|
+
company: args.company,
|
|
144
|
+
email: args.email,
|
|
145
|
+
location: args.location,
|
|
146
|
+
name: args.name,
|
|
147
|
+
description: args.description,
|
|
148
|
+
default_repository_permission: args.default_repository_permission,
|
|
149
|
+
members_can_create_repositories: args.members_can_create_repositories !== undefined ? args.members_can_create_repositories === 'true' : undefined,
|
|
150
|
+
});
|
|
151
|
+
return successResult(data);
|
|
152
|
+
},
|
|
160
153
|
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
154
|
+
// list_members - List organization members
|
|
155
|
+
{
|
|
156
|
+
definition: {
|
|
157
|
+
name: 'github_orgs_list_members',
|
|
158
|
+
description: 'List members of an organization',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
properties: {
|
|
162
|
+
org: {
|
|
163
|
+
type: 'string',
|
|
164
|
+
description: 'Organization name',
|
|
165
|
+
},
|
|
166
|
+
filter: {
|
|
167
|
+
type: 'string',
|
|
168
|
+
enum: ['2fa_disabled', 'all'],
|
|
169
|
+
description: 'Filter members by 2FA status',
|
|
170
|
+
},
|
|
171
|
+
role: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
enum: ['all', 'admin', 'member'],
|
|
174
|
+
description: 'Filter by role',
|
|
175
|
+
},
|
|
176
|
+
per_page: {
|
|
177
|
+
type: 'number',
|
|
178
|
+
description: 'Results per page (max 100)',
|
|
179
|
+
},
|
|
180
|
+
page: {
|
|
181
|
+
type: 'number',
|
|
182
|
+
description: 'Page number',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
required: ['org'],
|
|
185
186
|
},
|
|
186
|
-
permission: {
|
|
187
|
-
type: 'string',
|
|
188
|
-
enum: ['pull', 'push', 'admin'],
|
|
189
|
-
description: 'Default permission for repos',
|
|
190
|
-
},
|
|
191
|
-
parent_team_id: { type: 'number', description: 'Parent team ID for nested teams' },
|
|
192
187
|
},
|
|
193
|
-
|
|
188
|
+
handler: async (octokit, args) => {
|
|
189
|
+
const { data } = await octokit.orgs.listMembers({
|
|
190
|
+
org: args.org,
|
|
191
|
+
filter: args.filter,
|
|
192
|
+
role: args.role,
|
|
193
|
+
per_page: args.per_page,
|
|
194
|
+
page: args.page,
|
|
195
|
+
});
|
|
196
|
+
return successResult(data);
|
|
197
|
+
},
|
|
194
198
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
199
|
+
// get_membership - Get organization membership for a user
|
|
200
|
+
{
|
|
201
|
+
definition: {
|
|
202
|
+
name: 'github_orgs_get_membership',
|
|
203
|
+
description: 'Get organization membership for a user',
|
|
204
|
+
inputSchema: {
|
|
205
|
+
type: 'object',
|
|
206
|
+
properties: {
|
|
207
|
+
org: {
|
|
208
|
+
type: 'string',
|
|
209
|
+
description: 'Organization name',
|
|
210
|
+
},
|
|
211
|
+
username: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
description: 'GitHub username',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
required: ['org', 'username'],
|
|
209
217
|
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
218
|
+
},
|
|
219
|
+
handler: async (octokit, args) => {
|
|
220
|
+
const { data } = await octokit.orgs.getMembershipForUser({
|
|
221
|
+
org: args.org,
|
|
222
|
+
username: args.username,
|
|
223
|
+
});
|
|
224
|
+
return successResult(data);
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
// set_membership - Set organization membership for a user
|
|
228
|
+
{
|
|
229
|
+
definition: {
|
|
230
|
+
name: 'github_orgs_set_membership',
|
|
231
|
+
description: 'Set organization membership for a user',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
org: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
description: 'Organization name',
|
|
238
|
+
},
|
|
239
|
+
username: {
|
|
240
|
+
type: 'string',
|
|
241
|
+
description: 'GitHub username',
|
|
242
|
+
},
|
|
243
|
+
role: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
enum: ['admin', 'member'],
|
|
246
|
+
description: 'Role for the user in the organization',
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
required: ['org', 'username'],
|
|
213
250
|
},
|
|
214
|
-
parent_team_id: { type: 'number' },
|
|
215
251
|
},
|
|
216
|
-
|
|
252
|
+
handler: async (octokit, args) => {
|
|
253
|
+
const { data } = await octokit.orgs.setMembershipForUser({
|
|
254
|
+
org: args.org,
|
|
255
|
+
username: args.username,
|
|
256
|
+
role: args.role,
|
|
257
|
+
});
|
|
258
|
+
return successResult(data);
|
|
259
|
+
},
|
|
217
260
|
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
261
|
+
// remove_member - Remove a member from an organization
|
|
262
|
+
{
|
|
263
|
+
definition: {
|
|
264
|
+
name: 'github_orgs_remove_member',
|
|
265
|
+
description: 'Remove a member from an organization',
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {
|
|
269
|
+
org: {
|
|
270
|
+
type: 'string',
|
|
271
|
+
description: 'Organization name',
|
|
272
|
+
},
|
|
273
|
+
username: {
|
|
274
|
+
type: 'string',
|
|
275
|
+
description: 'GitHub username',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
required: ['org', 'username'],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
handler: async (octokit, args) => {
|
|
282
|
+
await octokit.orgs.removeMember({
|
|
283
|
+
org: args.org,
|
|
284
|
+
username: args.username,
|
|
285
|
+
});
|
|
286
|
+
return successResult({ success: true, message: 'Member removed from organization' });
|
|
287
|
+
},
|
|
229
288
|
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
289
|
+
// list_pending_invitations - List pending organization invitations
|
|
290
|
+
{
|
|
291
|
+
definition: {
|
|
292
|
+
name: 'github_orgs_list_pending_invitations',
|
|
293
|
+
description: 'List pending invitations for an organization',
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: 'object',
|
|
296
|
+
properties: {
|
|
297
|
+
org: {
|
|
298
|
+
type: 'string',
|
|
299
|
+
description: 'Organization name',
|
|
300
|
+
},
|
|
301
|
+
per_page: {
|
|
302
|
+
type: 'number',
|
|
303
|
+
description: 'Results per page (max 100)',
|
|
304
|
+
},
|
|
305
|
+
page: {
|
|
306
|
+
type: 'number',
|
|
307
|
+
description: 'Page number',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
required: ['org'],
|
|
242
311
|
},
|
|
243
|
-
per_page: { type: 'number' },
|
|
244
|
-
page: { type: 'number' },
|
|
245
312
|
},
|
|
246
|
-
|
|
313
|
+
handler: async (octokit, args) => {
|
|
314
|
+
const { data } = await octokit.orgs.listPendingInvitations({
|
|
315
|
+
org: args.org,
|
|
316
|
+
per_page: args.per_page,
|
|
317
|
+
page: args.page,
|
|
318
|
+
});
|
|
319
|
+
return successResult(data);
|
|
320
|
+
},
|
|
247
321
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
322
|
+
// create_invitation - Create an organization invitation
|
|
323
|
+
{
|
|
324
|
+
definition: {
|
|
325
|
+
name: 'github_orgs_create_invitation',
|
|
326
|
+
description: 'Create an invitation to join an organization',
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: 'object',
|
|
329
|
+
properties: {
|
|
330
|
+
org: {
|
|
331
|
+
type: 'string',
|
|
332
|
+
description: 'Organization name',
|
|
333
|
+
},
|
|
334
|
+
invitee_id: {
|
|
335
|
+
type: 'number',
|
|
336
|
+
description: 'GitHub user ID to invite',
|
|
337
|
+
},
|
|
338
|
+
email: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
description: 'Email address to invite (if not using invitee_id)',
|
|
341
|
+
},
|
|
342
|
+
role: {
|
|
343
|
+
type: 'string',
|
|
344
|
+
enum: ['admin', 'direct_member', 'billing_manager'],
|
|
345
|
+
description: 'Role for the invited user',
|
|
346
|
+
},
|
|
347
|
+
team_ids: {
|
|
348
|
+
type: 'string',
|
|
349
|
+
description: 'Comma-separated list of team IDs to add the user to',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
required: ['org'],
|
|
262
353
|
},
|
|
263
354
|
},
|
|
264
|
-
|
|
355
|
+
handler: async (octokit, args) => {
|
|
356
|
+
const teamIds = args.team_ids
|
|
357
|
+
? args.team_ids.split(',').map((id) => parseInt(id.trim(), 10))
|
|
358
|
+
: undefined;
|
|
359
|
+
const { data } = await octokit.orgs.createInvitation({
|
|
360
|
+
org: args.org,
|
|
361
|
+
invitee_id: args.invitee_id,
|
|
362
|
+
email: args.email,
|
|
363
|
+
role: args.role,
|
|
364
|
+
team_ids: teamIds,
|
|
365
|
+
});
|
|
366
|
+
return successResult(data);
|
|
367
|
+
},
|
|
265
368
|
},
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
369
|
+
// cancel_invitation - Cancel an organization invitation
|
|
370
|
+
{
|
|
371
|
+
definition: {
|
|
372
|
+
name: 'github_orgs_cancel_invitation',
|
|
373
|
+
description: 'Cancel an organization invitation',
|
|
374
|
+
inputSchema: {
|
|
375
|
+
type: 'object',
|
|
376
|
+
properties: {
|
|
377
|
+
org: {
|
|
378
|
+
type: 'string',
|
|
379
|
+
description: 'Organization name',
|
|
380
|
+
},
|
|
381
|
+
invitation_id: {
|
|
382
|
+
type: 'number',
|
|
383
|
+
description: 'Invitation ID',
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
required: ['org', 'invitation_id'],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
handler: async (octokit, args) => {
|
|
390
|
+
await octokit.orgs.cancelInvitation({
|
|
391
|
+
org: args.org,
|
|
392
|
+
invitation_id: args.invitation_id,
|
|
393
|
+
});
|
|
394
|
+
return successResult({ success: true, message: 'Invitation cancelled' });
|
|
395
|
+
},
|
|
278
396
|
},
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
397
|
+
// list_webhooks - List organization webhooks
|
|
398
|
+
{
|
|
399
|
+
definition: {
|
|
400
|
+
name: 'github_orgs_list_webhooks',
|
|
401
|
+
description: 'List webhooks for an organization',
|
|
402
|
+
inputSchema: {
|
|
403
|
+
type: 'object',
|
|
404
|
+
properties: {
|
|
405
|
+
org: {
|
|
406
|
+
type: 'string',
|
|
407
|
+
description: 'Organization name',
|
|
408
|
+
},
|
|
409
|
+
per_page: {
|
|
410
|
+
type: 'number',
|
|
411
|
+
description: 'Results per page (max 100)',
|
|
412
|
+
},
|
|
413
|
+
page: {
|
|
414
|
+
type: 'number',
|
|
415
|
+
description: 'Page number',
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
required: ['org'],
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
handler: async (octokit, args) => {
|
|
422
|
+
const { data } = await octokit.orgs.listWebhooks({
|
|
423
|
+
org: args.org,
|
|
424
|
+
per_page: args.per_page,
|
|
425
|
+
page: args.page,
|
|
426
|
+
});
|
|
427
|
+
return successResult(data);
|
|
428
|
+
},
|
|
292
429
|
},
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
430
|
+
// get_webhook - Get an organization webhook
|
|
431
|
+
{
|
|
432
|
+
definition: {
|
|
433
|
+
name: 'github_orgs_get_webhook',
|
|
434
|
+
description: 'Get a webhook for an organization',
|
|
435
|
+
inputSchema: {
|
|
436
|
+
type: 'object',
|
|
437
|
+
properties: {
|
|
438
|
+
org: {
|
|
439
|
+
type: 'string',
|
|
440
|
+
description: 'Organization name',
|
|
441
|
+
},
|
|
442
|
+
hook_id: {
|
|
443
|
+
type: 'number',
|
|
444
|
+
description: 'Webhook ID',
|
|
445
|
+
},
|
|
446
|
+
},
|
|
447
|
+
required: ['org', 'hook_id'],
|
|
308
448
|
},
|
|
309
449
|
},
|
|
310
|
-
|
|
450
|
+
handler: async (octokit, args) => {
|
|
451
|
+
const { data } = await octokit.orgs.getWebhook({
|
|
452
|
+
org: args.org,
|
|
453
|
+
hook_id: args.hook_id,
|
|
454
|
+
});
|
|
455
|
+
return successResult(data);
|
|
456
|
+
},
|
|
311
457
|
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
458
|
+
// create_webhook - Create an organization webhook
|
|
459
|
+
{
|
|
460
|
+
definition: {
|
|
461
|
+
name: 'github_orgs_create_webhook',
|
|
462
|
+
description: 'Create a webhook for an organization',
|
|
463
|
+
inputSchema: {
|
|
464
|
+
type: 'object',
|
|
465
|
+
properties: {
|
|
466
|
+
org: {
|
|
467
|
+
type: 'string',
|
|
468
|
+
description: 'Organization name',
|
|
469
|
+
},
|
|
470
|
+
name: {
|
|
471
|
+
type: 'string',
|
|
472
|
+
description: 'Webhook name (must be "web")',
|
|
473
|
+
},
|
|
474
|
+
config_url: {
|
|
475
|
+
type: 'string',
|
|
476
|
+
description: 'URL to receive webhook payloads',
|
|
477
|
+
},
|
|
478
|
+
config_content_type: {
|
|
479
|
+
type: 'string',
|
|
480
|
+
enum: ['json', 'form'],
|
|
481
|
+
description: 'Content type for payloads',
|
|
482
|
+
},
|
|
483
|
+
config_secret: {
|
|
484
|
+
type: 'string',
|
|
485
|
+
description: 'Secret for webhook signature',
|
|
486
|
+
},
|
|
487
|
+
config_insecure_ssl: {
|
|
488
|
+
type: 'string',
|
|
489
|
+
enum: ['0', '1'],
|
|
490
|
+
description: 'Allow insecure SSL (0 = no, 1 = yes)',
|
|
491
|
+
},
|
|
492
|
+
events: {
|
|
493
|
+
type: 'string',
|
|
494
|
+
description: 'Comma-separated list of events to subscribe to',
|
|
495
|
+
},
|
|
496
|
+
active: {
|
|
497
|
+
type: 'string',
|
|
498
|
+
enum: ['true', 'false'],
|
|
499
|
+
description: 'Whether the webhook is active',
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
required: ['org', 'name', 'config_url'],
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
handler: async (octokit, args) => {
|
|
506
|
+
const events = args.events
|
|
507
|
+
? args.events.split(',').map((e) => e.trim())
|
|
508
|
+
: undefined;
|
|
509
|
+
const { data } = await octokit.orgs.createWebhook({
|
|
510
|
+
org: args.org,
|
|
511
|
+
name: args.name,
|
|
512
|
+
config: {
|
|
513
|
+
url: args.config_url,
|
|
514
|
+
content_type: args.config_content_type,
|
|
515
|
+
secret: args.config_secret,
|
|
516
|
+
insecure_ssl: args.config_insecure_ssl,
|
|
517
|
+
},
|
|
518
|
+
events,
|
|
519
|
+
active: args.active !== undefined ? args.active === 'true' : undefined,
|
|
520
|
+
});
|
|
521
|
+
return successResult(data);
|
|
522
|
+
},
|
|
324
523
|
},
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
524
|
+
// update_webhook - Update an organization webhook
|
|
525
|
+
{
|
|
526
|
+
definition: {
|
|
527
|
+
name: 'github_orgs_update_webhook',
|
|
528
|
+
description: 'Update a webhook for an organization',
|
|
529
|
+
inputSchema: {
|
|
530
|
+
type: 'object',
|
|
531
|
+
properties: {
|
|
532
|
+
org: {
|
|
533
|
+
type: 'string',
|
|
534
|
+
description: 'Organization name',
|
|
535
|
+
},
|
|
536
|
+
hook_id: {
|
|
537
|
+
type: 'number',
|
|
538
|
+
description: 'Webhook ID',
|
|
539
|
+
},
|
|
540
|
+
config_url: {
|
|
541
|
+
type: 'string',
|
|
542
|
+
description: 'URL to receive webhook payloads',
|
|
543
|
+
},
|
|
544
|
+
config_content_type: {
|
|
545
|
+
type: 'string',
|
|
546
|
+
enum: ['json', 'form'],
|
|
547
|
+
description: 'Content type for payloads',
|
|
548
|
+
},
|
|
549
|
+
config_secret: {
|
|
550
|
+
type: 'string',
|
|
551
|
+
description: 'Secret for webhook signature',
|
|
552
|
+
},
|
|
553
|
+
config_insecure_ssl: {
|
|
554
|
+
type: 'string',
|
|
555
|
+
enum: ['0', '1'],
|
|
556
|
+
description: 'Allow insecure SSL (0 = no, 1 = yes)',
|
|
557
|
+
},
|
|
558
|
+
events: {
|
|
559
|
+
type: 'string',
|
|
560
|
+
description: 'Comma-separated list of events to subscribe to',
|
|
561
|
+
},
|
|
562
|
+
active: {
|
|
563
|
+
type: 'string',
|
|
564
|
+
enum: ['true', 'false'],
|
|
565
|
+
description: 'Whether the webhook is active',
|
|
566
|
+
},
|
|
567
|
+
},
|
|
568
|
+
required: ['org', 'hook_id'],
|
|
338
569
|
},
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
570
|
+
},
|
|
571
|
+
handler: async (octokit, args) => {
|
|
572
|
+
const events = args.events
|
|
573
|
+
? args.events.split(',').map((e) => e.trim())
|
|
574
|
+
: undefined;
|
|
575
|
+
const config = args.config_url ? {
|
|
576
|
+
url: args.config_url,
|
|
577
|
+
content_type: args.config_content_type,
|
|
578
|
+
secret: args.config_secret,
|
|
579
|
+
insecure_ssl: args.config_insecure_ssl,
|
|
580
|
+
} : undefined;
|
|
581
|
+
const { data } = await octokit.orgs.updateWebhook({
|
|
582
|
+
org: args.org,
|
|
583
|
+
hook_id: args.hook_id,
|
|
584
|
+
config,
|
|
585
|
+
events,
|
|
586
|
+
active: args.active !== undefined ? args.active === 'true' : undefined,
|
|
587
|
+
});
|
|
588
|
+
return successResult(data);
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
// delete_webhook - Delete an organization webhook
|
|
592
|
+
{
|
|
593
|
+
definition: {
|
|
594
|
+
name: 'github_orgs_delete_webhook',
|
|
595
|
+
description: 'Delete a webhook for an organization',
|
|
596
|
+
inputSchema: {
|
|
597
|
+
type: 'object',
|
|
598
|
+
properties: {
|
|
599
|
+
org: {
|
|
600
|
+
type: 'string',
|
|
601
|
+
description: 'Organization name',
|
|
602
|
+
},
|
|
603
|
+
hook_id: {
|
|
604
|
+
type: 'number',
|
|
605
|
+
description: 'Webhook ID',
|
|
606
|
+
},
|
|
607
|
+
},
|
|
608
|
+
required: ['org', 'hook_id'],
|
|
343
609
|
},
|
|
344
610
|
},
|
|
345
|
-
|
|
611
|
+
handler: async (octokit, args) => {
|
|
612
|
+
await octokit.orgs.deleteWebhook({
|
|
613
|
+
org: args.org,
|
|
614
|
+
hook_id: args.hook_id,
|
|
615
|
+
});
|
|
616
|
+
return successResult({ success: true, message: 'Webhook deleted' });
|
|
617
|
+
},
|
|
346
618
|
},
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
export async function handleOrgsTool(octokit, args) {
|
|
350
|
-
const org = args.org;
|
|
351
|
-
const username = args.username;
|
|
352
|
-
const teamSlug = args.team_slug;
|
|
353
|
-
// List for authenticated user
|
|
354
|
-
if (!org && !username) {
|
|
355
|
-
const { data } = await octokit.orgs.listForAuthenticatedUser(args);
|
|
356
|
-
return data;
|
|
357
|
-
}
|
|
358
|
-
// List for user
|
|
359
|
-
if (username && !org) {
|
|
360
|
-
const { data } = await octokit.orgs.listForUser(args);
|
|
361
|
-
return data;
|
|
362
|
-
}
|
|
363
|
-
// Get organization
|
|
364
|
-
if (org && !username && !teamSlug && !('name' in args) && !('filter' in args) && !('role' in args) && !('invitee_id' in args) && !('email' in args)) {
|
|
365
|
-
const { data } = await octokit.orgs.get({ org });
|
|
366
|
-
return data;
|
|
367
|
-
}
|
|
368
|
-
// Update organization
|
|
369
|
-
if (org && !username && !teamSlug && ('billing_email' in args || 'company' in args || 'email' in args || 'twitter_username' in args || 'location' in args || 'name' in args || 'description' in args)) {
|
|
370
|
-
const { data } = await octokit.orgs.update(args);
|
|
371
|
-
return data;
|
|
372
|
-
}
|
|
373
|
-
// List members
|
|
374
|
-
if (org && !username && !teamSlug && ('filter' in args || 'role' in args)) {
|
|
375
|
-
const { data } = await octokit.orgs.listMembers(args);
|
|
376
|
-
return data;
|
|
377
|
-
}
|
|
378
|
-
// Check membership
|
|
379
|
-
if (org && username && !teamSlug && !('role' in args)) {
|
|
380
|
-
try {
|
|
381
|
-
await octokit.orgs.checkMembershipForUser({ org, username });
|
|
382
|
-
return { isMember: true };
|
|
383
|
-
}
|
|
384
|
-
catch {
|
|
385
|
-
return { isMember: false };
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
// Get membership
|
|
389
|
-
if (org && username && !teamSlug && !('role' in args)) {
|
|
390
|
-
const { data } = await octokit.orgs.getMembershipForUser({ org, username });
|
|
391
|
-
return data;
|
|
392
|
-
}
|
|
393
|
-
// Set membership
|
|
394
|
-
if (org && username && !teamSlug && 'role' in args) {
|
|
395
|
-
const { data } = await octokit.orgs.setMembershipForUser(args);
|
|
396
|
-
return data;
|
|
397
|
-
}
|
|
398
|
-
// List teams
|
|
399
|
-
if (org && !teamSlug && !username && !('name' in args)) {
|
|
400
|
-
const { data } = await octokit.teams.list({ org, ...args });
|
|
401
|
-
return data;
|
|
402
|
-
}
|
|
403
|
-
// Get team
|
|
404
|
-
if (org && teamSlug && !username && !('name' in args) && !('permission' in args) && Object.keys(args).filter(k => !['org', 'team_slug', 'per_page', 'page'].includes(k)).length === 0) {
|
|
405
|
-
if ('per_page' in args || 'page' in args) {
|
|
406
|
-
// List team members
|
|
407
|
-
const { data } = await octokit.teams.listMembersInOrg(args);
|
|
408
|
-
return data;
|
|
409
|
-
}
|
|
410
|
-
const { data } = await octokit.teams.getByName({ org, team_slug: teamSlug });
|
|
411
|
-
return data;
|
|
412
|
-
}
|
|
413
|
-
// Create team
|
|
414
|
-
if (org && !teamSlug && 'name' in args) {
|
|
415
|
-
const { data } = await octokit.teams.create(args);
|
|
416
|
-
return data;
|
|
417
|
-
}
|
|
418
|
-
// Update team
|
|
419
|
-
if (org && teamSlug && ('name' in args || 'description' in args || 'privacy' in args)) {
|
|
420
|
-
const { data } = await octokit.teams.updateInOrg(args);
|
|
421
|
-
return data;
|
|
422
|
-
}
|
|
423
|
-
// Delete team
|
|
424
|
-
if (org && teamSlug && Object.keys(args).length === 2) {
|
|
425
|
-
await octokit.teams.deleteInOrg({ org, team_slug: teamSlug });
|
|
426
|
-
return { success: true, message: 'Team deleted' };
|
|
427
|
-
}
|
|
428
|
-
// Add team member
|
|
429
|
-
if (org && teamSlug && username) {
|
|
430
|
-
const { data } = await octokit.teams.addOrUpdateMembershipForUserInOrg(args);
|
|
431
|
-
return data;
|
|
432
|
-
}
|
|
433
|
-
// Add team repo
|
|
434
|
-
if (org && teamSlug && 'owner' in args && 'repo' in args) {
|
|
435
|
-
await octokit.teams.addOrUpdateRepoPermissionsInOrg(args);
|
|
436
|
-
return { success: true, message: 'Repository added to team' };
|
|
437
|
-
}
|
|
438
|
-
// List invitations
|
|
439
|
-
if (org && !teamSlug && !username && !('name' in args)) {
|
|
440
|
-
const { data } = await octokit.orgs.listPendingInvitations({ org, ...args });
|
|
441
|
-
return data;
|
|
442
|
-
}
|
|
443
|
-
// Create invitation
|
|
444
|
-
if (org && ('invitee_id' in args || 'email' in args)) {
|
|
445
|
-
const { data } = await octokit.orgs.createInvitation(args);
|
|
446
|
-
return data;
|
|
447
|
-
}
|
|
448
|
-
// Default: list for authenticated user
|
|
449
|
-
const { data } = await octokit.orgs.listForAuthenticatedUser();
|
|
450
|
-
return data;
|
|
451
|
-
}
|
|
452
|
-
//# sourceMappingURL=orgs.js.map
|
|
619
|
+
],
|
|
620
|
+
};
|