@github-tools/sdk 1.9.0 → 1.10.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/README.md +82 -27
- package/dist/connect/eve.d.mts +14 -9
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +14 -9
- package/dist/connect/eve.mjs.map +1 -1
- package/dist/connect.d.mts +16 -8
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/eve-runtime-CI4dR_hI.d.mts +54 -0
- package/dist/eve-runtime-CI4dR_hI.d.mts.map +1 -0
- package/dist/eve-runtime-CIcrt7MD.mjs +674 -0
- package/dist/eve-runtime-CIcrt7MD.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +4 -0
- package/dist/eve-runtime.mjs +3 -0
- package/dist/eve.d.mts +5 -34
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +356 -3
- package/dist/eve.mjs.map +1 -0
- package/dist/{index-CtID5dUi.d.mts → index-B0nL0C00.d.mts} +159 -19
- package/dist/index-B0nL0C00.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{src-D6vC3V8r.mjs → src-v-LjzPpR.mjs} +354 -68
- package/dist/src-v-LjzPpR.mjs.map +1 -0
- package/dist/{token-sbepWIkd.mjs → token-DDMlEkK-.mjs} +34 -5
- package/dist/token-DDMlEkK-.mjs.map +1 -0
- package/dist/{types-BVLof-5R.d.mts → types-VW0m0Uxl.d.mts} +3 -3
- package/dist/{types-BVLof-5R.d.mts.map → types-VW0m0Uxl.d.mts.map} +1 -1
- package/dist/{types-BOnJ0Rou.d.mts → types-Ygt1pw1N.d.mts} +4 -3
- package/dist/types-Ygt1pw1N.d.mts.map +1 -0
- package/dist/workflow.d.mts +1 -1
- package/dist/workflow.mjs +2 -2
- package/dist/{write-tools-cg_ialNd.mjs → write-tools-uIVfURVp.mjs} +792 -25
- package/dist/write-tools-uIVfURVp.mjs.map +1 -0
- package/package.json +5 -1
- package/dist/eve-DmiXBuli.mjs +0 -864
- package/dist/eve-DmiXBuli.mjs.map +0 -1
- package/dist/index-CtID5dUi.d.mts.map +0 -1
- package/dist/src-D6vC3V8r.mjs.map +0 -1
- package/dist/token-sbepWIkd.mjs.map +0 -1
- package/dist/types-BOnJ0Rou.d.mts.map +0 -1
- package/dist/write-tools-cg_ialNd.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as listWorkflowJobsDescription, $n as listLabelsDescription, $r as getFileContentToModelOutput, $t as searchRepositoriesDescription, A as getLatestReleaseInputSchema, An as addAssigneesInputSchema, Ar as listPullRequestFilesInputSchema, At as listGistsInputSchema, B as getCombinedStatusCore, Bn as createIssueCore, Br as requestReviewersCore, Bt as getCommitCore, C as createReleaseDescription, Ci as listBranchesCore, Cn as listCommentReactionsDescription, Cr as deletePullRequestCommentDescription, Ct as getGistDescription, D as deleteReleaseInputSchema, Dn as listIssueReactionsInputSchema, Dr as getPullRequestInputSchema, Dt as listGistCommentsInputSchema, E as deleteReleaseDescription, En as listIssueReactionsDescription, Er as getPullRequestDescription, Et as listGistCommentsDescription, F as listReleasesDescription, Fn as addLabelsDescription, Fr as listPullRequestsDescription, Ft as compareCommitsDescription, G as listCheckRunsInputSchema, Gn as deleteIssueCommentInputSchema, Gr as updatePullRequestCommentInputSchema, Gt as listCommitsInputSchema, H as getCombinedStatusInputSchema, Hn as createIssueInputSchema, Hr as requestReviewersInputSchema, Ht as getCommitInputSchema, I as listReleasesInputSchema, In as addLabelsInputSchema, Ir as listPullRequestsInputSchema, It as compareCommitsInputSchema, J as cancelWorkflowRunInputSchema, Jn as getIssueInputSchema, Jr as updatePullRequestInputSchema, Jt as searchCodeInputSchema, K as cancelWorkflowRunCore, Kn as getIssueCore, Kr as updatePullRequestCore, Kt as searchCodeCore, L as updateReleaseCore, Ln as closeIssueCore, Lr as mergePullRequestCore, Lt as getBlameCore, M as getReleaseDescription, Mn as addIssueCommentDescription, Mr as listPullRequestReviewsDescription, Mt as updateGistDescription, N as getReleaseInputSchema, Nn as addIssueCommentInputSchema, Nr as listPullRequestReviewsInputSchema, Nt as updateGistInputSchema, O as getLatestReleaseCore, On as addAssigneesCore, Or as listPullRequestFilesCore, Ot as listGistsCore, P as listReleasesCore, Pn as addLabelsCore, Pr as listPullRequestsCore, Pt as compareCommitsCore, Q as listWorkflowJobsCore, Qn as listLabelsCore, Qr as getCommitToModelOutput, Qt as searchRepositoriesCore, R as updateReleaseDescription, Rn as closeIssueDescription, Rr as mergePullRequestDescription, Rt as getBlameDescription, S as createReleaseCore, Si as getRepositoryTreeInputSchema, Sn as listCommentReactionsCore, Sr as deletePullRequestCommentCore, St as getGistCore, T as deleteReleaseCore, Ti as listBranchesInputSchema, Tn as listIssueReactionsCore, Tr as getPullRequestCore, Tt as listGistCommentsCore, U as listCheckRunsCore, Un as deleteIssueCommentCore, Ur as updatePullRequestCommentCore, Ut as listCommitsCore, V as getCombinedStatusDescription, Vn as createIssueDescription, Vr as requestReviewersDescription, Vt as getCommitDescription, W as listCheckRunsDescription, Wn as deleteIssueCommentDescription, Wr as updatePullRequestCommentDescription, Wt as listCommitsDescription, X as getWorkflowRunDescription, Xn as listIssuesDescription, Xr as resolveGithubToken, Xt as searchIssuesDescription, Y as getWorkflowRunCore, Yn as listIssuesCore, Yr as createGithubTokenResolver, Yt as searchIssuesCore, Z as getWorkflowRunInputSchema, Zn as listIssuesInputSchema, Zr as compareCommitsToModelOutput, Zt as searchIssuesInputSchema, _ as getPullRequestContextDescription, _i as getRepositoryCore, _n as addCommentReactionDescription, _r as createPullRequestDescription, _t as createGistDescription, a as resolvePresetTools, ai as createOrUpdateFileCore, an as markNotificationReadDescription, ar as removeLabelDescription, at as listWorkflowsDescription, b as getReleaseContextDescription, bi as getRepositoryTreeCore, bn as addIssueReactionDescription, br as createPullRequestReviewDescription, bt as deleteGistDescription, ci as createRepositoryCore, cn as addDiscussionCommentDescription, cr as updateIssueCommentDescription, ct as rerunWorkflowRunDescription, d as getCiFailureContextDescription, di as forkRepositoryCore, dn as getDiscussionDescription, dr as updateIssueDescription, dt as triggerWorkflowDescription, ei as getPullRequestContextToModelOutput, en as searchRepositoriesInputSchema, er as listLabelsInputSchema, et as listWorkflowJobsInputSchema, f as getCiFailureContextInputSchema, fi as forkRepositoryDescription, fn as getDiscussionInputSchema, fr as updateIssueInputSchema, ft as triggerWorkflowInputSchema, g as getPullRequestContextCore, gi as getFileContentInputSchema, gn as addCommentReactionCore, gr as createPullRequestCore, gt as createGistCore, h as getIssueContextInputSchema, hi as getFileContentDescription, hn as listDiscussionsInputSchema, hr as addPullRequestCommentInputSchema, ht as createGistCommentInputSchema, ii as createBranchInputSchema, in as markNotificationReadCore, ir as removeLabelCore, it as listWorkflowsCore, j as getReleaseCore, jn as addIssueCommentCore, jr as listPullRequestReviewsCore, jt as updateGistCore, k as getLatestReleaseDescription, kn as addAssigneesDescription, kr as listPullRequestFilesDescription, kt as listGistsDescription, li as createRepositoryDescription, ln as addDiscussionCommentInputSchema, lr as updateIssueCommentInputSchema, lt as rerunWorkflowRunInputSchema, m as getIssueContextDescription, mi as getFileContentCore, mn as listDiscussionsDescription, mr as addPullRequestCommentDescription, mt as createGistCommentDescription, ni as createBranchCore, nn as listNotificationsDescription, nr as removeAssigneesDescription, nt as listWorkflowRunsDescription, o as bindToolsContext, oi as createOrUpdateFileDescription, on as markNotificationReadInputSchema, or as removeLabelInputSchema, ot as listWorkflowsInputSchema, p as getIssueContextCore, pi as forkRepositoryInputSchema, pn as listDiscussionsCore, pr as addPullRequestCommentCore, pt as createGistCommentCore, q as cancelWorkflowRunDescription, qn as getIssueDescription, qr as updatePullRequestDescription, qt as searchCodeDescription, ri as createBranchDescription, rn as listNotificationsInputSchema, rr as removeAssigneesInputSchema, rt as listWorkflowRunsInputSchema, s as formatContextInstructions, si as createOrUpdateFileInputSchema, sn as addDiscussionCommentCore, sr as updateIssueCommentCore, st as rerunWorkflowRunCore, ti as listPullRequestFilesToModelOutput, tn as listNotificationsCore, tr as removeAssigneesCore, tt as listWorkflowRunsCore, u as getCiFailureContextCore, ui as createRepositoryInputSchema, un as getDiscussionCore, ur as updateIssueCore, ut as triggerWorkflowCore, v as getPullRequestContextInputSchema, vi as getRepositoryDescription, vn as addCommentReactionInputSchema, vr as createPullRequestInputSchema, vt as createGistInputSchema, w as createReleaseInputSchema, wi as listBranchesDescription, wn as listCommentReactionsInputSchema, wr as deletePullRequestCommentInputSchema, wt as getGistInputSchema, x as getReleaseContextInputSchema, xi as getRepositoryTreeDescription, xn as addIssueReactionInputSchema, xr as createPullRequestReviewInputSchema, xt as deleteGistInputSchema, y as getReleaseContextCore, yi as getRepositoryInputSchema, yn as addIssueReactionCore, yr as createPullRequestReviewCore, yt as deleteGistCore, z as updateReleaseInputSchema, zn as closeIssueInputSchema, zr as mergePullRequestInputSchema, zt as getBlameInputSchema } from "./write-tools-uIVfURVp.mjs";
|
|
2
2
|
import { ToolLoopAgent, tool } from "ai";
|
|
3
3
|
//#region src/tools/repository.ts
|
|
4
4
|
async function getRepositoryStep(args) {
|
|
@@ -170,6 +170,20 @@ const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => to
|
|
|
170
170
|
...args
|
|
171
171
|
})
|
|
172
172
|
});
|
|
173
|
+
async function updatePullRequestStep(args) {
|
|
174
|
+
"use step";
|
|
175
|
+
return updatePullRequestCore(args);
|
|
176
|
+
}
|
|
177
|
+
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
178
|
+
const updatePullRequest = (token, { needsApproval = true } = {}) => tool({
|
|
179
|
+
description: updatePullRequestDescription,
|
|
180
|
+
needsApproval,
|
|
181
|
+
inputSchema: updatePullRequestInputSchema,
|
|
182
|
+
execute: async (args) => updatePullRequestStep({
|
|
183
|
+
token: await resolveGithubToken(token),
|
|
184
|
+
...args
|
|
185
|
+
})
|
|
186
|
+
});
|
|
173
187
|
async function addPullRequestCommentStep(args) {
|
|
174
188
|
"use step";
|
|
175
189
|
return addPullRequestCommentCore(args);
|
|
@@ -184,6 +198,34 @@ const addPullRequestComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
184
198
|
...args
|
|
185
199
|
})
|
|
186
200
|
});
|
|
201
|
+
async function updatePullRequestCommentStep(args) {
|
|
202
|
+
"use step";
|
|
203
|
+
return updatePullRequestCommentCore(args);
|
|
204
|
+
}
|
|
205
|
+
/** Update the body of a comment on a pull request. Requires approval by default. */
|
|
206
|
+
const updatePullRequestComment = (token, { needsApproval = true } = {}) => tool({
|
|
207
|
+
description: updatePullRequestCommentDescription,
|
|
208
|
+
needsApproval,
|
|
209
|
+
inputSchema: updatePullRequestCommentInputSchema,
|
|
210
|
+
execute: async (args) => updatePullRequestCommentStep({
|
|
211
|
+
token: await resolveGithubToken(token),
|
|
212
|
+
...args
|
|
213
|
+
})
|
|
214
|
+
});
|
|
215
|
+
async function deletePullRequestCommentStep(args) {
|
|
216
|
+
"use step";
|
|
217
|
+
return deletePullRequestCommentCore(args);
|
|
218
|
+
}
|
|
219
|
+
/** Delete a comment from a pull request permanently. Requires approval by default. */
|
|
220
|
+
const deletePullRequestComment = (token, { needsApproval = true } = {}) => tool({
|
|
221
|
+
description: deletePullRequestCommentDescription,
|
|
222
|
+
needsApproval,
|
|
223
|
+
inputSchema: deletePullRequestCommentInputSchema,
|
|
224
|
+
execute: async (args) => deletePullRequestCommentStep({
|
|
225
|
+
token: await resolveGithubToken(token),
|
|
226
|
+
...args
|
|
227
|
+
})
|
|
228
|
+
});
|
|
187
229
|
async function listPullRequestFilesStep(args) {
|
|
188
230
|
"use step";
|
|
189
231
|
return listPullRequestFilesCore(args);
|
|
@@ -309,6 +351,48 @@ const closeIssue = (token, { needsApproval = true } = {}) => tool({
|
|
|
309
351
|
...args
|
|
310
352
|
})
|
|
311
353
|
});
|
|
354
|
+
async function updateIssueStep(args) {
|
|
355
|
+
"use step";
|
|
356
|
+
return updateIssueCore(args);
|
|
357
|
+
}
|
|
358
|
+
/** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */
|
|
359
|
+
const updateIssue = (token, { needsApproval = true } = {}) => tool({
|
|
360
|
+
description: updateIssueDescription,
|
|
361
|
+
needsApproval,
|
|
362
|
+
inputSchema: updateIssueInputSchema,
|
|
363
|
+
execute: async (args) => updateIssueStep({
|
|
364
|
+
token: await resolveGithubToken(token),
|
|
365
|
+
...args
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
async function updateIssueCommentStep(args) {
|
|
369
|
+
"use step";
|
|
370
|
+
return updateIssueCommentCore(args);
|
|
371
|
+
}
|
|
372
|
+
/** Update the body of a comment on a GitHub issue. Requires approval by default. */
|
|
373
|
+
const updateIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
374
|
+
description: updateIssueCommentDescription,
|
|
375
|
+
needsApproval,
|
|
376
|
+
inputSchema: updateIssueCommentInputSchema,
|
|
377
|
+
execute: async (args) => updateIssueCommentStep({
|
|
378
|
+
token: await resolveGithubToken(token),
|
|
379
|
+
...args
|
|
380
|
+
})
|
|
381
|
+
});
|
|
382
|
+
async function deleteIssueCommentStep(args) {
|
|
383
|
+
"use step";
|
|
384
|
+
return deleteIssueCommentCore(args);
|
|
385
|
+
}
|
|
386
|
+
/** Delete a comment from a GitHub issue permanently. Requires approval by default. */
|
|
387
|
+
const deleteIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
388
|
+
description: deleteIssueCommentDescription,
|
|
389
|
+
needsApproval,
|
|
390
|
+
inputSchema: deleteIssueCommentInputSchema,
|
|
391
|
+
execute: async (args) => deleteIssueCommentStep({
|
|
392
|
+
token: await resolveGithubToken(token),
|
|
393
|
+
...args
|
|
394
|
+
})
|
|
395
|
+
});
|
|
312
396
|
async function listLabelsStep(args) {
|
|
313
397
|
"use step";
|
|
314
398
|
return listLabelsCore(args);
|
|
@@ -379,12 +463,139 @@ const removeAssignees = (token, { needsApproval = true } = {}) => tool({
|
|
|
379
463
|
})
|
|
380
464
|
});
|
|
381
465
|
//#endregion
|
|
466
|
+
//#region src/tools/reactions.ts
|
|
467
|
+
async function listIssueReactionsStep(args) {
|
|
468
|
+
"use step";
|
|
469
|
+
return listIssueReactionsCore(args);
|
|
470
|
+
}
|
|
471
|
+
/** List reactions on an issue or pull request conversation. */
|
|
472
|
+
const listIssueReactions = (token) => tool({
|
|
473
|
+
description: listIssueReactionsDescription,
|
|
474
|
+
inputSchema: listIssueReactionsInputSchema,
|
|
475
|
+
execute: async (args) => listIssueReactionsStep({
|
|
476
|
+
token: await resolveGithubToken(token),
|
|
477
|
+
...args
|
|
478
|
+
})
|
|
479
|
+
});
|
|
480
|
+
async function addIssueReactionStep(args) {
|
|
481
|
+
"use step";
|
|
482
|
+
return addIssueReactionCore(args);
|
|
483
|
+
}
|
|
484
|
+
/** React to an issue or pull request with an emoji. Requires approval by default. */
|
|
485
|
+
const addIssueReaction = (token, { needsApproval = true } = {}) => tool({
|
|
486
|
+
description: addIssueReactionDescription,
|
|
487
|
+
needsApproval,
|
|
488
|
+
inputSchema: addIssueReactionInputSchema,
|
|
489
|
+
execute: async (args) => addIssueReactionStep({
|
|
490
|
+
token: await resolveGithubToken(token),
|
|
491
|
+
...args
|
|
492
|
+
})
|
|
493
|
+
});
|
|
494
|
+
async function listCommentReactionsStep(args) {
|
|
495
|
+
"use step";
|
|
496
|
+
return listCommentReactionsCore(args);
|
|
497
|
+
}
|
|
498
|
+
/** List reactions on an issue or pull request comment. */
|
|
499
|
+
const listCommentReactions = (token) => tool({
|
|
500
|
+
description: listCommentReactionsDescription,
|
|
501
|
+
inputSchema: listCommentReactionsInputSchema,
|
|
502
|
+
execute: async (args) => listCommentReactionsStep({
|
|
503
|
+
token: await resolveGithubToken(token),
|
|
504
|
+
...args
|
|
505
|
+
})
|
|
506
|
+
});
|
|
507
|
+
async function addCommentReactionStep(args) {
|
|
508
|
+
"use step";
|
|
509
|
+
return addCommentReactionCore(args);
|
|
510
|
+
}
|
|
511
|
+
/** React to an issue or pull request comment with an emoji. Requires approval by default. */
|
|
512
|
+
const addCommentReaction = (token, { needsApproval = true } = {}) => tool({
|
|
513
|
+
description: addCommentReactionDescription,
|
|
514
|
+
needsApproval,
|
|
515
|
+
inputSchema: addCommentReactionInputSchema,
|
|
516
|
+
execute: async (args) => addCommentReactionStep({
|
|
517
|
+
token: await resolveGithubToken(token),
|
|
518
|
+
...args
|
|
519
|
+
})
|
|
520
|
+
});
|
|
521
|
+
//#endregion
|
|
522
|
+
//#region src/tools/discussions.ts
|
|
523
|
+
async function listDiscussionsStep(args) {
|
|
524
|
+
"use step";
|
|
525
|
+
return listDiscussionsCore(args);
|
|
526
|
+
}
|
|
527
|
+
/** List discussions in a repository, optionally filtered by category. */
|
|
528
|
+
const listDiscussions = (token) => tool({
|
|
529
|
+
description: listDiscussionsDescription,
|
|
530
|
+
inputSchema: listDiscussionsInputSchema,
|
|
531
|
+
execute: async (args) => listDiscussionsStep({
|
|
532
|
+
token: await resolveGithubToken(token),
|
|
533
|
+
...args
|
|
534
|
+
})
|
|
535
|
+
});
|
|
536
|
+
async function getDiscussionStep(args) {
|
|
537
|
+
"use step";
|
|
538
|
+
return getDiscussionCore(args);
|
|
539
|
+
}
|
|
540
|
+
/** Get a discussion by number. */
|
|
541
|
+
const getDiscussion = (token) => tool({
|
|
542
|
+
description: getDiscussionDescription,
|
|
543
|
+
inputSchema: getDiscussionInputSchema,
|
|
544
|
+
execute: async (args) => getDiscussionStep({
|
|
545
|
+
token: await resolveGithubToken(token),
|
|
546
|
+
...args
|
|
547
|
+
})
|
|
548
|
+
});
|
|
549
|
+
async function addDiscussionCommentStep(args) {
|
|
550
|
+
"use step";
|
|
551
|
+
return addDiscussionCommentCore(args);
|
|
552
|
+
}
|
|
553
|
+
/** Add a comment to a discussion. Requires approval by default. */
|
|
554
|
+
const addDiscussionComment = (token, { needsApproval = true } = {}) => tool({
|
|
555
|
+
description: addDiscussionCommentDescription,
|
|
556
|
+
needsApproval,
|
|
557
|
+
inputSchema: addDiscussionCommentInputSchema,
|
|
558
|
+
execute: async (args) => addDiscussionCommentStep({
|
|
559
|
+
token: await resolveGithubToken(token),
|
|
560
|
+
...args
|
|
561
|
+
})
|
|
562
|
+
});
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region src/tools/notifications.ts
|
|
565
|
+
async function listNotificationsStep(args) {
|
|
566
|
+
"use step";
|
|
567
|
+
return listNotificationsCore(args);
|
|
568
|
+
}
|
|
569
|
+
/** List notification threads for the authenticated user. */
|
|
570
|
+
const listNotifications = (token) => tool({
|
|
571
|
+
description: listNotificationsDescription,
|
|
572
|
+
inputSchema: listNotificationsInputSchema,
|
|
573
|
+
execute: async (args) => listNotificationsStep({
|
|
574
|
+
token: await resolveGithubToken(token),
|
|
575
|
+
...args
|
|
576
|
+
})
|
|
577
|
+
});
|
|
578
|
+
async function markNotificationReadStep(args) {
|
|
579
|
+
"use step";
|
|
580
|
+
return markNotificationReadCore(args);
|
|
581
|
+
}
|
|
582
|
+
/** Mark a notification thread as read. Requires approval by default. */
|
|
583
|
+
const markNotificationRead = (token, { needsApproval = true } = {}) => tool({
|
|
584
|
+
description: markNotificationReadDescription,
|
|
585
|
+
needsApproval,
|
|
586
|
+
inputSchema: markNotificationReadInputSchema,
|
|
587
|
+
execute: async (args) => markNotificationReadStep({
|
|
588
|
+
token: await resolveGithubToken(token),
|
|
589
|
+
...args
|
|
590
|
+
})
|
|
591
|
+
});
|
|
592
|
+
//#endregion
|
|
382
593
|
//#region src/tools/search.ts
|
|
383
594
|
async function searchCodeStep(args) {
|
|
384
595
|
"use step";
|
|
385
596
|
return searchCodeCore(args);
|
|
386
597
|
}
|
|
387
|
-
/** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. */
|
|
598
|
+
/** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. Results include matching text snippets when GitHub returns them. */
|
|
388
599
|
const searchCode = (token) => tool({
|
|
389
600
|
description: searchCodeDescription,
|
|
390
601
|
inputSchema: searchCodeInputSchema,
|
|
@@ -406,6 +617,19 @@ const searchRepositories = (token) => tool({
|
|
|
406
617
|
...args
|
|
407
618
|
})
|
|
408
619
|
});
|
|
620
|
+
async function searchIssuesStep(args) {
|
|
621
|
+
"use step";
|
|
622
|
+
return searchIssuesCore(args);
|
|
623
|
+
}
|
|
624
|
+
/** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */
|
|
625
|
+
const searchIssues = (token) => tool({
|
|
626
|
+
description: searchIssuesDescription,
|
|
627
|
+
inputSchema: searchIssuesInputSchema,
|
|
628
|
+
execute: async (args) => searchIssuesStep({
|
|
629
|
+
token: await resolveGithubToken(token),
|
|
630
|
+
...args
|
|
631
|
+
})
|
|
632
|
+
});
|
|
409
633
|
//#endregion
|
|
410
634
|
//#region src/tools/commits.ts
|
|
411
635
|
async function listCommitsStep(args) {
|
|
@@ -738,6 +962,34 @@ const createRelease = (token, { needsApproval = true } = {}) => tool({
|
|
|
738
962
|
...args
|
|
739
963
|
})
|
|
740
964
|
});
|
|
965
|
+
async function updateReleaseStep(args) {
|
|
966
|
+
"use step";
|
|
967
|
+
return updateReleaseCore(args);
|
|
968
|
+
}
|
|
969
|
+
/** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */
|
|
970
|
+
const updateRelease = (token, { needsApproval = true } = {}) => tool({
|
|
971
|
+
description: updateReleaseDescription,
|
|
972
|
+
needsApproval,
|
|
973
|
+
inputSchema: updateReleaseInputSchema,
|
|
974
|
+
execute: async (args) => updateReleaseStep({
|
|
975
|
+
token: await resolveGithubToken(token),
|
|
976
|
+
...args
|
|
977
|
+
})
|
|
978
|
+
});
|
|
979
|
+
async function deleteReleaseStep(args) {
|
|
980
|
+
"use step";
|
|
981
|
+
return deleteReleaseCore(args);
|
|
982
|
+
}
|
|
983
|
+
/** Delete a release permanently. Requires approval by default. */
|
|
984
|
+
const deleteRelease = (token, { needsApproval = true } = {}) => tool({
|
|
985
|
+
description: deleteReleaseDescription,
|
|
986
|
+
needsApproval,
|
|
987
|
+
inputSchema: deleteReleaseInputSchema,
|
|
988
|
+
execute: async (args) => deleteReleaseStep({
|
|
989
|
+
token: await resolveGithubToken(token),
|
|
990
|
+
...args
|
|
991
|
+
})
|
|
992
|
+
});
|
|
741
993
|
//#endregion
|
|
742
994
|
//#region src/tools/bundles.ts
|
|
743
995
|
async function getPullRequestContextStep(args) {
|
|
@@ -758,7 +1010,7 @@ async function getIssueContextStep(args) {
|
|
|
758
1010
|
"use step";
|
|
759
1011
|
return getIssueContextCore(args);
|
|
760
1012
|
}
|
|
761
|
-
/** Fetch an issue plus available
|
|
1013
|
+
/** Fetch an issue plus available label names and recent comments in one call. */
|
|
762
1014
|
const getIssueContext = (token) => tool({
|
|
763
1015
|
description: getIssueContextDescription,
|
|
764
1016
|
inputSchema: getIssueContextInputSchema,
|
|
@@ -808,100 +1060,116 @@ function resolveAiSdkApproval(toolName, config) {
|
|
|
808
1060
|
}
|
|
809
1061
|
//#endregion
|
|
810
1062
|
//#region src/agents.ts
|
|
811
|
-
const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on
|
|
812
|
-
|
|
1063
|
+
const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.
|
|
1064
|
+
Call independent read tools in the same step when you already know the arguments — never serialize reads that could run in parallel.
|
|
1065
|
+
Bodies default to detail summary; patches default to includePatch false; prefer getFileContent with startLine/endLine or maxLines for large files.`;
|
|
1066
|
+
const DEFAULT_INSTRUCTIONS = `You are a helpful GitHub assistant. You can read and explore repositories, issues, pull requests, discussions, commits, code, gists, and workflows. You can also create issues, pull requests, comments, gists, reactions, trigger workflows, and update files when asked.
|
|
813
1067
|
|
|
814
|
-
Prefer getPullRequestContext, getIssueContext, getReleaseContext, or getCiFailureContext
|
|
1068
|
+
Prefer getPullRequestContext, getIssueContext, getReleaseContext, or getCiFailureContext for multi-part reads instead of chaining separate tools.
|
|
815
1069
|
|
|
816
1070
|
${SHARED_RULES}`;
|
|
817
1071
|
const PRESET_INSTRUCTIONS = {
|
|
818
1072
|
"code-review": `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.
|
|
819
1073
|
|
|
820
1074
|
When reviewing a PR:
|
|
821
|
-
-
|
|
822
|
-
-
|
|
823
|
-
-
|
|
824
|
-
-
|
|
825
|
-
-
|
|
826
|
-
-
|
|
827
|
-
- Check for bugs, logic errors, and edge cases
|
|
828
|
-
- Suggest improvements when you spot issues
|
|
829
|
-
- Be constructive — explain why something is a problem and how to fix it
|
|
830
|
-
- Use createPullRequestReview to submit a formal review with inline comments on specific lines
|
|
831
|
-
- Post your review as PR comments when asked
|
|
1075
|
+
- Start with getPullRequestContext (set includeChecks true when CI matters)
|
|
1076
|
+
- Then listPullRequestFiles with includePatch true and filenames for only the files you need — in the same step as any getFileContent / getBlame calls when possible
|
|
1077
|
+
- Use getBlame then getCommit(includePatch true) only when line history matters
|
|
1078
|
+
- Check for bugs, logic errors, and edge cases; be constructive
|
|
1079
|
+
- Use createPullRequestReview for formal reviews when asked
|
|
1080
|
+
- Use updatePullRequest to change title, body, base branch, or draft status; addPullRequestComment / updatePullRequestComment / deletePullRequestComment to manage comments
|
|
832
1081
|
|
|
833
1082
|
${SHARED_RULES}`,
|
|
834
1083
|
"issue-triage": `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.
|
|
835
1084
|
|
|
836
1085
|
When triaging issues:
|
|
837
|
-
-
|
|
838
|
-
-
|
|
839
|
-
-
|
|
840
|
-
-
|
|
841
|
-
-
|
|
842
|
-
- Use
|
|
843
|
-
-
|
|
844
|
-
- Set detail full only when the truncated body is not enough
|
|
1086
|
+
- Call getIssueContext exactly once (full body + labelNames + recent comments). In that same step, call listIssues or searchIssues if you need duplicate checks
|
|
1087
|
+
- Never re-call getIssueContext for the same issue
|
|
1088
|
+
- Pick labels from labelNames; use addLabels / removeLabel to apply them
|
|
1089
|
+
- Create issues with clear titles and descriptions when asked
|
|
1090
|
+
- Use updateIssue to edit title, body, labels, milestone, or assignees, and to reopen a closed issue (state: 'open') — there is no separate reopen tool
|
|
1091
|
+
- Use updateIssueComment / deleteIssueComment to correct or remove existing comments
|
|
1092
|
+
- Acknowledge a report or a comment with addIssueReaction / addCommentReaction instead of posting a comment that says nothing new
|
|
845
1093
|
|
|
846
1094
|
${SHARED_RULES}`,
|
|
847
1095
|
"ci-ops": `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.
|
|
848
1096
|
|
|
849
1097
|
When working with workflows:
|
|
850
|
-
- Prefer getCiFailureContext
|
|
851
|
-
- Use listCheckRuns
|
|
852
|
-
- Inspect job steps to
|
|
853
|
-
-
|
|
854
|
-
- Trigger workflow dispatches with the correct inputs and branch
|
|
855
|
-
- Be careful with cancel and re-run operations — confirm the target run
|
|
856
|
-
- Summarize run history and trends when asked
|
|
1098
|
+
- Prefer getCiFailureContext first when diagnosing a failing ref
|
|
1099
|
+
- Use listCheckRuns / getCombinedStatus for narrower follow-ups
|
|
1100
|
+
- Inspect job steps to find the failing step; confirm before cancel/re-run
|
|
1101
|
+
- Trigger workflow_dispatch with the correct inputs and branch when asked
|
|
857
1102
|
|
|
858
1103
|
${SHARED_RULES}`,
|
|
859
1104
|
"security-audit": `You are a security audit assistant. Your job is to review repositories for security risks and report findings clearly — you never make destructive changes.
|
|
860
1105
|
|
|
861
1106
|
When auditing a repository:
|
|
862
|
-
- Use searchCode
|
|
863
|
-
- Use
|
|
864
|
-
- Prefer getCiFailureContext or getPullRequestContext
|
|
865
|
-
- Use
|
|
866
|
-
-
|
|
867
|
-
-
|
|
868
|
-
- This preset can only read, create issues, comment, and label — never assume you can fix the code directly
|
|
1107
|
+
- Use searchCode for secrets and unsafe patterns; getBlame / listCommits to trace introductions
|
|
1108
|
+
- Use searchIssues to check for prior reports of the same vulnerability before filing a duplicate
|
|
1109
|
+
- Prefer getCiFailureContext or getPullRequestContext for CI / PR context
|
|
1110
|
+
- Use compareCommits to scope changes (includePatch only when you need diffs)
|
|
1111
|
+
- Report findings as issues with reproduction, impact, and severity
|
|
1112
|
+
- Read-only plus createIssue / addIssueComment / addLabels — never assume you can fix code directly
|
|
869
1113
|
|
|
870
1114
|
${SHARED_RULES}`,
|
|
871
1115
|
"repo-explorer": `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.
|
|
872
1116
|
|
|
873
1117
|
When exploring repos:
|
|
874
|
-
- Answer questions about
|
|
875
|
-
-
|
|
876
|
-
- Use
|
|
877
|
-
-
|
|
878
|
-
-
|
|
879
|
-
-
|
|
880
|
-
- You have read-only access — you cannot make changes
|
|
1118
|
+
- Answer questions about structure and organization; find files and patterns with searchCode / getFileContent
|
|
1119
|
+
- Use searchIssues to find issues or pull requests by qualifier across a repository or organization
|
|
1120
|
+
- Use listDiscussions / getDiscussion for questions answered in the repository's discussions rather than its issues
|
|
1121
|
+
- Prefer getPullRequestContext or getCiFailureContext when summarizing a PR or failing CI
|
|
1122
|
+
- Use getBlame for line ownership; summarize recent commits / PRs / issues when asked
|
|
1123
|
+
- Read-only — you cannot make changes
|
|
881
1124
|
|
|
882
1125
|
${SHARED_RULES}`,
|
|
883
1126
|
"release-manager": `You are a release management assistant. Your job is to help prepare and publish GitHub releases.
|
|
884
1127
|
|
|
885
1128
|
When preparing a release:
|
|
886
|
-
- Prefer getReleaseContext
|
|
887
|
-
- Use compareCommits
|
|
888
|
-
-
|
|
889
|
-
-
|
|
890
|
-
- Use
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
-
|
|
1129
|
+
- Prefer getReleaseContext first (current/latest release, previous release, tag compare)
|
|
1130
|
+
- Use compareCommits / listCommits for more changelog detail; getCiFailureContext before cutting
|
|
1131
|
+
- createRelease with generateReleaseNotes when there is no manual changelog
|
|
1132
|
+
- Double-check the target branch or SHA — releases and tags are hard to undo
|
|
1133
|
+
- Use updateRelease to fix notes or toggle draft/prerelease after publishing; deleteRelease only when explicitly asked — it does not delete the underlying tag
|
|
1134
|
+
|
|
1135
|
+
${SHARED_RULES}`,
|
|
1136
|
+
"discussion-moderator": `You are a discussion moderator. Your job is to answer and guide repository Discussions clearly and on-topic.
|
|
1137
|
+
|
|
1138
|
+
When working in discussions:
|
|
1139
|
+
- Use listDiscussions / getDiscussion to load the thread before replying
|
|
1140
|
+
- Prefer addDiscussionComment for answers that belong in Discussions
|
|
1141
|
+
- Use searchIssues / getIssueContext when the question overlaps an existing issue; addIssueComment only when the follow-up belongs on that issue
|
|
1142
|
+
- Keep replies concise and point to docs or code when helpful
|
|
894
1143
|
|
|
895
1144
|
${SHARED_RULES}`,
|
|
896
|
-
"
|
|
1145
|
+
"notification-inbox": `You are a notification inbox assistant. Your job is to help triage GitHub notification threads for the authenticated user.
|
|
1146
|
+
|
|
1147
|
+
When clearing the inbox:
|
|
1148
|
+
- Use listNotifications to see unread threads (set all true only when asked)
|
|
1149
|
+
- Open the related getIssue or getPullRequest when you need context before acting
|
|
1150
|
+
- Use markNotificationRead once a thread is handled or is noise
|
|
1151
|
+
- These tools need a user PAT with Notifications access — say so if calls fail for that reason
|
|
1152
|
+
|
|
1153
|
+
${SHARED_RULES}`,
|
|
1154
|
+
"pr-author": `You are a pull request authoring assistant. Your job is to prepare branches, edit files, and open focused PRs.
|
|
1155
|
+
|
|
1156
|
+
When opening a PR:
|
|
1157
|
+
- Inspect the repo with getRepository / listBranches / getFileContent before editing
|
|
1158
|
+
- createBranch from a sensible base, then createOrUpdateFile for the change set
|
|
1159
|
+
- createPullRequest with a clear title and body; updatePullRequest if the draft or description needs a fix
|
|
1160
|
+
- Use listPullRequestFiles / compareCommits / getCommit to verify what will land
|
|
1161
|
+
- Stay scoped to authoring — you do not review, merge, or manage issues
|
|
1162
|
+
|
|
1163
|
+
${SHARED_RULES}`,
|
|
1164
|
+
"maintainer": `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, discussions, notifications, gists, and workflows.
|
|
897
1165
|
|
|
898
1166
|
When maintaining repos:
|
|
899
|
-
- Prefer getPullRequestContext or getCiFailureContext for multi-part reads
|
|
900
|
-
- Be careful with
|
|
901
|
-
-
|
|
902
|
-
- Use
|
|
903
|
-
-
|
|
904
|
-
-
|
|
1167
|
+
- Prefer getPullRequestContext or getCiFailureContext for multi-part reads
|
|
1168
|
+
- Be careful with writes — review before acting
|
|
1169
|
+
- Keep issues, PRs, and commits clear and well-structured
|
|
1170
|
+
- Use listNotifications to find what needs attention, then markNotificationRead once a thread is handled
|
|
1171
|
+
- Acknowledge a thread with addIssueReaction / addCommentReaction instead of a comment that adds nothing
|
|
1172
|
+
- Answer questions in discussions with addDiscussionComment
|
|
905
1173
|
|
|
906
1174
|
${SHARED_RULES}`
|
|
907
1175
|
};
|
|
@@ -962,14 +1230,11 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
|
|
|
962
1230
|
*
|
|
963
1231
|
* Write operations require user approval by default.
|
|
964
1232
|
* Control this globally or per-tool via `requireApproval`.
|
|
965
|
-
*
|
|
1233
|
+
* Prefer `preset` to expose only the tools your agent needs.
|
|
966
1234
|
* Pass `context` to default owner/repo/PR/issue/ref on tool inputs.
|
|
967
1235
|
*
|
|
968
1236
|
* @example
|
|
969
1237
|
* ```ts
|
|
970
|
-
* // All tools (default)
|
|
971
|
-
* createGithubTools({ token })
|
|
972
|
-
*
|
|
973
1238
|
* // Code-review agent — only PR & commit tools
|
|
974
1239
|
* createGithubTools({ token, preset: 'code-review' })
|
|
975
1240
|
*
|
|
@@ -983,6 +1248,9 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
|
|
|
983
1248
|
* // Combine presets
|
|
984
1249
|
* createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
|
|
985
1250
|
*
|
|
1251
|
+
* // Full catalog (same as omitting preset)
|
|
1252
|
+
* createGithubTools({ token, preset: 'maintainer' })
|
|
1253
|
+
*
|
|
986
1254
|
* // Granular approval
|
|
987
1255
|
* createGithubTools({
|
|
988
1256
|
* token,
|
|
@@ -1010,6 +1278,7 @@ function createGithubTools({ token, requireApproval = true, preset, context, ove
|
|
|
1010
1278
|
getIssue: getIssue(resolveToken),
|
|
1011
1279
|
searchCode: searchCode(resolveToken),
|
|
1012
1280
|
searchRepositories: searchRepositories(resolveToken),
|
|
1281
|
+
searchIssues: searchIssues(resolveToken),
|
|
1013
1282
|
listCommits: listCommits(resolveToken),
|
|
1014
1283
|
getCommit: getCommit(resolveToken),
|
|
1015
1284
|
getBlame: getBlame(resolveToken),
|
|
@@ -1028,7 +1297,10 @@ function createGithubTools({ token, requireApproval = true, preset, context, ove
|
|
|
1028
1297
|
...approval("mergePullRequest"),
|
|
1029
1298
|
coAuthors
|
|
1030
1299
|
}),
|
|
1300
|
+
updatePullRequest: updatePullRequest(resolveToken, approval("updatePullRequest")),
|
|
1031
1301
|
addPullRequestComment: addPullRequestComment(resolveToken, approval("addPullRequestComment")),
|
|
1302
|
+
updatePullRequestComment: updatePullRequestComment(resolveToken, approval("updatePullRequestComment")),
|
|
1303
|
+
deletePullRequestComment: deletePullRequestComment(resolveToken, approval("deletePullRequestComment")),
|
|
1032
1304
|
listPullRequestFiles: listPullRequestFiles(resolveToken),
|
|
1033
1305
|
listPullRequestReviews: listPullRequestReviews(resolveToken),
|
|
1034
1306
|
createPullRequestReview: createPullRequestReview(resolveToken, approval("createPullRequestReview")),
|
|
@@ -1037,12 +1309,24 @@ function createGithubTools({ token, requireApproval = true, preset, context, ove
|
|
|
1037
1309
|
getIssueContext: getIssueContext(resolveToken),
|
|
1038
1310
|
createIssue: createIssue(resolveToken, approval("createIssue")),
|
|
1039
1311
|
addIssueComment: addIssueComment(resolveToken, approval("addIssueComment")),
|
|
1312
|
+
updateIssueComment: updateIssueComment(resolveToken, approval("updateIssueComment")),
|
|
1313
|
+
deleteIssueComment: deleteIssueComment(resolveToken, approval("deleteIssueComment")),
|
|
1040
1314
|
closeIssue: closeIssue(resolveToken, approval("closeIssue")),
|
|
1315
|
+
updateIssue: updateIssue(resolveToken, approval("updateIssue")),
|
|
1041
1316
|
listLabels: listLabels(resolveToken),
|
|
1042
1317
|
addLabels: addLabels(resolveToken, approval("addLabels")),
|
|
1043
1318
|
removeLabel: removeLabel(resolveToken, approval("removeLabel")),
|
|
1044
1319
|
addAssignees: addAssignees(resolveToken, approval("addAssignees")),
|
|
1045
1320
|
removeAssignees: removeAssignees(resolveToken, approval("removeAssignees")),
|
|
1321
|
+
listIssueReactions: listIssueReactions(resolveToken),
|
|
1322
|
+
addIssueReaction: addIssueReaction(resolveToken, approval("addIssueReaction")),
|
|
1323
|
+
listCommentReactions: listCommentReactions(resolveToken),
|
|
1324
|
+
addCommentReaction: addCommentReaction(resolveToken, approval("addCommentReaction")),
|
|
1325
|
+
listDiscussions: listDiscussions(resolveToken),
|
|
1326
|
+
getDiscussion: getDiscussion(resolveToken),
|
|
1327
|
+
addDiscussionComment: addDiscussionComment(resolveToken, approval("addDiscussionComment")),
|
|
1328
|
+
listNotifications: listNotifications(resolveToken),
|
|
1329
|
+
markNotificationRead: markNotificationRead(resolveToken, approval("markNotificationRead")),
|
|
1046
1330
|
listGists: listGists(resolveToken),
|
|
1047
1331
|
getGist: getGist(resolveToken),
|
|
1048
1332
|
listGistComments: listGistComments(resolveToken),
|
|
@@ -1064,7 +1348,9 @@ function createGithubTools({ token, requireApproval = true, preset, context, ove
|
|
|
1064
1348
|
getLatestRelease: getLatestRelease(resolveToken),
|
|
1065
1349
|
getRelease: getRelease(resolveToken),
|
|
1066
1350
|
getReleaseContext: getReleaseContext(resolveToken),
|
|
1067
|
-
createRelease: createRelease(resolveToken, approval("createRelease"))
|
|
1351
|
+
createRelease: createRelease(resolveToken, approval("createRelease")),
|
|
1352
|
+
updateRelease: updateRelease(resolveToken, approval("updateRelease")),
|
|
1353
|
+
deleteRelease: deleteRelease(resolveToken, approval("deleteRelease"))
|
|
1068
1354
|
};
|
|
1069
1355
|
if (overrides) {
|
|
1070
1356
|
for (const [name, toolOverrides] of Object.entries(overrides)) if (name in allTools && toolOverrides) {
|
|
@@ -1080,6 +1366,6 @@ function createGithubTools({ token, requireApproval = true, preset, context, ove
|
|
|
1080
1366
|
return Object.fromEntries(Object.entries(scoped).filter(([name]) => allowed.has(name)));
|
|
1081
1367
|
}
|
|
1082
1368
|
//#endregion
|
|
1083
|
-
export {
|
|
1369
|
+
export { listIssues as $, compareCommits as A, getDiscussion as B, createGist as C, getRepositoryTree as Ct, listGistComments as D, getGist as E, searchIssues as F, listIssueReactions as G, addCommentReaction as H, searchRepositories as I, addLabels as J, addAssignees as K, listNotifications as L, getCommit as M, listCommits as N, listGists as O, searchCode as P, getIssue as Q, markNotificationRead as R, triggerWorkflow as S, getRepository as St, deleteGist as T, addIssueReaction as U, listDiscussions as V, listCommentReactions as W, createIssue as X, closeIssue as Y, deleteIssueComment as Z, getWorkflowRun as _, createBranch as _t, getIssueContext as a, addPullRequestComment as at, listWorkflows as b, forkRepository as bt, createRelease as c, deletePullRequestComment as ct, getRelease as d, listPullRequestReviews as dt, listLabels as et, listReleases as f, listPullRequests as ft, cancelWorkflowRun as g, updatePullRequestComment as gt, listCheckRuns as h, updatePullRequest as ht, getCiFailureContext as i, updateIssueComment as it, getBlame as j, updateGist as k, deleteRelease as l, getPullRequest as lt, getCombinedStatus as m, requestReviewers as mt, createGithubAgent as n, removeLabel as nt, getPullRequestContext as o, createPullRequest as ot, updateRelease as p, mergePullRequest as pt, addIssueComment as q, resolveInstructions as r, updateIssue as rt, getReleaseContext as s, createPullRequestReview as st, createGithubTools as t, removeAssignees as tt, getLatestRelease as u, listPullRequestFiles as ut, listWorkflowJobs as v, createOrUpdateFile as vt, createGistComment as w, listBranches as wt, rerunWorkflowRun as x, getFileContent as xt, listWorkflowRuns as y, createRepository as yt, addDiscussionComment as z };
|
|
1084
1370
|
|
|
1085
|
-
//# sourceMappingURL=src-
|
|
1371
|
+
//# sourceMappingURL=src-v-LjzPpR.mjs.map
|