@github-tools/sdk 1.16.1 → 1.18.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 +51 -15
- package/dist/connect/eve.d.mts +2 -2
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +12 -4
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/cores-BeLZwcde.mjs +269 -0
- package/dist/cores-BeLZwcde.mjs.map +1 -0
- package/dist/evaluation-f-2QwBid.mjs +210 -0
- package/dist/evaluation-f-2QwBid.mjs.map +1 -0
- package/dist/{eve-runtime-BnWUzXdV.d.mts → eve-runtime-DNQrQZ36.d.mts} +5 -5
- package/dist/{eve-runtime-BnWUzXdV.d.mts.map → eve-runtime-DNQrQZ36.d.mts.map} +1 -1
- package/dist/{eve-runtime-Cfyy1tzp.mjs → eve-runtime-DnhM9Vog.mjs} +14 -11
- package/dist/eve-runtime-DnhM9Vog.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -3
- package/dist/eve.d.mts +4 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +2 -2
- package/dist/{index-JH3DVh1R.d.mts → index-DkZvveZP.d.mts} +337 -11
- package/dist/index-DkZvveZP.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/instructions-BuypoY0x.mjs +148 -0
- package/dist/instructions-BuypoY0x.mjs.map +1 -0
- package/dist/interrupts-BSDPwdJ2.d.mts +60 -0
- package/dist/interrupts-BSDPwdJ2.d.mts.map +1 -0
- package/dist/{src-C54blWpT.mjs → src-Bx5p1Unc.mjs} +130 -232
- package/dist/src-Bx5p1Unc.mjs.map +1 -0
- package/dist/tanstack/interrupts.d.mts +2 -0
- package/dist/tanstack/interrupts.mjs +17 -0
- package/dist/tanstack/interrupts.mjs.map +1 -0
- package/dist/tanstack.d.mts +4971 -0
- package/dist/tanstack.d.mts.map +1 -0
- package/dist/tanstack.mjs +465 -0
- package/dist/tanstack.mjs.map +1 -0
- package/dist/{token-Iop2lapd.mjs → token-BOLrrbTS.mjs} +65 -10
- package/dist/token-BOLrrbTS.mjs.map +1 -0
- package/dist/tool-types-CrC80SIL.d.mts +1573 -0
- package/dist/tool-types-CrC80SIL.d.mts.map +1 -0
- package/dist/{types-ve9shBaf.d.mts → types-BmwOpI5-.d.mts} +19 -8
- package/dist/types-BmwOpI5-.d.mts.map +1 -0
- package/dist/{types-BKXTeCqT.d.mts → types-CPAsEMzx.d.mts} +2 -2
- package/dist/{types-BKXTeCqT.d.mts.map → types-CPAsEMzx.d.mts.map} +1 -1
- package/dist/workflow.d.mts +7 -5
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +3 -2
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-BvuWAzwo.mjs → write-tools-BaoTUCg7.mjs} +2293 -2558
- package/dist/write-tools-BaoTUCg7.mjs.map +1 -0
- package/package.json +32 -16
- package/dist/eve-runtime-Cfyy1tzp.mjs.map +0 -1
- package/dist/index-JH3DVh1R.d.mts.map +0 -1
- package/dist/src-C54blWpT.mjs.map +0 -1
- package/dist/token-Iop2lapd.mjs.map +0 -1
- package/dist/tool-types-BsfalcyC.d.mts +0 -4163
- package/dist/tool-types-BsfalcyC.d.mts.map +0 -1
- package/dist/types-ve9shBaf.d.mts.map +0 -1
- package/dist/write-tools-BvuWAzwo.mjs.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as createGistDescription, $i as getRepositoryTreeDescription, $n as mergePullRequestDescription, $r as removeAssigneesDescription, $t as listWorkflowsDescription, A as searchRepositoriesInputSchema, Ai as listCheckRunsInputSchema, An as createPullRequestInputSchema, Ar as createIssueInputSchema, At as getIssueContextInputSchema, B as listIssueReactionsCore, Bi as deleteBranchCore, Bn as listPullRequestFilesCore, Br as getIssueCore, Bt as getWorkflowJobLogsCore, C as searchCodeDescription, Ci as listCommitsDescription, Cn as updateReleaseDescription, Cr as addLabelsDescription, Ct as listDiscussionsDescription, D as searchIssuesInputSchema, Di as getCombinedStatusInputSchema, Dn as addPullRequestCommentInputSchema, Dr as closeIssueInputSchema, Dt as getCiFailureContextInputSchema, E as searchIssuesDescription, Ei as getCombinedStatusDescription, En as addPullRequestCommentDescription, Er as closeIssueDescription, Et as getCiFailureContextDescription, F as addIssueReactionDescription, Fi as createOrUpdateFileDescription, Fn as deletePullRequestCommentDescription, Fr as deleteIssueCommentDescription, Ft as getReleaseContextDescription, G as listNotificationsInputSchema, Gi as forkRepositoryInputSchema, Gn as listPullRequestReviewThreadsInputSchema, Gr as listIssueCommentsInputSchema, Gt as getWorkflowRunInputSchema, H as listIssueReactionsInputSchema, Hi as deleteBranchInputSchema, Hn as listPullRequestFilesInputSchema, Hr as getIssueInputSchema, Ht as getWorkflowJobLogsInputSchema, I as addIssueReactionInputSchema, Ii as createOrUpdateFileInputSchema, In as deletePullRequestCommentInputSchema, Ir as deleteIssueCommentInputSchema, It as getReleaseContextInputSchema, J as markNotificationReadInputSchema, Ji as getFileContentInputSchema, Jn as listPullRequestReviewsInputSchema, Jr as listIssuesInputSchema, Jt as listWorkflowJobsInputSchema, K as markNotificationReadCore, Ki as getFileContentCore, Kn as listPullRequestReviewsCore, Kr as listIssuesCore, Kt as listWorkflowJobsCore, L as listCommentReactionsCore, Li as createRepositoryCore, Ln as getPullRequestCore, Lr as deleteLabelCore, Lt as cancelWorkflowRunCore, M as addCommentReactionDescription, Mi as createBranchDescription, Mn as createPullRequestReviewDescription, Mr as createLabelDescription, Mt as getPullRequestContextDescription, N as addCommentReactionInputSchema, Ni as createBranchInputSchema, Nn as createPullRequestReviewInputSchema, Nr as createLabelInputSchema, Nt as getPullRequestContextInputSchema, O as searchRepositoriesCore, Oi as listCheckRunsCore, On as createPullRequestCore, Or as createIssueCore, Ot as getIssueContextCore, P as addIssueReactionCore, Pi as createOrUpdateFileCore, Pn as deletePullRequestCommentCore, Pr as deleteIssueCommentCore, Pt as getReleaseContextCore, Q as createGistCore, Qi as getRepositoryTreeCore, Qn as mergePullRequestCore, Qr as removeAssigneesCore, Qt as listWorkflowsCore, R as listCommentReactionsDescription, Ri as createRepositoryDescription, Rn as getPullRequestDescription, Rr as deleteLabelDescription, Rt as cancelWorkflowRunDescription, S as searchCodeCore, Si as listCommitsCore, Sn as updateReleaseCore, Sr as addLabelsCore, St as listDiscussionsCore, T as searchIssuesCore, Ti as getCombinedStatusCore, Tn as addPullRequestCommentCore, Tr as closeIssueCore, Tt as getCiFailureContextCore, U as listNotificationsCore, Ui as forkRepositoryCore, Un as listPullRequestReviewThreadsCore, Ur as listIssueCommentsCore, Ut as getWorkflowRunCore, V as listIssueReactionsDescription, Vi as deleteBranchDescription, Vn as listPullRequestFilesDescription, Vr as getIssueDescription, Vt as getWorkflowJobLogsDescription, W as listNotificationsDescription, Wi as forkRepositoryDescription, Wn as listPullRequestReviewThreadsDescription, Wr as listIssueCommentsDescription, Wt as getWorkflowRunDescription, X as createGistCommentDescription, Xi as getRepositoryDescription, Xn as listPullRequestsDescription, Xr as listLabelsDescription, Xt as listWorkflowRunsDescription, Y as createGistCommentCore, Yi as getRepositoryCore, Yn as listPullRequestsCore, Yr as listLabelsCore, Yt as listWorkflowRunsCore, Z as createGistCommentInputSchema, Zi as getRepositoryInputSchema, Zn as listPullRequestsInputSchema, Zr as listLabelsInputSchema, Zt as listWorkflowRunsInputSchema, _ as githubTokenCall, _i as getBlameDescription, _n as getReleaseDescription, _r as addAssigneesDescription, _t as addDiscussionCommentDescription, ai as updateIssueCommentDescription, an as triggerWorkflowDescription, ar as requestReviewersDescription, at as getGistDescription, bi as getCommitDescription, bn as listReleasesDescription, br as addIssueCommentDescription, bt as getDiscussionDescription, ca as stripRateLimit, ci as updateIssueDescription, cn as createReleaseDescription, cr as resolveReviewThreadDescription, ct as listGistCommentsDescription, di as updateLabelDescription, dn as deleteReleaseDescription, dr as updatePullRequestCommentDescription, dt as listGistsDescription, ea as getRepositoryTreeInputSchema, ei as removeAssigneesInputSchema, en as listWorkflowsInputSchema, er as mergePullRequestInputSchema, et as createGistInputSchema, fi as updateLabelInputSchema, fn as deleteReleaseInputSchema, fr as updatePullRequestCommentInputSchema, ft as listGistsInputSchema, g as createGithubTokenResolver, gi as getBlameCore, gn as getReleaseCore, gr as addAssigneesCore, gt as addDiscussionCommentCore, h as resolvePresetTools, hi as compareCommitsInputSchema, hn as getLatestReleaseInputSchema, hr as updatePullRequestInputSchema, ht as updateGistInputSchema, ii as updateIssueCommentCore, in as triggerWorkflowCore, ir as requestReviewersCore, it as getGistCore, j as addCommentReactionCore, ji as createBranchCore, jn as createPullRequestReviewCore, jr as createLabelCore, jt as getPullRequestContextCore, k as searchRepositoriesDescription, ki as listCheckRunsDescription, kn as createPullRequestDescription, kr as createIssueDescription, kt as getIssueContextDescription, li as updateIssueInputSchema, ln as createReleaseInputSchema, lr as resolveReviewThreadInputSchema, lt as listGistCommentsInputSchema, mi as compareCommitsDescription, mn as getLatestReleaseDescription, mr as updatePullRequestDescription, mt as updateGistDescription, na as listBranchesDescription, ni as removeLabelDescription, nn as rerunWorkflowRunDescription, nr as replyToReviewCommentDescription, nt as deleteGistDescription, oi as updateIssueCommentInputSchema, on as triggerWorkflowInputSchema, or as requestReviewersInputSchema, ot as getGistInputSchema, pi as compareCommitsCore, pn as getLatestReleaseCore, pr as updatePullRequestCore, pt as updateGistCore, q as markNotificationReadDescription, qi as getFileContentDescription, qn as listPullRequestReviewsDescription, qr as listIssuesDescription, qt as listWorkflowJobsDescription, r as bindToolsContext, ra as listBranchesInputSchema, ri as removeLabelInputSchema, rn as rerunWorkflowRunInputSchema, rr as replyToReviewCommentInputSchema, rt as deleteGistInputSchema, si as updateIssueCore, sn as createReleaseCore, sr as resolveReviewThreadCore, st as listGistCommentsCore, ta as listBranchesCore, ti as removeLabelCore, tn as rerunWorkflowRunCore, tr as replyToReviewCommentCore, tt as deleteGistCore, ui as updateLabelCore, un as deleteReleaseCore, ur as updatePullRequestCommentCore, ut as listGistsCore, v as resolveGithubToken, vi as getBlameInputSchema, vn as getReleaseInputSchema, vr as addAssigneesInputSchema, vt as addDiscussionCommentInputSchema, w as searchCodeInputSchema, wi as listCommitsInputSchema, wn as updateReleaseInputSchema, wr as addLabelsInputSchema, wt as listDiscussionsInputSchema, xi as getCommitInputSchema, xn as listReleasesInputSchema, xr as addIssueCommentInputSchema, xt as getDiscussionInputSchema, yi as getCommitCore, yn as listReleasesCore, yr as addIssueCommentCore, yt as getDiscussionCore, z as listCommentReactionsInputSchema, zi as createRepositoryInputSchema, zn as getPullRequestInputSchema, zr as deleteLabelInputSchema, zt as cancelWorkflowRunInputSchema } from "./write-tools-BaoTUCg7.mjs";
|
|
2
|
+
import { a as getCommitToModelOutput, c as getRepositoryTreeToModelOutput, i as compareCommitsToModelOutput, l as listPullRequestFilesToModelOutput, n as needsAutoApproval, o as getFileContentToModelOutput, r as selectPresets, s as getPullRequestContextToModelOutput } from "./evaluation-f-2QwBid.mjs";
|
|
3
|
+
import { n as resolveApprovalMode, t as resolveInstructions } from "./instructions-BuypoY0x.mjs";
|
|
2
4
|
import { ToolLoopAgent, tool } from "ai";
|
|
3
5
|
//#region src/tools/repository.ts
|
|
4
6
|
async function getRepositoryStep(args) {
|
|
@@ -10,7 +12,7 @@ const getRepository = (token) => tool({
|
|
|
10
12
|
description: getRepositoryDescription,
|
|
11
13
|
inputSchema: getRepositoryInputSchema,
|
|
12
14
|
execute: async (args) => getRepositoryStep({
|
|
13
|
-
token: await resolveGithubToken(token),
|
|
15
|
+
token: await resolveGithubToken(token, githubTokenCall("getRepository", args)),
|
|
14
16
|
...args
|
|
15
17
|
})
|
|
16
18
|
});
|
|
@@ -23,7 +25,7 @@ const listBranches = (token) => tool({
|
|
|
23
25
|
description: listBranchesDescription,
|
|
24
26
|
inputSchema: listBranchesInputSchema,
|
|
25
27
|
execute: async (args) => listBranchesStep({
|
|
26
|
-
token: await resolveGithubToken(token),
|
|
28
|
+
token: await resolveGithubToken(token, githubTokenCall("listBranches", args)),
|
|
27
29
|
...args
|
|
28
30
|
})
|
|
29
31
|
});
|
|
@@ -37,7 +39,7 @@ const getFileContent = (token) => tool({
|
|
|
37
39
|
inputSchema: getFileContentInputSchema,
|
|
38
40
|
toModelOutput: getFileContentToModelOutput,
|
|
39
41
|
execute: async (args) => getFileContentStep({
|
|
40
|
-
token: await resolveGithubToken(token),
|
|
42
|
+
token: await resolveGithubToken(token, githubTokenCall("getFileContent", args)),
|
|
41
43
|
...args
|
|
42
44
|
})
|
|
43
45
|
});
|
|
@@ -51,7 +53,7 @@ const getRepositoryTree = (token) => tool({
|
|
|
51
53
|
inputSchema: getRepositoryTreeInputSchema,
|
|
52
54
|
toModelOutput: getRepositoryTreeToModelOutput,
|
|
53
55
|
execute: async (args) => getRepositoryTreeStep({
|
|
54
|
-
token: await resolveGithubToken(token),
|
|
56
|
+
token: await resolveGithubToken(token, githubTokenCall("getRepositoryTree", args)),
|
|
55
57
|
...args
|
|
56
58
|
})
|
|
57
59
|
});
|
|
@@ -65,7 +67,7 @@ const createBranch = (token, { needsApproval = true } = {}) => tool({
|
|
|
65
67
|
needsApproval,
|
|
66
68
|
inputSchema: createBranchInputSchema,
|
|
67
69
|
execute: async (args) => createBranchStep({
|
|
68
|
-
token: await resolveGithubToken(token),
|
|
70
|
+
token: await resolveGithubToken(token, githubTokenCall("createBranch", args)),
|
|
69
71
|
...args
|
|
70
72
|
})
|
|
71
73
|
});
|
|
@@ -79,7 +81,7 @@ const deleteBranch = (token, { needsApproval = true } = {}) => tool({
|
|
|
79
81
|
needsApproval,
|
|
80
82
|
inputSchema: deleteBranchInputSchema,
|
|
81
83
|
execute: async (args) => deleteBranchStep({
|
|
82
|
-
token: await resolveGithubToken(token),
|
|
84
|
+
token: await resolveGithubToken(token, githubTokenCall("deleteBranch", args)),
|
|
83
85
|
...args
|
|
84
86
|
})
|
|
85
87
|
});
|
|
@@ -93,7 +95,7 @@ const forkRepository = (token, { needsApproval = true } = {}) => tool({
|
|
|
93
95
|
needsApproval,
|
|
94
96
|
inputSchema: forkRepositoryInputSchema,
|
|
95
97
|
execute: async (args) => forkRepositoryStep({
|
|
96
|
-
token: await resolveGithubToken(token),
|
|
98
|
+
token: await resolveGithubToken(token, githubTokenCall("forkRepository", args)),
|
|
97
99
|
...args
|
|
98
100
|
})
|
|
99
101
|
});
|
|
@@ -107,7 +109,7 @@ const createRepository = (token, { needsApproval = true } = {}) => tool({
|
|
|
107
109
|
needsApproval,
|
|
108
110
|
inputSchema: createRepositoryInputSchema,
|
|
109
111
|
execute: async (args) => createRepositoryStep({
|
|
110
|
-
token: await resolveGithubToken(token),
|
|
112
|
+
token: await resolveGithubToken(token, githubTokenCall("createRepository", args)),
|
|
111
113
|
...args
|
|
112
114
|
})
|
|
113
115
|
});
|
|
@@ -121,7 +123,7 @@ const createOrUpdateFile = (token, { needsApproval = true, author, committer, co
|
|
|
121
123
|
needsApproval,
|
|
122
124
|
inputSchema: createOrUpdateFileInputSchema,
|
|
123
125
|
execute: async (args) => createOrUpdateFileStep({
|
|
124
|
-
token: await resolveGithubToken(token),
|
|
126
|
+
token: await resolveGithubToken(token, githubTokenCall("createOrUpdateFile", args)),
|
|
125
127
|
author,
|
|
126
128
|
committer,
|
|
127
129
|
coAuthors,
|
|
@@ -139,7 +141,7 @@ const listPullRequests = (token) => tool({
|
|
|
139
141
|
description: listPullRequestsDescription,
|
|
140
142
|
inputSchema: listPullRequestsInputSchema,
|
|
141
143
|
execute: async (args) => listPullRequestsStep({
|
|
142
|
-
token: await resolveGithubToken(token),
|
|
144
|
+
token: await resolveGithubToken(token, githubTokenCall("listPullRequests", args)),
|
|
143
145
|
...args
|
|
144
146
|
})
|
|
145
147
|
});
|
|
@@ -152,7 +154,7 @@ const getPullRequest = (token) => tool({
|
|
|
152
154
|
description: getPullRequestDescription,
|
|
153
155
|
inputSchema: getPullRequestInputSchema,
|
|
154
156
|
execute: async (args) => getPullRequestStep({
|
|
155
|
-
token: await resolveGithubToken(token),
|
|
157
|
+
token: await resolveGithubToken(token, githubTokenCall("getPullRequest", args)),
|
|
156
158
|
...args
|
|
157
159
|
})
|
|
158
160
|
});
|
|
@@ -166,7 +168,7 @@ const createPullRequest = (token, { needsApproval = true } = {}) => tool({
|
|
|
166
168
|
needsApproval,
|
|
167
169
|
inputSchema: createPullRequestInputSchema,
|
|
168
170
|
execute: async (args) => createPullRequestStep({
|
|
169
|
-
token: await resolveGithubToken(token),
|
|
171
|
+
token: await resolveGithubToken(token, githubTokenCall("createPullRequest", args)),
|
|
170
172
|
...args
|
|
171
173
|
})
|
|
172
174
|
});
|
|
@@ -180,7 +182,7 @@ const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => to
|
|
|
180
182
|
needsApproval,
|
|
181
183
|
inputSchema: mergePullRequestInputSchema,
|
|
182
184
|
execute: async (args) => mergePullRequestStep({
|
|
183
|
-
token: await resolveGithubToken(token),
|
|
185
|
+
token: await resolveGithubToken(token, githubTokenCall("mergePullRequest", args)),
|
|
184
186
|
coAuthors,
|
|
185
187
|
...args
|
|
186
188
|
})
|
|
@@ -195,7 +197,7 @@ const updatePullRequest = (token, { needsApproval = true } = {}) => tool({
|
|
|
195
197
|
needsApproval,
|
|
196
198
|
inputSchema: updatePullRequestInputSchema,
|
|
197
199
|
execute: async (args) => updatePullRequestStep({
|
|
198
|
-
token: await resolveGithubToken(token),
|
|
200
|
+
token: await resolveGithubToken(token, githubTokenCall("updatePullRequest", args)),
|
|
199
201
|
...args
|
|
200
202
|
})
|
|
201
203
|
});
|
|
@@ -209,7 +211,7 @@ const addPullRequestComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
209
211
|
needsApproval,
|
|
210
212
|
inputSchema: addPullRequestCommentInputSchema,
|
|
211
213
|
execute: async (args) => addPullRequestCommentStep({
|
|
212
|
-
token: await resolveGithubToken(token),
|
|
214
|
+
token: await resolveGithubToken(token, githubTokenCall("addPullRequestComment", args)),
|
|
213
215
|
...args
|
|
214
216
|
})
|
|
215
217
|
});
|
|
@@ -223,7 +225,7 @@ const updatePullRequestComment = (token, { needsApproval = true } = {}) => tool(
|
|
|
223
225
|
needsApproval,
|
|
224
226
|
inputSchema: updatePullRequestCommentInputSchema,
|
|
225
227
|
execute: async (args) => updatePullRequestCommentStep({
|
|
226
|
-
token: await resolveGithubToken(token),
|
|
228
|
+
token: await resolveGithubToken(token, githubTokenCall("updatePullRequestComment", args)),
|
|
227
229
|
...args
|
|
228
230
|
})
|
|
229
231
|
});
|
|
@@ -237,7 +239,7 @@ const deletePullRequestComment = (token, { needsApproval = true } = {}) => tool(
|
|
|
237
239
|
needsApproval,
|
|
238
240
|
inputSchema: deletePullRequestCommentInputSchema,
|
|
239
241
|
execute: async (args) => deletePullRequestCommentStep({
|
|
240
|
-
token: await resolveGithubToken(token),
|
|
242
|
+
token: await resolveGithubToken(token, githubTokenCall("deletePullRequestComment", args)),
|
|
241
243
|
...args
|
|
242
244
|
})
|
|
243
245
|
});
|
|
@@ -251,7 +253,7 @@ const listPullRequestFiles = (token) => tool({
|
|
|
251
253
|
inputSchema: listPullRequestFilesInputSchema,
|
|
252
254
|
toModelOutput: listPullRequestFilesToModelOutput,
|
|
253
255
|
execute: async (args) => listPullRequestFilesStep({
|
|
254
|
-
token: await resolveGithubToken(token),
|
|
256
|
+
token: await resolveGithubToken(token, githubTokenCall("listPullRequestFiles", args)),
|
|
255
257
|
...args
|
|
256
258
|
})
|
|
257
259
|
});
|
|
@@ -264,7 +266,7 @@ const listPullRequestReviews = (token) => tool({
|
|
|
264
266
|
description: listPullRequestReviewsDescription,
|
|
265
267
|
inputSchema: listPullRequestReviewsInputSchema,
|
|
266
268
|
execute: async (args) => listPullRequestReviewsStep({
|
|
267
|
-
token: await resolveGithubToken(token),
|
|
269
|
+
token: await resolveGithubToken(token, githubTokenCall("listPullRequestReviews", args)),
|
|
268
270
|
...args
|
|
269
271
|
})
|
|
270
272
|
});
|
|
@@ -278,7 +280,7 @@ const createPullRequestReview = (token, { needsApproval = true } = {}) => tool({
|
|
|
278
280
|
needsApproval,
|
|
279
281
|
inputSchema: createPullRequestReviewInputSchema,
|
|
280
282
|
execute: async (args) => createPullRequestReviewStep({
|
|
281
|
-
token: await resolveGithubToken(token),
|
|
283
|
+
token: await resolveGithubToken(token, githubTokenCall("createPullRequestReview", args)),
|
|
282
284
|
...args
|
|
283
285
|
})
|
|
284
286
|
});
|
|
@@ -291,7 +293,7 @@ const listPullRequestReviewThreads = (token) => tool({
|
|
|
291
293
|
description: listPullRequestReviewThreadsDescription,
|
|
292
294
|
inputSchema: listPullRequestReviewThreadsInputSchema,
|
|
293
295
|
execute: async (args) => listPullRequestReviewThreadsStep({
|
|
294
|
-
token: await resolveGithubToken(token),
|
|
296
|
+
token: await resolveGithubToken(token, githubTokenCall("listPullRequestReviewThreads", args)),
|
|
295
297
|
...args
|
|
296
298
|
})
|
|
297
299
|
});
|
|
@@ -305,7 +307,7 @@ const replyToReviewComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
305
307
|
needsApproval,
|
|
306
308
|
inputSchema: replyToReviewCommentInputSchema,
|
|
307
309
|
execute: async (args) => replyToReviewCommentStep({
|
|
308
|
-
token: await resolveGithubToken(token),
|
|
310
|
+
token: await resolveGithubToken(token, githubTokenCall("replyToReviewComment", args)),
|
|
309
311
|
...args
|
|
310
312
|
})
|
|
311
313
|
});
|
|
@@ -319,7 +321,7 @@ const resolveReviewThread = (token, { needsApproval = true } = {}) => tool({
|
|
|
319
321
|
needsApproval,
|
|
320
322
|
inputSchema: resolveReviewThreadInputSchema,
|
|
321
323
|
execute: async (args) => resolveReviewThreadStep({
|
|
322
|
-
token: await resolveGithubToken(token),
|
|
324
|
+
token: await resolveGithubToken(token, githubTokenCall("resolveReviewThread", args)),
|
|
323
325
|
...args
|
|
324
326
|
})
|
|
325
327
|
});
|
|
@@ -333,7 +335,7 @@ const requestReviewers = (token, { needsApproval = true } = {}) => tool({
|
|
|
333
335
|
needsApproval,
|
|
334
336
|
inputSchema: requestReviewersInputSchema,
|
|
335
337
|
execute: async (args) => requestReviewersStep({
|
|
336
|
-
token: await resolveGithubToken(token),
|
|
338
|
+
token: await resolveGithubToken(token, githubTokenCall("requestReviewers", args)),
|
|
337
339
|
...args
|
|
338
340
|
})
|
|
339
341
|
});
|
|
@@ -348,7 +350,7 @@ const listIssues = (token) => tool({
|
|
|
348
350
|
description: listIssuesDescription,
|
|
349
351
|
inputSchema: listIssuesInputSchema,
|
|
350
352
|
execute: async (args) => listIssuesStep({
|
|
351
|
-
token: await resolveGithubToken(token),
|
|
353
|
+
token: await resolveGithubToken(token, githubTokenCall("listIssues", args)),
|
|
352
354
|
...args
|
|
353
355
|
})
|
|
354
356
|
});
|
|
@@ -361,7 +363,7 @@ const getIssue = (token) => tool({
|
|
|
361
363
|
description: getIssueDescription,
|
|
362
364
|
inputSchema: getIssueInputSchema,
|
|
363
365
|
execute: async (args) => getIssueStep({
|
|
364
|
-
token: await resolveGithubToken(token),
|
|
366
|
+
token: await resolveGithubToken(token, githubTokenCall("getIssue", args)),
|
|
365
367
|
...args
|
|
366
368
|
})
|
|
367
369
|
});
|
|
@@ -374,7 +376,7 @@ const listIssueComments = (token) => tool({
|
|
|
374
376
|
description: listIssueCommentsDescription,
|
|
375
377
|
inputSchema: listIssueCommentsInputSchema,
|
|
376
378
|
execute: async (args) => listIssueCommentsStep({
|
|
377
|
-
token: await resolveGithubToken(token),
|
|
379
|
+
token: await resolveGithubToken(token, githubTokenCall("listIssueComments", args)),
|
|
378
380
|
...args
|
|
379
381
|
})
|
|
380
382
|
});
|
|
@@ -388,7 +390,7 @@ const createIssue = (token, { needsApproval = true } = {}) => tool({
|
|
|
388
390
|
needsApproval,
|
|
389
391
|
inputSchema: createIssueInputSchema,
|
|
390
392
|
execute: async (args) => createIssueStep({
|
|
391
|
-
token: await resolveGithubToken(token),
|
|
393
|
+
token: await resolveGithubToken(token, githubTokenCall("createIssue", args)),
|
|
392
394
|
...args
|
|
393
395
|
})
|
|
394
396
|
});
|
|
@@ -402,7 +404,7 @@ const addIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
402
404
|
needsApproval,
|
|
403
405
|
inputSchema: addIssueCommentInputSchema,
|
|
404
406
|
execute: async (args) => addIssueCommentStep({
|
|
405
|
-
token: await resolveGithubToken(token),
|
|
407
|
+
token: await resolveGithubToken(token, githubTokenCall("addIssueComment", args)),
|
|
406
408
|
...args
|
|
407
409
|
})
|
|
408
410
|
});
|
|
@@ -416,7 +418,7 @@ const closeIssue = (token, { needsApproval = true } = {}) => tool({
|
|
|
416
418
|
needsApproval,
|
|
417
419
|
inputSchema: closeIssueInputSchema,
|
|
418
420
|
execute: async (args) => closeIssueStep({
|
|
419
|
-
token: await resolveGithubToken(token),
|
|
421
|
+
token: await resolveGithubToken(token, githubTokenCall("closeIssue", args)),
|
|
420
422
|
...args
|
|
421
423
|
})
|
|
422
424
|
});
|
|
@@ -430,7 +432,7 @@ const updateIssue = (token, { needsApproval = true } = {}) => tool({
|
|
|
430
432
|
needsApproval,
|
|
431
433
|
inputSchema: updateIssueInputSchema,
|
|
432
434
|
execute: async (args) => updateIssueStep({
|
|
433
|
-
token: await resolveGithubToken(token),
|
|
435
|
+
token: await resolveGithubToken(token, githubTokenCall("updateIssue", args)),
|
|
434
436
|
...args
|
|
435
437
|
})
|
|
436
438
|
});
|
|
@@ -444,7 +446,7 @@ const updateIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
444
446
|
needsApproval,
|
|
445
447
|
inputSchema: updateIssueCommentInputSchema,
|
|
446
448
|
execute: async (args) => updateIssueCommentStep({
|
|
447
|
-
token: await resolveGithubToken(token),
|
|
449
|
+
token: await resolveGithubToken(token, githubTokenCall("updateIssueComment", args)),
|
|
448
450
|
...args
|
|
449
451
|
})
|
|
450
452
|
});
|
|
@@ -458,7 +460,7 @@ const deleteIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
458
460
|
needsApproval,
|
|
459
461
|
inputSchema: deleteIssueCommentInputSchema,
|
|
460
462
|
execute: async (args) => deleteIssueCommentStep({
|
|
461
|
-
token: await resolveGithubToken(token),
|
|
463
|
+
token: await resolveGithubToken(token, githubTokenCall("deleteIssueComment", args)),
|
|
462
464
|
...args
|
|
463
465
|
})
|
|
464
466
|
});
|
|
@@ -471,7 +473,7 @@ const listLabels = (token) => tool({
|
|
|
471
473
|
description: listLabelsDescription,
|
|
472
474
|
inputSchema: listLabelsInputSchema,
|
|
473
475
|
execute: async (args) => listLabelsStep({
|
|
474
|
-
token: await resolveGithubToken(token),
|
|
476
|
+
token: await resolveGithubToken(token, githubTokenCall("listLabels", args)),
|
|
475
477
|
...args
|
|
476
478
|
})
|
|
477
479
|
});
|
|
@@ -485,7 +487,7 @@ const addLabels = (token, { needsApproval = true } = {}) => tool({
|
|
|
485
487
|
needsApproval,
|
|
486
488
|
inputSchema: addLabelsInputSchema,
|
|
487
489
|
execute: async (args) => addLabelsStep({
|
|
488
|
-
token: await resolveGithubToken(token),
|
|
490
|
+
token: await resolveGithubToken(token, githubTokenCall("addLabels", args)),
|
|
489
491
|
...args
|
|
490
492
|
})
|
|
491
493
|
});
|
|
@@ -499,7 +501,7 @@ const removeLabel = (token, { needsApproval = true } = {}) => tool({
|
|
|
499
501
|
needsApproval,
|
|
500
502
|
inputSchema: removeLabelInputSchema,
|
|
501
503
|
execute: async (args) => removeLabelStep({
|
|
502
|
-
token: await resolveGithubToken(token),
|
|
504
|
+
token: await resolveGithubToken(token, githubTokenCall("removeLabel", args)),
|
|
503
505
|
...args
|
|
504
506
|
})
|
|
505
507
|
});
|
|
@@ -513,7 +515,7 @@ const createLabel = (token, { needsApproval = true } = {}) => tool({
|
|
|
513
515
|
needsApproval,
|
|
514
516
|
inputSchema: createLabelInputSchema,
|
|
515
517
|
execute: async (args) => createLabelStep({
|
|
516
|
-
token: await resolveGithubToken(token),
|
|
518
|
+
token: await resolveGithubToken(token, githubTokenCall("createLabel", args)),
|
|
517
519
|
...args
|
|
518
520
|
})
|
|
519
521
|
});
|
|
@@ -527,7 +529,7 @@ const updateLabel = (token, { needsApproval = true } = {}) => tool({
|
|
|
527
529
|
needsApproval,
|
|
528
530
|
inputSchema: updateLabelInputSchema,
|
|
529
531
|
execute: async (args) => updateLabelStep({
|
|
530
|
-
token: await resolveGithubToken(token),
|
|
532
|
+
token: await resolveGithubToken(token, githubTokenCall("updateLabel", args)),
|
|
531
533
|
...args
|
|
532
534
|
})
|
|
533
535
|
});
|
|
@@ -541,7 +543,7 @@ const deleteLabel = (token, { needsApproval = true } = {}) => tool({
|
|
|
541
543
|
needsApproval,
|
|
542
544
|
inputSchema: deleteLabelInputSchema,
|
|
543
545
|
execute: async (args) => deleteLabelStep({
|
|
544
|
-
token: await resolveGithubToken(token),
|
|
546
|
+
token: await resolveGithubToken(token, githubTokenCall("deleteLabel", args)),
|
|
545
547
|
...args
|
|
546
548
|
})
|
|
547
549
|
});
|
|
@@ -555,7 +557,7 @@ const addAssignees = (token, { needsApproval = true } = {}) => tool({
|
|
|
555
557
|
needsApproval,
|
|
556
558
|
inputSchema: addAssigneesInputSchema,
|
|
557
559
|
execute: async (args) => addAssigneesStep({
|
|
558
|
-
token: await resolveGithubToken(token),
|
|
560
|
+
token: await resolveGithubToken(token, githubTokenCall("addAssignees", args)),
|
|
559
561
|
...args
|
|
560
562
|
})
|
|
561
563
|
});
|
|
@@ -569,7 +571,7 @@ const removeAssignees = (token, { needsApproval = true } = {}) => tool({
|
|
|
569
571
|
needsApproval,
|
|
570
572
|
inputSchema: removeAssigneesInputSchema,
|
|
571
573
|
execute: async (args) => removeAssigneesStep({
|
|
572
|
-
token: await resolveGithubToken(token),
|
|
574
|
+
token: await resolveGithubToken(token, githubTokenCall("removeAssignees", args)),
|
|
573
575
|
...args
|
|
574
576
|
})
|
|
575
577
|
});
|
|
@@ -584,7 +586,7 @@ const listIssueReactions = (token) => tool({
|
|
|
584
586
|
description: listIssueReactionsDescription,
|
|
585
587
|
inputSchema: listIssueReactionsInputSchema,
|
|
586
588
|
execute: async (args) => listIssueReactionsStep({
|
|
587
|
-
token: await resolveGithubToken(token),
|
|
589
|
+
token: await resolveGithubToken(token, githubTokenCall("listIssueReactions", args)),
|
|
588
590
|
...args
|
|
589
591
|
})
|
|
590
592
|
});
|
|
@@ -598,7 +600,7 @@ const addIssueReaction = (token, { needsApproval = true } = {}) => tool({
|
|
|
598
600
|
needsApproval,
|
|
599
601
|
inputSchema: addIssueReactionInputSchema,
|
|
600
602
|
execute: async (args) => addIssueReactionStep({
|
|
601
|
-
token: await resolveGithubToken(token),
|
|
603
|
+
token: await resolveGithubToken(token, githubTokenCall("addIssueReaction", args)),
|
|
602
604
|
...args
|
|
603
605
|
})
|
|
604
606
|
});
|
|
@@ -611,7 +613,7 @@ const listCommentReactions = (token) => tool({
|
|
|
611
613
|
description: listCommentReactionsDescription,
|
|
612
614
|
inputSchema: listCommentReactionsInputSchema,
|
|
613
615
|
execute: async (args) => listCommentReactionsStep({
|
|
614
|
-
token: await resolveGithubToken(token),
|
|
616
|
+
token: await resolveGithubToken(token, githubTokenCall("listCommentReactions", args)),
|
|
615
617
|
...args
|
|
616
618
|
})
|
|
617
619
|
});
|
|
@@ -625,7 +627,7 @@ const addCommentReaction = (token, { needsApproval = true } = {}) => tool({
|
|
|
625
627
|
needsApproval,
|
|
626
628
|
inputSchema: addCommentReactionInputSchema,
|
|
627
629
|
execute: async (args) => addCommentReactionStep({
|
|
628
|
-
token: await resolveGithubToken(token),
|
|
630
|
+
token: await resolveGithubToken(token, githubTokenCall("addCommentReaction", args)),
|
|
629
631
|
...args
|
|
630
632
|
})
|
|
631
633
|
});
|
|
@@ -640,7 +642,7 @@ const listDiscussions = (token) => tool({
|
|
|
640
642
|
description: listDiscussionsDescription,
|
|
641
643
|
inputSchema: listDiscussionsInputSchema,
|
|
642
644
|
execute: async (args) => listDiscussionsStep({
|
|
643
|
-
token: await resolveGithubToken(token),
|
|
645
|
+
token: await resolveGithubToken(token, githubTokenCall("listDiscussions", args)),
|
|
644
646
|
...args
|
|
645
647
|
})
|
|
646
648
|
});
|
|
@@ -653,7 +655,7 @@ const getDiscussion = (token) => tool({
|
|
|
653
655
|
description: getDiscussionDescription,
|
|
654
656
|
inputSchema: getDiscussionInputSchema,
|
|
655
657
|
execute: async (args) => getDiscussionStep({
|
|
656
|
-
token: await resolveGithubToken(token),
|
|
658
|
+
token: await resolveGithubToken(token, githubTokenCall("getDiscussion", args)),
|
|
657
659
|
...args
|
|
658
660
|
})
|
|
659
661
|
});
|
|
@@ -667,7 +669,7 @@ const addDiscussionComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
667
669
|
needsApproval,
|
|
668
670
|
inputSchema: addDiscussionCommentInputSchema,
|
|
669
671
|
execute: async (args) => addDiscussionCommentStep({
|
|
670
|
-
token: await resolveGithubToken(token),
|
|
672
|
+
token: await resolveGithubToken(token, githubTokenCall("addDiscussionComment", args)),
|
|
671
673
|
...args
|
|
672
674
|
})
|
|
673
675
|
});
|
|
@@ -682,7 +684,7 @@ const listNotifications = (token) => tool({
|
|
|
682
684
|
description: listNotificationsDescription,
|
|
683
685
|
inputSchema: listNotificationsInputSchema,
|
|
684
686
|
execute: async (args) => listNotificationsStep({
|
|
685
|
-
token: await resolveGithubToken(token),
|
|
687
|
+
token: await resolveGithubToken(token, githubTokenCall("listNotifications", args)),
|
|
686
688
|
...args
|
|
687
689
|
})
|
|
688
690
|
});
|
|
@@ -696,7 +698,7 @@ const markNotificationRead = (token, { needsApproval = true } = {}) => tool({
|
|
|
696
698
|
needsApproval,
|
|
697
699
|
inputSchema: markNotificationReadInputSchema,
|
|
698
700
|
execute: async (args) => markNotificationReadStep({
|
|
699
|
-
token: await resolveGithubToken(token),
|
|
701
|
+
token: await resolveGithubToken(token, githubTokenCall("markNotificationRead", args)),
|
|
700
702
|
...args
|
|
701
703
|
})
|
|
702
704
|
});
|
|
@@ -711,7 +713,7 @@ const searchCode = (token) => tool({
|
|
|
711
713
|
description: searchCodeDescription,
|
|
712
714
|
inputSchema: searchCodeInputSchema,
|
|
713
715
|
execute: async (args) => searchCodeStep({
|
|
714
|
-
token: await resolveGithubToken(token),
|
|
716
|
+
token: await resolveGithubToken(token, githubTokenCall("searchCode", args)),
|
|
715
717
|
...args
|
|
716
718
|
})
|
|
717
719
|
});
|
|
@@ -724,7 +726,7 @@ const searchRepositories = (token) => tool({
|
|
|
724
726
|
description: searchRepositoriesDescription,
|
|
725
727
|
inputSchema: searchRepositoriesInputSchema,
|
|
726
728
|
execute: async (args) => searchRepositoriesStep({
|
|
727
|
-
token: await resolveGithubToken(token),
|
|
729
|
+
token: await resolveGithubToken(token, githubTokenCall("searchRepositories", args)),
|
|
728
730
|
...args
|
|
729
731
|
})
|
|
730
732
|
});
|
|
@@ -737,7 +739,7 @@ const searchIssues = (token) => tool({
|
|
|
737
739
|
description: searchIssuesDescription,
|
|
738
740
|
inputSchema: searchIssuesInputSchema,
|
|
739
741
|
execute: async (args) => searchIssuesStep({
|
|
740
|
-
token: await resolveGithubToken(token),
|
|
742
|
+
token: await resolveGithubToken(token, githubTokenCall("searchIssues", args)),
|
|
741
743
|
...args
|
|
742
744
|
})
|
|
743
745
|
});
|
|
@@ -752,7 +754,7 @@ const listCommits = (token) => tool({
|
|
|
752
754
|
description: listCommitsDescription,
|
|
753
755
|
inputSchema: listCommitsInputSchema,
|
|
754
756
|
execute: async (args) => listCommitsStep({
|
|
755
|
-
token: await resolveGithubToken(token),
|
|
757
|
+
token: await resolveGithubToken(token, githubTokenCall("listCommits", args)),
|
|
756
758
|
...args
|
|
757
759
|
})
|
|
758
760
|
});
|
|
@@ -766,7 +768,7 @@ const getCommit = (token) => tool({
|
|
|
766
768
|
inputSchema: getCommitInputSchema,
|
|
767
769
|
toModelOutput: getCommitToModelOutput,
|
|
768
770
|
execute: async (args) => getCommitStep({
|
|
769
|
-
token: await resolveGithubToken(token),
|
|
771
|
+
token: await resolveGithubToken(token, githubTokenCall("getCommit", args)),
|
|
770
772
|
...args
|
|
771
773
|
})
|
|
772
774
|
});
|
|
@@ -779,7 +781,7 @@ const getBlame = (token) => tool({
|
|
|
779
781
|
description: getBlameDescription,
|
|
780
782
|
inputSchema: getBlameInputSchema,
|
|
781
783
|
execute: async (args) => getBlameStep({
|
|
782
|
-
token: await resolveGithubToken(token),
|
|
784
|
+
token: await resolveGithubToken(token, githubTokenCall("getBlame", args)),
|
|
783
785
|
...args
|
|
784
786
|
})
|
|
785
787
|
});
|
|
@@ -793,7 +795,7 @@ const compareCommits = (token) => tool({
|
|
|
793
795
|
inputSchema: compareCommitsInputSchema,
|
|
794
796
|
toModelOutput: compareCommitsToModelOutput,
|
|
795
797
|
execute: async (args) => compareCommitsStep({
|
|
796
|
-
token: await resolveGithubToken(token),
|
|
798
|
+
token: await resolveGithubToken(token, githubTokenCall("compareCommits", args)),
|
|
797
799
|
...args
|
|
798
800
|
})
|
|
799
801
|
});
|
|
@@ -808,7 +810,7 @@ const listGists = (token) => tool({
|
|
|
808
810
|
description: listGistsDescription,
|
|
809
811
|
inputSchema: listGistsInputSchema,
|
|
810
812
|
execute: async (args) => listGistsStep({
|
|
811
|
-
token: await resolveGithubToken(token),
|
|
813
|
+
token: await resolveGithubToken(token, githubTokenCall("listGists", args)),
|
|
812
814
|
...args
|
|
813
815
|
})
|
|
814
816
|
});
|
|
@@ -821,7 +823,7 @@ const getGist = (token) => tool({
|
|
|
821
823
|
description: getGistDescription,
|
|
822
824
|
inputSchema: getGistInputSchema,
|
|
823
825
|
execute: async (args) => getGistStep({
|
|
824
|
-
token: await resolveGithubToken(token),
|
|
826
|
+
token: await resolveGithubToken(token, githubTokenCall("getGist", args)),
|
|
825
827
|
...args
|
|
826
828
|
})
|
|
827
829
|
});
|
|
@@ -834,7 +836,7 @@ const listGistComments = (token) => tool({
|
|
|
834
836
|
description: listGistCommentsDescription,
|
|
835
837
|
inputSchema: listGistCommentsInputSchema,
|
|
836
838
|
execute: async (args) => listGistCommentsStep({
|
|
837
|
-
token: await resolveGithubToken(token),
|
|
839
|
+
token: await resolveGithubToken(token, githubTokenCall("listGistComments", args)),
|
|
838
840
|
...args
|
|
839
841
|
})
|
|
840
842
|
});
|
|
@@ -848,7 +850,7 @@ const createGist = (token, { needsApproval = true } = {}) => tool({
|
|
|
848
850
|
needsApproval,
|
|
849
851
|
inputSchema: createGistInputSchema,
|
|
850
852
|
execute: async (args) => createGistStep({
|
|
851
|
-
token: await resolveGithubToken(token),
|
|
853
|
+
token: await resolveGithubToken(token, githubTokenCall("createGist", args)),
|
|
852
854
|
...args
|
|
853
855
|
})
|
|
854
856
|
});
|
|
@@ -862,7 +864,7 @@ const updateGist = (token, { needsApproval = true } = {}) => tool({
|
|
|
862
864
|
needsApproval,
|
|
863
865
|
inputSchema: updateGistInputSchema,
|
|
864
866
|
execute: async (args) => updateGistStep({
|
|
865
|
-
token: await resolveGithubToken(token),
|
|
867
|
+
token: await resolveGithubToken(token, githubTokenCall("updateGist", args)),
|
|
866
868
|
...args
|
|
867
869
|
})
|
|
868
870
|
});
|
|
@@ -876,7 +878,7 @@ const deleteGist = (token, { needsApproval = true } = {}) => tool({
|
|
|
876
878
|
needsApproval,
|
|
877
879
|
inputSchema: deleteGistInputSchema,
|
|
878
880
|
execute: async (args) => deleteGistStep({
|
|
879
|
-
token: await resolveGithubToken(token),
|
|
881
|
+
token: await resolveGithubToken(token, githubTokenCall("deleteGist", args)),
|
|
880
882
|
...args
|
|
881
883
|
})
|
|
882
884
|
});
|
|
@@ -890,7 +892,7 @@ const createGistComment = (token, { needsApproval = true } = {}) => tool({
|
|
|
890
892
|
needsApproval,
|
|
891
893
|
inputSchema: createGistCommentInputSchema,
|
|
892
894
|
execute: async (args) => createGistCommentStep({
|
|
893
|
-
token: await resolveGithubToken(token),
|
|
895
|
+
token: await resolveGithubToken(token, githubTokenCall("createGistComment", args)),
|
|
894
896
|
...args
|
|
895
897
|
})
|
|
896
898
|
});
|
|
@@ -905,7 +907,7 @@ const listWorkflows = (token) => tool({
|
|
|
905
907
|
description: listWorkflowsDescription,
|
|
906
908
|
inputSchema: listWorkflowsInputSchema,
|
|
907
909
|
execute: async (args) => listWorkflowsStep({
|
|
908
|
-
token: await resolveGithubToken(token),
|
|
910
|
+
token: await resolveGithubToken(token, githubTokenCall("listWorkflows", args)),
|
|
909
911
|
...args
|
|
910
912
|
})
|
|
911
913
|
});
|
|
@@ -918,7 +920,7 @@ const listWorkflowRuns = (token) => tool({
|
|
|
918
920
|
description: listWorkflowRunsDescription,
|
|
919
921
|
inputSchema: listWorkflowRunsInputSchema,
|
|
920
922
|
execute: async (args) => listWorkflowRunsStep({
|
|
921
|
-
token: await resolveGithubToken(token),
|
|
923
|
+
token: await resolveGithubToken(token, githubTokenCall("listWorkflowRuns", args)),
|
|
922
924
|
...args
|
|
923
925
|
})
|
|
924
926
|
});
|
|
@@ -931,7 +933,7 @@ const getWorkflowRun = (token) => tool({
|
|
|
931
933
|
description: getWorkflowRunDescription,
|
|
932
934
|
inputSchema: getWorkflowRunInputSchema,
|
|
933
935
|
execute: async (args) => getWorkflowRunStep({
|
|
934
|
-
token: await resolveGithubToken(token),
|
|
936
|
+
token: await resolveGithubToken(token, githubTokenCall("getWorkflowRun", args)),
|
|
935
937
|
...args
|
|
936
938
|
})
|
|
937
939
|
});
|
|
@@ -944,7 +946,7 @@ const listWorkflowJobs = (token) => tool({
|
|
|
944
946
|
description: listWorkflowJobsDescription,
|
|
945
947
|
inputSchema: listWorkflowJobsInputSchema,
|
|
946
948
|
execute: async (args) => listWorkflowJobsStep({
|
|
947
|
-
token: await resolveGithubToken(token),
|
|
949
|
+
token: await resolveGithubToken(token, githubTokenCall("listWorkflowJobs", args)),
|
|
948
950
|
...args
|
|
949
951
|
})
|
|
950
952
|
});
|
|
@@ -957,7 +959,7 @@ const getWorkflowJobLogs = (token) => tool({
|
|
|
957
959
|
description: getWorkflowJobLogsDescription,
|
|
958
960
|
inputSchema: getWorkflowJobLogsInputSchema,
|
|
959
961
|
execute: async (args) => getWorkflowJobLogsStep({
|
|
960
|
-
token: await resolveGithubToken(token),
|
|
962
|
+
token: await resolveGithubToken(token, githubTokenCall("getWorkflowJobLogs", args)),
|
|
961
963
|
...args
|
|
962
964
|
})
|
|
963
965
|
});
|
|
@@ -971,7 +973,7 @@ const triggerWorkflow = (token, { needsApproval = true } = {}) => tool({
|
|
|
971
973
|
needsApproval,
|
|
972
974
|
inputSchema: triggerWorkflowInputSchema,
|
|
973
975
|
execute: async (args) => triggerWorkflowStep({
|
|
974
|
-
token: await resolveGithubToken(token),
|
|
976
|
+
token: await resolveGithubToken(token, githubTokenCall("triggerWorkflow", args)),
|
|
975
977
|
...args
|
|
976
978
|
})
|
|
977
979
|
});
|
|
@@ -985,7 +987,7 @@ const cancelWorkflowRun = (token, { needsApproval = true } = {}) => tool({
|
|
|
985
987
|
needsApproval,
|
|
986
988
|
inputSchema: cancelWorkflowRunInputSchema,
|
|
987
989
|
execute: async (args) => cancelWorkflowRunStep({
|
|
988
|
-
token: await resolveGithubToken(token),
|
|
990
|
+
token: await resolveGithubToken(token, githubTokenCall("cancelWorkflowRun", args)),
|
|
989
991
|
...args
|
|
990
992
|
})
|
|
991
993
|
});
|
|
@@ -999,7 +1001,7 @@ const rerunWorkflowRun = (token, { needsApproval = true } = {}) => tool({
|
|
|
999
1001
|
needsApproval,
|
|
1000
1002
|
inputSchema: rerunWorkflowRunInputSchema,
|
|
1001
1003
|
execute: async (args) => rerunWorkflowRunStep({
|
|
1002
|
-
token: await resolveGithubToken(token),
|
|
1004
|
+
token: await resolveGithubToken(token, githubTokenCall("rerunWorkflowRun", args)),
|
|
1003
1005
|
...args
|
|
1004
1006
|
})
|
|
1005
1007
|
});
|
|
@@ -1014,7 +1016,7 @@ const listCheckRuns = (token) => tool({
|
|
|
1014
1016
|
description: listCheckRunsDescription,
|
|
1015
1017
|
inputSchema: listCheckRunsInputSchema,
|
|
1016
1018
|
execute: async (args) => listCheckRunsStep({
|
|
1017
|
-
token: await resolveGithubToken(token),
|
|
1019
|
+
token: await resolveGithubToken(token, githubTokenCall("listCheckRuns", args)),
|
|
1018
1020
|
...args
|
|
1019
1021
|
})
|
|
1020
1022
|
});
|
|
@@ -1027,7 +1029,7 @@ const getCombinedStatus = (token) => tool({
|
|
|
1027
1029
|
description: getCombinedStatusDescription,
|
|
1028
1030
|
inputSchema: getCombinedStatusInputSchema,
|
|
1029
1031
|
execute: async (args) => getCombinedStatusStep({
|
|
1030
|
-
token: await resolveGithubToken(token),
|
|
1032
|
+
token: await resolveGithubToken(token, githubTokenCall("getCombinedStatus", args)),
|
|
1031
1033
|
...args
|
|
1032
1034
|
})
|
|
1033
1035
|
});
|
|
@@ -1042,7 +1044,7 @@ const listReleases = (token) => tool({
|
|
|
1042
1044
|
description: listReleasesDescription,
|
|
1043
1045
|
inputSchema: listReleasesInputSchema,
|
|
1044
1046
|
execute: async (args) => listReleasesStep({
|
|
1045
|
-
token: await resolveGithubToken(token),
|
|
1047
|
+
token: await resolveGithubToken(token, githubTokenCall("listReleases", args)),
|
|
1046
1048
|
...args
|
|
1047
1049
|
})
|
|
1048
1050
|
});
|
|
@@ -1055,7 +1057,7 @@ const getLatestRelease = (token) => tool({
|
|
|
1055
1057
|
description: getLatestReleaseDescription,
|
|
1056
1058
|
inputSchema: getLatestReleaseInputSchema,
|
|
1057
1059
|
execute: async (args) => getLatestReleaseStep({
|
|
1058
|
-
token: await resolveGithubToken(token),
|
|
1060
|
+
token: await resolveGithubToken(token, githubTokenCall("getLatestRelease", args)),
|
|
1059
1061
|
...args
|
|
1060
1062
|
})
|
|
1061
1063
|
});
|
|
@@ -1068,7 +1070,7 @@ const getRelease = (token) => tool({
|
|
|
1068
1070
|
description: getReleaseDescription,
|
|
1069
1071
|
inputSchema: getReleaseInputSchema,
|
|
1070
1072
|
execute: async (args) => getReleaseStep({
|
|
1071
|
-
token: await resolveGithubToken(token),
|
|
1073
|
+
token: await resolveGithubToken(token, githubTokenCall("getRelease", args)),
|
|
1072
1074
|
...args
|
|
1073
1075
|
})
|
|
1074
1076
|
});
|
|
@@ -1082,7 +1084,7 @@ const createRelease = (token, { needsApproval = true } = {}) => tool({
|
|
|
1082
1084
|
needsApproval,
|
|
1083
1085
|
inputSchema: createReleaseInputSchema,
|
|
1084
1086
|
execute: async (args) => createReleaseStep({
|
|
1085
|
-
token: await resolveGithubToken(token),
|
|
1087
|
+
token: await resolveGithubToken(token, githubTokenCall("createRelease", args)),
|
|
1086
1088
|
...args
|
|
1087
1089
|
})
|
|
1088
1090
|
});
|
|
@@ -1096,7 +1098,7 @@ const updateRelease = (token, { needsApproval = true } = {}) => tool({
|
|
|
1096
1098
|
needsApproval,
|
|
1097
1099
|
inputSchema: updateReleaseInputSchema,
|
|
1098
1100
|
execute: async (args) => updateReleaseStep({
|
|
1099
|
-
token: await resolveGithubToken(token),
|
|
1101
|
+
token: await resolveGithubToken(token, githubTokenCall("updateRelease", args)),
|
|
1100
1102
|
...args
|
|
1101
1103
|
})
|
|
1102
1104
|
});
|
|
@@ -1110,7 +1112,7 @@ const deleteRelease = (token, { needsApproval = true } = {}) => tool({
|
|
|
1110
1112
|
needsApproval,
|
|
1111
1113
|
inputSchema: deleteReleaseInputSchema,
|
|
1112
1114
|
execute: async (args) => deleteReleaseStep({
|
|
1113
|
-
token: await resolveGithubToken(token),
|
|
1115
|
+
token: await resolveGithubToken(token, githubTokenCall("deleteRelease", args)),
|
|
1114
1116
|
...args
|
|
1115
1117
|
})
|
|
1116
1118
|
});
|
|
@@ -1126,7 +1128,7 @@ const getPullRequestContext = (token) => tool({
|
|
|
1126
1128
|
inputSchema: getPullRequestContextInputSchema,
|
|
1127
1129
|
toModelOutput: getPullRequestContextToModelOutput,
|
|
1128
1130
|
execute: async (args) => getPullRequestContextStep({
|
|
1129
|
-
token: await resolveGithubToken(token),
|
|
1131
|
+
token: await resolveGithubToken(token, githubTokenCall("getPullRequestContext", args)),
|
|
1130
1132
|
...args
|
|
1131
1133
|
})
|
|
1132
1134
|
});
|
|
@@ -1139,7 +1141,7 @@ const getIssueContext = (token) => tool({
|
|
|
1139
1141
|
description: getIssueContextDescription,
|
|
1140
1142
|
inputSchema: getIssueContextInputSchema,
|
|
1141
1143
|
execute: async (args) => getIssueContextStep({
|
|
1142
|
-
token: await resolveGithubToken(token),
|
|
1144
|
+
token: await resolveGithubToken(token, githubTokenCall("getIssueContext", args)),
|
|
1143
1145
|
...args
|
|
1144
1146
|
})
|
|
1145
1147
|
});
|
|
@@ -1152,7 +1154,7 @@ const getReleaseContext = (token) => tool({
|
|
|
1152
1154
|
description: getReleaseContextDescription,
|
|
1153
1155
|
inputSchema: getReleaseContextInputSchema,
|
|
1154
1156
|
execute: async (args) => getReleaseContextStep({
|
|
1155
|
-
token: await resolveGithubToken(token),
|
|
1157
|
+
token: await resolveGithubToken(token, githubTokenCall("getReleaseContext", args)),
|
|
1156
1158
|
...args
|
|
1157
1159
|
})
|
|
1158
1160
|
});
|
|
@@ -1165,154 +1167,23 @@ const getCiFailureContext = (token) => tool({
|
|
|
1165
1167
|
description: getCiFailureContextDescription,
|
|
1166
1168
|
inputSchema: getCiFailureContextInputSchema,
|
|
1167
1169
|
execute: async (args) => getCiFailureContextStep({
|
|
1168
|
-
token: await resolveGithubToken(token),
|
|
1170
|
+
token: await resolveGithubToken(token, githubTokenCall("getCiFailureContext", args)),
|
|
1169
1171
|
...args
|
|
1170
1172
|
})
|
|
1171
1173
|
});
|
|
1172
1174
|
//#endregion
|
|
1173
1175
|
//#region src/core/approval.ts
|
|
1174
1176
|
/**
|
|
1175
|
-
* Resolve
|
|
1176
|
-
*
|
|
1177
|
-
* @param toolName - The write tool to check.
|
|
1178
|
-
* @param config - Global or per-tool approval config.
|
|
1179
|
-
* @returns `true` when approval is required; defaults to `true` for unspecified write tools in object mode.
|
|
1177
|
+
* Resolve the AI SDK `needsApproval` value for a write tool.
|
|
1178
|
+
* `'auto'` becomes a function that evaluates each call with {@link needsAutoApproval}.
|
|
1180
1179
|
*/
|
|
1181
|
-
function resolveAiSdkApproval(toolName, config) {
|
|
1182
|
-
|
|
1183
|
-
|
|
1180
|
+
function resolveAiSdkApproval(toolName, config, evaluation) {
|
|
1181
|
+
const mode = resolveApprovalMode(toolName, config);
|
|
1182
|
+
if (mode !== "auto") return mode;
|
|
1183
|
+
return (input, { messages }) => needsAutoApproval(toolName, input, messages, evaluation);
|
|
1184
1184
|
}
|
|
1185
1185
|
//#endregion
|
|
1186
1186
|
//#region src/agents.ts
|
|
1187
|
-
const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.
|
|
1188
|
-
Call independent read tools in the same step when you already know the arguments — never serialize reads that could run in parallel.
|
|
1189
|
-
Bodies default to detail summary; patches default to includePatch false; prefer getFileContent with startLine/endLine or maxLines for large files.
|
|
1190
|
-
Paged lists return { items, hasMore, page, nextPage }. When hasMore, call with nextPage or raise maxPages — never the same page. Prefer path/author/since/until on listCommits instead of walking history. Prefer a path prefix on getRepositoryTree over recursive true.`;
|
|
1191
|
-
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.
|
|
1192
|
-
|
|
1193
|
-
Prefer getPullRequestContext, getIssueContext, getReleaseContext, or getCiFailureContext for multi-part reads instead of chaining separate tools.
|
|
1194
|
-
|
|
1195
|
-
${SHARED_RULES}`;
|
|
1196
|
-
const PRESET_INSTRUCTIONS = {
|
|
1197
|
-
"code-review": `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.
|
|
1198
|
-
|
|
1199
|
-
When reviewing a PR:
|
|
1200
|
-
- Start with getPullRequestContext (set includeChecks true when CI matters)
|
|
1201
|
-
- Then listPullRequestFiles with includePatch true and filenames for only the files you need — in the same step as any getFileContent / getBlame calls when possible
|
|
1202
|
-
- Use getBlame then getCommit(includePatch true) only when line history matters
|
|
1203
|
-
- Check for bugs, logic errors, and edge cases; be constructive
|
|
1204
|
-
- Use createPullRequestReview for formal reviews when asked
|
|
1205
|
-
- Use listPullRequestReviewThreads (unresolved by default) to see open feedback; replyToReviewComment to answer in a thread and resolveReviewThread once it is addressed
|
|
1206
|
-
- Use updatePullRequest to change title, body, base branch, or draft status; addPullRequestComment / updatePullRequestComment / deletePullRequestComment to manage comments
|
|
1207
|
-
|
|
1208
|
-
${SHARED_RULES}`,
|
|
1209
|
-
"issue-triage": `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.
|
|
1210
|
-
|
|
1211
|
-
When triaging issues:
|
|
1212
|
-
- Call getIssueContext exactly once (full body + labelNames + recent comments). In that same step, call listIssues or searchIssues if you need duplicate checks
|
|
1213
|
-
- Never re-call getIssueContext for the same issue
|
|
1214
|
-
- Use listIssueComments to paginate beyond the comments returned by getIssueContext
|
|
1215
|
-
- Pick labels from labelNames; use addLabels / removeLabel to apply them. Use createLabel / updateLabel / deleteLabel when the repository taxonomy itself needs changing
|
|
1216
|
-
- Create issues with clear titles and descriptions when asked
|
|
1217
|
-
- Use updateIssue to edit title, body, labels, milestone, or assignees, and to reopen a closed issue (state: 'open') — there is no separate reopen tool
|
|
1218
|
-
- Use updateIssueComment / deleteIssueComment to correct or remove existing comments
|
|
1219
|
-
- Acknowledge a report or a comment with addIssueReaction / addCommentReaction instead of posting a comment that says nothing new
|
|
1220
|
-
|
|
1221
|
-
${SHARED_RULES}`,
|
|
1222
|
-
"ci-ops": `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.
|
|
1223
|
-
|
|
1224
|
-
When working with workflows:
|
|
1225
|
-
- Prefer getCiFailureContext first when diagnosing a failing ref
|
|
1226
|
-
- Read the failing job's output with getWorkflowJobLogs (the default 200-line tail is usually enough; raise maxLines only when the error is higher up)
|
|
1227
|
-
- Use listCheckRuns / getCombinedStatus for narrower follow-ups
|
|
1228
|
-
- Inspect job steps to find the failing step; confirm before cancel/re-run
|
|
1229
|
-
- Trigger workflow_dispatch with the correct inputs and branch when asked
|
|
1230
|
-
|
|
1231
|
-
${SHARED_RULES}`,
|
|
1232
|
-
"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.
|
|
1233
|
-
|
|
1234
|
-
When auditing a repository:
|
|
1235
|
-
- Use searchCode for secrets and unsafe patterns; getBlame / listCommits to trace introductions
|
|
1236
|
-
- Use searchIssues to check for prior reports of the same vulnerability before filing a duplicate
|
|
1237
|
-
- Prefer getCiFailureContext or getPullRequestContext for CI / PR context
|
|
1238
|
-
- Use compareCommits to scope changes (includePatch only when you need diffs)
|
|
1239
|
-
- Report findings as issues with reproduction, impact, and severity
|
|
1240
|
-
- Read-only plus createIssue / addIssueComment / addLabels — never assume you can fix code directly
|
|
1241
|
-
|
|
1242
|
-
${SHARED_RULES}`,
|
|
1243
|
-
"repo-explorer": `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.
|
|
1244
|
-
|
|
1245
|
-
When exploring repos:
|
|
1246
|
-
- Answer questions about structure and organization; find files and patterns with searchCode / getFileContent
|
|
1247
|
-
- Use searchIssues to find issues or pull requests by qualifier across a repository or organization
|
|
1248
|
-
- Use listDiscussions / getDiscussion for questions answered in the repository's discussions rather than its issues
|
|
1249
|
-
- Prefer getPullRequestContext or getCiFailureContext when summarizing a PR or failing CI
|
|
1250
|
-
- Use getBlame for line ownership; summarize recent commits / PRs / issues when asked
|
|
1251
|
-
- Read-only — you cannot make changes
|
|
1252
|
-
|
|
1253
|
-
${SHARED_RULES}`,
|
|
1254
|
-
"release-manager": `You are a release management assistant. Your job is to help prepare and publish GitHub releases.
|
|
1255
|
-
|
|
1256
|
-
When preparing a release:
|
|
1257
|
-
- Prefer getReleaseContext first (current/latest release, previous release, tag compare)
|
|
1258
|
-
- Use compareCommits / listCommits for more changelog detail; getCiFailureContext before cutting
|
|
1259
|
-
- createRelease with generateReleaseNotes when there is no manual changelog
|
|
1260
|
-
- Double-check the target branch or SHA — releases and tags are hard to undo
|
|
1261
|
-
- Use updateRelease to fix notes or toggle draft/prerelease after publishing; deleteRelease only when explicitly asked — it does not delete the underlying tag
|
|
1262
|
-
|
|
1263
|
-
${SHARED_RULES}`,
|
|
1264
|
-
"discussion-moderator": `You are a discussion moderator. Your job is to answer and guide repository Discussions clearly and on-topic.
|
|
1265
|
-
|
|
1266
|
-
When working in discussions:
|
|
1267
|
-
- Use listDiscussions / getDiscussion to load the thread before replying
|
|
1268
|
-
- Prefer addDiscussionComment for answers that belong in Discussions
|
|
1269
|
-
- Use searchIssues / getIssueContext when the question overlaps an existing issue; addIssueComment only when the follow-up belongs on that issue
|
|
1270
|
-
- Keep replies concise and point to docs or code when helpful
|
|
1271
|
-
|
|
1272
|
-
${SHARED_RULES}`,
|
|
1273
|
-
"notification-inbox": `You are a notification inbox assistant. Your job is to help triage GitHub notification threads for the authenticated user.
|
|
1274
|
-
|
|
1275
|
-
When clearing the inbox:
|
|
1276
|
-
- Use listNotifications to see unread threads (set all true only when asked)
|
|
1277
|
-
- Open the related getIssue or getPullRequest when you need context before acting
|
|
1278
|
-
- Use markNotificationRead once a thread is handled or is noise
|
|
1279
|
-
- These tools need a user PAT with Notifications access — say so if calls fail for that reason
|
|
1280
|
-
|
|
1281
|
-
${SHARED_RULES}`,
|
|
1282
|
-
"pr-author": `You are a pull request authoring assistant. Your job is to prepare branches, edit files, and open focused PRs.
|
|
1283
|
-
|
|
1284
|
-
When opening a PR:
|
|
1285
|
-
- Inspect the repo with getRepository / listBranches / getFileContent before editing
|
|
1286
|
-
- createBranch from a sensible base, then createOrUpdateFile for the change set
|
|
1287
|
-
- createPullRequest with a clear title and body; updatePullRequest if the draft or description needs a fix
|
|
1288
|
-
- Use listPullRequestFiles / compareCommits / getCommit to verify what will land
|
|
1289
|
-
- Address review feedback: listPullRequestReviewThreads for open threads, replyToReviewComment to answer, resolveReviewThread once fixed
|
|
1290
|
-
- Use deleteBranch to clean up a merged or abandoned branch when asked
|
|
1291
|
-
- Stay scoped to authoring — you do not review, merge, or manage issues
|
|
1292
|
-
|
|
1293
|
-
${SHARED_RULES}`,
|
|
1294
|
-
"maintainer": `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, discussions, notifications, gists, and workflows.
|
|
1295
|
-
|
|
1296
|
-
When maintaining repos:
|
|
1297
|
-
- Prefer getPullRequestContext or getCiFailureContext for multi-part reads
|
|
1298
|
-
- Be careful with writes — review before acting
|
|
1299
|
-
- Keep issues, PRs, and commits clear and well-structured
|
|
1300
|
-
- Use listNotifications to find what needs attention, then markNotificationRead once a thread is handled
|
|
1301
|
-
- Acknowledge a thread with addIssueReaction / addCommentReaction instead of a comment that adds nothing
|
|
1302
|
-
- Answer questions in discussions with addDiscussionComment
|
|
1303
|
-
|
|
1304
|
-
${SHARED_RULES}`
|
|
1305
|
-
};
|
|
1306
|
-
function resolveInstructions(options) {
|
|
1307
|
-
const defaultPrompt = options.preset && !Array.isArray(options.preset) ? PRESET_INSTRUCTIONS[options.preset] : DEFAULT_INSTRUCTIONS;
|
|
1308
|
-
let prompt;
|
|
1309
|
-
if (options.instructions) prompt = options.instructions;
|
|
1310
|
-
else if (options.additionalInstructions) prompt = `${defaultPrompt}\n\n${options.additionalInstructions}`;
|
|
1311
|
-
else prompt = defaultPrompt;
|
|
1312
|
-
const contextBlock = options.context ? formatContextInstructions(options.context) : "";
|
|
1313
|
-
if (contextBlock) return `${prompt}\n\n${contextBlock}`;
|
|
1314
|
-
return prompt;
|
|
1315
|
-
}
|
|
1316
1187
|
/**
|
|
1317
1188
|
* Create a pre-configured GitHub agent powered by the AI SDK's `ToolLoopAgent`.
|
|
1318
1189
|
*
|
|
@@ -1323,7 +1194,7 @@ function resolveInstructions(options) {
|
|
|
1323
1194
|
* import { createGithubAgent } from '@github-tools/sdk'
|
|
1324
1195
|
*
|
|
1325
1196
|
* const agent = createGithubAgent({
|
|
1326
|
-
* model: 'anthropic/claude-
|
|
1197
|
+
* model: 'anthropic/claude-opus-5.5',
|
|
1327
1198
|
* token: process.env.GITHUB_TOKEN!,
|
|
1328
1199
|
* preset: 'code-review',
|
|
1329
1200
|
* context: { owner: 'vercel', repo: 'ai', pullNumber: 42 },
|
|
@@ -1332,26 +1203,50 @@ function resolveInstructions(options) {
|
|
|
1332
1203
|
* const result = await agent.generate({ prompt: 'Review this PR' })
|
|
1333
1204
|
* ```
|
|
1334
1205
|
*/
|
|
1335
|
-
function createGithubAgent({ token, preset, requireApproval, context, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
|
|
1206
|
+
function createGithubAgent({ token, preset, requireApproval, evaluation, context, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
|
|
1207
|
+
const staticPreset = preset === "auto" ? void 0 : preset;
|
|
1336
1208
|
const tools = createGithubTools({
|
|
1337
1209
|
token,
|
|
1338
1210
|
requireApproval,
|
|
1339
|
-
|
|
1211
|
+
evaluation,
|
|
1212
|
+
preset: staticPreset,
|
|
1340
1213
|
context,
|
|
1341
1214
|
author,
|
|
1342
1215
|
committer,
|
|
1343
1216
|
coAuthors
|
|
1344
1217
|
});
|
|
1345
|
-
|
|
1218
|
+
const settings = {
|
|
1346
1219
|
...agentOptions,
|
|
1347
1220
|
tools,
|
|
1348
1221
|
instructions: resolveInstructions({
|
|
1349
|
-
preset,
|
|
1222
|
+
preset: staticPreset,
|
|
1350
1223
|
instructions,
|
|
1351
1224
|
additionalInstructions,
|
|
1352
1225
|
context
|
|
1353
1226
|
})
|
|
1354
|
-
}
|
|
1227
|
+
};
|
|
1228
|
+
if (preset === "auto") {
|
|
1229
|
+
const prepareCall = agentOptions.prepareCall;
|
|
1230
|
+
settings.prepareCall = async (call) => {
|
|
1231
|
+
const messages = typeof call.prompt === "string" ? [{
|
|
1232
|
+
role: "user",
|
|
1233
|
+
content: call.prompt
|
|
1234
|
+
}] : call.prompt ?? call.messages ?? [];
|
|
1235
|
+
const selected = await selectPresets(messages, evaluation);
|
|
1236
|
+
const next = {
|
|
1237
|
+
...call,
|
|
1238
|
+
activeTools: [...resolvePresetTools(selected)],
|
|
1239
|
+
instructions: resolveInstructions({
|
|
1240
|
+
preset: selected.length === 1 ? selected[0] : selected,
|
|
1241
|
+
instructions,
|
|
1242
|
+
additionalInstructions,
|
|
1243
|
+
context
|
|
1244
|
+
})
|
|
1245
|
+
};
|
|
1246
|
+
return prepareCall ? prepareCall(next) : next;
|
|
1247
|
+
};
|
|
1248
|
+
}
|
|
1249
|
+
return new ToolLoopAgent(settings);
|
|
1355
1250
|
}
|
|
1356
1251
|
//#endregion
|
|
1357
1252
|
//#region src/index.ts
|
|
@@ -1381,6 +1276,9 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
|
|
|
1381
1276
|
* // Full catalog (same as omitting preset)
|
|
1382
1277
|
* createGithubTools({ token, preset: 'maintainer' })
|
|
1383
1278
|
*
|
|
1279
|
+
* // Ask only for risky or unrequested low-risk writes (evaluated by Jev)
|
|
1280
|
+
* createGithubTools({ token, requireApproval: 'auto' })
|
|
1281
|
+
*
|
|
1384
1282
|
* // Granular approval
|
|
1385
1283
|
* createGithubTools({
|
|
1386
1284
|
* token,
|
|
@@ -1393,9 +1291,9 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
|
|
|
1393
1291
|
* })
|
|
1394
1292
|
* ```
|
|
1395
1293
|
*/
|
|
1396
|
-
function createGithubTools({ token, requireApproval = true, preset, context, overrides, author, committer, coAuthors } = {}) {
|
|
1294
|
+
function createGithubTools({ token, requireApproval = true, evaluation, preset, context, overrides, author, committer, coAuthors } = {}) {
|
|
1397
1295
|
const resolveToken = createGithubTokenResolver(token);
|
|
1398
|
-
const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) });
|
|
1296
|
+
const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval, evaluation) });
|
|
1399
1297
|
const allowed = preset ? resolvePresetTools(preset) : null;
|
|
1400
1298
|
const allTools = {
|
|
1401
1299
|
getRepository: getRepository(resolveToken),
|
|
@@ -1522,6 +1420,6 @@ function withStrippedRateLimit(tool) {
|
|
|
1522
1420
|
};
|
|
1523
1421
|
}
|
|
1524
1422
|
//#endregion
|
|
1525
|
-
export {
|
|
1423
|
+
export { deleteLabel as $, compareCommits as A, getRepository as At, getDiscussion as B, createGist as C, updatePullRequestComment as Ct, listGistComments as D, deleteBranch as Dt, getGist as E, createRepository as Et, searchIssues as F, listIssueReactions as G, addCommentReaction as H, searchRepositories as I, addLabels as J, addAssignees as K, listNotifications as L, getCommit as M, listBranches as Mt, listCommits as N, listGists as O, forkRepository as Ot, searchCode as P, deleteIssueComment as Q, markNotificationRead as R, triggerWorkflow as S, updatePullRequest as St, deleteGist as T, createOrUpdateFile as Tt, addIssueReaction as U, listDiscussions as V, listCommentReactions as W, createIssue as X, closeIssue as Y, createLabel as Z, getWorkflowRun as _, listPullRequests as _t, getPullRequestContext as a, removeLabel as at, listWorkflows as b, requestReviewers as bt, deleteRelease as c, updateLabel as ct, listReleases as d, createPullRequestReview as dt, getIssue as et, updateRelease as f, deletePullRequestComment as ft, getWorkflowJobLogs as g, listPullRequestReviews as gt, cancelWorkflowRun as h, listPullRequestReviewThreads as ht, getIssueContext as i, removeAssignees as it, getBlame as j, getRepositoryTree as jt, updateGist as k, getFileContent as kt, getLatestRelease as l, addPullRequestComment as lt, listCheckRuns as m, listPullRequestFiles as mt, createGithubAgent as n, listIssues as nt, getReleaseContext as o, updateIssue as ot, getCombinedStatus as p, getPullRequest as pt, addIssueComment as q, getCiFailureContext as r, listLabels as rt, createRelease as s, updateIssueComment as st, createGithubTools as t, listIssueComments as tt, getRelease as u, createPullRequest as ut, listWorkflowJobs as v, mergePullRequest as vt, createGistComment as w, createBranch as wt, rerunWorkflowRun as x, resolveReviewThread as xt, listWorkflowRuns as y, replyToReviewComment as yt, addDiscussionComment as z };
|
|
1526
1424
|
|
|
1527
|
-
//# sourceMappingURL=src-
|
|
1425
|
+
//# sourceMappingURL=src-Bx5p1Unc.mjs.map
|