@ldraney/github-mcp 0.1.0 → 0.2.0-beta.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/dist/index.js +8 -2
- package/dist/prompts/activity-summary.d.ts +10 -0
- package/dist/prompts/activity-summary.js +154 -0
- package/dist/server.d.ts +8 -1
- package/dist/server.js +20 -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,392 +1,870 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { successResult } from '../types.js';
|
|
2
|
+
export const reposCategory = {
|
|
3
|
+
name: 'repos',
|
|
4
|
+
description: 'Repository management tools',
|
|
5
|
+
tools: [
|
|
6
|
+
// list - List repositories for authenticated user
|
|
7
|
+
{
|
|
8
|
+
definition: {
|
|
9
|
+
name: 'github_repos_list',
|
|
10
|
+
description: 'List repositories for the authenticated user',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
visibility: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
enum: ['all', 'public', 'private'],
|
|
17
|
+
description: 'Filter by visibility',
|
|
18
|
+
},
|
|
19
|
+
sort: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
enum: ['created', 'updated', 'pushed', 'full_name'],
|
|
22
|
+
description: 'Sort field',
|
|
23
|
+
},
|
|
24
|
+
per_page: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
description: 'Results per page (max 100)',
|
|
27
|
+
},
|
|
28
|
+
page: {
|
|
29
|
+
type: 'number',
|
|
30
|
+
description: 'Page number',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
29
33
|
},
|
|
30
34
|
},
|
|
35
|
+
handler: async (octokit, args) => {
|
|
36
|
+
const { data } = await octokit.repos.listForAuthenticatedUser({
|
|
37
|
+
visibility: args.visibility,
|
|
38
|
+
sort: args.sort,
|
|
39
|
+
per_page: args.per_page,
|
|
40
|
+
page: args.page,
|
|
41
|
+
});
|
|
42
|
+
return successResult(data);
|
|
43
|
+
},
|
|
31
44
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
// list_for_org - List repositories for an organization
|
|
46
|
+
{
|
|
47
|
+
definition: {
|
|
48
|
+
name: 'github_repos_list_for_org',
|
|
49
|
+
description: 'List repositories for an organization',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
org: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
description: 'Organization name',
|
|
56
|
+
},
|
|
57
|
+
type: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
enum: ['all', 'public', 'private', 'forks', 'sources', 'member'],
|
|
60
|
+
description: 'Filter by type',
|
|
61
|
+
},
|
|
62
|
+
sort: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
enum: ['created', 'updated', 'pushed', 'full_name'],
|
|
65
|
+
description: 'Sort field',
|
|
66
|
+
},
|
|
67
|
+
per_page: {
|
|
68
|
+
type: 'number',
|
|
69
|
+
description: 'Results per page (max 100)',
|
|
70
|
+
},
|
|
71
|
+
page: {
|
|
72
|
+
type: 'number',
|
|
73
|
+
description: 'Page number',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
required: ['org'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
handler: async (octokit, args) => {
|
|
80
|
+
const { data } = await octokit.repos.listForOrg({
|
|
81
|
+
org: args.org,
|
|
82
|
+
type: args.type,
|
|
83
|
+
sort: args.sort,
|
|
84
|
+
per_page: args.per_page,
|
|
85
|
+
page: args.page,
|
|
86
|
+
});
|
|
87
|
+
return successResult(data);
|
|
88
|
+
},
|
|
59
89
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
// list_for_user - List repositories for a user
|
|
91
|
+
{
|
|
92
|
+
definition: {
|
|
93
|
+
name: 'github_repos_list_for_user',
|
|
94
|
+
description: 'List public repositories for a user',
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: 'object',
|
|
97
|
+
properties: {
|
|
98
|
+
username: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
description: 'GitHub username',
|
|
101
|
+
},
|
|
102
|
+
type: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
enum: ['all', 'owner', 'member'],
|
|
105
|
+
description: 'Filter by type',
|
|
106
|
+
},
|
|
107
|
+
sort: {
|
|
108
|
+
type: 'string',
|
|
109
|
+
enum: ['created', 'updated', 'pushed', 'full_name'],
|
|
110
|
+
description: 'Sort field',
|
|
111
|
+
},
|
|
112
|
+
per_page: {
|
|
113
|
+
type: 'number',
|
|
114
|
+
description: 'Results per page (max 100)',
|
|
115
|
+
},
|
|
116
|
+
page: {
|
|
117
|
+
type: 'number',
|
|
118
|
+
description: 'Page number',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ['username'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
handler: async (octokit, args) => {
|
|
125
|
+
const { data } = await octokit.repos.listForUser({
|
|
126
|
+
username: args.username,
|
|
127
|
+
type: args.type,
|
|
128
|
+
sort: args.sort,
|
|
129
|
+
per_page: args.per_page,
|
|
130
|
+
page: args.page,
|
|
131
|
+
});
|
|
132
|
+
return successResult(data);
|
|
133
|
+
},
|
|
71
134
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
135
|
+
// get - Get a repository
|
|
136
|
+
{
|
|
137
|
+
definition: {
|
|
138
|
+
name: 'github_repos_get',
|
|
139
|
+
description: 'Get a repository by owner and name',
|
|
140
|
+
inputSchema: {
|
|
141
|
+
type: 'object',
|
|
142
|
+
properties: {
|
|
143
|
+
owner: {
|
|
144
|
+
type: 'string',
|
|
145
|
+
description: 'Repository owner',
|
|
146
|
+
},
|
|
147
|
+
repo: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
description: 'Repository name',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
required: ['owner', 'repo'],
|
|
84
153
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
154
|
+
},
|
|
155
|
+
handler: async (octokit, args) => {
|
|
156
|
+
const { data } = await octokit.repos.get({
|
|
157
|
+
owner: args.owner,
|
|
158
|
+
repo: args.repo,
|
|
159
|
+
});
|
|
160
|
+
return successResult(data);
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
// create - Create a repository for authenticated user
|
|
164
|
+
{
|
|
165
|
+
definition: {
|
|
166
|
+
name: 'github_repos_create',
|
|
167
|
+
description: 'Create a new repository for the authenticated user',
|
|
168
|
+
inputSchema: {
|
|
169
|
+
type: 'object',
|
|
170
|
+
properties: {
|
|
171
|
+
name: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
description: 'Repository name',
|
|
174
|
+
},
|
|
175
|
+
description: {
|
|
176
|
+
type: 'string',
|
|
177
|
+
description: 'Repository description',
|
|
178
|
+
},
|
|
179
|
+
private: {
|
|
180
|
+
type: 'string',
|
|
181
|
+
enum: ['true', 'false'],
|
|
182
|
+
description: 'Whether the repository is private',
|
|
183
|
+
},
|
|
184
|
+
auto_init: {
|
|
185
|
+
type: 'string',
|
|
186
|
+
enum: ['true', 'false'],
|
|
187
|
+
description: 'Create an initial commit with README',
|
|
188
|
+
},
|
|
189
|
+
gitignore_template: {
|
|
190
|
+
type: 'string',
|
|
191
|
+
description: 'Gitignore template to use (e.g., Node, Python)',
|
|
192
|
+
},
|
|
193
|
+
license_template: {
|
|
194
|
+
type: 'string',
|
|
195
|
+
description: 'License template (e.g., mit, apache-2.0)',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
required: ['name'],
|
|
88
199
|
},
|
|
89
|
-
per_page: { type: 'number' },
|
|
90
|
-
page: { type: 'number' },
|
|
91
200
|
},
|
|
92
|
-
|
|
201
|
+
handler: async (octokit, args) => {
|
|
202
|
+
const { data } = await octokit.repos.createForAuthenticatedUser({
|
|
203
|
+
name: args.name,
|
|
204
|
+
description: args.description,
|
|
205
|
+
private: args.private === 'true',
|
|
206
|
+
auto_init: args.auto_init === 'true',
|
|
207
|
+
gitignore_template: args.gitignore_template,
|
|
208
|
+
license_template: args.license_template,
|
|
209
|
+
});
|
|
210
|
+
return successResult(data);
|
|
211
|
+
},
|
|
93
212
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
213
|
+
// create_in_org - Create a repository in an organization
|
|
214
|
+
{
|
|
215
|
+
definition: {
|
|
216
|
+
name: 'github_repos_create_in_org',
|
|
217
|
+
description: 'Create a new repository in an organization',
|
|
218
|
+
inputSchema: {
|
|
219
|
+
type: 'object',
|
|
220
|
+
properties: {
|
|
221
|
+
org: {
|
|
222
|
+
type: 'string',
|
|
223
|
+
description: 'Organization name',
|
|
224
|
+
},
|
|
225
|
+
name: {
|
|
226
|
+
type: 'string',
|
|
227
|
+
description: 'Repository name',
|
|
228
|
+
},
|
|
229
|
+
description: {
|
|
230
|
+
type: 'string',
|
|
231
|
+
description: 'Repository description',
|
|
232
|
+
},
|
|
233
|
+
private: {
|
|
234
|
+
type: 'string',
|
|
235
|
+
enum: ['true', 'false'],
|
|
236
|
+
description: 'Whether the repository is private',
|
|
237
|
+
},
|
|
238
|
+
auto_init: {
|
|
239
|
+
type: 'string',
|
|
240
|
+
enum: ['true', 'false'],
|
|
241
|
+
description: 'Create an initial commit with README',
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
required: ['org', 'name'],
|
|
105
245
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
246
|
+
},
|
|
247
|
+
handler: async (octokit, args) => {
|
|
248
|
+
const { data } = await octokit.repos.createInOrg({
|
|
249
|
+
org: args.org,
|
|
250
|
+
name: args.name,
|
|
251
|
+
description: args.description,
|
|
252
|
+
private: args.private === 'true',
|
|
253
|
+
auto_init: args.auto_init === 'true',
|
|
254
|
+
});
|
|
255
|
+
return successResult(data);
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
// update - Update a repository
|
|
259
|
+
{
|
|
260
|
+
definition: {
|
|
261
|
+
name: 'github_repos_update',
|
|
262
|
+
description: 'Update a repository',
|
|
263
|
+
inputSchema: {
|
|
264
|
+
type: 'object',
|
|
265
|
+
properties: {
|
|
266
|
+
owner: {
|
|
267
|
+
type: 'string',
|
|
268
|
+
description: 'Repository owner',
|
|
269
|
+
},
|
|
270
|
+
repo: {
|
|
271
|
+
type: 'string',
|
|
272
|
+
description: 'Repository name',
|
|
273
|
+
},
|
|
274
|
+
name: {
|
|
275
|
+
type: 'string',
|
|
276
|
+
description: 'New repository name',
|
|
277
|
+
},
|
|
278
|
+
description: {
|
|
279
|
+
type: 'string',
|
|
280
|
+
description: 'Repository description',
|
|
281
|
+
},
|
|
282
|
+
private: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
enum: ['true', 'false'],
|
|
285
|
+
description: 'Whether the repository is private',
|
|
286
|
+
},
|
|
287
|
+
default_branch: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
description: 'Default branch name',
|
|
290
|
+
},
|
|
291
|
+
has_issues: {
|
|
292
|
+
type: 'string',
|
|
293
|
+
enum: ['true', 'false'],
|
|
294
|
+
description: 'Enable issues',
|
|
295
|
+
},
|
|
296
|
+
has_wiki: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
enum: ['true', 'false'],
|
|
299
|
+
description: 'Enable wiki',
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
required: ['owner', 'repo'],
|
|
109
303
|
},
|
|
110
|
-
per_page: { type: 'number' },
|
|
111
|
-
page: { type: 'number' },
|
|
112
304
|
},
|
|
113
|
-
|
|
305
|
+
handler: async (octokit, args) => {
|
|
306
|
+
const { data } = await octokit.repos.update({
|
|
307
|
+
owner: args.owner,
|
|
308
|
+
repo: args.repo,
|
|
309
|
+
name: args.name,
|
|
310
|
+
description: args.description,
|
|
311
|
+
private: args.private !== undefined ? args.private === 'true' : undefined,
|
|
312
|
+
default_branch: args.default_branch,
|
|
313
|
+
has_issues: args.has_issues !== undefined ? args.has_issues === 'true' : undefined,
|
|
314
|
+
has_wiki: args.has_wiki !== undefined ? args.has_wiki === 'true' : undefined,
|
|
315
|
+
});
|
|
316
|
+
return successResult(data);
|
|
317
|
+
},
|
|
114
318
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
319
|
+
// delete - Delete a repository
|
|
320
|
+
{
|
|
321
|
+
definition: {
|
|
322
|
+
name: 'github_repos_delete',
|
|
323
|
+
description: 'Delete a repository (requires delete_repo scope)',
|
|
324
|
+
inputSchema: {
|
|
325
|
+
type: 'object',
|
|
326
|
+
properties: {
|
|
327
|
+
owner: {
|
|
328
|
+
type: 'string',
|
|
329
|
+
description: 'Repository owner',
|
|
330
|
+
},
|
|
331
|
+
repo: {
|
|
332
|
+
type: 'string',
|
|
333
|
+
description: 'Repository name',
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
required: ['owner', 'repo'],
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
handler: async (octokit, args) => {
|
|
340
|
+
await octokit.repos.delete({
|
|
341
|
+
owner: args.owner,
|
|
342
|
+
repo: args.repo,
|
|
343
|
+
});
|
|
344
|
+
return successResult({ success: true, message: 'Repository deleted' });
|
|
345
|
+
},
|
|
128
346
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
347
|
+
// list_branches - List branches
|
|
348
|
+
{
|
|
349
|
+
definition: {
|
|
350
|
+
name: 'github_repos_list_branches',
|
|
351
|
+
description: 'List branches for a repository',
|
|
352
|
+
inputSchema: {
|
|
353
|
+
type: 'object',
|
|
354
|
+
properties: {
|
|
355
|
+
owner: {
|
|
356
|
+
type: 'string',
|
|
357
|
+
description: 'Repository owner',
|
|
358
|
+
},
|
|
359
|
+
repo: {
|
|
360
|
+
type: 'string',
|
|
361
|
+
description: 'Repository name',
|
|
362
|
+
},
|
|
363
|
+
protected: {
|
|
364
|
+
type: 'string',
|
|
365
|
+
enum: ['true', 'false'],
|
|
366
|
+
description: 'Filter by protected status',
|
|
367
|
+
},
|
|
368
|
+
per_page: {
|
|
369
|
+
type: 'number',
|
|
370
|
+
description: 'Results per page (max 100)',
|
|
371
|
+
},
|
|
372
|
+
page: {
|
|
373
|
+
type: 'number',
|
|
374
|
+
description: 'Page number',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
required: ['owner', 'repo'],
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
handler: async (octokit, args) => {
|
|
381
|
+
const { data } = await octokit.repos.listBranches({
|
|
382
|
+
owner: args.owner,
|
|
383
|
+
repo: args.repo,
|
|
384
|
+
protected: args.protected !== undefined ? args.protected === 'true' : undefined,
|
|
385
|
+
per_page: args.per_page,
|
|
386
|
+
page: args.page,
|
|
387
|
+
});
|
|
388
|
+
return successResult(data);
|
|
389
|
+
},
|
|
143
390
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
391
|
+
// get_branch - Get a branch
|
|
392
|
+
{
|
|
393
|
+
definition: {
|
|
394
|
+
name: 'github_repos_get_branch',
|
|
395
|
+
description: 'Get a branch by name',
|
|
396
|
+
inputSchema: {
|
|
397
|
+
type: 'object',
|
|
398
|
+
properties: {
|
|
399
|
+
owner: {
|
|
400
|
+
type: 'string',
|
|
401
|
+
description: 'Repository owner',
|
|
402
|
+
},
|
|
403
|
+
repo: {
|
|
404
|
+
type: 'string',
|
|
405
|
+
description: 'Repository name',
|
|
406
|
+
},
|
|
407
|
+
branch: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
description: 'Branch name',
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
required: ['owner', 'repo', 'branch'],
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
handler: async (octokit, args) => {
|
|
416
|
+
const { data } = await octokit.repos.getBranch({
|
|
417
|
+
owner: args.owner,
|
|
418
|
+
repo: args.repo,
|
|
419
|
+
branch: args.branch,
|
|
420
|
+
});
|
|
421
|
+
return successResult(data);
|
|
422
|
+
},
|
|
156
423
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
424
|
+
// list_commits - List commits
|
|
425
|
+
{
|
|
426
|
+
definition: {
|
|
427
|
+
name: 'github_repos_list_commits',
|
|
428
|
+
description: 'List commits for a repository',
|
|
429
|
+
inputSchema: {
|
|
430
|
+
type: 'object',
|
|
431
|
+
properties: {
|
|
432
|
+
owner: {
|
|
433
|
+
type: 'string',
|
|
434
|
+
description: 'Repository owner',
|
|
435
|
+
},
|
|
436
|
+
repo: {
|
|
437
|
+
type: 'string',
|
|
438
|
+
description: 'Repository name',
|
|
439
|
+
},
|
|
440
|
+
sha: {
|
|
441
|
+
type: 'string',
|
|
442
|
+
description: 'SHA or branch to start listing commits from',
|
|
443
|
+
},
|
|
444
|
+
path: {
|
|
445
|
+
type: 'string',
|
|
446
|
+
description: 'Only commits containing this file path',
|
|
447
|
+
},
|
|
448
|
+
author: {
|
|
449
|
+
type: 'string',
|
|
450
|
+
description: 'GitHub username or email to filter by',
|
|
451
|
+
},
|
|
452
|
+
per_page: {
|
|
453
|
+
type: 'number',
|
|
454
|
+
description: 'Results per page (max 100)',
|
|
455
|
+
},
|
|
456
|
+
page: {
|
|
457
|
+
type: 'number',
|
|
458
|
+
description: 'Page number',
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
required: ['owner', 'repo'],
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
handler: async (octokit, args) => {
|
|
465
|
+
const { data } = await octokit.repos.listCommits({
|
|
466
|
+
owner: args.owner,
|
|
467
|
+
repo: args.repo,
|
|
468
|
+
sha: args.sha,
|
|
469
|
+
path: args.path,
|
|
470
|
+
author: args.author,
|
|
471
|
+
per_page: args.per_page,
|
|
472
|
+
page: args.page,
|
|
473
|
+
});
|
|
474
|
+
return successResult(data);
|
|
475
|
+
},
|
|
170
476
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
477
|
+
// get_commit - Get a commit
|
|
478
|
+
{
|
|
479
|
+
definition: {
|
|
480
|
+
name: 'github_repos_get_commit',
|
|
481
|
+
description: 'Get a commit by SHA',
|
|
482
|
+
inputSchema: {
|
|
483
|
+
type: 'object',
|
|
484
|
+
properties: {
|
|
485
|
+
owner: {
|
|
486
|
+
type: 'string',
|
|
487
|
+
description: 'Repository owner',
|
|
488
|
+
},
|
|
489
|
+
repo: {
|
|
490
|
+
type: 'string',
|
|
491
|
+
description: 'Repository name',
|
|
492
|
+
},
|
|
493
|
+
ref: {
|
|
494
|
+
type: 'string',
|
|
495
|
+
description: 'Commit SHA, branch name, or tag name',
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
required: ['owner', 'repo', 'ref'],
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
handler: async (octokit, args) => {
|
|
502
|
+
const { data } = await octokit.repos.getCommit({
|
|
503
|
+
owner: args.owner,
|
|
504
|
+
repo: args.repo,
|
|
505
|
+
ref: args.ref,
|
|
506
|
+
});
|
|
507
|
+
return successResult(data);
|
|
508
|
+
},
|
|
187
509
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
510
|
+
// compare_commits - Compare two commits
|
|
511
|
+
{
|
|
512
|
+
definition: {
|
|
513
|
+
name: 'github_repos_compare_commits',
|
|
514
|
+
description: 'Compare two commits',
|
|
515
|
+
inputSchema: {
|
|
516
|
+
type: 'object',
|
|
517
|
+
properties: {
|
|
518
|
+
owner: {
|
|
519
|
+
type: 'string',
|
|
520
|
+
description: 'Repository owner',
|
|
521
|
+
},
|
|
522
|
+
repo: {
|
|
523
|
+
type: 'string',
|
|
524
|
+
description: 'Repository name',
|
|
525
|
+
},
|
|
526
|
+
base: {
|
|
527
|
+
type: 'string',
|
|
528
|
+
description: 'Base branch/commit SHA',
|
|
529
|
+
},
|
|
530
|
+
head: {
|
|
531
|
+
type: 'string',
|
|
532
|
+
description: 'Head branch/commit SHA',
|
|
533
|
+
},
|
|
534
|
+
per_page: {
|
|
535
|
+
type: 'number',
|
|
536
|
+
description: 'Results per page (max 100)',
|
|
537
|
+
},
|
|
538
|
+
page: {
|
|
539
|
+
type: 'number',
|
|
540
|
+
description: 'Page number',
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
required: ['owner', 'repo', 'base', 'head'],
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
|
+
handler: async (octokit, args) => {
|
|
547
|
+
const { data } = await octokit.repos.compareCommits({
|
|
548
|
+
owner: args.owner,
|
|
549
|
+
repo: args.repo,
|
|
550
|
+
base: args.base,
|
|
551
|
+
head: args.head,
|
|
552
|
+
per_page: args.per_page,
|
|
553
|
+
page: args.page,
|
|
554
|
+
});
|
|
555
|
+
return successResult(data);
|
|
556
|
+
},
|
|
206
557
|
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
558
|
+
// get_content - Get repository content
|
|
559
|
+
{
|
|
560
|
+
definition: {
|
|
561
|
+
name: 'github_repos_get_content',
|
|
562
|
+
description: 'Get the contents of a file or directory',
|
|
563
|
+
inputSchema: {
|
|
564
|
+
type: 'object',
|
|
565
|
+
properties: {
|
|
566
|
+
owner: {
|
|
567
|
+
type: 'string',
|
|
568
|
+
description: 'Repository owner',
|
|
569
|
+
},
|
|
570
|
+
repo: {
|
|
571
|
+
type: 'string',
|
|
572
|
+
description: 'Repository name',
|
|
573
|
+
},
|
|
574
|
+
path: {
|
|
575
|
+
type: 'string',
|
|
576
|
+
description: 'Path to file or directory',
|
|
577
|
+
},
|
|
578
|
+
ref: {
|
|
579
|
+
type: 'string',
|
|
580
|
+
description: 'Branch, tag, or commit SHA',
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
required: ['owner', 'repo', 'path'],
|
|
584
|
+
},
|
|
585
|
+
},
|
|
586
|
+
handler: async (octokit, args) => {
|
|
587
|
+
const { data } = await octokit.repos.getContent({
|
|
588
|
+
owner: args.owner,
|
|
589
|
+
repo: args.repo,
|
|
590
|
+
path: args.path,
|
|
591
|
+
ref: args.ref,
|
|
592
|
+
});
|
|
593
|
+
return successResult(data);
|
|
594
|
+
},
|
|
219
595
|
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
596
|
+
// create_or_update_file - Create or update a file
|
|
597
|
+
{
|
|
598
|
+
definition: {
|
|
599
|
+
name: 'github_repos_create_or_update_file',
|
|
600
|
+
description: 'Create or update a file in a repository',
|
|
601
|
+
inputSchema: {
|
|
602
|
+
type: 'object',
|
|
603
|
+
properties: {
|
|
604
|
+
owner: {
|
|
605
|
+
type: 'string',
|
|
606
|
+
description: 'Repository owner',
|
|
607
|
+
},
|
|
608
|
+
repo: {
|
|
609
|
+
type: 'string',
|
|
610
|
+
description: 'Repository name',
|
|
611
|
+
},
|
|
612
|
+
path: {
|
|
613
|
+
type: 'string',
|
|
614
|
+
description: 'Path to the file',
|
|
615
|
+
},
|
|
616
|
+
message: {
|
|
617
|
+
type: 'string',
|
|
618
|
+
description: 'Commit message',
|
|
619
|
+
},
|
|
620
|
+
content: {
|
|
621
|
+
type: 'string',
|
|
622
|
+
description: 'File content (will be base64 encoded)',
|
|
623
|
+
},
|
|
624
|
+
sha: {
|
|
625
|
+
type: 'string',
|
|
626
|
+
description: 'SHA of file being replaced (required for updates)',
|
|
627
|
+
},
|
|
628
|
+
branch: {
|
|
629
|
+
type: 'string',
|
|
630
|
+
description: 'Branch to commit to',
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
required: ['owner', 'repo', 'path', 'message', 'content'],
|
|
634
|
+
},
|
|
635
|
+
},
|
|
636
|
+
handler: async (octokit, args) => {
|
|
637
|
+
const content = Buffer.from(args.content).toString('base64');
|
|
638
|
+
const { data } = await octokit.repos.createOrUpdateFileContents({
|
|
639
|
+
owner: args.owner,
|
|
640
|
+
repo: args.repo,
|
|
641
|
+
path: args.path,
|
|
642
|
+
message: args.message,
|
|
643
|
+
content,
|
|
644
|
+
sha: args.sha,
|
|
645
|
+
branch: args.branch,
|
|
646
|
+
});
|
|
647
|
+
return successResult(data);
|
|
648
|
+
},
|
|
232
649
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
650
|
+
// delete_file - Delete a file
|
|
651
|
+
{
|
|
652
|
+
definition: {
|
|
653
|
+
name: 'github_repos_delete_file',
|
|
654
|
+
description: 'Delete a file from a repository',
|
|
655
|
+
inputSchema: {
|
|
656
|
+
type: 'object',
|
|
657
|
+
properties: {
|
|
658
|
+
owner: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
description: 'Repository owner',
|
|
661
|
+
},
|
|
662
|
+
repo: {
|
|
663
|
+
type: 'string',
|
|
664
|
+
description: 'Repository name',
|
|
665
|
+
},
|
|
666
|
+
path: {
|
|
667
|
+
type: 'string',
|
|
668
|
+
description: 'Path to the file',
|
|
669
|
+
},
|
|
670
|
+
message: {
|
|
671
|
+
type: 'string',
|
|
672
|
+
description: 'Commit message',
|
|
673
|
+
},
|
|
674
|
+
sha: {
|
|
675
|
+
type: 'string',
|
|
676
|
+
description: 'SHA of the file being deleted',
|
|
677
|
+
},
|
|
678
|
+
branch: {
|
|
679
|
+
type: 'string',
|
|
680
|
+
description: 'Branch to commit to',
|
|
681
|
+
},
|
|
682
|
+
},
|
|
683
|
+
required: ['owner', 'repo', 'path', 'message', 'sha'],
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
handler: async (octokit, args) => {
|
|
687
|
+
const { data } = await octokit.repos.deleteFile({
|
|
688
|
+
owner: args.owner,
|
|
689
|
+
repo: args.repo,
|
|
690
|
+
path: args.path,
|
|
691
|
+
message: args.message,
|
|
692
|
+
sha: args.sha,
|
|
693
|
+
branch: args.branch,
|
|
694
|
+
});
|
|
695
|
+
return successResult(data);
|
|
696
|
+
},
|
|
247
697
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
698
|
+
// list_collaborators - List collaborators
|
|
699
|
+
{
|
|
700
|
+
definition: {
|
|
701
|
+
name: 'github_repos_list_collaborators',
|
|
702
|
+
description: 'List collaborators for a repository',
|
|
703
|
+
inputSchema: {
|
|
704
|
+
type: 'object',
|
|
705
|
+
properties: {
|
|
706
|
+
owner: {
|
|
707
|
+
type: 'string',
|
|
708
|
+
description: 'Repository owner',
|
|
709
|
+
},
|
|
710
|
+
repo: {
|
|
711
|
+
type: 'string',
|
|
712
|
+
description: 'Repository name',
|
|
713
|
+
},
|
|
714
|
+
affiliation: {
|
|
715
|
+
type: 'string',
|
|
716
|
+
enum: ['outside', 'direct', 'all'],
|
|
717
|
+
description: 'Filter by affiliation',
|
|
718
|
+
},
|
|
719
|
+
per_page: {
|
|
720
|
+
type: 'number',
|
|
721
|
+
description: 'Results per page (max 100)',
|
|
722
|
+
},
|
|
723
|
+
page: {
|
|
724
|
+
type: 'number',
|
|
725
|
+
description: 'Page number',
|
|
726
|
+
},
|
|
727
|
+
},
|
|
728
|
+
required: ['owner', 'repo'],
|
|
729
|
+
},
|
|
730
|
+
},
|
|
731
|
+
handler: async (octokit, args) => {
|
|
732
|
+
const { data } = await octokit.repos.listCollaborators({
|
|
733
|
+
owner: args.owner,
|
|
734
|
+
repo: args.repo,
|
|
735
|
+
affiliation: args.affiliation,
|
|
736
|
+
per_page: args.per_page,
|
|
737
|
+
page: args.page,
|
|
738
|
+
});
|
|
739
|
+
return successResult(data);
|
|
740
|
+
},
|
|
261
741
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
742
|
+
// add_collaborator - Add a collaborator
|
|
743
|
+
{
|
|
744
|
+
definition: {
|
|
745
|
+
name: 'github_repos_add_collaborator',
|
|
746
|
+
description: 'Add a collaborator to a repository',
|
|
747
|
+
inputSchema: {
|
|
748
|
+
type: 'object',
|
|
749
|
+
properties: {
|
|
750
|
+
owner: {
|
|
751
|
+
type: 'string',
|
|
752
|
+
description: 'Repository owner',
|
|
753
|
+
},
|
|
754
|
+
repo: {
|
|
755
|
+
type: 'string',
|
|
756
|
+
description: 'Repository name',
|
|
757
|
+
},
|
|
758
|
+
username: {
|
|
759
|
+
type: 'string',
|
|
760
|
+
description: 'Username to add',
|
|
761
|
+
},
|
|
762
|
+
permission: {
|
|
763
|
+
type: 'string',
|
|
764
|
+
enum: ['pull', 'push', 'admin', 'maintain', 'triage'],
|
|
765
|
+
description: 'Permission level',
|
|
766
|
+
},
|
|
767
|
+
},
|
|
768
|
+
required: ['owner', 'repo', 'username'],
|
|
769
|
+
},
|
|
770
|
+
},
|
|
771
|
+
handler: async (octokit, args) => {
|
|
772
|
+
const { data } = await octokit.repos.addCollaborator({
|
|
773
|
+
owner: args.owner,
|
|
774
|
+
repo: args.repo,
|
|
775
|
+
username: args.username,
|
|
776
|
+
permission: args.permission,
|
|
777
|
+
});
|
|
778
|
+
return successResult(data || { success: true, message: 'Collaborator added' });
|
|
779
|
+
},
|
|
275
780
|
},
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
781
|
+
// list_forks - List forks
|
|
782
|
+
{
|
|
783
|
+
definition: {
|
|
784
|
+
name: 'github_repos_list_forks',
|
|
785
|
+
description: 'List forks of a repository',
|
|
786
|
+
inputSchema: {
|
|
787
|
+
type: 'object',
|
|
788
|
+
properties: {
|
|
789
|
+
owner: {
|
|
790
|
+
type: 'string',
|
|
791
|
+
description: 'Repository owner',
|
|
792
|
+
},
|
|
793
|
+
repo: {
|
|
794
|
+
type: 'string',
|
|
795
|
+
description: 'Repository name',
|
|
796
|
+
},
|
|
797
|
+
sort: {
|
|
798
|
+
type: 'string',
|
|
799
|
+
enum: ['newest', 'oldest', 'stargazers', 'watchers'],
|
|
800
|
+
description: 'Sort field',
|
|
801
|
+
},
|
|
802
|
+
per_page: {
|
|
803
|
+
type: 'number',
|
|
804
|
+
description: 'Results per page (max 100)',
|
|
805
|
+
},
|
|
806
|
+
page: {
|
|
807
|
+
type: 'number',
|
|
808
|
+
description: 'Page number',
|
|
809
|
+
},
|
|
810
|
+
},
|
|
811
|
+
required: ['owner', 'repo'],
|
|
812
|
+
},
|
|
813
|
+
},
|
|
814
|
+
handler: async (octokit, args) => {
|
|
815
|
+
const { data } = await octokit.repos.listForks({
|
|
816
|
+
owner: args.owner,
|
|
817
|
+
repo: args.repo,
|
|
818
|
+
sort: args.sort,
|
|
819
|
+
per_page: args.per_page,
|
|
820
|
+
page: args.page,
|
|
821
|
+
});
|
|
822
|
+
return successResult(data);
|
|
823
|
+
},
|
|
287
824
|
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
825
|
+
// create_fork - Create a fork
|
|
826
|
+
{
|
|
827
|
+
definition: {
|
|
828
|
+
name: 'github_repos_create_fork',
|
|
829
|
+
description: 'Create a fork of a repository',
|
|
830
|
+
inputSchema: {
|
|
831
|
+
type: 'object',
|
|
832
|
+
properties: {
|
|
833
|
+
owner: {
|
|
834
|
+
type: 'string',
|
|
835
|
+
description: 'Repository owner',
|
|
836
|
+
},
|
|
837
|
+
repo: {
|
|
838
|
+
type: 'string',
|
|
839
|
+
description: 'Repository name',
|
|
840
|
+
},
|
|
841
|
+
organization: {
|
|
842
|
+
type: 'string',
|
|
843
|
+
description: 'Organization to fork into (optional)',
|
|
844
|
+
},
|
|
845
|
+
name: {
|
|
846
|
+
type: 'string',
|
|
847
|
+
description: 'Name for the forked repository',
|
|
848
|
+
},
|
|
849
|
+
default_branch_only: {
|
|
850
|
+
type: 'string',
|
|
851
|
+
enum: ['true', 'false'],
|
|
852
|
+
description: 'Only fork the default branch',
|
|
853
|
+
},
|
|
854
|
+
},
|
|
855
|
+
required: ['owner', 'repo'],
|
|
856
|
+
},
|
|
857
|
+
},
|
|
858
|
+
handler: async (octokit, args) => {
|
|
859
|
+
const { data } = await octokit.repos.createFork({
|
|
860
|
+
owner: args.owner,
|
|
861
|
+
repo: args.repo,
|
|
862
|
+
organization: args.organization,
|
|
863
|
+
name: args.name,
|
|
864
|
+
default_branch_only: args.default_branch_only === 'true',
|
|
865
|
+
});
|
|
866
|
+
return successResult(data);
|
|
867
|
+
},
|
|
305
868
|
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
export async function handleReposTool(octokit, args) {
|
|
309
|
-
// Extract tool name from the call context
|
|
310
|
-
// This is a simplified handler - in practice, you'd want to route based on tool name
|
|
311
|
-
// For list (authenticated user's repos)
|
|
312
|
-
if ('visibility' in args || ('affiliation' in args && !('username' in args) && !('org' in args))) {
|
|
313
|
-
const { data } = await octokit.repos.listForAuthenticatedUser(args);
|
|
314
|
-
return data;
|
|
315
|
-
}
|
|
316
|
-
// For listForUser
|
|
317
|
-
if ('username' in args && !('owner' in args)) {
|
|
318
|
-
const { data } = await octokit.repos.listForUser(args);
|
|
319
|
-
return data;
|
|
320
|
-
}
|
|
321
|
-
// For listForOrg
|
|
322
|
-
if ('org' in args && !('owner' in args)) {
|
|
323
|
-
const { data } = await octokit.repos.listForOrg(args);
|
|
324
|
-
return data;
|
|
325
|
-
}
|
|
326
|
-
// For get
|
|
327
|
-
if ('owner' in args && 'repo' in args && !('name' in args) && !('path' in args) && !('branch' in args) && !('ref' in args) && !('tag_name' in args) && !('basehead' in args)) {
|
|
328
|
-
const { data } = await octokit.repos.get(args);
|
|
329
|
-
return data;
|
|
330
|
-
}
|
|
331
|
-
// For create
|
|
332
|
-
if ('name' in args && !('owner' in args)) {
|
|
333
|
-
const { data } = await octokit.repos.createForAuthenticatedUser(args);
|
|
334
|
-
return data;
|
|
335
|
-
}
|
|
336
|
-
// For fork
|
|
337
|
-
if ('owner' in args && 'repo' in args && ('organization' in args || Object.keys(args).length === 2)) {
|
|
338
|
-
const { data } = await octokit.repos.createFork(args);
|
|
339
|
-
return data;
|
|
340
|
-
}
|
|
341
|
-
// For branches
|
|
342
|
-
if ('owner' in args && 'repo' in args && 'branch' in args) {
|
|
343
|
-
const { data } = await octokit.repos.getBranch(args);
|
|
344
|
-
return data;
|
|
345
|
-
}
|
|
346
|
-
if ('owner' in args && 'repo' in args && 'protected' in args) {
|
|
347
|
-
const { data } = await octokit.repos.listBranches(args);
|
|
348
|
-
return data;
|
|
349
|
-
}
|
|
350
|
-
// For content
|
|
351
|
-
if ('owner' in args && 'repo' in args && 'path' in args && !('message' in args)) {
|
|
352
|
-
const { data } = await octokit.repos.getContent(args);
|
|
353
|
-
return data;
|
|
354
|
-
}
|
|
355
|
-
// For create/update file
|
|
356
|
-
if ('owner' in args && 'repo' in args && 'path' in args && 'message' in args && 'content' in args) {
|
|
357
|
-
const { data } = await octokit.repos.createOrUpdateFileContents(args);
|
|
358
|
-
return data;
|
|
359
|
-
}
|
|
360
|
-
// For commits
|
|
361
|
-
if ('owner' in args && 'repo' in args && 'ref' in args && !('basehead' in args)) {
|
|
362
|
-
const { data } = await octokit.repos.getCommit(args);
|
|
363
|
-
return data;
|
|
364
|
-
}
|
|
365
|
-
if ('owner' in args && 'repo' in args && 'basehead' in args) {
|
|
366
|
-
const { data } = await octokit.repos.compareCommits(args);
|
|
367
|
-
return data;
|
|
368
|
-
}
|
|
369
|
-
if ('owner' in args && 'repo' in args && ('sha' in args || 'author' in args || 'since' in args || 'until' in args)) {
|
|
370
|
-
const { data } = await octokit.repos.listCommits(args);
|
|
371
|
-
return data;
|
|
372
|
-
}
|
|
373
|
-
// For contributors
|
|
374
|
-
if ('owner' in args && 'repo' in args && 'anon' in args) {
|
|
375
|
-
const { data } = await octokit.repos.listContributors(args);
|
|
376
|
-
return data;
|
|
377
|
-
}
|
|
378
|
-
// For releases
|
|
379
|
-
if ('owner' in args && 'repo' in args && 'tag_name' in args) {
|
|
380
|
-
const { data } = await octokit.repos.createRelease(args);
|
|
381
|
-
return data;
|
|
382
|
-
}
|
|
383
|
-
// For tags
|
|
384
|
-
if ('owner' in args && 'repo' in args) {
|
|
385
|
-
const { data } = await octokit.repos.listTags(args);
|
|
386
|
-
return data;
|
|
387
|
-
}
|
|
388
|
-
// Default: list for authenticated user
|
|
389
|
-
const { data } = await octokit.repos.listForAuthenticatedUser();
|
|
390
|
-
return data;
|
|
391
|
-
}
|
|
392
|
-
//# sourceMappingURL=repos.js.map
|
|
869
|
+
],
|
|
870
|
+
};
|