@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,315 +1,504 @@
1
- export const gistsTools = [
2
- {
3
- name: 'github_gists_list',
4
- description: 'List gists for the authenticated user',
5
- inputSchema: {
6
- type: 'object',
7
- properties: {
8
- since: { type: 'string', description: 'ISO 8601 date - only gists updated after this' },
9
- per_page: { type: 'number' },
10
- page: { type: 'number' },
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
- name: 'github_gists_listForUser',
16
- description: 'List public gists for a user',
17
- inputSchema: {
18
- type: 'object',
19
- properties: {
20
- username: { type: 'string', description: 'GitHub username' },
21
- since: { type: 'string', description: 'ISO 8601 date' },
22
- per_page: { type: 'number' },
23
- page: { type: 'number' },
24
- },
25
- required: ['username'],
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
- name: 'github_gists_listPublic',
30
- description: 'List public gists',
31
- inputSchema: {
32
- type: 'object',
33
- properties: {
34
- since: { type: 'string', description: 'ISO 8601 date' },
35
- per_page: { type: 'number' },
36
- page: { type: 'number' },
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
- name: 'github_gists_listStarred',
42
- description: 'List starred gists for the authenticated user',
43
- inputSchema: {
44
- type: 'object',
45
- properties: {
46
- since: { type: 'string', description: 'ISO 8601 date' },
47
- per_page: { type: 'number' },
48
- page: { type: 'number' },
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
- name: 'github_gists_get',
54
- description: 'Get a specific gist',
55
- inputSchema: {
56
- type: 'object',
57
- properties: {
58
- gist_id: { type: 'string', description: 'Gist ID' },
59
- },
60
- required: ['gist_id'],
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
- name: 'github_gists_create',
65
- description: 'Create a gist',
66
- inputSchema: {
67
- type: 'object',
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
- description: 'Files in the gist. Keys are filenames, values are objects with content property',
73
- additionalProperties: {
74
- type: 'object',
75
- properties: {
76
- content: { type: 'string', description: 'File content' },
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
- required: ['files'],
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
- name: 'github_gists_update',
88
- description: 'Update a gist',
89
- inputSchema: {
90
- type: 'object',
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
- description: 'Files to update. Set content to empty string to delete, or provide new content',
97
- additionalProperties: {
98
- type: 'object',
99
- properties: {
100
- content: { type: 'string', description: 'File content' },
101
- filename: { type: 'string', description: 'New filename to rename to' },
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
- required: ['gist_id'],
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
- name: 'github_gists_delete',
111
- description: 'Delete a gist',
112
- inputSchema: {
113
- type: 'object',
114
- properties: {
115
- gist_id: { type: 'string', description: 'Gist ID' },
116
- },
117
- required: ['gist_id'],
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
- name: 'github_gists_star',
122
- description: 'Star a gist',
123
- inputSchema: {
124
- type: 'object',
125
- properties: {
126
- gist_id: { type: 'string', description: 'Gist ID' },
127
- },
128
- required: ['gist_id'],
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
- name: 'github_gists_unstar',
133
- description: 'Unstar a gist',
134
- inputSchema: {
135
- type: 'object',
136
- properties: {
137
- gist_id: { type: 'string', description: 'Gist ID' },
138
- },
139
- required: ['gist_id'],
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
- name: 'github_gists_checkIsStarred',
144
- description: 'Check if a gist is starred',
145
- inputSchema: {
146
- type: 'object',
147
- properties: {
148
- gist_id: { type: 'string', description: 'Gist ID' },
149
- },
150
- required: ['gist_id'],
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
- name: 'github_gists_fork',
155
- description: 'Fork a gist',
156
- inputSchema: {
157
- type: 'object',
158
- properties: {
159
- gist_id: { type: 'string', description: 'Gist ID' },
160
- },
161
- required: ['gist_id'],
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
- name: 'github_gists_listForks',
166
- description: 'List forks of a gist',
167
- inputSchema: {
168
- type: 'object',
169
- properties: {
170
- gist_id: { type: 'string', description: 'Gist ID' },
171
- per_page: { type: 'number' },
172
- page: { type: 'number' },
173
- },
174
- required: ['gist_id'],
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
- name: 'github_gists_listComments',
179
- description: 'List comments on a gist',
180
- inputSchema: {
181
- type: 'object',
182
- properties: {
183
- gist_id: { type: 'string', description: 'Gist ID' },
184
- per_page: { type: 'number' },
185
- page: { type: 'number' },
186
- },
187
- required: ['gist_id'],
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
- name: 'github_gists_createComment',
192
- description: 'Create a comment on a gist',
193
- inputSchema: {
194
- type: 'object',
195
- properties: {
196
- gist_id: { type: 'string', description: 'Gist ID' },
197
- body: { type: 'string', description: 'Comment body' },
198
- },
199
- required: ['gist_id', 'body'],
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
- name: 'github_gists_getRevision',
204
- description: 'Get a specific revision of a gist',
205
- inputSchema: {
206
- type: 'object',
207
- properties: {
208
- gist_id: { type: 'string', description: 'Gist ID' },
209
- sha: { type: 'string', description: 'Revision SHA' },
210
- },
211
- required: ['gist_id', 'sha'],
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
- name: 'github_gists_listCommits',
216
- description: 'List commits for a gist',
217
- inputSchema: {
218
- type: 'object',
219
- properties: {
220
- gist_id: { type: 'string', description: 'Gist ID' },
221
- per_page: { type: 'number' },
222
- page: { type: 'number' },
223
- },
224
- required: ['gist_id'],
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
+ };