@github-tools/sdk 1.8.2 → 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 +247 -78
- package/dist/connect/eve.d.mts +18 -7
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +17 -4
- package/dist/connect/eve.mjs.map +1 -1
- package/dist/connect.d.mts +31 -11
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +6 -3
- package/dist/connect.mjs.map +1 -1
- 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 +331 -112
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +356 -3
- package/dist/eve.mjs.map +1 -0
- package/dist/index-B0nL0C00.d.mts +746 -0
- 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-v-LjzPpR.mjs +1371 -0
- package/dist/src-v-LjzPpR.mjs.map +1 -0
- package/dist/{token-CW8lQBND.mjs → token-DDMlEkK-.mjs} +74 -7
- package/dist/token-DDMlEkK-.mjs.map +1 -0
- package/dist/types-VW0m0Uxl.d.mts +39 -0
- package/dist/types-VW0m0Uxl.d.mts.map +1 -0
- package/dist/{types-B0mvQgJf.d.mts → types-Ygt1pw1N.d.mts} +30 -9
- package/dist/types-Ygt1pw1N.d.mts.map +1 -0
- package/dist/workflow.d.mts +7 -7
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +6 -4
- package/dist/workflow.mjs.map +1 -1
- package/dist/write-tools-uIVfURVp.mjs +3509 -0
- package/dist/write-tools-uIVfURVp.mjs.map +1 -0
- package/package.json +17 -13
- package/dist/eve-UPaHEGVi.mjs +0 -512
- package/dist/eve-UPaHEGVi.mjs.map +0 -1
- package/dist/index-Cs1Kebmt.d.mts +0 -463
- package/dist/index-Cs1Kebmt.d.mts.map +0 -1
- package/dist/src-CfzZfU82.mjs +0 -812
- package/dist/src-CfzZfU82.mjs.map +0 -1
- package/dist/token-CW8lQBND.mjs.map +0 -1
- package/dist/types-B0mvQgJf.d.mts.map +0 -1
- package/dist/types-DwHrGKWO.d.mts +0 -27
- package/dist/types-DwHrGKWO.d.mts.map +0 -1
- package/dist/write-tools-Dx9LfYlU.mjs +0 -1840
- package/dist/write-tools-Dx9LfYlU.mjs.map +0 -1
package/dist/src-CfzZfU82.mjs
DELETED
|
@@ -1,812 +0,0 @@
|
|
|
1
|
-
import { $ as getCommitInputSchema, $t as listPullRequestsInputSchema, A as createGistCore, At as removeLabelCore, B as listGistCommentsDescription, Bt as createPullRequestReviewDescription, C as rerunWorkflowRunInputSchema, Cn as getRepositoryCore, Ct as getIssueInputSchema, D as createGistCommentCore, Dn as listBranchesDescription, Dt as listLabelsCore, E as triggerWorkflowInputSchema, En as listBranchesCore, Et as listIssuesInputSchema, F as deleteGistInputSchema, Ft as addPullRequestCommentInputSchema, G as updateGistCore, Gt as listPullRequestFilesCore, H as listGistsCore, Ht as getPullRequestCore, I as getGistCore, It as createPullRequestCore, J as getBlameCore, Jt as listPullRequestReviewsCore, K as updateGistDescription, Kt as listPullRequestFilesDescription, L as getGistDescription, Lt as createPullRequestDescription, M as createGistInputSchema, Mt as removeLabelInputSchema, N as deleteGistCore, Nt as addPullRequestCommentCore, O as createGistCommentDescription, On as listBranchesInputSchema, Ot as listLabelsDescription, P as deleteGistDescription, Pt as addPullRequestCommentDescription, Q as getCommitDescription, Qt as listPullRequestsDescription, R as getGistInputSchema, Rt as createPullRequestInputSchema, S as rerunWorkflowRunDescription, Sn as getFileContentInputSchema, St as getIssueDescription, T as triggerWorkflowDescription, Tn as getRepositoryInputSchema, Tt as listIssuesDescription, U as listGistsDescription, Ut as getPullRequestDescription, V as listGistCommentsInputSchema, Vt as createPullRequestReviewInputSchema, W as listGistsInputSchema, Wt as getPullRequestInputSchema, X as getBlameInputSchema, Xt as listPullRequestReviewsInputSchema, Y as getBlameDescription, Yt as listPullRequestReviewsDescription, Z as getCommitCore, Zt as listPullRequestsCore, _ as listWorkflowRunsInputSchema, _n as forkRepositoryCore, _t as closeIssueInputSchema, a as resolvePresetTools, an as getCommitToModelOutput, at as searchCodeInputSchema, b as listWorkflowsInputSchema, bn as getFileContentCore, bt as createIssueInputSchema, c as cancelWorkflowRunInputSchema, cn as createBranchCore, ct as searchRepositoriesInputSchema, d as getWorkflowRunInputSchema, dn as createOrUpdateFileCore, dt as addIssueCommentInputSchema, en as mergePullRequestCore, et as listCommitsCore, f as listWorkflowJobsCore, fn as createOrUpdateFileDescription, ft as addLabelsCore, g as listWorkflowRunsDescription, gn as createRepositoryInputSchema, gt as closeIssueDescription, h as listWorkflowRunsCore, hn as createRepositoryDescription, ht as closeIssueCore, in as resolveGithubToken, it as searchCodeDescription, j as createGistDescription, jt as removeLabelDescription, k as createGistCommentInputSchema, kt as listLabelsInputSchema, l as getWorkflowRunCore, ln as createBranchDescription, lt as addIssueCommentCore, m as listWorkflowJobsInputSchema, mn as createRepositoryCore, mt as addLabelsInputSchema, nn as mergePullRequestInputSchema, nt as listCommitsInputSchema, o as cancelWorkflowRunCore, on as getFileContentToModelOutput, ot as searchRepositoriesCore, p as listWorkflowJobsDescription, pn as createOrUpdateFileInputSchema, pt as addLabelsDescription, q as updateGistInputSchema, qt as listPullRequestFilesInputSchema, rn as createGithubTokenResolver, rt as searchCodeCore, s as cancelWorkflowRunDescription, sn as listPullRequestFilesToModelOutput, st as searchRepositoriesDescription, tn as mergePullRequestDescription, tt as listCommitsDescription, u as getWorkflowRunDescription, un as createBranchInputSchema, ut as addIssueCommentDescription, v as listWorkflowsCore, vn as forkRepositoryDescription, vt as createIssueCore, w as triggerWorkflowCore, wn as getRepositoryDescription, wt as listIssuesCore, x as rerunWorkflowRunCore, xn as getFileContentDescription, xt as getIssueCore, y as listWorkflowsDescription, yn as forkRepositoryInputSchema, yt as createIssueDescription, z as listGistCommentsCore, zt as createPullRequestReviewCore } from "./write-tools-Dx9LfYlU.mjs";
|
|
2
|
-
import { ToolLoopAgent, tool } from "ai";
|
|
3
|
-
//#region src/tools/repository.ts
|
|
4
|
-
async function getRepositoryStep(args) {
|
|
5
|
-
"use step";
|
|
6
|
-
return getRepositoryCore(args);
|
|
7
|
-
}
|
|
8
|
-
/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */
|
|
9
|
-
const getRepository = (token) => tool({
|
|
10
|
-
description: getRepositoryDescription,
|
|
11
|
-
inputSchema: getRepositoryInputSchema,
|
|
12
|
-
execute: async (args) => getRepositoryStep({
|
|
13
|
-
token: await resolveGithubToken(token),
|
|
14
|
-
...args
|
|
15
|
-
})
|
|
16
|
-
});
|
|
17
|
-
async function listBranchesStep(args) {
|
|
18
|
-
"use step";
|
|
19
|
-
return listBranchesCore(args);
|
|
20
|
-
}
|
|
21
|
-
/** List branches in a GitHub repository. */
|
|
22
|
-
const listBranches = (token) => tool({
|
|
23
|
-
description: listBranchesDescription,
|
|
24
|
-
inputSchema: listBranchesInputSchema,
|
|
25
|
-
execute: async (args) => listBranchesStep({
|
|
26
|
-
token: await resolveGithubToken(token),
|
|
27
|
-
...args
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
async function getFileContentStep(args) {
|
|
31
|
-
"use step";
|
|
32
|
-
return getFileContentCore(args);
|
|
33
|
-
}
|
|
34
|
-
/** Get the content of a file from a GitHub repository. */
|
|
35
|
-
const getFileContent = (token) => tool({
|
|
36
|
-
description: getFileContentDescription,
|
|
37
|
-
inputSchema: getFileContentInputSchema,
|
|
38
|
-
toModelOutput: getFileContentToModelOutput,
|
|
39
|
-
execute: async (args) => getFileContentStep({
|
|
40
|
-
token: await resolveGithubToken(token),
|
|
41
|
-
...args
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
async function createBranchStep(args) {
|
|
45
|
-
"use step";
|
|
46
|
-
return createBranchCore(args);
|
|
47
|
-
}
|
|
48
|
-
/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
|
|
49
|
-
const createBranch = (token, { needsApproval = true } = {}) => tool({
|
|
50
|
-
description: createBranchDescription,
|
|
51
|
-
needsApproval,
|
|
52
|
-
inputSchema: createBranchInputSchema,
|
|
53
|
-
execute: async (args) => createBranchStep({
|
|
54
|
-
token: await resolveGithubToken(token),
|
|
55
|
-
...args
|
|
56
|
-
})
|
|
57
|
-
});
|
|
58
|
-
async function forkRepositoryStep(args) {
|
|
59
|
-
"use step";
|
|
60
|
-
return forkRepositoryCore(args);
|
|
61
|
-
}
|
|
62
|
-
/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
63
|
-
const forkRepository = (token, { needsApproval = true } = {}) => tool({
|
|
64
|
-
description: forkRepositoryDescription,
|
|
65
|
-
needsApproval,
|
|
66
|
-
inputSchema: forkRepositoryInputSchema,
|
|
67
|
-
execute: async (args) => forkRepositoryStep({
|
|
68
|
-
token: await resolveGithubToken(token),
|
|
69
|
-
...args
|
|
70
|
-
})
|
|
71
|
-
});
|
|
72
|
-
async function createRepositoryStep(args) {
|
|
73
|
-
"use step";
|
|
74
|
-
return createRepositoryCore(args);
|
|
75
|
-
}
|
|
76
|
-
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
77
|
-
const createRepository = (token, { needsApproval = true } = {}) => tool({
|
|
78
|
-
description: createRepositoryDescription,
|
|
79
|
-
needsApproval,
|
|
80
|
-
inputSchema: createRepositoryInputSchema,
|
|
81
|
-
execute: async (args) => createRepositoryStep({
|
|
82
|
-
token: await resolveGithubToken(token),
|
|
83
|
-
...args
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
|
-
async function createOrUpdateFileStep(args) {
|
|
87
|
-
"use step";
|
|
88
|
-
return createOrUpdateFileCore(args);
|
|
89
|
-
}
|
|
90
|
-
/** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
|
|
91
|
-
const createOrUpdateFile = (token, { needsApproval = true, author, committer, coAuthors } = {}) => tool({
|
|
92
|
-
description: createOrUpdateFileDescription,
|
|
93
|
-
needsApproval,
|
|
94
|
-
inputSchema: createOrUpdateFileInputSchema,
|
|
95
|
-
execute: async (args) => createOrUpdateFileStep({
|
|
96
|
-
token: await resolveGithubToken(token),
|
|
97
|
-
author,
|
|
98
|
-
committer,
|
|
99
|
-
coAuthors,
|
|
100
|
-
...args
|
|
101
|
-
})
|
|
102
|
-
});
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/tools/pull-requests.ts
|
|
105
|
-
async function listPullRequestsStep(args) {
|
|
106
|
-
"use step";
|
|
107
|
-
return listPullRequestsCore(args);
|
|
108
|
-
}
|
|
109
|
-
/** List pull requests for a GitHub repository. */
|
|
110
|
-
const listPullRequests = (token) => tool({
|
|
111
|
-
description: listPullRequestsDescription,
|
|
112
|
-
inputSchema: listPullRequestsInputSchema,
|
|
113
|
-
execute: async (args) => listPullRequestsStep({
|
|
114
|
-
token: await resolveGithubToken(token),
|
|
115
|
-
...args
|
|
116
|
-
})
|
|
117
|
-
});
|
|
118
|
-
async function getPullRequestStep(args) {
|
|
119
|
-
"use step";
|
|
120
|
-
return getPullRequestCore(args);
|
|
121
|
-
}
|
|
122
|
-
/** Get detailed information about a specific pull request. */
|
|
123
|
-
const getPullRequest = (token) => tool({
|
|
124
|
-
description: getPullRequestDescription,
|
|
125
|
-
inputSchema: getPullRequestInputSchema,
|
|
126
|
-
execute: async (args) => getPullRequestStep({
|
|
127
|
-
token: await resolveGithubToken(token),
|
|
128
|
-
...args
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
async function createPullRequestStep(args) {
|
|
132
|
-
"use step";
|
|
133
|
-
return createPullRequestCore(args);
|
|
134
|
-
}
|
|
135
|
-
/** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
136
|
-
const createPullRequest = (token, { needsApproval = true } = {}) => tool({
|
|
137
|
-
description: createPullRequestDescription,
|
|
138
|
-
needsApproval,
|
|
139
|
-
inputSchema: createPullRequestInputSchema,
|
|
140
|
-
execute: async (args) => createPullRequestStep({
|
|
141
|
-
token: await resolveGithubToken(token),
|
|
142
|
-
...args
|
|
143
|
-
})
|
|
144
|
-
});
|
|
145
|
-
async function mergePullRequestStep(args) {
|
|
146
|
-
"use step";
|
|
147
|
-
return mergePullRequestCore(args);
|
|
148
|
-
}
|
|
149
|
-
/** Merge a pull request. Requires approval by default. */
|
|
150
|
-
const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => tool({
|
|
151
|
-
description: mergePullRequestDescription,
|
|
152
|
-
needsApproval,
|
|
153
|
-
inputSchema: mergePullRequestInputSchema,
|
|
154
|
-
execute: async (args) => mergePullRequestStep({
|
|
155
|
-
token: await resolveGithubToken(token),
|
|
156
|
-
coAuthors,
|
|
157
|
-
...args
|
|
158
|
-
})
|
|
159
|
-
});
|
|
160
|
-
async function addPullRequestCommentStep(args) {
|
|
161
|
-
"use step";
|
|
162
|
-
return addPullRequestCommentCore(args);
|
|
163
|
-
}
|
|
164
|
-
/** Add a comment to a pull request. Requires approval by default. */
|
|
165
|
-
const addPullRequestComment = (token, { needsApproval = true } = {}) => tool({
|
|
166
|
-
description: addPullRequestCommentDescription,
|
|
167
|
-
needsApproval,
|
|
168
|
-
inputSchema: addPullRequestCommentInputSchema,
|
|
169
|
-
execute: async (args) => addPullRequestCommentStep({
|
|
170
|
-
token: await resolveGithubToken(token),
|
|
171
|
-
...args
|
|
172
|
-
})
|
|
173
|
-
});
|
|
174
|
-
async function listPullRequestFilesStep(args) {
|
|
175
|
-
"use step";
|
|
176
|
-
return listPullRequestFilesCore(args);
|
|
177
|
-
}
|
|
178
|
-
/** List files changed in a pull request, including diff status and patch content. */
|
|
179
|
-
const listPullRequestFiles = (token) => tool({
|
|
180
|
-
description: listPullRequestFilesDescription,
|
|
181
|
-
inputSchema: listPullRequestFilesInputSchema,
|
|
182
|
-
toModelOutput: listPullRequestFilesToModelOutput,
|
|
183
|
-
execute: async (args) => listPullRequestFilesStep({
|
|
184
|
-
token: await resolveGithubToken(token),
|
|
185
|
-
...args
|
|
186
|
-
})
|
|
187
|
-
});
|
|
188
|
-
async function listPullRequestReviewsStep(args) {
|
|
189
|
-
"use step";
|
|
190
|
-
return listPullRequestReviewsCore(args);
|
|
191
|
-
}
|
|
192
|
-
/** List reviews on a pull request (approvals, change requests, and comments). */
|
|
193
|
-
const listPullRequestReviews = (token) => tool({
|
|
194
|
-
description: listPullRequestReviewsDescription,
|
|
195
|
-
inputSchema: listPullRequestReviewsInputSchema,
|
|
196
|
-
execute: async (args) => listPullRequestReviewsStep({
|
|
197
|
-
token: await resolveGithubToken(token),
|
|
198
|
-
...args
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
async function createPullRequestReviewStep(args) {
|
|
202
|
-
"use step";
|
|
203
|
-
return createPullRequestReviewCore(args);
|
|
204
|
-
}
|
|
205
|
-
/** Submit a pull request review with optional inline comments. Requires approval by default. */
|
|
206
|
-
const createPullRequestReview = (token, { needsApproval = true } = {}) => tool({
|
|
207
|
-
description: createPullRequestReviewDescription,
|
|
208
|
-
needsApproval,
|
|
209
|
-
inputSchema: createPullRequestReviewInputSchema,
|
|
210
|
-
execute: async (args) => createPullRequestReviewStep({
|
|
211
|
-
token: await resolveGithubToken(token),
|
|
212
|
-
...args
|
|
213
|
-
})
|
|
214
|
-
});
|
|
215
|
-
//#endregion
|
|
216
|
-
//#region src/tools/issues.ts
|
|
217
|
-
async function listIssuesStep(args) {
|
|
218
|
-
"use step";
|
|
219
|
-
return listIssuesCore(args);
|
|
220
|
-
}
|
|
221
|
-
/** List issues for a GitHub repository (excludes pull requests). */
|
|
222
|
-
const listIssues = (token) => tool({
|
|
223
|
-
description: listIssuesDescription,
|
|
224
|
-
inputSchema: listIssuesInputSchema,
|
|
225
|
-
execute: async (args) => listIssuesStep({
|
|
226
|
-
token: await resolveGithubToken(token),
|
|
227
|
-
...args
|
|
228
|
-
})
|
|
229
|
-
});
|
|
230
|
-
async function getIssueStep(args) {
|
|
231
|
-
"use step";
|
|
232
|
-
return getIssueCore(args);
|
|
233
|
-
}
|
|
234
|
-
/** Get detailed information about a specific issue. */
|
|
235
|
-
const getIssue = (token) => tool({
|
|
236
|
-
description: getIssueDescription,
|
|
237
|
-
inputSchema: getIssueInputSchema,
|
|
238
|
-
execute: async (args) => getIssueStep({
|
|
239
|
-
token: await resolveGithubToken(token),
|
|
240
|
-
...args
|
|
241
|
-
})
|
|
242
|
-
});
|
|
243
|
-
async function createIssueStep(args) {
|
|
244
|
-
"use step";
|
|
245
|
-
return createIssueCore(args);
|
|
246
|
-
}
|
|
247
|
-
/** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
248
|
-
const createIssue = (token, { needsApproval = true } = {}) => tool({
|
|
249
|
-
description: createIssueDescription,
|
|
250
|
-
needsApproval,
|
|
251
|
-
inputSchema: createIssueInputSchema,
|
|
252
|
-
execute: async (args) => createIssueStep({
|
|
253
|
-
token: await resolveGithubToken(token),
|
|
254
|
-
...args
|
|
255
|
-
})
|
|
256
|
-
});
|
|
257
|
-
async function addIssueCommentStep(args) {
|
|
258
|
-
"use step";
|
|
259
|
-
return addIssueCommentCore(args);
|
|
260
|
-
}
|
|
261
|
-
/** Add a comment to a GitHub issue. Requires approval by default. */
|
|
262
|
-
const addIssueComment = (token, { needsApproval = true } = {}) => tool({
|
|
263
|
-
description: addIssueCommentDescription,
|
|
264
|
-
needsApproval,
|
|
265
|
-
inputSchema: addIssueCommentInputSchema,
|
|
266
|
-
execute: async (args) => addIssueCommentStep({
|
|
267
|
-
token: await resolveGithubToken(token),
|
|
268
|
-
...args
|
|
269
|
-
})
|
|
270
|
-
});
|
|
271
|
-
async function closeIssueStep(args) {
|
|
272
|
-
"use step";
|
|
273
|
-
return closeIssueCore(args);
|
|
274
|
-
}
|
|
275
|
-
/** Close an open GitHub issue. Requires approval by default. */
|
|
276
|
-
const closeIssue = (token, { needsApproval = true } = {}) => tool({
|
|
277
|
-
description: closeIssueDescription,
|
|
278
|
-
needsApproval,
|
|
279
|
-
inputSchema: closeIssueInputSchema,
|
|
280
|
-
execute: async (args) => closeIssueStep({
|
|
281
|
-
token: await resolveGithubToken(token),
|
|
282
|
-
...args
|
|
283
|
-
})
|
|
284
|
-
});
|
|
285
|
-
async function listLabelsStep(args) {
|
|
286
|
-
"use step";
|
|
287
|
-
return listLabelsCore(args);
|
|
288
|
-
}
|
|
289
|
-
/** List labels available in a GitHub repository. */
|
|
290
|
-
const listLabels = (token) => tool({
|
|
291
|
-
description: listLabelsDescription,
|
|
292
|
-
inputSchema: listLabelsInputSchema,
|
|
293
|
-
execute: async (args) => listLabelsStep({
|
|
294
|
-
token: await resolveGithubToken(token),
|
|
295
|
-
...args
|
|
296
|
-
})
|
|
297
|
-
});
|
|
298
|
-
async function addLabelsStep(args) {
|
|
299
|
-
"use step";
|
|
300
|
-
return addLabelsCore(args);
|
|
301
|
-
}
|
|
302
|
-
/** Add labels to an issue or pull request. Requires approval by default. */
|
|
303
|
-
const addLabels = (token, { needsApproval = true } = {}) => tool({
|
|
304
|
-
description: addLabelsDescription,
|
|
305
|
-
needsApproval,
|
|
306
|
-
inputSchema: addLabelsInputSchema,
|
|
307
|
-
execute: async (args) => addLabelsStep({
|
|
308
|
-
token: await resolveGithubToken(token),
|
|
309
|
-
...args
|
|
310
|
-
})
|
|
311
|
-
});
|
|
312
|
-
async function removeLabelStep(args) {
|
|
313
|
-
"use step";
|
|
314
|
-
return removeLabelCore(args);
|
|
315
|
-
}
|
|
316
|
-
/** Remove a label from an issue or pull request. Requires approval by default. */
|
|
317
|
-
const removeLabel = (token, { needsApproval = true } = {}) => tool({
|
|
318
|
-
description: removeLabelDescription,
|
|
319
|
-
needsApproval,
|
|
320
|
-
inputSchema: removeLabelInputSchema,
|
|
321
|
-
execute: async (args) => removeLabelStep({
|
|
322
|
-
token: await resolveGithubToken(token),
|
|
323
|
-
...args
|
|
324
|
-
})
|
|
325
|
-
});
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region src/tools/search.ts
|
|
328
|
-
async function searchCodeStep(args) {
|
|
329
|
-
"use step";
|
|
330
|
-
return searchCodeCore(args);
|
|
331
|
-
}
|
|
332
|
-
/** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. */
|
|
333
|
-
const searchCode = (token) => tool({
|
|
334
|
-
description: searchCodeDescription,
|
|
335
|
-
inputSchema: searchCodeInputSchema,
|
|
336
|
-
execute: async (args) => searchCodeStep({
|
|
337
|
-
token: await resolveGithubToken(token),
|
|
338
|
-
...args
|
|
339
|
-
})
|
|
340
|
-
});
|
|
341
|
-
async function searchRepositoriesStep(args) {
|
|
342
|
-
"use step";
|
|
343
|
-
return searchRepositoriesCore(args);
|
|
344
|
-
}
|
|
345
|
-
/** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
|
|
346
|
-
const searchRepositories = (token) => tool({
|
|
347
|
-
description: searchRepositoriesDescription,
|
|
348
|
-
inputSchema: searchRepositoriesInputSchema,
|
|
349
|
-
execute: async (args) => searchRepositoriesStep({
|
|
350
|
-
token: await resolveGithubToken(token),
|
|
351
|
-
...args
|
|
352
|
-
})
|
|
353
|
-
});
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region src/tools/commits.ts
|
|
356
|
-
async function listCommitsStep(args) {
|
|
357
|
-
"use step";
|
|
358
|
-
return listCommitsCore(args);
|
|
359
|
-
}
|
|
360
|
-
/** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */
|
|
361
|
-
const listCommits = (token) => tool({
|
|
362
|
-
description: listCommitsDescription,
|
|
363
|
-
inputSchema: listCommitsInputSchema,
|
|
364
|
-
execute: async (args) => listCommitsStep({
|
|
365
|
-
token: await resolveGithubToken(token),
|
|
366
|
-
...args
|
|
367
|
-
})
|
|
368
|
-
});
|
|
369
|
-
async function getCommitStep(args) {
|
|
370
|
-
"use step";
|
|
371
|
-
return getCommitCore(args);
|
|
372
|
-
}
|
|
373
|
-
/** Get detailed information about a specific commit, including files changed with additions and deletions. */
|
|
374
|
-
const getCommit = (token) => tool({
|
|
375
|
-
description: getCommitDescription,
|
|
376
|
-
inputSchema: getCommitInputSchema,
|
|
377
|
-
toModelOutput: getCommitToModelOutput,
|
|
378
|
-
execute: async (args) => getCommitStep({
|
|
379
|
-
token: await resolveGithubToken(token),
|
|
380
|
-
...args
|
|
381
|
-
})
|
|
382
|
-
});
|
|
383
|
-
async function getBlameStep(args) {
|
|
384
|
-
"use step";
|
|
385
|
-
return getBlameCore(args);
|
|
386
|
-
}
|
|
387
|
-
/** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */
|
|
388
|
-
const getBlame = (token) => tool({
|
|
389
|
-
description: getBlameDescription,
|
|
390
|
-
inputSchema: getBlameInputSchema,
|
|
391
|
-
execute: async (args) => getBlameStep({
|
|
392
|
-
token: await resolveGithubToken(token),
|
|
393
|
-
...args
|
|
394
|
-
})
|
|
395
|
-
});
|
|
396
|
-
//#endregion
|
|
397
|
-
//#region src/tools/gists.ts
|
|
398
|
-
async function listGistsStep(args) {
|
|
399
|
-
"use step";
|
|
400
|
-
return listGistsCore(args);
|
|
401
|
-
}
|
|
402
|
-
/** List gists for the authenticated user or a specific user. */
|
|
403
|
-
const listGists = (token) => tool({
|
|
404
|
-
description: listGistsDescription,
|
|
405
|
-
inputSchema: listGistsInputSchema,
|
|
406
|
-
execute: async (args) => listGistsStep({
|
|
407
|
-
token: await resolveGithubToken(token),
|
|
408
|
-
...args
|
|
409
|
-
})
|
|
410
|
-
});
|
|
411
|
-
async function getGistStep(args) {
|
|
412
|
-
"use step";
|
|
413
|
-
return getGistCore(args);
|
|
414
|
-
}
|
|
415
|
-
/** Get a gist by ID, including file contents. */
|
|
416
|
-
const getGist = (token) => tool({
|
|
417
|
-
description: getGistDescription,
|
|
418
|
-
inputSchema: getGistInputSchema,
|
|
419
|
-
execute: async (args) => getGistStep({
|
|
420
|
-
token: await resolveGithubToken(token),
|
|
421
|
-
...args
|
|
422
|
-
})
|
|
423
|
-
});
|
|
424
|
-
async function listGistCommentsStep(args) {
|
|
425
|
-
"use step";
|
|
426
|
-
return listGistCommentsCore(args);
|
|
427
|
-
}
|
|
428
|
-
/** List comments on a gist. */
|
|
429
|
-
const listGistComments = (token) => tool({
|
|
430
|
-
description: listGistCommentsDescription,
|
|
431
|
-
inputSchema: listGistCommentsInputSchema,
|
|
432
|
-
execute: async (args) => listGistCommentsStep({
|
|
433
|
-
token: await resolveGithubToken(token),
|
|
434
|
-
...args
|
|
435
|
-
})
|
|
436
|
-
});
|
|
437
|
-
async function createGistStep(args) {
|
|
438
|
-
"use step";
|
|
439
|
-
return createGistCore(args);
|
|
440
|
-
}
|
|
441
|
-
/** Create a new gist with one or more files. Requires approval by default. */
|
|
442
|
-
const createGist = (token, { needsApproval = true } = {}) => tool({
|
|
443
|
-
description: createGistDescription,
|
|
444
|
-
needsApproval,
|
|
445
|
-
inputSchema: createGistInputSchema,
|
|
446
|
-
execute: async (args) => createGistStep({
|
|
447
|
-
token: await resolveGithubToken(token),
|
|
448
|
-
...args
|
|
449
|
-
})
|
|
450
|
-
});
|
|
451
|
-
async function updateGistStep(args) {
|
|
452
|
-
"use step";
|
|
453
|
-
return updateGistCore(args);
|
|
454
|
-
}
|
|
455
|
-
/** Update an existing gist. Requires approval by default. */
|
|
456
|
-
const updateGist = (token, { needsApproval = true } = {}) => tool({
|
|
457
|
-
description: updateGistDescription,
|
|
458
|
-
needsApproval,
|
|
459
|
-
inputSchema: updateGistInputSchema,
|
|
460
|
-
execute: async (args) => updateGistStep({
|
|
461
|
-
token: await resolveGithubToken(token),
|
|
462
|
-
...args
|
|
463
|
-
})
|
|
464
|
-
});
|
|
465
|
-
async function deleteGistStep(args) {
|
|
466
|
-
"use step";
|
|
467
|
-
return deleteGistCore(args);
|
|
468
|
-
}
|
|
469
|
-
/** Delete a gist permanently. Requires approval by default. */
|
|
470
|
-
const deleteGist = (token, { needsApproval = true } = {}) => tool({
|
|
471
|
-
description: deleteGistDescription,
|
|
472
|
-
needsApproval,
|
|
473
|
-
inputSchema: deleteGistInputSchema,
|
|
474
|
-
execute: async (args) => deleteGistStep({
|
|
475
|
-
token: await resolveGithubToken(token),
|
|
476
|
-
...args
|
|
477
|
-
})
|
|
478
|
-
});
|
|
479
|
-
async function createGistCommentStep(args) {
|
|
480
|
-
"use step";
|
|
481
|
-
return createGistCommentCore(args);
|
|
482
|
-
}
|
|
483
|
-
/** Add a comment to a gist. Requires approval by default. */
|
|
484
|
-
const createGistComment = (token, { needsApproval = true } = {}) => tool({
|
|
485
|
-
description: createGistCommentDescription,
|
|
486
|
-
needsApproval,
|
|
487
|
-
inputSchema: createGistCommentInputSchema,
|
|
488
|
-
execute: async (args) => createGistCommentStep({
|
|
489
|
-
token: await resolveGithubToken(token),
|
|
490
|
-
...args
|
|
491
|
-
})
|
|
492
|
-
});
|
|
493
|
-
//#endregion
|
|
494
|
-
//#region src/tools/workflows.ts
|
|
495
|
-
async function listWorkflowsStep(args) {
|
|
496
|
-
"use step";
|
|
497
|
-
return listWorkflowsCore(args);
|
|
498
|
-
}
|
|
499
|
-
/** List GitHub Actions workflows in a repository. */
|
|
500
|
-
const listWorkflows = (token) => tool({
|
|
501
|
-
description: listWorkflowsDescription,
|
|
502
|
-
inputSchema: listWorkflowsInputSchema,
|
|
503
|
-
execute: async (args) => listWorkflowsStep({
|
|
504
|
-
token: await resolveGithubToken(token),
|
|
505
|
-
...args
|
|
506
|
-
})
|
|
507
|
-
});
|
|
508
|
-
async function listWorkflowRunsStep(args) {
|
|
509
|
-
"use step";
|
|
510
|
-
return listWorkflowRunsCore(args);
|
|
511
|
-
}
|
|
512
|
-
/** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
|
|
513
|
-
const listWorkflowRuns = (token) => tool({
|
|
514
|
-
description: listWorkflowRunsDescription,
|
|
515
|
-
inputSchema: listWorkflowRunsInputSchema,
|
|
516
|
-
execute: async (args) => listWorkflowRunsStep({
|
|
517
|
-
token: await resolveGithubToken(token),
|
|
518
|
-
...args
|
|
519
|
-
})
|
|
520
|
-
});
|
|
521
|
-
async function getWorkflowRunStep(args) {
|
|
522
|
-
"use step";
|
|
523
|
-
return getWorkflowRunCore(args);
|
|
524
|
-
}
|
|
525
|
-
/** Get details of a specific workflow run including status, timing, and trigger info. */
|
|
526
|
-
const getWorkflowRun = (token) => tool({
|
|
527
|
-
description: getWorkflowRunDescription,
|
|
528
|
-
inputSchema: getWorkflowRunInputSchema,
|
|
529
|
-
execute: async (args) => getWorkflowRunStep({
|
|
530
|
-
token: await resolveGithubToken(token),
|
|
531
|
-
...args
|
|
532
|
-
})
|
|
533
|
-
});
|
|
534
|
-
async function listWorkflowJobsStep(args) {
|
|
535
|
-
"use step";
|
|
536
|
-
return listWorkflowJobsCore(args);
|
|
537
|
-
}
|
|
538
|
-
/** List jobs for a workflow run, including step-level status and timing. */
|
|
539
|
-
const listWorkflowJobs = (token) => tool({
|
|
540
|
-
description: listWorkflowJobsDescription,
|
|
541
|
-
inputSchema: listWorkflowJobsInputSchema,
|
|
542
|
-
execute: async (args) => listWorkflowJobsStep({
|
|
543
|
-
token: await resolveGithubToken(token),
|
|
544
|
-
...args
|
|
545
|
-
})
|
|
546
|
-
});
|
|
547
|
-
async function triggerWorkflowStep(args) {
|
|
548
|
-
"use step";
|
|
549
|
-
return triggerWorkflowCore(args);
|
|
550
|
-
}
|
|
551
|
-
/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
552
|
-
const triggerWorkflow = (token, { needsApproval = true } = {}) => tool({
|
|
553
|
-
description: triggerWorkflowDescription,
|
|
554
|
-
needsApproval,
|
|
555
|
-
inputSchema: triggerWorkflowInputSchema,
|
|
556
|
-
execute: async (args) => triggerWorkflowStep({
|
|
557
|
-
token: await resolveGithubToken(token),
|
|
558
|
-
...args
|
|
559
|
-
})
|
|
560
|
-
});
|
|
561
|
-
async function cancelWorkflowRunStep(args) {
|
|
562
|
-
"use step";
|
|
563
|
-
return cancelWorkflowRunCore(args);
|
|
564
|
-
}
|
|
565
|
-
/** Cancel an in-progress workflow run. Requires approval by default. */
|
|
566
|
-
const cancelWorkflowRun = (token, { needsApproval = true } = {}) => tool({
|
|
567
|
-
description: cancelWorkflowRunDescription,
|
|
568
|
-
needsApproval,
|
|
569
|
-
inputSchema: cancelWorkflowRunInputSchema,
|
|
570
|
-
execute: async (args) => cancelWorkflowRunStep({
|
|
571
|
-
token: await resolveGithubToken(token),
|
|
572
|
-
...args
|
|
573
|
-
})
|
|
574
|
-
});
|
|
575
|
-
async function rerunWorkflowRunStep(args) {
|
|
576
|
-
"use step";
|
|
577
|
-
return rerunWorkflowRunCore(args);
|
|
578
|
-
}
|
|
579
|
-
/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
580
|
-
const rerunWorkflowRun = (token, { needsApproval = true } = {}) => tool({
|
|
581
|
-
description: rerunWorkflowRunDescription,
|
|
582
|
-
needsApproval,
|
|
583
|
-
inputSchema: rerunWorkflowRunInputSchema,
|
|
584
|
-
execute: async (args) => rerunWorkflowRunStep({
|
|
585
|
-
token: await resolveGithubToken(token),
|
|
586
|
-
...args
|
|
587
|
-
})
|
|
588
|
-
});
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region src/core/approval.ts
|
|
591
|
-
/**
|
|
592
|
-
* Resolve whether a write tool requires approval for the AI SDK.
|
|
593
|
-
*
|
|
594
|
-
* @param toolName - The write tool to check.
|
|
595
|
-
* @param config - Global or per-tool approval config.
|
|
596
|
-
* @returns `true` when approval is required; defaults to `true` for unspecified write tools in object mode.
|
|
597
|
-
*/
|
|
598
|
-
function resolveAiSdkApproval(toolName, config) {
|
|
599
|
-
if (typeof config === "boolean") return config;
|
|
600
|
-
return config[toolName] ?? true;
|
|
601
|
-
}
|
|
602
|
-
//#endregion
|
|
603
|
-
//#region src/agents.ts
|
|
604
|
-
const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.`;
|
|
605
|
-
const DEFAULT_INSTRUCTIONS = `You are a helpful GitHub assistant. You can read and explore repositories, issues, pull requests, commits, code, gists, and workflows. You can also create issues, pull requests, comments, gists, trigger workflows, and update files when asked.
|
|
606
|
-
|
|
607
|
-
${SHARED_RULES}`;
|
|
608
|
-
const PRESET_INSTRUCTIONS = {
|
|
609
|
-
"code-review": `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.
|
|
610
|
-
|
|
611
|
-
When reviewing a PR:
|
|
612
|
-
- Read the PR description and changed files carefully
|
|
613
|
-
- To trace why a specific line exists or who last touched it, use getBlame on the file path and ref (branch or merge commit), then follow up with getCommit if you need the full patch
|
|
614
|
-
- Check for bugs, logic errors, and edge cases
|
|
615
|
-
- Suggest improvements when you spot issues
|
|
616
|
-
- Be constructive — explain why something is a problem and how to fix it
|
|
617
|
-
- Use listPullRequestFiles to see exactly which files changed before diving into details
|
|
618
|
-
- Use createPullRequestReview to submit a formal review with inline comments on specific lines
|
|
619
|
-
- Post your review as PR comments when asked
|
|
620
|
-
|
|
621
|
-
${SHARED_RULES}`,
|
|
622
|
-
"issue-triage": `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.
|
|
623
|
-
|
|
624
|
-
When triaging issues:
|
|
625
|
-
- Read issue descriptions carefully to understand the problem
|
|
626
|
-
- Identify duplicates when possible
|
|
627
|
-
- Help categorize and prioritize issues
|
|
628
|
-
- Respond to users with clear, helpful information
|
|
629
|
-
- Use listLabels to see available labels, then addLabels and removeLabel to categorize issues
|
|
630
|
-
- Create new issues when asked, with clear titles and descriptions
|
|
631
|
-
|
|
632
|
-
${SHARED_RULES}`,
|
|
633
|
-
"ci-ops": `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.
|
|
634
|
-
|
|
635
|
-
When working with workflows:
|
|
636
|
-
- Check workflow run status and report failures clearly
|
|
637
|
-
- Inspect job steps to identify exactly where a run failed
|
|
638
|
-
- Re-run failed workflows when asked
|
|
639
|
-
- Trigger workflow dispatches with the correct inputs and branch
|
|
640
|
-
- Be careful with cancel and re-run operations — confirm the target run
|
|
641
|
-
- Summarize run history and trends when asked
|
|
642
|
-
|
|
643
|
-
${SHARED_RULES}`,
|
|
644
|
-
"repo-explorer": `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.
|
|
645
|
-
|
|
646
|
-
When exploring repos:
|
|
647
|
-
- Answer questions about code structure and organization
|
|
648
|
-
- Use getBlame when the user asks about history or ownership of specific lines in a file
|
|
649
|
-
- Summarize recent activity (commits, PRs, issues)
|
|
650
|
-
- Find specific files, functions, or patterns in code
|
|
651
|
-
- Explain how different parts of the codebase work together
|
|
652
|
-
- You have read-only access — you cannot make changes
|
|
653
|
-
|
|
654
|
-
${SHARED_RULES}`,
|
|
655
|
-
"maintainer": `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, gists, and workflows.
|
|
656
|
-
|
|
657
|
-
When maintaining repos:
|
|
658
|
-
- Be careful with write operations — review before acting
|
|
659
|
-
- Create well-structured issues and PRs with clear descriptions
|
|
660
|
-
- Use merge strategies appropriate for the repository
|
|
661
|
-
- Keep commit messages clean and descriptive
|
|
662
|
-
- When closing issues, provide a clear reason
|
|
663
|
-
|
|
664
|
-
${SHARED_RULES}`
|
|
665
|
-
};
|
|
666
|
-
function resolveInstructions(options) {
|
|
667
|
-
const defaultPrompt = options.preset && !Array.isArray(options.preset) ? PRESET_INSTRUCTIONS[options.preset] : DEFAULT_INSTRUCTIONS;
|
|
668
|
-
if (options.instructions) return options.instructions;
|
|
669
|
-
if (options.additionalInstructions) return `${defaultPrompt}\n\n${options.additionalInstructions}`;
|
|
670
|
-
return defaultPrompt;
|
|
671
|
-
}
|
|
672
|
-
/**
|
|
673
|
-
* Create a pre-configured GitHub agent powered by the AI SDK's `ToolLoopAgent`.
|
|
674
|
-
*
|
|
675
|
-
* Returns a `ToolLoopAgent` instance with `.generate()` and `.stream()` methods.
|
|
676
|
-
*
|
|
677
|
-
* @example
|
|
678
|
-
* ```ts
|
|
679
|
-
* import { createGithubAgent } from '@github-tools/sdk'
|
|
680
|
-
*
|
|
681
|
-
* const agent = createGithubAgent({
|
|
682
|
-
* model: 'anthropic/claude-sonnet-4.6',
|
|
683
|
-
* token: process.env.GITHUB_TOKEN!,
|
|
684
|
-
* preset: 'code-review',
|
|
685
|
-
* })
|
|
686
|
-
*
|
|
687
|
-
* const result = await agent.generate({ prompt: 'Review PR #42 on vercel/ai' })
|
|
688
|
-
* ```
|
|
689
|
-
*/
|
|
690
|
-
function createGithubAgent({ token, preset, requireApproval, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
|
|
691
|
-
const tools = createGithubTools({
|
|
692
|
-
token,
|
|
693
|
-
requireApproval,
|
|
694
|
-
preset,
|
|
695
|
-
author,
|
|
696
|
-
committer,
|
|
697
|
-
coAuthors
|
|
698
|
-
});
|
|
699
|
-
return new ToolLoopAgent({
|
|
700
|
-
...agentOptions,
|
|
701
|
-
tools,
|
|
702
|
-
instructions: resolveInstructions({
|
|
703
|
-
preset,
|
|
704
|
-
instructions,
|
|
705
|
-
additionalInstructions
|
|
706
|
-
})
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
//#endregion
|
|
710
|
-
//#region src/index.ts
|
|
711
|
-
/**
|
|
712
|
-
* Create a set of GitHub tools for the Vercel AI SDK.
|
|
713
|
-
*
|
|
714
|
-
* Write operations require user approval by default.
|
|
715
|
-
* Control this globally or per-tool via `requireApproval`.
|
|
716
|
-
* Use `preset` to get only the tools you need.
|
|
717
|
-
*
|
|
718
|
-
* @example
|
|
719
|
-
* ```ts
|
|
720
|
-
* // All tools (default)
|
|
721
|
-
* createGithubTools({ token })
|
|
722
|
-
*
|
|
723
|
-
* // Code-review agent — only PR & commit tools
|
|
724
|
-
* createGithubTools({ token, preset: 'code-review' })
|
|
725
|
-
*
|
|
726
|
-
* // Combine presets
|
|
727
|
-
* createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
|
|
728
|
-
*
|
|
729
|
-
* // Granular approval
|
|
730
|
-
* createGithubTools({
|
|
731
|
-
* token,
|
|
732
|
-
* preset: 'maintainer',
|
|
733
|
-
* requireApproval: {
|
|
734
|
-
* mergePullRequest: true,
|
|
735
|
-
* createOrUpdateFile: true,
|
|
736
|
-
* addPullRequestComment: false,
|
|
737
|
-
* }
|
|
738
|
-
* })
|
|
739
|
-
* ```
|
|
740
|
-
*/
|
|
741
|
-
function createGithubTools({ token, requireApproval = true, preset, overrides, author, committer, coAuthors } = {}) {
|
|
742
|
-
const resolveToken = createGithubTokenResolver(token);
|
|
743
|
-
const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) });
|
|
744
|
-
const allowed = preset ? resolvePresetTools(preset) : null;
|
|
745
|
-
const allTools = {
|
|
746
|
-
getRepository: getRepository(resolveToken),
|
|
747
|
-
listBranches: listBranches(resolveToken),
|
|
748
|
-
getFileContent: getFileContent(resolveToken),
|
|
749
|
-
listPullRequests: listPullRequests(resolveToken),
|
|
750
|
-
getPullRequest: getPullRequest(resolveToken),
|
|
751
|
-
listIssues: listIssues(resolveToken),
|
|
752
|
-
getIssue: getIssue(resolveToken),
|
|
753
|
-
searchCode: searchCode(resolveToken),
|
|
754
|
-
searchRepositories: searchRepositories(resolveToken),
|
|
755
|
-
listCommits: listCommits(resolveToken),
|
|
756
|
-
getCommit: getCommit(resolveToken),
|
|
757
|
-
getBlame: getBlame(resolveToken),
|
|
758
|
-
createBranch: createBranch(resolveToken, approval("createBranch")),
|
|
759
|
-
forkRepository: forkRepository(resolveToken, approval("forkRepository")),
|
|
760
|
-
createRepository: createRepository(resolveToken, approval("createRepository")),
|
|
761
|
-
createOrUpdateFile: createOrUpdateFile(resolveToken, {
|
|
762
|
-
...approval("createOrUpdateFile"),
|
|
763
|
-
author,
|
|
764
|
-
committer,
|
|
765
|
-
coAuthors
|
|
766
|
-
}),
|
|
767
|
-
createPullRequest: createPullRequest(resolveToken, approval("createPullRequest")),
|
|
768
|
-
mergePullRequest: mergePullRequest(resolveToken, {
|
|
769
|
-
...approval("mergePullRequest"),
|
|
770
|
-
coAuthors
|
|
771
|
-
}),
|
|
772
|
-
addPullRequestComment: addPullRequestComment(resolveToken, approval("addPullRequestComment")),
|
|
773
|
-
listPullRequestFiles: listPullRequestFiles(resolveToken),
|
|
774
|
-
listPullRequestReviews: listPullRequestReviews(resolveToken),
|
|
775
|
-
createPullRequestReview: createPullRequestReview(resolveToken, approval("createPullRequestReview")),
|
|
776
|
-
createIssue: createIssue(resolveToken, approval("createIssue")),
|
|
777
|
-
addIssueComment: addIssueComment(resolveToken, approval("addIssueComment")),
|
|
778
|
-
closeIssue: closeIssue(resolveToken, approval("closeIssue")),
|
|
779
|
-
listLabels: listLabels(resolveToken),
|
|
780
|
-
addLabels: addLabels(resolveToken, approval("addLabels")),
|
|
781
|
-
removeLabel: removeLabel(resolveToken, approval("removeLabel")),
|
|
782
|
-
listGists: listGists(resolveToken),
|
|
783
|
-
getGist: getGist(resolveToken),
|
|
784
|
-
listGistComments: listGistComments(resolveToken),
|
|
785
|
-
createGist: createGist(resolveToken, approval("createGist")),
|
|
786
|
-
updateGist: updateGist(resolveToken, approval("updateGist")),
|
|
787
|
-
deleteGist: deleteGist(resolveToken, approval("deleteGist")),
|
|
788
|
-
createGistComment: createGistComment(resolveToken, approval("createGistComment")),
|
|
789
|
-
listWorkflows: listWorkflows(resolveToken),
|
|
790
|
-
listWorkflowRuns: listWorkflowRuns(resolveToken),
|
|
791
|
-
getWorkflowRun: getWorkflowRun(resolveToken),
|
|
792
|
-
listWorkflowJobs: listWorkflowJobs(resolveToken),
|
|
793
|
-
triggerWorkflow: triggerWorkflow(resolveToken, approval("triggerWorkflow")),
|
|
794
|
-
cancelWorkflowRun: cancelWorkflowRun(resolveToken, approval("cancelWorkflowRun")),
|
|
795
|
-
rerunWorkflowRun: rerunWorkflowRun(resolveToken, approval("rerunWorkflowRun"))
|
|
796
|
-
};
|
|
797
|
-
if (overrides) {
|
|
798
|
-
for (const [name, toolOverrides] of Object.entries(overrides)) if (name in allTools && toolOverrides) {
|
|
799
|
-
const key = name;
|
|
800
|
-
Object.assign(allTools, { [key]: {
|
|
801
|
-
...allTools[key],
|
|
802
|
-
...toolOverrides
|
|
803
|
-
} });
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
if (!allowed) return allTools;
|
|
807
|
-
return Object.fromEntries(Object.entries(allTools).filter(([name]) => allowed.has(name)));
|
|
808
|
-
}
|
|
809
|
-
//#endregion
|
|
810
|
-
export { removeLabel as A, createOrUpdateFile as B, addIssueComment as C, getIssue as D, createIssue as E, listPullRequestFiles as F, listBranches as G, forkRepository as H, listPullRequestReviews as I, listPullRequests as L, createPullRequest as M, createPullRequestReview as N, listIssues as O, getPullRequest as P, mergePullRequest as R, searchRepositories as S, closeIssue as T, getFileContent as U, createRepository as V, getRepository as W, updateGist as _, getWorkflowRun as a, listCommits as b, listWorkflows as c, createGist as d, createGistComment as f, listGists as g, listGistComments as h, cancelWorkflowRun as i, addPullRequestComment as j, listLabels as k, rerunWorkflowRun as l, getGist as m, createGithubAgent as n, listWorkflowJobs as o, deleteGist as p, resolveInstructions as r, listWorkflowRuns as s, createGithubTools as t, triggerWorkflow as u, getBlame as v, addLabels as w, searchCode as x, getCommit as y, createBranch as z };
|
|
811
|
-
|
|
812
|
-
//# sourceMappingURL=src-CfzZfU82.mjs.map
|