@github-tools/sdk 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +78 -3
  2. package/dist/connect/eve.d.mts +18 -0
  3. package/dist/connect/eve.d.mts.map +1 -0
  4. package/dist/connect/eve.mjs +27 -0
  5. package/dist/connect/eve.mjs.map +1 -0
  6. package/dist/connect.d.mts +46 -0
  7. package/dist/connect.d.mts.map +1 -0
  8. package/dist/connect.mjs +22 -0
  9. package/dist/connect.mjs.map +1 -0
  10. package/dist/eve-UPaHEGVi.mjs +512 -0
  11. package/dist/eve-UPaHEGVi.mjs.map +1 -0
  12. package/dist/eve.d.mts +47 -89
  13. package/dist/eve.d.mts.map +1 -1
  14. package/dist/eve.mjs +2 -521
  15. package/dist/{tool-types-CuirBEc8.d.mts → index-Cs1Kebmt.d.mts} +251 -32
  16. package/dist/index-Cs1Kebmt.d.mts.map +1 -0
  17. package/dist/index.d.mts +2 -3
  18. package/dist/index.mjs +3 -3
  19. package/dist/{src-BgnkKMD7.mjs → src-CfzZfU82.mjs} +87 -87
  20. package/dist/src-CfzZfU82.mjs.map +1 -0
  21. package/dist/token-CW8lQBND.mjs +100 -0
  22. package/dist/token-CW8lQBND.mjs.map +1 -0
  23. package/dist/types-B0mvQgJf.d.mts +49 -0
  24. package/dist/types-B0mvQgJf.d.mts.map +1 -0
  25. package/dist/types-DwHrGKWO.d.mts +27 -0
  26. package/dist/types-DwHrGKWO.d.mts.map +1 -0
  27. package/dist/workflow.d.mts +4 -5
  28. package/dist/workflow.d.mts.map +1 -1
  29. package/dist/workflow.mjs +3 -3
  30. package/dist/workflow.mjs.map +1 -1
  31. package/dist/{write-tools-vzlewWo5.mjs → write-tools-Dx9LfYlU.mjs} +26 -9
  32. package/dist/write-tools-Dx9LfYlU.mjs.map +1 -0
  33. package/package.json +18 -5
  34. package/dist/eve.mjs.map +0 -1
  35. package/dist/index-BRUYe5q0.d.mts +0 -220
  36. package/dist/index-BRUYe5q0.d.mts.map +0 -1
  37. package/dist/src-BgnkKMD7.mjs.map +0 -1
  38. package/dist/tool-types-CuirBEc8.d.mts.map +0 -1
  39. package/dist/write-tools-vzlewWo5.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $ as getCommitDescription, $t as listPullRequestsDescription, A as createGistCommentInputSchema, At as listLabelsInputSchema, B as listGistCommentsCore, Bt as createPullRequestReviewCore, C as rerunWorkflowRunDescription, Cn as getRepositoryDescription, Ct as getIssueDescription, D as triggerWorkflowInputSchema, Dn as listBranchesInputSchema, Dt as listIssuesInputSchema, E as triggerWorkflowDescription, En as listBranchesDescription, Et as listIssuesDescription, F as deleteGistDescription, Ft as addPullRequestCommentDescription, G as listGistsInputSchema, Gt as getPullRequestInputSchema, H as listGistCommentsInputSchema, Ht as createPullRequestReviewInputSchema, I as deleteGistInputSchema, It as addPullRequestCommentInputSchema, J as updateGistInputSchema, Jt as listPullRequestFilesInputSchema, K as updateGistCore, Kt as listPullRequestFilesCore, L as getGistCore, Lt as createPullRequestCore, M as createGistDescription, Mt as removeLabelDescription, N as createGistInputSchema, Nt as removeLabelInputSchema, O as createGistCommentCore, Ot as listLabelsCore, P as deleteGistCore, Pt as addPullRequestCommentCore, Q as getCommitCore, Qt as listPullRequestsCore, R as getGistDescription, Rt as createPullRequestDescription, S as rerunWorkflowRunCore, Sn as getRepositoryCore, St as getIssueCore, T as triggerWorkflowCore, Tn as listBranchesCore, Tt as listIssuesCore, U as listGistsCore, Ut as getPullRequestCore, V as listGistCommentsDescription, Vt as createPullRequestReviewDescription, W as listGistsDescription, Wt as getPullRequestDescription, X as getBlameDescription, Xt as listPullRequestReviewsDescription, Y as getBlameCore, Yt as listPullRequestReviewsCore, Z as getBlameInputSchema, Zt as listPullRequestReviewsInputSchema, _ as listWorkflowRunsDescription, _n as forkRepositoryDescription, _t as closeIssueDescription, an as getFileContentToModelOutput, at as searchCodeDescription, b as listWorkflowsDescription, bn as getFileContentDescription, bt as createIssueDescription, c as cancelWorkflowRunDescription, cn as createBranchDescription, ct as searchRepositoriesDescription, d as getWorkflowRunDescription, dn as createOrUpdateFileDescription, dt as addIssueCommentDescription, en as listPullRequestsInputSchema, et as getCommitInputSchema, f as getWorkflowRunInputSchema, fn as createOrUpdateFileInputSchema, ft as addIssueCommentInputSchema, g as listWorkflowRunsCore, gn as forkRepositoryCore, gt as closeIssueCore, h as listWorkflowJobsInputSchema, hn as createRepositoryInputSchema, ht as addLabelsInputSchema, in as getCommitToModelOutput, it as searchCodeCore, j as createGistCore, jt as removeLabelCore, k as createGistCommentDescription, kt as listLabelsDescription, l as cancelWorkflowRunInputSchema, ln as createBranchInputSchema, lt as searchRepositoriesInputSchema, m as listWorkflowJobsDescription, mn as createRepositoryDescription, mt as addLabelsDescription, n as resolveGithubToken, nn as mergePullRequestDescription, nt as listCommitsDescription, o as resolvePresetTools, on as listPullRequestFilesToModelOutput, ot as searchCodeInputSchema, p as listWorkflowJobsCore, pn as createRepositoryCore, pt as addLabelsCore, q as updateGistDescription, qt as listPullRequestFilesDescription, rn as mergePullRequestInputSchema, rt as listCommitsInputSchema, s as cancelWorkflowRunCore, sn as createBranchCore, st as searchRepositoriesCore, tn as mergePullRequestCore, tt as listCommitsCore, u as getWorkflowRunCore, un as createOrUpdateFileCore, ut as addIssueCommentCore, v as listWorkflowRunsInputSchema, vn as forkRepositoryInputSchema, vt as closeIssueInputSchema, w as rerunWorkflowRunInputSchema, wn as getRepositoryInputSchema, wt as getIssueInputSchema, x as listWorkflowsInputSchema, xn as getFileContentInputSchema, xt as createIssueInputSchema, y as listWorkflowsCore, yn as getFileContentCore, yt as createIssueCore, z as getGistInputSchema, zt as createPullRequestInputSchema } from "./write-tools-vzlewWo5.mjs";
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
2
  import { ToolLoopAgent, tool } from "ai";
3
3
  //#region src/tools/repository.ts
4
4
  async function getRepositoryStep(args) {
@@ -10,7 +10,7 @@ const getRepository = (token) => tool({
10
10
  description: getRepositoryDescription,
11
11
  inputSchema: getRepositoryInputSchema,
12
12
  execute: async (args) => getRepositoryStep({
13
- token,
13
+ token: await resolveGithubToken(token),
14
14
  ...args
15
15
  })
16
16
  });
@@ -23,7 +23,7 @@ const listBranches = (token) => tool({
23
23
  description: listBranchesDescription,
24
24
  inputSchema: listBranchesInputSchema,
25
25
  execute: async (args) => listBranchesStep({
26
- token,
26
+ token: await resolveGithubToken(token),
27
27
  ...args
28
28
  })
29
29
  });
@@ -37,7 +37,7 @@ const getFileContent = (token) => tool({
37
37
  inputSchema: getFileContentInputSchema,
38
38
  toModelOutput: getFileContentToModelOutput,
39
39
  execute: async (args) => getFileContentStep({
40
- token,
40
+ token: await resolveGithubToken(token),
41
41
  ...args
42
42
  })
43
43
  });
@@ -51,7 +51,7 @@ const createBranch = (token, { needsApproval = true } = {}) => tool({
51
51
  needsApproval,
52
52
  inputSchema: createBranchInputSchema,
53
53
  execute: async (args) => createBranchStep({
54
- token,
54
+ token: await resolveGithubToken(token),
55
55
  ...args
56
56
  })
57
57
  });
@@ -65,7 +65,7 @@ const forkRepository = (token, { needsApproval = true } = {}) => tool({
65
65
  needsApproval,
66
66
  inputSchema: forkRepositoryInputSchema,
67
67
  execute: async (args) => forkRepositoryStep({
68
- token,
68
+ token: await resolveGithubToken(token),
69
69
  ...args
70
70
  })
71
71
  });
@@ -79,7 +79,7 @@ const createRepository = (token, { needsApproval = true } = {}) => tool({
79
79
  needsApproval,
80
80
  inputSchema: createRepositoryInputSchema,
81
81
  execute: async (args) => createRepositoryStep({
82
- token,
82
+ token: await resolveGithubToken(token),
83
83
  ...args
84
84
  })
85
85
  });
@@ -93,7 +93,7 @@ const createOrUpdateFile = (token, { needsApproval = true, author, committer, co
93
93
  needsApproval,
94
94
  inputSchema: createOrUpdateFileInputSchema,
95
95
  execute: async (args) => createOrUpdateFileStep({
96
- token,
96
+ token: await resolveGithubToken(token),
97
97
  author,
98
98
  committer,
99
99
  coAuthors,
@@ -111,7 +111,7 @@ const listPullRequests = (token) => tool({
111
111
  description: listPullRequestsDescription,
112
112
  inputSchema: listPullRequestsInputSchema,
113
113
  execute: async (args) => listPullRequestsStep({
114
- token,
114
+ token: await resolveGithubToken(token),
115
115
  ...args
116
116
  })
117
117
  });
@@ -124,7 +124,7 @@ const getPullRequest = (token) => tool({
124
124
  description: getPullRequestDescription,
125
125
  inputSchema: getPullRequestInputSchema,
126
126
  execute: async (args) => getPullRequestStep({
127
- token,
127
+ token: await resolveGithubToken(token),
128
128
  ...args
129
129
  })
130
130
  });
@@ -138,7 +138,7 @@ const createPullRequest = (token, { needsApproval = true } = {}) => tool({
138
138
  needsApproval,
139
139
  inputSchema: createPullRequestInputSchema,
140
140
  execute: async (args) => createPullRequestStep({
141
- token,
141
+ token: await resolveGithubToken(token),
142
142
  ...args
143
143
  })
144
144
  });
@@ -152,7 +152,7 @@ const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => to
152
152
  needsApproval,
153
153
  inputSchema: mergePullRequestInputSchema,
154
154
  execute: async (args) => mergePullRequestStep({
155
- token,
155
+ token: await resolveGithubToken(token),
156
156
  coAuthors,
157
157
  ...args
158
158
  })
@@ -167,7 +167,7 @@ const addPullRequestComment = (token, { needsApproval = true } = {}) => tool({
167
167
  needsApproval,
168
168
  inputSchema: addPullRequestCommentInputSchema,
169
169
  execute: async (args) => addPullRequestCommentStep({
170
- token,
170
+ token: await resolveGithubToken(token),
171
171
  ...args
172
172
  })
173
173
  });
@@ -181,7 +181,7 @@ const listPullRequestFiles = (token) => tool({
181
181
  inputSchema: listPullRequestFilesInputSchema,
182
182
  toModelOutput: listPullRequestFilesToModelOutput,
183
183
  execute: async (args) => listPullRequestFilesStep({
184
- token,
184
+ token: await resolveGithubToken(token),
185
185
  ...args
186
186
  })
187
187
  });
@@ -194,7 +194,7 @@ const listPullRequestReviews = (token) => tool({
194
194
  description: listPullRequestReviewsDescription,
195
195
  inputSchema: listPullRequestReviewsInputSchema,
196
196
  execute: async (args) => listPullRequestReviewsStep({
197
- token,
197
+ token: await resolveGithubToken(token),
198
198
  ...args
199
199
  })
200
200
  });
@@ -208,7 +208,7 @@ const createPullRequestReview = (token, { needsApproval = true } = {}) => tool({
208
208
  needsApproval,
209
209
  inputSchema: createPullRequestReviewInputSchema,
210
210
  execute: async (args) => createPullRequestReviewStep({
211
- token,
211
+ token: await resolveGithubToken(token),
212
212
  ...args
213
213
  })
214
214
  });
@@ -223,7 +223,7 @@ const listIssues = (token) => tool({
223
223
  description: listIssuesDescription,
224
224
  inputSchema: listIssuesInputSchema,
225
225
  execute: async (args) => listIssuesStep({
226
- token,
226
+ token: await resolveGithubToken(token),
227
227
  ...args
228
228
  })
229
229
  });
@@ -236,7 +236,7 @@ const getIssue = (token) => tool({
236
236
  description: getIssueDescription,
237
237
  inputSchema: getIssueInputSchema,
238
238
  execute: async (args) => getIssueStep({
239
- token,
239
+ token: await resolveGithubToken(token),
240
240
  ...args
241
241
  })
242
242
  });
@@ -250,7 +250,7 @@ const createIssue = (token, { needsApproval = true } = {}) => tool({
250
250
  needsApproval,
251
251
  inputSchema: createIssueInputSchema,
252
252
  execute: async (args) => createIssueStep({
253
- token,
253
+ token: await resolveGithubToken(token),
254
254
  ...args
255
255
  })
256
256
  });
@@ -264,7 +264,7 @@ const addIssueComment = (token, { needsApproval = true } = {}) => tool({
264
264
  needsApproval,
265
265
  inputSchema: addIssueCommentInputSchema,
266
266
  execute: async (args) => addIssueCommentStep({
267
- token,
267
+ token: await resolveGithubToken(token),
268
268
  ...args
269
269
  })
270
270
  });
@@ -278,7 +278,7 @@ const closeIssue = (token, { needsApproval = true } = {}) => tool({
278
278
  needsApproval,
279
279
  inputSchema: closeIssueInputSchema,
280
280
  execute: async (args) => closeIssueStep({
281
- token,
281
+ token: await resolveGithubToken(token),
282
282
  ...args
283
283
  })
284
284
  });
@@ -291,7 +291,7 @@ const listLabels = (token) => tool({
291
291
  description: listLabelsDescription,
292
292
  inputSchema: listLabelsInputSchema,
293
293
  execute: async (args) => listLabelsStep({
294
- token,
294
+ token: await resolveGithubToken(token),
295
295
  ...args
296
296
  })
297
297
  });
@@ -305,7 +305,7 @@ const addLabels = (token, { needsApproval = true } = {}) => tool({
305
305
  needsApproval,
306
306
  inputSchema: addLabelsInputSchema,
307
307
  execute: async (args) => addLabelsStep({
308
- token,
308
+ token: await resolveGithubToken(token),
309
309
  ...args
310
310
  })
311
311
  });
@@ -319,7 +319,7 @@ const removeLabel = (token, { needsApproval = true } = {}) => tool({
319
319
  needsApproval,
320
320
  inputSchema: removeLabelInputSchema,
321
321
  execute: async (args) => removeLabelStep({
322
- token,
322
+ token: await resolveGithubToken(token),
323
323
  ...args
324
324
  })
325
325
  });
@@ -334,7 +334,7 @@ const searchCode = (token) => tool({
334
334
  description: searchCodeDescription,
335
335
  inputSchema: searchCodeInputSchema,
336
336
  execute: async (args) => searchCodeStep({
337
- token,
337
+ token: await resolveGithubToken(token),
338
338
  ...args
339
339
  })
340
340
  });
@@ -347,7 +347,7 @@ const searchRepositories = (token) => tool({
347
347
  description: searchRepositoriesDescription,
348
348
  inputSchema: searchRepositoriesInputSchema,
349
349
  execute: async (args) => searchRepositoriesStep({
350
- token,
350
+ token: await resolveGithubToken(token),
351
351
  ...args
352
352
  })
353
353
  });
@@ -362,7 +362,7 @@ const listCommits = (token) => tool({
362
362
  description: listCommitsDescription,
363
363
  inputSchema: listCommitsInputSchema,
364
364
  execute: async (args) => listCommitsStep({
365
- token,
365
+ token: await resolveGithubToken(token),
366
366
  ...args
367
367
  })
368
368
  });
@@ -376,7 +376,7 @@ const getCommit = (token) => tool({
376
376
  inputSchema: getCommitInputSchema,
377
377
  toModelOutput: getCommitToModelOutput,
378
378
  execute: async (args) => getCommitStep({
379
- token,
379
+ token: await resolveGithubToken(token),
380
380
  ...args
381
381
  })
382
382
  });
@@ -389,7 +389,7 @@ const getBlame = (token) => tool({
389
389
  description: getBlameDescription,
390
390
  inputSchema: getBlameInputSchema,
391
391
  execute: async (args) => getBlameStep({
392
- token,
392
+ token: await resolveGithubToken(token),
393
393
  ...args
394
394
  })
395
395
  });
@@ -404,7 +404,7 @@ const listGists = (token) => tool({
404
404
  description: listGistsDescription,
405
405
  inputSchema: listGistsInputSchema,
406
406
  execute: async (args) => listGistsStep({
407
- token,
407
+ token: await resolveGithubToken(token),
408
408
  ...args
409
409
  })
410
410
  });
@@ -417,7 +417,7 @@ const getGist = (token) => tool({
417
417
  description: getGistDescription,
418
418
  inputSchema: getGistInputSchema,
419
419
  execute: async (args) => getGistStep({
420
- token,
420
+ token: await resolveGithubToken(token),
421
421
  ...args
422
422
  })
423
423
  });
@@ -430,7 +430,7 @@ const listGistComments = (token) => tool({
430
430
  description: listGistCommentsDescription,
431
431
  inputSchema: listGistCommentsInputSchema,
432
432
  execute: async (args) => listGistCommentsStep({
433
- token,
433
+ token: await resolveGithubToken(token),
434
434
  ...args
435
435
  })
436
436
  });
@@ -444,7 +444,7 @@ const createGist = (token, { needsApproval = true } = {}) => tool({
444
444
  needsApproval,
445
445
  inputSchema: createGistInputSchema,
446
446
  execute: async (args) => createGistStep({
447
- token,
447
+ token: await resolveGithubToken(token),
448
448
  ...args
449
449
  })
450
450
  });
@@ -458,7 +458,7 @@ const updateGist = (token, { needsApproval = true } = {}) => tool({
458
458
  needsApproval,
459
459
  inputSchema: updateGistInputSchema,
460
460
  execute: async (args) => updateGistStep({
461
- token,
461
+ token: await resolveGithubToken(token),
462
462
  ...args
463
463
  })
464
464
  });
@@ -472,7 +472,7 @@ const deleteGist = (token, { needsApproval = true } = {}) => tool({
472
472
  needsApproval,
473
473
  inputSchema: deleteGistInputSchema,
474
474
  execute: async (args) => deleteGistStep({
475
- token,
475
+ token: await resolveGithubToken(token),
476
476
  ...args
477
477
  })
478
478
  });
@@ -486,7 +486,7 @@ const createGistComment = (token, { needsApproval = true } = {}) => tool({
486
486
  needsApproval,
487
487
  inputSchema: createGistCommentInputSchema,
488
488
  execute: async (args) => createGistCommentStep({
489
- token,
489
+ token: await resolveGithubToken(token),
490
490
  ...args
491
491
  })
492
492
  });
@@ -501,7 +501,7 @@ const listWorkflows = (token) => tool({
501
501
  description: listWorkflowsDescription,
502
502
  inputSchema: listWorkflowsInputSchema,
503
503
  execute: async (args) => listWorkflowsStep({
504
- token,
504
+ token: await resolveGithubToken(token),
505
505
  ...args
506
506
  })
507
507
  });
@@ -514,7 +514,7 @@ const listWorkflowRuns = (token) => tool({
514
514
  description: listWorkflowRunsDescription,
515
515
  inputSchema: listWorkflowRunsInputSchema,
516
516
  execute: async (args) => listWorkflowRunsStep({
517
- token,
517
+ token: await resolveGithubToken(token),
518
518
  ...args
519
519
  })
520
520
  });
@@ -527,7 +527,7 @@ const getWorkflowRun = (token) => tool({
527
527
  description: getWorkflowRunDescription,
528
528
  inputSchema: getWorkflowRunInputSchema,
529
529
  execute: async (args) => getWorkflowRunStep({
530
- token,
530
+ token: await resolveGithubToken(token),
531
531
  ...args
532
532
  })
533
533
  });
@@ -540,7 +540,7 @@ const listWorkflowJobs = (token) => tool({
540
540
  description: listWorkflowJobsDescription,
541
541
  inputSchema: listWorkflowJobsInputSchema,
542
542
  execute: async (args) => listWorkflowJobsStep({
543
- token,
543
+ token: await resolveGithubToken(token),
544
544
  ...args
545
545
  })
546
546
  });
@@ -554,7 +554,7 @@ const triggerWorkflow = (token, { needsApproval = true } = {}) => tool({
554
554
  needsApproval,
555
555
  inputSchema: triggerWorkflowInputSchema,
556
556
  execute: async (args) => triggerWorkflowStep({
557
- token,
557
+ token: await resolveGithubToken(token),
558
558
  ...args
559
559
  })
560
560
  });
@@ -568,7 +568,7 @@ const cancelWorkflowRun = (token, { needsApproval = true } = {}) => tool({
568
568
  needsApproval,
569
569
  inputSchema: cancelWorkflowRunInputSchema,
570
570
  execute: async (args) => cancelWorkflowRunStep({
571
- token,
571
+ token: await resolveGithubToken(token),
572
572
  ...args
573
573
  })
574
574
  });
@@ -582,7 +582,7 @@ const rerunWorkflowRun = (token, { needsApproval = true } = {}) => tool({
582
582
  needsApproval,
583
583
  inputSchema: rerunWorkflowRunInputSchema,
584
584
  execute: async (args) => rerunWorkflowRunStep({
585
- token,
585
+ token: await resolveGithubToken(token),
586
586
  ...args
587
587
  })
588
588
  });
@@ -739,60 +739,60 @@ function createGithubAgent({ token, preset, requireApproval, instructions, addit
739
739
  * ```
740
740
  */
741
741
  function createGithubTools({ token, requireApproval = true, preset, overrides, author, committer, coAuthors } = {}) {
742
- const resolvedToken = resolveGithubToken(token);
742
+ const resolveToken = createGithubTokenResolver(token);
743
743
  const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) });
744
744
  const allowed = preset ? resolvePresetTools(preset) : null;
745
745
  const allTools = {
746
- getRepository: getRepository(resolvedToken),
747
- listBranches: listBranches(resolvedToken),
748
- getFileContent: getFileContent(resolvedToken),
749
- listPullRequests: listPullRequests(resolvedToken),
750
- getPullRequest: getPullRequest(resolvedToken),
751
- listIssues: listIssues(resolvedToken),
752
- getIssue: getIssue(resolvedToken),
753
- searchCode: searchCode(resolvedToken),
754
- searchRepositories: searchRepositories(resolvedToken),
755
- listCommits: listCommits(resolvedToken),
756
- getCommit: getCommit(resolvedToken),
757
- getBlame: getBlame(resolvedToken),
758
- createBranch: createBranch(resolvedToken, approval("createBranch")),
759
- forkRepository: forkRepository(resolvedToken, approval("forkRepository")),
760
- createRepository: createRepository(resolvedToken, approval("createRepository")),
761
- createOrUpdateFile: createOrUpdateFile(resolvedToken, {
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
762
  ...approval("createOrUpdateFile"),
763
763
  author,
764
764
  committer,
765
765
  coAuthors
766
766
  }),
767
- createPullRequest: createPullRequest(resolvedToken, approval("createPullRequest")),
768
- mergePullRequest: mergePullRequest(resolvedToken, {
767
+ createPullRequest: createPullRequest(resolveToken, approval("createPullRequest")),
768
+ mergePullRequest: mergePullRequest(resolveToken, {
769
769
  ...approval("mergePullRequest"),
770
770
  coAuthors
771
771
  }),
772
- addPullRequestComment: addPullRequestComment(resolvedToken, approval("addPullRequestComment")),
773
- listPullRequestFiles: listPullRequestFiles(resolvedToken),
774
- listPullRequestReviews: listPullRequestReviews(resolvedToken),
775
- createPullRequestReview: createPullRequestReview(resolvedToken, approval("createPullRequestReview")),
776
- createIssue: createIssue(resolvedToken, approval("createIssue")),
777
- addIssueComment: addIssueComment(resolvedToken, approval("addIssueComment")),
778
- closeIssue: closeIssue(resolvedToken, approval("closeIssue")),
779
- listLabels: listLabels(resolvedToken),
780
- addLabels: addLabels(resolvedToken, approval("addLabels")),
781
- removeLabel: removeLabel(resolvedToken, approval("removeLabel")),
782
- listGists: listGists(resolvedToken),
783
- getGist: getGist(resolvedToken),
784
- listGistComments: listGistComments(resolvedToken),
785
- createGist: createGist(resolvedToken, approval("createGist")),
786
- updateGist: updateGist(resolvedToken, approval("updateGist")),
787
- deleteGist: deleteGist(resolvedToken, approval("deleteGist")),
788
- createGistComment: createGistComment(resolvedToken, approval("createGistComment")),
789
- listWorkflows: listWorkflows(resolvedToken),
790
- listWorkflowRuns: listWorkflowRuns(resolvedToken),
791
- getWorkflowRun: getWorkflowRun(resolvedToken),
792
- listWorkflowJobs: listWorkflowJobs(resolvedToken),
793
- triggerWorkflow: triggerWorkflow(resolvedToken, approval("triggerWorkflow")),
794
- cancelWorkflowRun: cancelWorkflowRun(resolvedToken, approval("cancelWorkflowRun")),
795
- rerunWorkflowRun: rerunWorkflowRun(resolvedToken, approval("rerunWorkflowRun"))
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
796
  };
797
797
  if (overrides) {
798
798
  for (const [name, toolOverrides] of Object.entries(overrides)) if (name in allTools && toolOverrides) {
@@ -809,4 +809,4 @@ function createGithubTools({ token, requireApproval = true, preset, overrides, a
809
809
  //#endregion
810
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
811
 
812
- //# sourceMappingURL=src-BgnkKMD7.mjs.map
812
+ //# sourceMappingURL=src-CfzZfU82.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-CfzZfU82.mjs","names":[],"sources":["../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/search.ts","../src/tools/commits.ts","../src/tools/gists.ts","../src/tools/workflows.ts","../src/core/approval.ts","../src/agents.ts","../src/index.ts"],"sourcesContent":["import { tool } from 'ai'\nimport {\n getRepositoryInputSchema,\n getRepositoryDescription,\n getRepositoryCore,\n listBranchesInputSchema,\n listBranchesDescription,\n listBranchesCore,\n getFileContentInputSchema,\n getFileContentDescription,\n getFileContentCore,\n createBranchInputSchema,\n createBranchDescription,\n createBranchCore,\n forkRepositoryInputSchema,\n forkRepositoryDescription,\n forkRepositoryCore,\n createRepositoryInputSchema,\n createRepositoryDescription,\n createRepositoryCore,\n createOrUpdateFileInputSchema,\n createOrUpdateFileDescription,\n createOrUpdateFileCore,\n composeCommitMessage,\n} from '../core/repository'\nimport { getFileContentToModelOutput } from '../core/model-output'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { CommitToolOptions, ToolOptions, GithubTool } from '../types'\n\nexport { composeCommitMessage }\n\nasync function getRepositoryStep(args: Parameters<typeof getRepositoryCore>[0]) {\n \"use step\"\n return getRepositoryCore(args)\n}\n\n/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */\nexport const getRepository = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getRepositoryDescription,\n inputSchema: getRepositoryInputSchema,\n execute: async args => getRepositoryStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listBranchesStep(args: Parameters<typeof listBranchesCore>[0]) {\n \"use step\"\n return listBranchesCore(args)\n}\n\n/** List branches in a GitHub repository. */\nexport const listBranches = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listBranchesDescription,\n inputSchema: listBranchesInputSchema,\n execute: async args => listBranchesStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getFileContentStep(args: Parameters<typeof getFileContentCore>[0]) {\n \"use step\"\n return getFileContentCore(args)\n}\n\n/** Get the content of a file from a GitHub repository. */\nexport const getFileContent = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getFileContentDescription,\n inputSchema: getFileContentInputSchema,\n toModelOutput: getFileContentToModelOutput,\n execute: async args => getFileContentStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createBranchStep(args: Parameters<typeof createBranchCore>[0]) {\n \"use step\"\n return createBranchCore(args)\n}\n\n/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */\nexport const createBranch = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createBranchDescription,\n needsApproval,\n inputSchema: createBranchInputSchema,\n execute: async args => createBranchStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function forkRepositoryStep(args: Parameters<typeof forkRepositoryCore>[0]) {\n \"use step\"\n return forkRepositoryCore(args)\n}\n\n/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */\nexport const forkRepository = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: forkRepositoryDescription,\n needsApproval,\n inputSchema: forkRepositoryInputSchema,\n execute: async args => forkRepositoryStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createRepositoryStep(args: Parameters<typeof createRepositoryCore>[0]) {\n \"use step\"\n return createRepositoryCore(args)\n}\n\n/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */\nexport const createRepository = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createRepositoryDescription,\n needsApproval,\n inputSchema: createRepositoryInputSchema,\n execute: async args => createRepositoryStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createOrUpdateFileStep(args: Parameters<typeof createOrUpdateFileCore>[0]) {\n \"use step\"\n return createOrUpdateFileCore(args)\n}\n\n/** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */\nexport const createOrUpdateFile = (\n token: GithubTokenInput,\n { needsApproval = true, author, committer, coAuthors }: CommitToolOptions = {},\n): GithubTool =>\n tool({\n description: createOrUpdateFileDescription,\n needsApproval,\n inputSchema: createOrUpdateFileInputSchema,\n execute: async args => createOrUpdateFileStep({ token: await resolveGithubToken(token), author, committer, coAuthors, ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listPullRequestsInputSchema,\n listPullRequestsDescription,\n listPullRequestsCore,\n getPullRequestInputSchema,\n getPullRequestDescription,\n getPullRequestCore,\n createPullRequestInputSchema,\n createPullRequestDescription,\n createPullRequestCore,\n mergePullRequestInputSchema,\n mergePullRequestDescription,\n mergePullRequestCore,\n addPullRequestCommentInputSchema,\n addPullRequestCommentDescription,\n addPullRequestCommentCore,\n listPullRequestFilesInputSchema,\n listPullRequestFilesDescription,\n listPullRequestFilesCore,\n listPullRequestReviewsInputSchema,\n listPullRequestReviewsDescription,\n listPullRequestReviewsCore,\n createPullRequestReviewInputSchema,\n createPullRequestReviewDescription,\n createPullRequestReviewCore,\n} from '../core/pull-requests'\nimport { listPullRequestFilesToModelOutput } from '../core/model-output'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { CommitIdentity, ToolOptions, GithubTool } from '../types'\n\nexport type MergeToolOptions = ToolOptions & {\n coAuthors?: CommitIdentity[]\n}\n\nasync function listPullRequestsStep(args: Parameters<typeof listPullRequestsCore>[0]) {\n \"use step\"\n return listPullRequestsCore(args)\n}\n\n/** List pull requests for a GitHub repository. */\nexport const listPullRequests = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listPullRequestsDescription,\n inputSchema: listPullRequestsInputSchema,\n execute: async args => listPullRequestsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getPullRequestStep(args: Parameters<typeof getPullRequestCore>[0]) {\n \"use step\"\n return getPullRequestCore(args)\n}\n\n/** Get detailed information about a specific pull request. */\nexport const getPullRequest = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getPullRequestDescription,\n inputSchema: getPullRequestInputSchema,\n execute: async args => getPullRequestStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createPullRequestStep(args: Parameters<typeof createPullRequestCore>[0]) {\n \"use step\"\n return createPullRequestCore(args)\n}\n\n/** Create a new pull request in a GitHub repository. Requires approval by default. */\nexport const createPullRequest = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createPullRequestDescription,\n needsApproval,\n inputSchema: createPullRequestInputSchema,\n execute: async args => createPullRequestStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function mergePullRequestStep(args: Parameters<typeof mergePullRequestCore>[0]) {\n \"use step\"\n return mergePullRequestCore(args)\n}\n\n/** Merge a pull request. Requires approval by default. */\nexport const mergePullRequest = (token: GithubTokenInput, { needsApproval = true, coAuthors }: MergeToolOptions = {}): GithubTool =>\n tool({\n description: mergePullRequestDescription,\n needsApproval,\n inputSchema: mergePullRequestInputSchema,\n execute: async args => mergePullRequestStep({ token: await resolveGithubToken(token), coAuthors, ...args }),\n })\n\nasync function addPullRequestCommentStep(args: Parameters<typeof addPullRequestCommentCore>[0]) {\n \"use step\"\n return addPullRequestCommentCore(args)\n}\n\n/** Add a comment to a pull request. Requires approval by default. */\nexport const addPullRequestComment = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addPullRequestCommentDescription,\n needsApproval,\n inputSchema: addPullRequestCommentInputSchema,\n execute: async args => addPullRequestCommentStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listPullRequestFilesStep(args: Parameters<typeof listPullRequestFilesCore>[0]) {\n \"use step\"\n return listPullRequestFilesCore(args)\n}\n\n/** List files changed in a pull request, including diff status and patch content. */\nexport const listPullRequestFiles = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listPullRequestFilesDescription,\n inputSchema: listPullRequestFilesInputSchema,\n toModelOutput: listPullRequestFilesToModelOutput,\n execute: async args => listPullRequestFilesStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listPullRequestReviewsStep(args: Parameters<typeof listPullRequestReviewsCore>[0]) {\n \"use step\"\n return listPullRequestReviewsCore(args)\n}\n\n/** List reviews on a pull request (approvals, change requests, and comments). */\nexport const listPullRequestReviews = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listPullRequestReviewsDescription,\n inputSchema: listPullRequestReviewsInputSchema,\n execute: async args => listPullRequestReviewsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createPullRequestReviewStep(args: Parameters<typeof createPullRequestReviewCore>[0]) {\n \"use step\"\n return createPullRequestReviewCore(args)\n}\n\n/** Submit a pull request review with optional inline comments. Requires approval by default. */\nexport const createPullRequestReview = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createPullRequestReviewDescription,\n needsApproval,\n inputSchema: createPullRequestReviewInputSchema,\n execute: async args => createPullRequestReviewStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listIssuesInputSchema,\n listIssuesDescription,\n listIssuesCore,\n getIssueInputSchema,\n getIssueDescription,\n getIssueCore,\n createIssueInputSchema,\n createIssueDescription,\n createIssueCore,\n addIssueCommentInputSchema,\n addIssueCommentDescription,\n addIssueCommentCore,\n closeIssueInputSchema,\n closeIssueDescription,\n closeIssueCore,\n listLabelsInputSchema,\n listLabelsDescription,\n listLabelsCore,\n addLabelsInputSchema,\n addLabelsDescription,\n addLabelsCore,\n removeLabelInputSchema,\n removeLabelDescription,\n removeLabelCore,\n} from '../core/issues'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listIssuesStep(args: Parameters<typeof listIssuesCore>[0]) {\n \"use step\"\n return listIssuesCore(args)\n}\n\n/** List issues for a GitHub repository (excludes pull requests). */\nexport const listIssues = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listIssuesDescription,\n inputSchema: listIssuesInputSchema,\n execute: async args => listIssuesStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getIssueStep(args: Parameters<typeof getIssueCore>[0]) {\n \"use step\"\n return getIssueCore(args)\n}\n\n/** Get detailed information about a specific issue. */\nexport const getIssue = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getIssueDescription,\n inputSchema: getIssueInputSchema,\n execute: async args => getIssueStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createIssueStep(args: Parameters<typeof createIssueCore>[0]) {\n \"use step\"\n return createIssueCore(args)\n}\n\n/** Create a new issue in a GitHub repository. Requires approval by default. */\nexport const createIssue = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createIssueDescription,\n needsApproval,\n inputSchema: createIssueInputSchema,\n execute: async args => createIssueStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function addIssueCommentStep(args: Parameters<typeof addIssueCommentCore>[0]) {\n \"use step\"\n return addIssueCommentCore(args)\n}\n\n/** Add a comment to a GitHub issue. Requires approval by default. */\nexport const addIssueComment = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addIssueCommentDescription,\n needsApproval,\n inputSchema: addIssueCommentInputSchema,\n execute: async args => addIssueCommentStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function closeIssueStep(args: Parameters<typeof closeIssueCore>[0]) {\n \"use step\"\n return closeIssueCore(args)\n}\n\n/** Close an open GitHub issue. Requires approval by default. */\nexport const closeIssue = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: closeIssueDescription,\n needsApproval,\n inputSchema: closeIssueInputSchema,\n execute: async args => closeIssueStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listLabelsStep(args: Parameters<typeof listLabelsCore>[0]) {\n \"use step\"\n return listLabelsCore(args)\n}\n\n/** List labels available in a GitHub repository. */\nexport const listLabels = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listLabelsDescription,\n inputSchema: listLabelsInputSchema,\n execute: async args => listLabelsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function addLabelsStep(args: Parameters<typeof addLabelsCore>[0]) {\n \"use step\"\n return addLabelsCore(args)\n}\n\n/** Add labels to an issue or pull request. Requires approval by default. */\nexport const addLabels = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addLabelsDescription,\n needsApproval,\n inputSchema: addLabelsInputSchema,\n execute: async args => addLabelsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function removeLabelStep(args: Parameters<typeof removeLabelCore>[0]) {\n \"use step\"\n return removeLabelCore(args)\n}\n\n/** Remove a label from an issue or pull request. Requires approval by default. */\nexport const removeLabel = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: removeLabelDescription,\n needsApproval,\n inputSchema: removeLabelInputSchema,\n execute: async args => removeLabelStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import { tool } from 'ai'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { GithubTool } from '../types'\nimport {\n searchCodeInputSchema,\n searchCodeDescription,\n searchCodeCore,\n searchRepositoriesInputSchema,\n searchRepositoriesDescription,\n searchRepositoriesCore,\n} from '../core/search'\n\nasync function searchCodeStep(args: Parameters<typeof searchCodeCore>[0]) {\n \"use step\"\n return searchCodeCore(args)\n}\n\n/** Search for code in GitHub repositories. Use qualifiers like \"repo:owner/name\" to scope the search. */\nexport const searchCode = (token: GithubTokenInput): GithubTool =>\n tool({\n description: searchCodeDescription,\n inputSchema: searchCodeInputSchema,\n execute: async args => searchCodeStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function searchRepositoriesStep(args: Parameters<typeof searchRepositoriesCore>[0]) {\n \"use step\"\n return searchRepositoriesCore(args)\n}\n\n/** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */\nexport const searchRepositories = (token: GithubTokenInput): GithubTool =>\n tool({\n description: searchRepositoriesDescription,\n inputSchema: searchRepositoriesInputSchema,\n execute: async args => searchRepositoriesStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import { tool } from 'ai'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { GithubTool } from '../types'\nimport {\n listCommitsInputSchema,\n listCommitsDescription,\n listCommitsCore,\n getCommitInputSchema,\n getCommitDescription,\n getCommitCore,\n getBlameInputSchema,\n getBlameDescription,\n getBlameCore,\n} from '../core/commits'\nimport { getCommitToModelOutput } from '../core/model-output'\n\nasync function listCommitsStep(args: Parameters<typeof listCommitsCore>[0]) {\n \"use step\"\n return listCommitsCore(args)\n}\n\n/** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */\nexport const listCommits = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listCommitsDescription,\n inputSchema: listCommitsInputSchema,\n execute: async args => listCommitsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getCommitStep(args: Parameters<typeof getCommitCore>[0]) {\n \"use step\"\n return getCommitCore(args)\n}\n\n/** Get detailed information about a specific commit, including files changed with additions and deletions. */\nexport const getCommit = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getCommitDescription,\n inputSchema: getCommitInputSchema,\n toModelOutput: getCommitToModelOutput,\n execute: async args => getCommitStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getBlameStep(args: Parameters<typeof getBlameCore>[0]) {\n \"use step\"\n return getBlameCore(args)\n}\n\n/** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */\nexport const getBlame = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getBlameDescription,\n inputSchema: getBlameInputSchema,\n execute: async args => getBlameStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listGistsInputSchema,\n listGistsDescription,\n listGistsCore,\n getGistInputSchema,\n getGistDescription,\n getGistCore,\n listGistCommentsInputSchema,\n listGistCommentsDescription,\n listGistCommentsCore,\n createGistInputSchema,\n createGistDescription,\n createGistCore,\n updateGistInputSchema,\n updateGistDescription,\n updateGistCore,\n deleteGistInputSchema,\n deleteGistDescription,\n deleteGistCore,\n createGistCommentInputSchema,\n createGistCommentDescription,\n createGistCommentCore,\n} from '../core/gists'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listGistsStep(args: Parameters<typeof listGistsCore>[0]) {\n \"use step\"\n return listGistsCore(args)\n}\n\n/** List gists for the authenticated user or a specific user. */\nexport const listGists = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listGistsDescription,\n inputSchema: listGistsInputSchema,\n execute: async args => listGistsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getGistStep(args: Parameters<typeof getGistCore>[0]) {\n \"use step\"\n return getGistCore(args)\n}\n\n/** Get a gist by ID, including file contents. */\nexport const getGist = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getGistDescription,\n inputSchema: getGistInputSchema,\n execute: async args => getGistStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listGistCommentsStep(args: Parameters<typeof listGistCommentsCore>[0]) {\n \"use step\"\n return listGistCommentsCore(args)\n}\n\n/** List comments on a gist. */\nexport const listGistComments = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listGistCommentsDescription,\n inputSchema: listGistCommentsInputSchema,\n execute: async args => listGistCommentsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createGistStep(args: Parameters<typeof createGistCore>[0]) {\n \"use step\"\n return createGistCore(args)\n}\n\n/** Create a new gist with one or more files. Requires approval by default. */\nexport const createGist = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createGistDescription,\n needsApproval,\n inputSchema: createGistInputSchema,\n execute: async args => createGistStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function updateGistStep(args: Parameters<typeof updateGistCore>[0]) {\n \"use step\"\n return updateGistCore(args)\n}\n\n/** Update an existing gist. Requires approval by default. */\nexport const updateGist = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: updateGistDescription,\n needsApproval,\n inputSchema: updateGistInputSchema,\n execute: async args => updateGistStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function deleteGistStep(args: Parameters<typeof deleteGistCore>[0]) {\n \"use step\"\n return deleteGistCore(args)\n}\n\n/** Delete a gist permanently. Requires approval by default. */\nexport const deleteGist = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: deleteGistDescription,\n needsApproval,\n inputSchema: deleteGistInputSchema,\n execute: async args => deleteGistStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function createGistCommentStep(args: Parameters<typeof createGistCommentCore>[0]) {\n \"use step\"\n return createGistCommentCore(args)\n}\n\n/** Add a comment to a gist. Requires approval by default. */\nexport const createGistComment = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createGistCommentDescription,\n needsApproval,\n inputSchema: createGistCommentInputSchema,\n execute: async args => createGistCommentStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listWorkflowsInputSchema,\n listWorkflowsDescription,\n listWorkflowsCore,\n listWorkflowRunsInputSchema,\n listWorkflowRunsDescription,\n listWorkflowRunsCore,\n getWorkflowRunInputSchema,\n getWorkflowRunDescription,\n getWorkflowRunCore,\n listWorkflowJobsInputSchema,\n listWorkflowJobsDescription,\n listWorkflowJobsCore,\n triggerWorkflowInputSchema,\n triggerWorkflowDescription,\n triggerWorkflowCore,\n cancelWorkflowRunInputSchema,\n cancelWorkflowRunDescription,\n cancelWorkflowRunCore,\n rerunWorkflowRunInputSchema,\n rerunWorkflowRunDescription,\n rerunWorkflowRunCore,\n} from '../core/workflows'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listWorkflowsStep(args: Parameters<typeof listWorkflowsCore>[0]) {\n \"use step\"\n return listWorkflowsCore(args)\n}\n\n/** List GitHub Actions workflows in a repository. */\nexport const listWorkflows = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listWorkflowsDescription,\n inputSchema: listWorkflowsInputSchema,\n execute: async args => listWorkflowsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listWorkflowRunsStep(args: Parameters<typeof listWorkflowRunsCore>[0]) {\n \"use step\"\n return listWorkflowRunsCore(args)\n}\n\n/** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */\nexport const listWorkflowRuns = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listWorkflowRunsDescription,\n inputSchema: listWorkflowRunsInputSchema,\n execute: async args => listWorkflowRunsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function getWorkflowRunStep(args: Parameters<typeof getWorkflowRunCore>[0]) {\n \"use step\"\n return getWorkflowRunCore(args)\n}\n\n/** Get details of a specific workflow run including status, timing, and trigger info. */\nexport const getWorkflowRun = (token: GithubTokenInput): GithubTool =>\n tool({\n description: getWorkflowRunDescription,\n inputSchema: getWorkflowRunInputSchema,\n execute: async args => getWorkflowRunStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function listWorkflowJobsStep(args: Parameters<typeof listWorkflowJobsCore>[0]) {\n \"use step\"\n return listWorkflowJobsCore(args)\n}\n\n/** List jobs for a workflow run, including step-level status and timing. */\nexport const listWorkflowJobs = (token: GithubTokenInput): GithubTool =>\n tool({\n description: listWorkflowJobsDescription,\n inputSchema: listWorkflowJobsInputSchema,\n execute: async args => listWorkflowJobsStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function triggerWorkflowStep(args: Parameters<typeof triggerWorkflowCore>[0]) {\n \"use step\"\n return triggerWorkflowCore(args)\n}\n\n/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */\nexport const triggerWorkflow = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: triggerWorkflowDescription,\n needsApproval,\n inputSchema: triggerWorkflowInputSchema,\n execute: async args => triggerWorkflowStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function cancelWorkflowRunStep(args: Parameters<typeof cancelWorkflowRunCore>[0]) {\n \"use step\"\n return cancelWorkflowRunCore(args)\n}\n\n/** Cancel an in-progress workflow run. Requires approval by default. */\nexport const cancelWorkflowRun = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: cancelWorkflowRunDescription,\n needsApproval,\n inputSchema: cancelWorkflowRunInputSchema,\n execute: async args => cancelWorkflowRunStep({ token: await resolveGithubToken(token), ...args }),\n })\n\nasync function rerunWorkflowRunStep(args: Parameters<typeof rerunWorkflowRunCore>[0]) {\n \"use step\"\n return rerunWorkflowRunCore(args)\n}\n\n/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */\nexport const rerunWorkflowRun = (token: GithubTokenInput, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: rerunWorkflowRunDescription,\n needsApproval,\n inputSchema: rerunWorkflowRunInputSchema,\n execute: async args => rerunWorkflowRunStep({ token: await resolveGithubToken(token), ...args }),\n })\n","import type { GithubWriteToolName } from './write-tools'\n\n/**\n * Whether write operations require user approval.\n *\n * - `true` — all write tools need approval (default)\n * - `false` — no approval needed for any write tool\n * - object — per-tool override via {@link GithubWriteToolName}; unspecified write tools default to `true`\n *\n * @example Global disable\n * ```ts\n * createGithubTools({ token, requireApproval: false })\n * ```\n *\n * @example Granular per write tool\n * ```ts\n * createGithubTools({\n * token,\n * requireApproval: {\n * mergePullRequest: true,\n * createOrUpdateFile: true,\n * addPullRequestComment: false,\n * },\n * })\n * ```\n */\nexport type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>\n\n/**\n * Resolve whether a write tool requires approval for the AI SDK.\n *\n * @param toolName - The write tool to check.\n * @param config - Global or per-tool approval config.\n * @returns `true` when approval is required; defaults to `true` for unspecified write tools in object mode.\n */\nexport function resolveAiSdkApproval(toolName: GithubWriteToolName, config: ApprovalConfig): boolean {\n if (typeof config === 'boolean') return config\n return config[toolName] ?? true\n}\n","import { ToolLoopAgent } from 'ai'\nimport type { ToolLoopAgentSettings, ToolSet } from 'ai'\nimport { createGithubTools } from './index'\nimport type { AllGithubTools, GithubToolsBaseOptions } from './core/tool-types'\nimport type { CombinedPresetToolNames, GithubToolPreset, PresetToolName } from './core/presets'\nimport type { GithubToolName } from './core/tool-names'\n\nconst SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.`\n\nconst 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.\n\n${SHARED_RULES}`\n\nconst PRESET_INSTRUCTIONS: Record<GithubToolPreset, string> = {\n 'code-review': `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.\n\nWhen reviewing a PR:\n- Read the PR description and changed files carefully\n- 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\n- Check for bugs, logic errors, and edge cases\n- Suggest improvements when you spot issues\n- Be constructive — explain why something is a problem and how to fix it\n- Use listPullRequestFiles to see exactly which files changed before diving into details\n- Use createPullRequestReview to submit a formal review with inline comments on specific lines\n- Post your review as PR comments when asked\n\n${SHARED_RULES}`,\n\n 'issue-triage': `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.\n\nWhen triaging issues:\n- Read issue descriptions carefully to understand the problem\n- Identify duplicates when possible\n- Help categorize and prioritize issues\n- Respond to users with clear, helpful information\n- Use listLabels to see available labels, then addLabels and removeLabel to categorize issues\n- Create new issues when asked, with clear titles and descriptions\n\n${SHARED_RULES}`,\n\n 'ci-ops': `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.\n\nWhen working with workflows:\n- Check workflow run status and report failures clearly\n- Inspect job steps to identify exactly where a run failed\n- Re-run failed workflows when asked\n- Trigger workflow dispatches with the correct inputs and branch\n- Be careful with cancel and re-run operations — confirm the target run\n- Summarize run history and trends when asked\n\n${SHARED_RULES}`,\n\n 'repo-explorer': `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.\n\nWhen exploring repos:\n- Answer questions about code structure and organization\n- Use getBlame when the user asks about history or ownership of specific lines in a file\n- Summarize recent activity (commits, PRs, issues)\n- Find specific files, functions, or patterns in code\n- Explain how different parts of the codebase work together\n- You have read-only access — you cannot make changes\n\n${SHARED_RULES}`,\n\n 'maintainer': `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, gists, and workflows.\n\nWhen maintaining repos:\n- Be careful with write operations — review before acting\n- Create well-structured issues and PRs with clear descriptions\n- Use merge strategies appropriate for the repository\n- Keep commit messages clean and descriptive\n- When closing issues, provide a clear reason\n\n${SHARED_RULES}`\n}\n\nexport function resolveInstructions(options: {\n preset?: GithubToolPreset | GithubToolPreset[]\n instructions?: string\n additionalInstructions?: string\n}): string {\n const defaultPrompt = options.preset && !Array.isArray(options.preset)\n ? PRESET_INSTRUCTIONS[options.preset]\n : DEFAULT_INSTRUCTIONS\n\n if (options.instructions) return options.instructions\n if (options.additionalInstructions) return `${defaultPrompt}\\n\\n${options.additionalInstructions}`\n return defaultPrompt\n}\n\ntype AgentOptions = Omit<ToolLoopAgentSettings<ToolSet>, 'model' | 'tools' | 'instructions'>\n\nexport type CreateGithubAgentOptions = AgentOptions & GithubToolsBaseOptions & {\n model: ToolLoopAgentSettings<ToolSet>['model']\n /**\n * Restrict tools and system prompt to a predefined preset.\n *\n * Selects a subset of tools and, when a single preset is passed,\n * sets a matching system prompt. Combine presets with an array to merge tool sets.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n /**\n * Fully replace the default system prompt.\n * When set, `preset` system prompts and `additionalInstructions` are ignored.\n */\n instructions?: string\n /**\n * Append text to the preset-specific (or default) system prompt.\n * Ignored when `instructions` is set.\n */\n additionalInstructions?: string\n}\n\nexport function createGithubAgent(options: CreateGithubAgentOptions & { preset?: undefined }): ToolLoopAgent<never, AllGithubTools>\nexport function createGithubAgent<P extends GithubToolPreset>(\n options: CreateGithubAgentOptions & { preset: P },\n): ToolLoopAgent<never, Pick<AllGithubTools, PresetToolName<P>>>\nexport function createGithubAgent<P extends readonly GithubToolPreset[]>(\n options: CreateGithubAgentOptions & { preset: P },\n): ToolLoopAgent<never, Pick<AllGithubTools, CombinedPresetToolNames<P>>>\n\n/**\n * Create a pre-configured GitHub agent powered by the AI SDK's `ToolLoopAgent`.\n *\n * Returns a `ToolLoopAgent` instance with `.generate()` and `.stream()` methods.\n *\n * @example\n * ```ts\n * import { createGithubAgent } from '@github-tools/sdk'\n *\n * const agent = createGithubAgent({\n * model: 'anthropic/claude-sonnet-4.6',\n * token: process.env.GITHUB_TOKEN!,\n * preset: 'code-review',\n * })\n *\n * const result = await agent.generate({ prompt: 'Review PR #42 on vercel/ai' })\n * ```\n */\nexport function createGithubAgent({\n token,\n preset,\n requireApproval,\n instructions,\n additionalInstructions,\n author,\n committer,\n coAuthors,\n ...agentOptions\n}: CreateGithubAgentOptions): ToolLoopAgent<never, AllGithubTools | Pick<AllGithubTools, GithubToolName>> {\n const tools = createGithubTools({ token, requireApproval, preset, author, committer, coAuthors })\n\n return new ToolLoopAgent({\n ...agentOptions,\n tools,\n instructions: resolveInstructions({ preset, instructions, additionalInstructions }),\n } as ToolLoopAgentSettings<never, typeof tools>) as ToolLoopAgent<never, typeof tools>\n}\n","import type { ToolSet } from 'ai'\nimport { getRepository, listBranches, getFileContent, createBranch, forkRepository, createRepository, createOrUpdateFile } from './tools/repository'\nimport { listPullRequests, getPullRequest, createPullRequest, mergePullRequest, addPullRequestComment, listPullRequestFiles, listPullRequestReviews, createPullRequestReview } from './tools/pull-requests'\nimport { listIssues, getIssue, createIssue, addIssueComment, closeIssue, listLabels, addLabels, removeLabel } from './tools/issues'\nimport { searchCode, searchRepositories } from './tools/search'\nimport { listCommits, getCommit, getBlame } from './tools/commits'\nimport { listGists, getGist, listGistComments, createGist, updateGist, deleteGist, createGistComment } from './tools/gists'\nimport { listWorkflows, listWorkflowRuns, getWorkflowRun, listWorkflowJobs, triggerWorkflow, cancelWorkflowRun, rerunWorkflowRun } from './tools/workflows'\nimport { resolveAiSdkApproval } from './core/approval'\nimport { resolvePresetTools, type CombinedPresetToolNames, type GithubToolPreset, type PresetToolName } from './core/presets'\nimport { type GithubToolName } from './core/tool-names'\nimport { type AllGithubTools, type GithubToolsBaseOptions } from './core/tool-types'\nimport { createGithubTokenResolver } from './core/token'\nimport type { GithubWriteToolName } from './core/write-tools'\n\nexport type { GithubWriteToolName } from './core/write-tools'\nexport type { ApprovalConfig } from './core/approval'\nexport type { GithubToolPreset, PresetToolName, CombinedPresetToolNames } from './core/presets'\nexport type { GithubToolName } from './core/tool-names'\nexport type { AllGithubTools, GithubToolsForPreset, PickGithubTools } from './core/tool-types'\nexport { PRESET_TOOLS } from './core/presets'\nexport { GITHUB_TOOL_NAMES } from './core/tool-names'\nexport { GITHUB_WRITE_TOOLS } from './core/write-tools'\n\nexport type GithubToolsOptions = GithubToolsBaseOptions & {\n /**\n * Restrict the returned tools to a predefined preset.\n * Omit to get all tools.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n *\n * @example\n * ```ts\n * // Only code-review tools\n * createGithubTools({ token, preset: 'code-review' })\n *\n * // Combine presets\n * createGithubTools({ token, preset: ['code-review', 'issue-triage'] })\n * ```\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n}\n\nexport function createGithubTools(options?: GithubToolsBaseOptions & { preset?: undefined }): AllGithubTools\nexport function createGithubTools<P extends GithubToolPreset>(\n options: GithubToolsBaseOptions & { preset: P },\n): Pick<AllGithubTools, PresetToolName<P>>\nexport function createGithubTools<P extends readonly GithubToolPreset[]>(\n options: GithubToolsBaseOptions & { preset: P },\n): Pick<AllGithubTools, CombinedPresetToolNames<P>>\nexport function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>\n/**\n * Create a set of GitHub tools for the Vercel AI SDK.\n *\n * Write operations require user approval by default.\n * Control this globally or per-tool via `requireApproval`.\n * Use `preset` to get only the tools you need.\n *\n * @example\n * ```ts\n * // All tools (default)\n * createGithubTools({ token })\n *\n * // Code-review agent — only PR & commit tools\n * createGithubTools({ token, preset: 'code-review' })\n *\n * // Combine presets\n * createGithubTools({ token, preset: ['code-review', 'issue-triage'] })\n *\n * // Granular approval\n * createGithubTools({\n * token,\n * preset: 'maintainer',\n * requireApproval: {\n * mergePullRequest: true,\n * createOrUpdateFile: true,\n * addPullRequestComment: false,\n * }\n * })\n * ```\n */\nexport function createGithubTools({\n token,\n requireApproval = true,\n preset,\n overrides,\n author,\n committer,\n coAuthors,\n}: GithubToolsOptions = {}): AllGithubTools | Pick<AllGithubTools, GithubToolName> {\n const resolveToken = createGithubTokenResolver(token)\n const approval = (name: GithubWriteToolName) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) })\n const allowed = preset ? resolvePresetTools(preset) : null\n\n const allTools = {\n getRepository: getRepository(resolveToken),\n listBranches: listBranches(resolveToken),\n getFileContent: getFileContent(resolveToken),\n listPullRequests: listPullRequests(resolveToken),\n getPullRequest: getPullRequest(resolveToken),\n listIssues: listIssues(resolveToken),\n getIssue: getIssue(resolveToken),\n searchCode: searchCode(resolveToken),\n searchRepositories: searchRepositories(resolveToken),\n listCommits: listCommits(resolveToken),\n getCommit: getCommit(resolveToken),\n getBlame: getBlame(resolveToken),\n createBranch: createBranch(resolveToken, approval('createBranch')),\n forkRepository: forkRepository(resolveToken, approval('forkRepository')),\n createRepository: createRepository(resolveToken, approval('createRepository')),\n createOrUpdateFile: createOrUpdateFile(resolveToken, { ...approval('createOrUpdateFile'), author, committer, coAuthors }),\n createPullRequest: createPullRequest(resolveToken, approval('createPullRequest')),\n mergePullRequest: mergePullRequest(resolveToken, { ...approval('mergePullRequest'), coAuthors }),\n addPullRequestComment: addPullRequestComment(resolveToken, approval('addPullRequestComment')),\n listPullRequestFiles: listPullRequestFiles(resolveToken),\n listPullRequestReviews: listPullRequestReviews(resolveToken),\n createPullRequestReview: createPullRequestReview(resolveToken, approval('createPullRequestReview')),\n createIssue: createIssue(resolveToken, approval('createIssue')),\n addIssueComment: addIssueComment(resolveToken, approval('addIssueComment')),\n closeIssue: closeIssue(resolveToken, approval('closeIssue')),\n listLabels: listLabels(resolveToken),\n addLabels: addLabels(resolveToken, approval('addLabels')),\n removeLabel: removeLabel(resolveToken, approval('removeLabel')),\n listGists: listGists(resolveToken),\n getGist: getGist(resolveToken),\n listGistComments: listGistComments(resolveToken),\n createGist: createGist(resolveToken, approval('createGist')),\n updateGist: updateGist(resolveToken, approval('updateGist')),\n deleteGist: deleteGist(resolveToken, approval('deleteGist')),\n createGistComment: createGistComment(resolveToken, approval('createGistComment')),\n listWorkflows: listWorkflows(resolveToken),\n listWorkflowRuns: listWorkflowRuns(resolveToken),\n getWorkflowRun: getWorkflowRun(resolveToken),\n listWorkflowJobs: listWorkflowJobs(resolveToken),\n triggerWorkflow: triggerWorkflow(resolveToken, approval('triggerWorkflow')),\n cancelWorkflowRun: cancelWorkflowRun(resolveToken, approval('cancelWorkflowRun')),\n rerunWorkflowRun: rerunWorkflowRun(resolveToken, approval('rerunWorkflowRun')),\n } satisfies AllGithubTools\n\n if (overrides) {\n for (const [name, toolOverrides] of Object.entries(overrides)) {\n if (name in allTools && toolOverrides) {\n const key = name as keyof typeof allTools\n Object.assign(allTools, { [key]: { ...allTools[key], ...toolOverrides } })\n }\n }\n }\n\n if (!allowed) return allTools\n\n return Object.fromEntries(\n Object.entries(allTools).filter(([name]) => allowed.has(name as GithubToolName))\n ) as Pick<typeof allTools, GithubToolName>\n}\n\nexport type GithubTools = AllGithubTools & ToolSet\n\n// Re-export individual tool factories for cherry-picking\nexport { createOctokit } from './client'\nexport { getRepository, listBranches, getFileContent, createBranch, forkRepository, createRepository, createOrUpdateFile } from './tools/repository'\nexport { listPullRequests, getPullRequest, createPullRequest, mergePullRequest, addPullRequestComment, listPullRequestFiles, listPullRequestReviews, createPullRequestReview } from './tools/pull-requests'\nexport { listIssues, getIssue, createIssue, addIssueComment, closeIssue, listLabels, addLabels, removeLabel } from './tools/issues'\nexport { searchCode, searchRepositories } from './tools/search'\nexport { listCommits, getCommit, getBlame } from './tools/commits'\nexport { listGists, getGist, listGistComments, createGist, updateGist, deleteGist, createGistComment } from './tools/gists'\nexport { listWorkflows, listWorkflowRuns, getWorkflowRun, listWorkflowJobs, triggerWorkflow, cancelWorkflowRun, rerunWorkflowRun } from './tools/workflows'\nexport type { CommitIdentity, CommitToolOptions, GithubTool, Octokit, ToolOptions, ToolOverrides } from './types'\nexport type { GithubTokenInput } from './core/token'\nexport { resolveGithubToken } from './core/token'\nexport { createGithubAgent } from './agents'\nexport type { CreateGithubAgentOptions } from './agents'\n"],"mappings":";;;AA+BA,eAAe,kBAAkB,MAA+C;AAC9E;AACA,QAAO,kBAAkB,KAAK;;;AAIhC,MAAa,iBAAiB,UAC5B,KAAK;CACH,aAAa;CACb,aAAa;CACb,SAAS,OAAM,SAAQ,kBAAkB;EAAE,OAAO,MAAM,mBAAmB,MAAM;EAAE,GAAG;EAAM,CAAC;CAC9F,CAAC;AAEJ,eAAe,iBAAiB,MAA8C;AAC5E;AACA,QAAO,iBAAiB,KAAK;;;AAI/B,MAAa,gBAAgB,UAC3B,KAAK;CACH,aAAa;CACb,aAAa;CACb,SAAS,OAAM,SAAQ,iBAAiB;EAAE,OAAO,MAAM,mBAAmB,MAAM;EAAE,GAAG;EAAM,CAAC;CAC7F,CAAC;AAEJ,eAAe,mBAAmB,MAAgD;AAChF;AACA,QAAO,mBAAmB,KAAK;;;AAIjC,MAAa,kBAAkB,UAC7B,KAAK;C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