@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,315 +1,504 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { successResult } from '../types.js';
|
|
2
|
+
export const gistsCategory = {
|
|
3
|
+
name: 'gists',
|
|
4
|
+
description: 'GitHub gist tools',
|
|
5
|
+
tools: [
|
|
6
|
+
// list - List gists for authenticated user
|
|
7
|
+
{
|
|
8
|
+
definition: {
|
|
9
|
+
name: 'github_gists_list',
|
|
10
|
+
description: 'List gists for the authenticated user',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {
|
|
14
|
+
since: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Only show gists updated after this time (ISO 8601 format)',
|
|
17
|
+
},
|
|
18
|
+
per_page: {
|
|
19
|
+
type: 'number',
|
|
20
|
+
description: 'Results per page (max 100)',
|
|
21
|
+
},
|
|
22
|
+
page: {
|
|
23
|
+
type: 'number',
|
|
24
|
+
description: 'Page number',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
handler: async (octokit, args) => {
|
|
30
|
+
const { data } = await octokit.gists.list({
|
|
31
|
+
since: args.since,
|
|
32
|
+
per_page: args.per_page,
|
|
33
|
+
page: args.page,
|
|
34
|
+
});
|
|
35
|
+
return successResult(data);
|
|
11
36
|
},
|
|
12
37
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
38
|
+
// list_public - List public gists
|
|
39
|
+
{
|
|
40
|
+
definition: {
|
|
41
|
+
name: 'github_gists_list_public',
|
|
42
|
+
description: 'List all public gists',
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
properties: {
|
|
46
|
+
since: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Only show gists updated after this time (ISO 8601 format)',
|
|
49
|
+
},
|
|
50
|
+
per_page: {
|
|
51
|
+
type: 'number',
|
|
52
|
+
description: 'Results per page (max 100)',
|
|
53
|
+
},
|
|
54
|
+
page: {
|
|
55
|
+
type: 'number',
|
|
56
|
+
description: 'Page number',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
handler: async (octokit, args) => {
|
|
62
|
+
const { data } = await octokit.gists.listPublic({
|
|
63
|
+
since: args.since,
|
|
64
|
+
per_page: args.per_page,
|
|
65
|
+
page: args.page,
|
|
66
|
+
});
|
|
67
|
+
return successResult(data);
|
|
68
|
+
},
|
|
26
69
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
70
|
+
// list_starred - List starred gists
|
|
71
|
+
{
|
|
72
|
+
definition: {
|
|
73
|
+
name: 'github_gists_list_starred',
|
|
74
|
+
description: 'List starred gists for the authenticated user',
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: 'object',
|
|
77
|
+
properties: {
|
|
78
|
+
since: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
description: 'Only show gists updated after this time (ISO 8601 format)',
|
|
81
|
+
},
|
|
82
|
+
per_page: {
|
|
83
|
+
type: 'number',
|
|
84
|
+
description: 'Results per page (max 100)',
|
|
85
|
+
},
|
|
86
|
+
page: {
|
|
87
|
+
type: 'number',
|
|
88
|
+
description: 'Page number',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
handler: async (octokit, args) => {
|
|
94
|
+
const { data } = await octokit.gists.listStarred({
|
|
95
|
+
since: args.since,
|
|
96
|
+
per_page: args.per_page,
|
|
97
|
+
page: args.page,
|
|
98
|
+
});
|
|
99
|
+
return successResult(data);
|
|
37
100
|
},
|
|
38
101
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
102
|
+
// list_for_user - List gists for a user
|
|
103
|
+
{
|
|
104
|
+
definition: {
|
|
105
|
+
name: 'github_gists_list_for_user',
|
|
106
|
+
description: 'List public gists for a user',
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
properties: {
|
|
110
|
+
username: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
description: 'GitHub username',
|
|
113
|
+
},
|
|
114
|
+
since: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Only show gists updated after this time (ISO 8601 format)',
|
|
117
|
+
},
|
|
118
|
+
per_page: {
|
|
119
|
+
type: 'number',
|
|
120
|
+
description: 'Results per page (max 100)',
|
|
121
|
+
},
|
|
122
|
+
page: {
|
|
123
|
+
type: 'number',
|
|
124
|
+
description: 'Page number',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
required: ['username'],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
handler: async (octokit, args) => {
|
|
131
|
+
const { data } = await octokit.gists.listForUser({
|
|
132
|
+
username: args.username,
|
|
133
|
+
since: args.since,
|
|
134
|
+
per_page: args.per_page,
|
|
135
|
+
page: args.page,
|
|
136
|
+
});
|
|
137
|
+
return successResult(data);
|
|
49
138
|
},
|
|
50
139
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
140
|
+
// get - Get a gist
|
|
141
|
+
{
|
|
142
|
+
definition: {
|
|
143
|
+
name: 'github_gists_get',
|
|
144
|
+
description: 'Get a gist by ID',
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
gist_id: {
|
|
149
|
+
type: 'string',
|
|
150
|
+
description: 'The unique identifier of the gist',
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
required: ['gist_id'],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
handler: async (octokit, args) => {
|
|
157
|
+
const { data } = await octokit.gists.get({
|
|
158
|
+
gist_id: args.gist_id,
|
|
159
|
+
});
|
|
160
|
+
return successResult(data);
|
|
161
|
+
},
|
|
61
162
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
properties: {
|
|
69
|
-
description: { type: 'string', description: 'Gist description' },
|
|
70
|
-
files: {
|
|
163
|
+
// create - Create a gist
|
|
164
|
+
{
|
|
165
|
+
definition: {
|
|
166
|
+
name: 'github_gists_create',
|
|
167
|
+
description: 'Create a new gist',
|
|
168
|
+
inputSchema: {
|
|
71
169
|
type: 'object',
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
170
|
+
properties: {
|
|
171
|
+
description: {
|
|
172
|
+
type: 'string',
|
|
173
|
+
description: 'Description of the gist',
|
|
174
|
+
},
|
|
175
|
+
files: {
|
|
176
|
+
type: 'object',
|
|
177
|
+
description: 'Files to include in the gist (object with filename keys and {content} values)',
|
|
178
|
+
},
|
|
179
|
+
public: {
|
|
180
|
+
type: 'string',
|
|
181
|
+
enum: ['true', 'false'],
|
|
182
|
+
description: 'Whether the gist is public',
|
|
77
183
|
},
|
|
78
|
-
required: ['content'],
|
|
79
184
|
},
|
|
185
|
+
required: ['files'],
|
|
80
186
|
},
|
|
81
|
-
public: { type: 'boolean', description: 'Whether the gist is public' },
|
|
82
187
|
},
|
|
83
|
-
|
|
188
|
+
handler: async (octokit, args) => {
|
|
189
|
+
const { data } = await octokit.gists.create({
|
|
190
|
+
description: args.description,
|
|
191
|
+
files: args.files,
|
|
192
|
+
public: args.public === 'true',
|
|
193
|
+
});
|
|
194
|
+
return successResult(data);
|
|
195
|
+
},
|
|
84
196
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
properties: {
|
|
92
|
-
gist_id: { type: 'string', description: 'Gist ID' },
|
|
93
|
-
description: { type: 'string', description: 'Gist description' },
|
|
94
|
-
files: {
|
|
197
|
+
// update - Update a gist
|
|
198
|
+
{
|
|
199
|
+
definition: {
|
|
200
|
+
name: 'github_gists_update',
|
|
201
|
+
description: 'Update a gist',
|
|
202
|
+
inputSchema: {
|
|
95
203
|
type: 'object',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
204
|
+
properties: {
|
|
205
|
+
gist_id: {
|
|
206
|
+
type: 'string',
|
|
207
|
+
description: 'The unique identifier of the gist',
|
|
208
|
+
},
|
|
209
|
+
description: {
|
|
210
|
+
type: 'string',
|
|
211
|
+
description: 'Description of the gist',
|
|
212
|
+
},
|
|
213
|
+
files: {
|
|
214
|
+
type: 'object',
|
|
215
|
+
description: 'Files to update (set content to null to delete a file)',
|
|
102
216
|
},
|
|
103
217
|
},
|
|
218
|
+
required: ['gist_id'],
|
|
104
219
|
},
|
|
105
220
|
},
|
|
106
|
-
|
|
221
|
+
handler: async (octokit, args) => {
|
|
222
|
+
const { data } = await octokit.gists.update({
|
|
223
|
+
gist_id: args.gist_id,
|
|
224
|
+
description: args.description,
|
|
225
|
+
files: args.files,
|
|
226
|
+
});
|
|
227
|
+
return successResult(data);
|
|
228
|
+
},
|
|
107
229
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
230
|
+
// delete - Delete a gist
|
|
231
|
+
{
|
|
232
|
+
definition: {
|
|
233
|
+
name: 'github_gists_delete',
|
|
234
|
+
description: 'Delete a gist',
|
|
235
|
+
inputSchema: {
|
|
236
|
+
type: 'object',
|
|
237
|
+
properties: {
|
|
238
|
+
gist_id: {
|
|
239
|
+
type: 'string',
|
|
240
|
+
description: 'The unique identifier of the gist',
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
required: ['gist_id'],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
handler: async (octokit, args) => {
|
|
247
|
+
await octokit.gists.delete({
|
|
248
|
+
gist_id: args.gist_id,
|
|
249
|
+
});
|
|
250
|
+
return successResult({ success: true, message: 'Gist deleted' });
|
|
251
|
+
},
|
|
118
252
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
253
|
+
// fork - Fork a gist
|
|
254
|
+
{
|
|
255
|
+
definition: {
|
|
256
|
+
name: 'github_gists_fork',
|
|
257
|
+
description: 'Fork a gist',
|
|
258
|
+
inputSchema: {
|
|
259
|
+
type: 'object',
|
|
260
|
+
properties: {
|
|
261
|
+
gist_id: {
|
|
262
|
+
type: 'string',
|
|
263
|
+
description: 'The unique identifier of the gist',
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
required: ['gist_id'],
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
handler: async (octokit, args) => {
|
|
270
|
+
const { data } = await octokit.gists.fork({
|
|
271
|
+
gist_id: args.gist_id,
|
|
272
|
+
});
|
|
273
|
+
return successResult(data);
|
|
274
|
+
},
|
|
129
275
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
276
|
+
// star - Star a gist
|
|
277
|
+
{
|
|
278
|
+
definition: {
|
|
279
|
+
name: 'github_gists_star',
|
|
280
|
+
description: 'Star a gist',
|
|
281
|
+
inputSchema: {
|
|
282
|
+
type: 'object',
|
|
283
|
+
properties: {
|
|
284
|
+
gist_id: {
|
|
285
|
+
type: 'string',
|
|
286
|
+
description: 'The unique identifier of the gist',
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
required: ['gist_id'],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
handler: async (octokit, args) => {
|
|
293
|
+
await octokit.gists.star({
|
|
294
|
+
gist_id: args.gist_id,
|
|
295
|
+
});
|
|
296
|
+
return successResult({ success: true, message: 'Gist starred' });
|
|
297
|
+
},
|
|
140
298
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
299
|
+
// unstar - Unstar a gist
|
|
300
|
+
{
|
|
301
|
+
definition: {
|
|
302
|
+
name: 'github_gists_unstar',
|
|
303
|
+
description: 'Unstar a gist',
|
|
304
|
+
inputSchema: {
|
|
305
|
+
type: 'object',
|
|
306
|
+
properties: {
|
|
307
|
+
gist_id: {
|
|
308
|
+
type: 'string',
|
|
309
|
+
description: 'The unique identifier of the gist',
|
|
310
|
+
},
|
|
311
|
+
},
|
|
312
|
+
required: ['gist_id'],
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
handler: async (octokit, args) => {
|
|
316
|
+
await octokit.gists.unstar({
|
|
317
|
+
gist_id: args.gist_id,
|
|
318
|
+
});
|
|
319
|
+
return successResult({ success: true, message: 'Gist unstarred' });
|
|
320
|
+
},
|
|
151
321
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
322
|
+
// check_is_starred - Check if a gist is starred
|
|
323
|
+
{
|
|
324
|
+
definition: {
|
|
325
|
+
name: 'github_gists_check_is_starred',
|
|
326
|
+
description: 'Check if a gist is starred by the authenticated user',
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: 'object',
|
|
329
|
+
properties: {
|
|
330
|
+
gist_id: {
|
|
331
|
+
type: 'string',
|
|
332
|
+
description: 'The unique identifier of the gist',
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
required: ['gist_id'],
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
handler: async (octokit, args) => {
|
|
339
|
+
try {
|
|
340
|
+
await octokit.gists.checkIsStarred({
|
|
341
|
+
gist_id: args.gist_id,
|
|
342
|
+
});
|
|
343
|
+
return successResult({ starred: true });
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
if (error && typeof error === 'object' && 'status' in error && error.status === 404) {
|
|
347
|
+
return successResult({ starred: false });
|
|
348
|
+
}
|
|
349
|
+
throw error;
|
|
350
|
+
}
|
|
351
|
+
},
|
|
162
352
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
353
|
+
// list_comments - List comments on a gist
|
|
354
|
+
{
|
|
355
|
+
definition: {
|
|
356
|
+
name: 'github_gists_list_comments',
|
|
357
|
+
description: 'List comments on a gist',
|
|
358
|
+
inputSchema: {
|
|
359
|
+
type: 'object',
|
|
360
|
+
properties: {
|
|
361
|
+
gist_id: {
|
|
362
|
+
type: 'string',
|
|
363
|
+
description: 'The unique identifier of the gist',
|
|
364
|
+
},
|
|
365
|
+
per_page: {
|
|
366
|
+
type: 'number',
|
|
367
|
+
description: 'Results per page (max 100)',
|
|
368
|
+
},
|
|
369
|
+
page: {
|
|
370
|
+
type: 'number',
|
|
371
|
+
description: 'Page number',
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
required: ['gist_id'],
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
handler: async (octokit, args) => {
|
|
378
|
+
const { data } = await octokit.gists.listComments({
|
|
379
|
+
gist_id: args.gist_id,
|
|
380
|
+
per_page: args.per_page,
|
|
381
|
+
page: args.page,
|
|
382
|
+
});
|
|
383
|
+
return successResult(data);
|
|
384
|
+
},
|
|
175
385
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
386
|
+
// get_comment - Get a comment on a gist
|
|
387
|
+
{
|
|
388
|
+
definition: {
|
|
389
|
+
name: 'github_gists_get_comment',
|
|
390
|
+
description: 'Get a comment on a gist',
|
|
391
|
+
inputSchema: {
|
|
392
|
+
type: 'object',
|
|
393
|
+
properties: {
|
|
394
|
+
gist_id: {
|
|
395
|
+
type: 'string',
|
|
396
|
+
description: 'The unique identifier of the gist',
|
|
397
|
+
},
|
|
398
|
+
comment_id: {
|
|
399
|
+
type: 'number',
|
|
400
|
+
description: 'The unique identifier of the comment',
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
required: ['gist_id', 'comment_id'],
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
handler: async (octokit, args) => {
|
|
407
|
+
const { data } = await octokit.gists.getComment({
|
|
408
|
+
gist_id: args.gist_id,
|
|
409
|
+
comment_id: args.comment_id,
|
|
410
|
+
});
|
|
411
|
+
return successResult(data);
|
|
412
|
+
},
|
|
188
413
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
414
|
+
// create_comment - Create a comment on a gist
|
|
415
|
+
{
|
|
416
|
+
definition: {
|
|
417
|
+
name: 'github_gists_create_comment',
|
|
418
|
+
description: 'Create a comment on a gist',
|
|
419
|
+
inputSchema: {
|
|
420
|
+
type: 'object',
|
|
421
|
+
properties: {
|
|
422
|
+
gist_id: {
|
|
423
|
+
type: 'string',
|
|
424
|
+
description: 'The unique identifier of the gist',
|
|
425
|
+
},
|
|
426
|
+
body: {
|
|
427
|
+
type: 'string',
|
|
428
|
+
description: 'The comment text',
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
required: ['gist_id', 'body'],
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
handler: async (octokit, args) => {
|
|
435
|
+
const { data } = await octokit.gists.createComment({
|
|
436
|
+
gist_id: args.gist_id,
|
|
437
|
+
body: args.body,
|
|
438
|
+
});
|
|
439
|
+
return successResult(data);
|
|
440
|
+
},
|
|
200
441
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
442
|
+
// update_comment - Update a comment on a gist
|
|
443
|
+
{
|
|
444
|
+
definition: {
|
|
445
|
+
name: 'github_gists_update_comment',
|
|
446
|
+
description: 'Update a comment on a gist',
|
|
447
|
+
inputSchema: {
|
|
448
|
+
type: 'object',
|
|
449
|
+
properties: {
|
|
450
|
+
gist_id: {
|
|
451
|
+
type: 'string',
|
|
452
|
+
description: 'The unique identifier of the gist',
|
|
453
|
+
},
|
|
454
|
+
comment_id: {
|
|
455
|
+
type: 'number',
|
|
456
|
+
description: 'The unique identifier of the comment',
|
|
457
|
+
},
|
|
458
|
+
body: {
|
|
459
|
+
type: 'string',
|
|
460
|
+
description: 'The updated comment text',
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
required: ['gist_id', 'comment_id', 'body'],
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
handler: async (octokit, args) => {
|
|
467
|
+
const { data } = await octokit.gists.updateComment({
|
|
468
|
+
gist_id: args.gist_id,
|
|
469
|
+
comment_id: args.comment_id,
|
|
470
|
+
body: args.body,
|
|
471
|
+
});
|
|
472
|
+
return successResult(data);
|
|
473
|
+
},
|
|
212
474
|
},
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
475
|
+
// delete_comment - Delete a comment on a gist
|
|
476
|
+
{
|
|
477
|
+
definition: {
|
|
478
|
+
name: 'github_gists_delete_comment',
|
|
479
|
+
description: 'Delete a comment on a gist',
|
|
480
|
+
inputSchema: {
|
|
481
|
+
type: 'object',
|
|
482
|
+
properties: {
|
|
483
|
+
gist_id: {
|
|
484
|
+
type: 'string',
|
|
485
|
+
description: 'The unique identifier of the gist',
|
|
486
|
+
},
|
|
487
|
+
comment_id: {
|
|
488
|
+
type: 'number',
|
|
489
|
+
description: 'The unique identifier of the comment',
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
required: ['gist_id', 'comment_id'],
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
handler: async (octokit, args) => {
|
|
496
|
+
await octokit.gists.deleteComment({
|
|
497
|
+
gist_id: args.gist_id,
|
|
498
|
+
comment_id: args.comment_id,
|
|
499
|
+
});
|
|
500
|
+
return successResult({ success: true, message: 'Comment deleted' });
|
|
501
|
+
},
|
|
225
502
|
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
export async function handleGistsTool(octokit, args) {
|
|
229
|
-
const gistId = args.gist_id;
|
|
230
|
-
const username = args.username;
|
|
231
|
-
// List for authenticated user
|
|
232
|
-
if (!gistId && !username && !('public' in args) && !('starred' in args)) {
|
|
233
|
-
const { data } = await octokit.gists.list(args);
|
|
234
|
-
return data;
|
|
235
|
-
}
|
|
236
|
-
// List for user
|
|
237
|
-
if (username) {
|
|
238
|
-
const { data } = await octokit.gists.listForUser(args);
|
|
239
|
-
return data;
|
|
240
|
-
}
|
|
241
|
-
// List public
|
|
242
|
-
if ('public' in args) {
|
|
243
|
-
const { data } = await octokit.gists.listPublic(args);
|
|
244
|
-
return data;
|
|
245
|
-
}
|
|
246
|
-
// List starred
|
|
247
|
-
if ('starred' in args) {
|
|
248
|
-
const { data } = await octokit.gists.listStarred(args);
|
|
249
|
-
return data;
|
|
250
|
-
}
|
|
251
|
-
// Get gist
|
|
252
|
-
if (gistId && !('files' in args) && !('description' in args) && !('body' in args) && !('sha' in args) && Object.keys(args).filter(k => !['gist_id', 'per_page', 'page'].includes(k)).length === 0) {
|
|
253
|
-
// Could be get, listComments, listForks, listCommits
|
|
254
|
-
if ('per_page' in args || 'page' in args) {
|
|
255
|
-
const { data } = await octokit.gists.listComments(args);
|
|
256
|
-
return data;
|
|
257
|
-
}
|
|
258
|
-
const { data } = await octokit.gists.get({ gist_id: gistId });
|
|
259
|
-
return data;
|
|
260
|
-
}
|
|
261
|
-
// Create gist
|
|
262
|
-
if ('files' in args && !gistId) {
|
|
263
|
-
const { data } = await octokit.gists.create(args);
|
|
264
|
-
return data;
|
|
265
|
-
}
|
|
266
|
-
// Update gist
|
|
267
|
-
if (gistId && ('files' in args || 'description' in args)) {
|
|
268
|
-
const { data } = await octokit.gists.update(args);
|
|
269
|
-
return data;
|
|
270
|
-
}
|
|
271
|
-
// Delete gist
|
|
272
|
-
if (gistId && Object.keys(args).length === 1) {
|
|
273
|
-
await octokit.gists.delete({ gist_id: gistId });
|
|
274
|
-
return { success: true, message: 'Gist deleted' };
|
|
275
|
-
}
|
|
276
|
-
// Star gist
|
|
277
|
-
if (gistId && 'star' in args) {
|
|
278
|
-
await octokit.gists.star({ gist_id: gistId });
|
|
279
|
-
return { success: true, message: 'Gist starred' };
|
|
280
|
-
}
|
|
281
|
-
// Unstar gist
|
|
282
|
-
if (gistId && 'unstar' in args) {
|
|
283
|
-
await octokit.gists.unstar({ gist_id: gistId });
|
|
284
|
-
return { success: true, message: 'Gist unstarred' };
|
|
285
|
-
}
|
|
286
|
-
// Check if starred
|
|
287
|
-
if (gistId && 'check_starred' in args) {
|
|
288
|
-
try {
|
|
289
|
-
await octokit.gists.checkIsStarred({ gist_id: gistId });
|
|
290
|
-
return { starred: true };
|
|
291
|
-
}
|
|
292
|
-
catch {
|
|
293
|
-
return { starred: false };
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
// Fork gist
|
|
297
|
-
if (gistId && 'fork' in args) {
|
|
298
|
-
const { data } = await octokit.gists.fork({ gist_id: gistId });
|
|
299
|
-
return data;
|
|
300
|
-
}
|
|
301
|
-
// Create comment
|
|
302
|
-
if (gistId && 'body' in args) {
|
|
303
|
-
const { data } = await octokit.gists.createComment(args);
|
|
304
|
-
return data;
|
|
305
|
-
}
|
|
306
|
-
// Get revision
|
|
307
|
-
if (gistId && 'sha' in args) {
|
|
308
|
-
const { data } = await octokit.gists.getRevision(args);
|
|
309
|
-
return data;
|
|
310
|
-
}
|
|
311
|
-
// Default: list for authenticated user
|
|
312
|
-
const { data } = await octokit.gists.list();
|
|
313
|
-
return data;
|
|
314
|
-
}
|
|
315
|
-
//# sourceMappingURL=gists.js.map
|
|
503
|
+
],
|
|
504
|
+
};
|