@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.
Files changed (84) hide show
  1. package/dist/index.js +8 -2
  2. package/dist/prompts/activity-summary.d.ts +10 -0
  3. package/dist/prompts/activity-summary.js +154 -0
  4. package/dist/prompts/code-review.d.ts +9 -0
  5. package/dist/prompts/code-review.js +145 -0
  6. package/dist/prompts/issue-triage.d.ts +9 -0
  7. package/dist/prompts/issue-triage.js +202 -0
  8. package/dist/prompts/release-notes.d.ts +9 -0
  9. package/dist/prompts/release-notes.js +236 -0
  10. package/dist/server.d.ts +8 -1
  11. package/dist/server.js +36 -210
  12. package/dist/tools/categories/actions.d.ts +2 -5
  13. package/dist/tools/categories/actions.js +640 -369
  14. package/dist/tools/categories/activity.d.ts +2 -0
  15. package/dist/tools/categories/activity.js +534 -0
  16. package/dist/tools/categories/apps.d.ts +2 -0
  17. package/dist/tools/categories/apps.js +224 -0
  18. package/dist/tools/categories/billing.d.ts +2 -0
  19. package/dist/tools/categories/billing.js +145 -0
  20. package/dist/tools/categories/checks.d.ts +2 -0
  21. package/dist/tools/categories/checks.js +554 -0
  22. package/dist/tools/categories/codeScanning.d.ts +2 -0
  23. package/dist/tools/categories/codeScanning.js +375 -0
  24. package/dist/tools/categories/codeSecurity.d.ts +2 -0
  25. package/dist/tools/categories/codeSecurity.js +463 -0
  26. package/dist/tools/categories/codesOfConduct.d.ts +2 -0
  27. package/dist/tools/categories/codesOfConduct.js +45 -0
  28. package/dist/tools/categories/codespaces.d.ts +2 -0
  29. package/dist/tools/categories/codespaces.js +259 -0
  30. package/dist/tools/categories/copilot.d.ts +2 -0
  31. package/dist/tools/categories/copilot.js +187 -0
  32. package/dist/tools/categories/dependabot.d.ts +2 -0
  33. package/dist/tools/categories/dependabot.js +454 -0
  34. package/dist/tools/categories/emojis.d.ts +2 -0
  35. package/dist/tools/categories/emojis.js +22 -0
  36. package/dist/tools/categories/gists.d.ts +2 -5
  37. package/dist/tools/categories/gists.js +474 -285
  38. package/dist/tools/categories/git.d.ts +2 -0
  39. package/dist/tools/categories/git.js +520 -0
  40. package/dist/tools/categories/gitignore.d.ts +2 -0
  41. package/dist/tools/categories/gitignore.js +45 -0
  42. package/dist/tools/categories/index.d.ts +33 -0
  43. package/dist/tools/categories/index.js +33 -0
  44. package/dist/tools/categories/interactions.d.ts +2 -0
  45. package/dist/tools/categories/interactions.js +184 -0
  46. package/dist/tools/categories/issues.d.ts +2 -5
  47. package/dist/tools/categories/issues.js +692 -390
  48. package/dist/tools/categories/licenses.d.ts +2 -0
  49. package/dist/tools/categories/licenses.js +95 -0
  50. package/dist/tools/categories/markdown.d.ts +2 -0
  51. package/dist/tools/categories/markdown.js +64 -0
  52. package/dist/tools/categories/meta.d.ts +2 -0
  53. package/dist/tools/categories/meta.js +74 -0
  54. package/dist/tools/categories/migrations.d.ts +2 -0
  55. package/dist/tools/categories/migrations.js +290 -0
  56. package/dist/tools/categories/orgs.d.ts +2 -5
  57. package/dist/tools/categories/orgs.js +585 -417
  58. package/dist/tools/categories/packages.d.ts +2 -0
  59. package/dist/tools/categories/packages.js +918 -0
  60. package/dist/tools/categories/projects.d.ts +2 -0
  61. package/dist/tools/categories/projects.js +692 -0
  62. package/dist/tools/categories/pulls.d.ts +2 -5
  63. package/dist/tools/categories/pulls.js +715 -332
  64. package/dist/tools/categories/rateLimit.d.ts +2 -0
  65. package/dist/tools/categories/rateLimit.js +22 -0
  66. package/dist/tools/categories/reactions.d.ts +2 -0
  67. package/dist/tools/categories/reactions.js +385 -0
  68. package/dist/tools/categories/repos.d.ts +2 -5
  69. package/dist/tools/categories/repos.js +844 -366
  70. package/dist/tools/categories/search.d.ts +2 -5
  71. package/dist/tools/categories/search.js +294 -196
  72. package/dist/tools/categories/secretScanning.d.ts +2 -0
  73. package/dist/tools/categories/secretScanning.js +324 -0
  74. package/dist/tools/categories/securityAdvisories.d.ts +2 -0
  75. package/dist/tools/categories/securityAdvisories.js +407 -0
  76. package/dist/tools/categories/teams.d.ts +2 -0
  77. package/dist/tools/categories/teams.js +614 -0
  78. package/dist/tools/categories/users.d.ts +2 -5
  79. package/dist/tools/categories/users.js +474 -247
  80. package/dist/tools/generator.d.ts +35 -15
  81. package/dist/tools/generator.js +113 -57
  82. package/dist/tools/types.d.ts +63 -0
  83. package/dist/tools/types.js +17 -0
  84. package/package.json +1 -1
@@ -1,452 +1,620 @@
1
- export const orgsTools = [
2
- {
3
- name: 'github_orgs_list',
4
- description: 'List organizations for the authenticated user',
5
- inputSchema: {
6
- type: 'object',
7
- properties: {
8
- per_page: { type: 'number' },
9
- page: { type: 'number' },
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
- name: 'github_orgs_listForUser',
15
- description: 'List organizations for a user',
16
- inputSchema: {
17
- type: 'object',
18
- properties: {
19
- username: { type: 'string', description: 'GitHub username' },
20
- per_page: { type: 'number' },
21
- page: { type: 'number' },
22
- },
23
- required: ['username'],
24
- },
25
- },
26
- {
27
- name: 'github_orgs_get',
28
- description: 'Get an organization',
29
- inputSchema: {
30
- type: 'object',
31
- properties: {
32
- org: { type: 'string', description: 'Organization name' },
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
- required: ['org'],
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
- name: 'github_orgs_listMembers',
63
- description: 'List members of an organization',
64
- inputSchema: {
65
- type: 'object',
66
- properties: {
67
- org: { type: 'string', description: 'Organization name' },
68
- filter: {
69
- type: 'string',
70
- enum: ['2fa_disabled', 'all'],
71
- description: 'Filter members',
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
- required: ['org'],
82
- },
83
- },
84
- {
85
- name: 'github_orgs_checkMembership',
86
- description: 'Check if a user is a member of an organization',
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
- name: 'github_orgs_setMembership',
110
- description: 'Set organization membership for a user',
111
- inputSchema: {
112
- type: 'object',
113
- properties: {
114
- org: { type: 'string', description: 'Organization name' },
115
- username: { type: 'string', description: 'GitHub username' },
116
- role: {
117
- type: 'string',
118
- enum: ['admin', 'member'],
119
- description: 'Role to assign',
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
- required: ['org', 'username', 'role'],
123
- },
124
- },
125
- {
126
- name: 'github_orgs_removeMember',
127
- description: 'Remove a member from an organization',
128
- inputSchema: {
129
- type: 'object',
130
- properties: {
131
- org: { type: 'string', description: 'Organization name' },
132
- username: { type: 'string', description: 'GitHub username' },
133
- },
134
- required: ['org', 'username'],
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
- name: 'github_orgs_createTeam',
164
- description: 'Create a team',
165
- inputSchema: {
166
- type: 'object',
167
- properties: {
168
- org: { type: 'string', description: 'Organization name' },
169
- name: { type: 'string', description: 'Team name' },
170
- description: { type: 'string', description: 'Team description' },
171
- maintainers: {
172
- type: 'array',
173
- items: { type: 'string' },
174
- description: 'GitHub usernames of team maintainers',
175
- },
176
- repo_names: {
177
- type: 'array',
178
- items: { type: 'string' },
179
- description: 'Full repo names (org/repo) to add',
180
- },
181
- privacy: {
182
- type: 'string',
183
- enum: ['secret', 'closed'],
184
- description: 'Team privacy level',
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
- required: ['org', 'name'],
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
- name: 'github_orgs_updateTeam',
198
- description: 'Update a team',
199
- inputSchema: {
200
- type: 'object',
201
- properties: {
202
- org: { type: 'string', description: 'Organization name' },
203
- team_slug: { type: 'string', description: 'Team slug' },
204
- name: { type: 'string', description: 'Team name' },
205
- description: { type: 'string', description: 'Team description' },
206
- privacy: {
207
- type: 'string',
208
- enum: ['secret', 'closed'],
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
- permission: {
211
- type: 'string',
212
- enum: ['pull', 'push', 'admin'],
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
- required: ['org', 'team_slug'],
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
- name: 'github_orgs_deleteTeam',
221
- description: 'Delete a team',
222
- inputSchema: {
223
- type: 'object',
224
- properties: {
225
- org: { type: 'string', description: 'Organization name' },
226
- team_slug: { type: 'string', description: 'Team slug' },
227
- },
228
- required: ['org', 'team_slug'],
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
- name: 'github_orgs_listTeamMembers',
233
- description: 'List members of a team',
234
- inputSchema: {
235
- type: 'object',
236
- properties: {
237
- org: { type: 'string', description: 'Organization name' },
238
- team_slug: { type: 'string', description: 'Team slug' },
239
- role: {
240
- type: 'string',
241
- enum: ['member', 'maintainer', 'all'],
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
- required: ['org', 'team_slug'],
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
- name: 'github_orgs_addTeamMember',
251
- description: 'Add a member to a team',
252
- inputSchema: {
253
- type: 'object',
254
- properties: {
255
- org: { type: 'string', description: 'Organization name' },
256
- team_slug: { type: 'string', description: 'Team slug' },
257
- username: { type: 'string', description: 'GitHub username' },
258
- role: {
259
- type: 'string',
260
- enum: ['member', 'maintainer'],
261
- description: 'Role in the team',
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
- required: ['org', 'team_slug', 'username'],
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
- name: 'github_orgs_removeTeamMember',
269
- description: 'Remove a member from a team',
270
- inputSchema: {
271
- type: 'object',
272
- properties: {
273
- org: { type: 'string', description: 'Organization name' },
274
- team_slug: { type: 'string', description: 'Team slug' },
275
- username: { type: 'string', description: 'GitHub username' },
276
- },
277
- required: ['org', 'team_slug', 'username'],
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
- name: 'github_orgs_listTeamRepos',
282
- description: 'List repositories for a team',
283
- inputSchema: {
284
- type: 'object',
285
- properties: {
286
- org: { type: 'string', description: 'Organization name' },
287
- team_slug: { type: 'string', description: 'Team slug' },
288
- per_page: { type: 'number' },
289
- page: { type: 'number' },
290
- },
291
- required: ['org', 'team_slug'],
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
- name: 'github_orgs_addTeamRepo',
296
- description: 'Add a repository to a team',
297
- inputSchema: {
298
- type: 'object',
299
- properties: {
300
- org: { type: 'string', description: 'Organization name' },
301
- team_slug: { type: 'string', description: 'Team slug' },
302
- owner: { type: 'string', description: 'Repository owner' },
303
- repo: { type: 'string', description: 'Repository name' },
304
- permission: {
305
- type: 'string',
306
- enum: ['pull', 'push', 'admin', 'maintain', 'triage'],
307
- description: 'Permission level',
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
- required: ['org', 'team_slug', 'owner', 'repo'],
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
- name: 'github_orgs_listInvitations',
315
- description: 'List pending organization invitations',
316
- inputSchema: {
317
- type: 'object',
318
- properties: {
319
- org: { type: 'string', description: 'Organization name' },
320
- per_page: { type: 'number' },
321
- page: { type: 'number' },
322
- },
323
- required: ['org'],
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
- name: 'github_orgs_createInvitation',
328
- description: 'Create an organization invitation',
329
- inputSchema: {
330
- type: 'object',
331
- properties: {
332
- org: { type: 'string', description: 'Organization name' },
333
- invitee_id: { type: 'number', description: 'GitHub user ID to invite' },
334
- email: { type: 'string', description: 'Email address to invite' },
335
- role: {
336
- type: 'string',
337
- enum: ['admin', 'direct_member', 'billing_manager'],
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
- team_ids: {
340
- type: 'array',
341
- items: { type: 'number' },
342
- description: 'Team IDs to add user to',
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
- required: ['org'],
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
+ };