@github-tools/sdk 1.16.0 → 1.17.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.
Files changed (43) hide show
  1. package/README.md +18 -9
  2. package/dist/connect/eve.d.mts +2 -3
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +1 -1
  5. package/dist/connect.d.mts +19 -11
  6. package/dist/connect.d.mts.map +1 -1
  7. package/dist/connect.mjs +2 -2
  8. package/dist/{eve-runtime-Bu8Gy8CS.d.mts → eve-runtime-DwPFaBlj.d.mts} +5 -5
  9. package/dist/{eve-runtime-Bu8Gy8CS.d.mts.map → eve-runtime-DwPFaBlj.d.mts.map} +1 -1
  10. package/dist/{eve-runtime-Cfyy1tzp.mjs → eve-runtime-NBFRz1SB.mjs} +11 -10
  11. package/dist/eve-runtime-NBFRz1SB.mjs.map +1 -0
  12. package/dist/eve-runtime.d.mts +5 -5
  13. package/dist/eve-runtime.mjs +3 -3
  14. package/dist/eve.d.mts +55 -55
  15. package/dist/eve.d.mts.map +1 -1
  16. package/dist/eve.mjs +2 -2
  17. package/dist/{index-BOerqLIm.d.mts → index-DglfkoWk.d.mts} +35 -10
  18. package/dist/{index-BOerqLIm.d.mts.map → index-DglfkoWk.d.mts.map} +1 -1
  19. package/dist/index.d.mts +3 -3
  20. package/dist/index.mjs +3 -3
  21. package/dist/{src-C54blWpT.mjs → src-SH7fl4eI.mjs} +135 -99
  22. package/dist/src-SH7fl4eI.mjs.map +1 -0
  23. package/dist/{token-Iop2lapd.mjs → token-C4lAap1Y.mjs} +65 -10
  24. package/dist/token-C4lAap1Y.mjs.map +1 -0
  25. package/dist/{tool-types-DbZpOYFG.d.mts → tool-types-DcfQIOAY.d.mts} +987 -38
  26. package/dist/tool-types-DcfQIOAY.d.mts.map +1 -0
  27. package/dist/{types-v39VrZ-m.d.mts → types-6nsCJ0Pu.d.mts} +19 -8
  28. package/dist/types-6nsCJ0Pu.d.mts.map +1 -0
  29. package/dist/{types-CCoH12WC.d.mts → types-vuvgvlL-.d.mts} +2 -2
  30. package/dist/{types-CCoH12WC.d.mts.map → types-vuvgvlL-.d.mts.map} +1 -1
  31. package/dist/workflow.d.mts +14 -12
  32. package/dist/workflow.d.mts.map +1 -1
  33. package/dist/workflow.mjs +2 -2
  34. package/dist/workflow.mjs.map +1 -1
  35. package/dist/{write-tools-BvuWAzwo.mjs → write-tools-BidBkLtv.mjs} +2388 -2216
  36. package/dist/write-tools-BidBkLtv.mjs.map +1 -0
  37. package/package.json +14 -14
  38. package/dist/eve-runtime-Cfyy1tzp.mjs.map +0 -1
  39. package/dist/src-C54blWpT.mjs.map +0 -1
  40. package/dist/token-Iop2lapd.mjs.map +0 -1
  41. package/dist/tool-types-DbZpOYFG.d.mts.map +0 -1
  42. package/dist/types-v39VrZ-m.d.mts.map +0 -1
  43. package/dist/write-tools-BvuWAzwo.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $ as getWorkflowJobLogsInputSchema, $i as listBranchesCore, $n as deleteIssueCommentInputSchema, $r as listPullRequestReviewsInputSchema, $t as searchCodeInputSchema, A as getLatestReleaseCore, Ai as createBranchDescription, An as listIssueReactionsCore, Ar as addPullRequestCommentCore, At as listGistCommentsCore, B as updateReleaseDescription, Bi as deleteBranchInputSchema, Bn as addLabelsDescription, Br as deletePullRequestCommentDescription, Bt as compareCommitsDescription, C as getReleaseContextInputSchema, Ci as compareCommitsToModelOutput, Cn as addCommentReactionInputSchema, Cr as updateIssueCommentInputSchema, Ct as createGistInputSchema, D as deleteReleaseCore, Di as getRepositoryTreeToModelOutput, Dn as listCommentReactionsCore, Dr as updateLabelCore, Dt as getGistCore, E as createReleaseInputSchema, Ei as getPullRequestContextToModelOutput, En as addIssueReactionInputSchema, Er as updateIssueInputSchema, Et as deleteGistInputSchema, F as getReleaseInputSchema, Fi as createRepositoryCore, Fn as addAssigneesInputSchema, Fr as createPullRequestInputSchema, Ft as listGistsInputSchema, G as listCheckRunsCore, Gi as getFileContentDescription, Gn as createIssueCore, Gr as listPullRequestFilesCore, Gt as getCommitCore, H as getCombinedStatusCore, Hi as forkRepositoryDescription, Hn as closeIssueCore, Hr as getPullRequestCore, Ht as getBlameCore, I as listReleasesCore, Ii as createRepositoryDescription, In as addIssueCommentCore, Ir as createPullRequestReviewCore, It as updateGistCore, J as cancelWorkflowRunCore, Ji as getRepositoryDescription, Jn as createLabelCore, Jr as listPullRequestReviewThreadsCore, Jt as listCommitsCore, K as listCheckRunsDescription, Ki as getFileContentInputSchema, Kn as createIssueDescription, Kr as listPullRequestFilesDescription, Kt as getCommitDescription, L as listReleasesDescription, Li as createRepositoryInputSchema, Ln as addIssueCommentDescription, Lr as createPullRequestReviewDescription, Lt as updateGistDescription, M as getLatestReleaseInputSchema, Mi as createOrUpdateFileCore, Mn as listIssueReactionsInputSchema, Mr as addPullRequestCommentInputSchema, Mt as listGistCommentsInputSchema, N as getReleaseCore, Ni as createOrUpdateFileDescription, Nn as addAssigneesCore, Nr as createPullRequestCore, Nt as listGistsCore, O as deleteReleaseDescription, Oi as listPullRequestFilesToModelOutput, On as listCommentReactionsDescription, Or as updateLabelDescription, Ot as getGistDescription, P as getReleaseDescription, Pi as createOrUpdateFileInputSchema, Pn as addAssigneesDescription, Pr as createPullRequestDescription, Pt as listGistsDescription, Q as getWorkflowJobLogsDescription, Qi as getRepositoryTreeInputSchema, Qn as deleteIssueCommentDescription, Qr as listPullRequestReviewsDescription, Qt as searchCodeDescription, R as listReleasesInputSchema, Ri as deleteBranchCore, Rn as addIssueCommentInputSchema, Rr as createPullRequestReviewInputSchema, Rt as updateGistInputSchema, S as getReleaseContextDescription, Si as resolveGithubToken, Sn as addCommentReactionDescription, Sr as updateIssueCommentDescription, St as createGistDescription, T as createReleaseDescription, Ti as getFileContentToModelOutput, Tn as addIssueReactionDescription, Tr as updateIssueDescription, Tt as deleteGistDescription, U as getCombinedStatusDescription, Ui as forkRepositoryInputSchema, Un as closeIssueDescription, Ur as getPullRequestDescription, Ut as getBlameDescription, V as updateReleaseInputSchema, Vi as forkRepositoryCore, Vn as addLabelsInputSchema, Vr as deletePullRequestCommentInputSchema, Vt as compareCommitsInputSchema, W as getCombinedStatusInputSchema, Wi as getFileContentCore, Wn as closeIssueInputSchema, Wr as getPullRequestInputSchema, Wt as getBlameInputSchema, X as cancelWorkflowRunInputSchema, Xi as getRepositoryTreeCore, Xn as createLabelInputSchema, Xr as listPullRequestReviewThreadsInputSchema, Xt as listCommitsInputSchema, Y as cancelWorkflowRunDescription, Yi as getRepositoryInputSchema, Yn as createLabelDescription, Yr as listPullRequestReviewThreadsDescription, Yt as listCommitsDescription, Z as getWorkflowJobLogsCore, Zi as getRepositoryTreeDescription, Zn as deleteIssueCommentCore, Zr as listPullRequestReviewsCore, Zt as searchCodeCore, _ as getIssueContextInputSchema, _i as updatePullRequestCommentInputSchema, _n as getDiscussionInputSchema, _r as removeAssigneesInputSchema, _t as triggerWorkflowInputSchema, ai as mergePullRequestInputSchema, an as searchRepositoriesInputSchema, ar as getIssueInputSchema, at as listWorkflowJobsInputSchema, b as getPullRequestContextInputSchema, bi as updatePullRequestInputSchema, bn as listDiscussionsInputSchema, br as removeLabelInputSchema, bt as createGistCommentInputSchema, c as bindToolsContext, ci as replyToReviewCommentInputSchema, cn as listNotificationsInputSchema, cr as listIssueCommentsInputSchema, ct as listWorkflowRunsInputSchema, di as requestReviewersInputSchema, dn as markNotificationReadInputSchema, dr as listIssuesInputSchema, dt as listWorkflowsInputSchema, ea as listBranchesDescription, ei as listPullRequestsCore, en as searchIssuesCore, er as deleteLabelCore, et as getWorkflowRunCore, f as getCiFailureContextCore, fi as resolveReviewThreadCore, fn as addDiscussionCommentCore, fr as listLabelsCore, ft as rerunWorkflowRunCore, g as getIssueContextDescription, gi as updatePullRequestCommentDescription, gn as getDiscussionDescription, gr as removeAssigneesDescription, gt as triggerWorkflowDescription, h as getIssueContextCore, hi as updatePullRequestCommentCore, hn as getDiscussionCore, hr as removeAssigneesCore, ht as triggerWorkflowCore, ii as mergePullRequestDescription, in as searchRepositoriesDescription, ir as getIssueDescription, it as listWorkflowJobsDescription, j as getLatestReleaseDescription, ji as createBranchInputSchema, jn as listIssueReactionsDescription, jr as addPullRequestCommentDescription, jt as listGistCommentsDescription, k as deleteReleaseInputSchema, ki as createBranchCore, kn as listCommentReactionsInputSchema, kr as updateLabelInputSchema, kt as getGistInputSchema, l as formatContextInstructions, li as requestReviewersCore, ln as markNotificationReadCore, lr as listIssuesCore, lt as listWorkflowsCore, m as getCiFailureContextInputSchema, mi as resolveReviewThreadInputSchema, mn as addDiscussionCommentInputSchema, mr as listLabelsInputSchema, mt as rerunWorkflowRunInputSchema, ni as listPullRequestsInputSchema, nn as searchIssuesInputSchema, nr as deleteLabelInputSchema, nt as getWorkflowRunInputSchema, oa as stripRateLimit, oi as replyToReviewCommentCore, on as listNotificationsCore, or as listIssueCommentsCore, ot as listWorkflowRunsCore, p as getCiFailureContextDescription, pi as resolveReviewThreadDescription, pn as addDiscussionCommentDescription, pr as listLabelsDescription, pt as rerunWorkflowRunDescription, q as listCheckRunsInputSchema, qi as getRepositoryCore, qn as createIssueInputSchema, qr as listPullRequestFilesInputSchema, qt as getCommitInputSchema, ri as mergePullRequestCore, rn as searchRepositoriesCore, rr as getIssueCore, rt as listWorkflowJobsCore, s as resolvePresetTools, si as replyToReviewCommentDescription, sn as listNotificationsDescription, sr as listIssueCommentsDescription, st as listWorkflowRunsDescription, ta as listBranchesInputSchema, ti as listPullRequestsDescription, tn as searchIssuesDescription, tr as deleteLabelDescription, tt as getWorkflowRunDescription, ui as requestReviewersDescription, un as markNotificationReadDescription, ur as listIssuesDescription, ut as listWorkflowsDescription, v as getPullRequestContextCore, vi as updatePullRequestCore, vn as listDiscussionsCore, vr as removeLabelCore, vt as createGistCommentCore, w as createReleaseCore, wi as getCommitToModelOutput, wn as addIssueReactionCore, wr as updateIssueCore, wt as deleteGistCore, x as getReleaseContextCore, xi as createGithubTokenResolver, xn as addCommentReactionCore, xr as updateIssueCommentCore, xt as createGistCore, y as getPullRequestContextDescription, yi as updatePullRequestDescription, yn as listDiscussionsDescription, yr as removeLabelDescription, yt as createGistCommentDescription, z as updateReleaseCore, zi as deleteBranchDescription, zn as addLabelsCore, zr as deletePullRequestCommentCore, zt as compareCommitsCore } from "./write-tools-BvuWAzwo.mjs";
1
+ import { $ as deleteGistCore, $i as getRepositoryCore, $n as replyToReviewCommentCore, $r as removeLabelCore, $t as rerunWorkflowRunCore, A as addCommentReactionDescription, Ai as getCommitToModelOutput, An as createPullRequestReviewDescription, Ar as createLabelDescription, At as getPullRequestContextDescription, B as listIssueReactionsInputSchema, Bi as createOrUpdateFileInputSchema, Bn as listPullRequestFilesInputSchema, Br as getIssueInputSchema, Bt as getWorkflowJobLogsInputSchema, C as searchIssuesCore, Ci as getCombinedStatusCore, Cn as addPullRequestCommentCore, Cr as closeIssueCore, Ct as getCiFailureContextCore, D as searchRepositoriesDescription, Di as listCheckRunsDescription, Dn as createPullRequestDescription, Dr as createIssueDescription, Dt as getIssueContextDescription, E as searchRepositoriesCore, Ei as listCheckRunsCore, En as createPullRequestCore, Er as createIssueCore, Et as getIssueContextCore, F as listCommentReactionsCore, Fi as createBranchCore, Fn as getPullRequestCore, Fr as deleteLabelCore, Ft as cancelWorkflowRunCore, G as markNotificationReadDescription, Gi as deleteBranchDescription, Gn as listPullRequestReviewsDescription, Gr as listIssuesDescription, Gt as listWorkflowJobsDescription, H as listNotificationsDescription, Hi as createRepositoryDescription, Hn as listPullRequestReviewThreadsDescription, Hr as listIssueCommentsDescription, Ht as getWorkflowRunDescription, I as listCommentReactionsDescription, Ii as createBranchDescription, In as getPullRequestDescription, Ir as deleteLabelDescription, It as cancelWorkflowRunDescription, J as createGistCommentDescription, Ji as forkRepositoryDescription, Jn as listPullRequestsDescription, Jr as listLabelsDescription, Jt as listWorkflowRunsDescription, K as markNotificationReadInputSchema, Ki as deleteBranchInputSchema, Kn as listPullRequestReviewsInputSchema, Kr as listIssuesInputSchema, Kt as listWorkflowJobsInputSchema, L as listCommentReactionsInputSchema, Li as createBranchInputSchema, Ln as getPullRequestInputSchema, Lr as deleteLabelInputSchema, Lt as cancelWorkflowRunInputSchema, M as addIssueReactionCore, Mi as getPullRequestContextToModelOutput, Mn as deletePullRequestCommentCore, Mr as deleteIssueCommentCore, Mt as getReleaseContextCore, N as addIssueReactionDescription, Ni as getRepositoryTreeToModelOutput, Nn as deletePullRequestCommentDescription, Nr as deleteIssueCommentDescription, Nt as getReleaseContextDescription, O as searchRepositoriesInputSchema, Oi as listCheckRunsInputSchema, On as createPullRequestInputSchema, Or as createIssueInputSchema, Ot as getIssueContextInputSchema, P as addIssueReactionInputSchema, Pi as listPullRequestFilesToModelOutput, Pn as deletePullRequestCommentInputSchema, Pr as deleteIssueCommentInputSchema, Pt as getReleaseContextInputSchema, Q as createGistInputSchema, Qi as getFileContentInputSchema, Qn as mergePullRequestInputSchema, Qr as removeAssigneesInputSchema, Qt as listWorkflowsInputSchema, R as listIssueReactionsCore, Ri as createOrUpdateFileCore, Rn as listPullRequestFilesCore, Rr as getIssueCore, Rt as getWorkflowJobLogsCore, S as searchCodeInputSchema, Si as listCommitsInputSchema, Sn as updateReleaseInputSchema, Sr as addLabelsInputSchema, St as listDiscussionsInputSchema, T as searchIssuesInputSchema, Ti as getCombinedStatusInputSchema, Tn as addPullRequestCommentInputSchema, Tr as closeIssueInputSchema, Tt as getCiFailureContextInputSchema, U as listNotificationsInputSchema, Ui as createRepositoryInputSchema, Un as listPullRequestReviewThreadsInputSchema, Ur as listIssueCommentsInputSchema, Ut as getWorkflowRunInputSchema, V as listNotificationsCore, Vi as createRepositoryCore, Vn as listPullRequestReviewThreadsCore, Vr as listIssueCommentsCore, Vt as getWorkflowRunCore, W as markNotificationReadCore, Wi as deleteBranchCore, Wn as listPullRequestReviewsCore, Wr as listIssuesCore, Wt as listWorkflowJobsCore, X as createGistCore, Xi as getFileContentCore, Xn as mergePullRequestCore, Xr as removeAssigneesCore, Xt as listWorkflowsCore, Y as createGistCommentInputSchema, Yi as forkRepositoryInputSchema, Yn as listPullRequestsInputSchema, Yr as listLabelsInputSchema, Yt as listWorkflowRunsInputSchema, Z as createGistDescription, Zi as getFileContentDescription, Zn as mergePullRequestDescription, Zr as removeAssigneesDescription, Zt as listWorkflowsDescription, _i as getCommitCore, _n as listReleasesCore, _r as addIssueCommentCore, _t as getDiscussionCore, aa as listBranchesCore, ai as updateIssueCore, an as createReleaseCore, ar as resolveReviewThreadCore, at as listGistCommentsCore, b as searchCodeCore, bi as listCommitsCore, bn as updateReleaseCore, br as addLabelsCore, bt as listDiscussionsCore, ci as updateLabelCore, cn as deleteReleaseCore, cr as updatePullRequestCommentCore, ct as listGistsCore, d as selectPresets, di as compareCommitsCore, dn as getLatestReleaseCore, dr as updatePullRequestCore, dt as updateGistCore, ea as getRepositoryDescription, ei as removeLabelDescription, en as rerunWorkflowRunDescription, er as replyToReviewCommentDescription, et as deleteGistDescription, fa as stripRateLimit, fi as compareCommitsDescription, fn as getLatestReleaseDescription, fr as updatePullRequestDescription, ft as updateGistDescription, g as resolveGithubToken, gi as getBlameInputSchema, gn as getReleaseInputSchema, gr as addAssigneesInputSchema, gt as addDiscussionCommentInputSchema, h as githubTokenCall, hi as getBlameDescription, hn as getReleaseDescription, hr as addAssigneesDescription, ht as addDiscussionCommentDescription, i as formatContextInstructions, ia as getRepositoryTreeInputSchema, ii as updateIssueCommentInputSchema, in as triggerWorkflowInputSchema, ir as requestReviewersInputSchema, it as getGistInputSchema, j as addCommentReactionInputSchema, ji as getFileContentToModelOutput, jn as createPullRequestReviewInputSchema, jr as createLabelInputSchema, jt as getPullRequestContextInputSchema, k as addCommentReactionCore, ki as compareCommitsToModelOutput, kn as createPullRequestReviewCore, kr as createLabelCore, kt as getPullRequestContextCore, li as updateLabelDescription, ln as deleteReleaseDescription, lr as updatePullRequestCommentDescription, lt as listGistsDescription, m as createGithubTokenResolver, mi as getBlameCore, mn as getReleaseCore, mr as addAssigneesCore, mt as addDiscussionCommentCore, na as getRepositoryTreeCore, ni as updateIssueCommentCore, nn as triggerWorkflowCore, nr as requestReviewersCore, nt as getGistCore, oa as listBranchesDescription, oi as updateIssueDescription, on as createReleaseDescription, or as resolveReviewThreadDescription, ot as listGistCommentsDescription, p as resolvePresetTools, pi as compareCommitsInputSchema, pn as getLatestReleaseInputSchema, pr as updatePullRequestInputSchema, pt as updateGistInputSchema, q as createGistCommentCore, qi as forkRepositoryCore, qn as listPullRequestsCore, qr as listLabelsCore, qt as listWorkflowRunsCore, r as bindToolsContext, ra as getRepositoryTreeDescription, ri as updateIssueCommentDescription, rn as triggerWorkflowDescription, rr as requestReviewersDescription, rt as getGistDescription, s as AUTO_APPROVAL_TOOLS, sa as listBranchesInputSchema, si as updateIssueInputSchema, sn as createReleaseInputSchema, sr as resolveReviewThreadInputSchema, st as listGistCommentsInputSchema, ta as getRepositoryInputSchema, ti as removeLabelInputSchema, tn as rerunWorkflowRunInputSchema, tr as replyToReviewCommentInputSchema, tt as deleteGistInputSchema, u as needsAutoApproval, ui as updateLabelInputSchema, un as deleteReleaseInputSchema, ur as updatePullRequestCommentInputSchema, ut as listGistsInputSchema, vi as getCommitDescription, vn as listReleasesDescription, vr as addIssueCommentDescription, vt as getDiscussionDescription, w as searchIssuesDescription, wi as getCombinedStatusDescription, wn as addPullRequestCommentDescription, wr as closeIssueDescription, wt as getCiFailureContextDescription, x as searchCodeDescription, xi as listCommitsDescription, xn as updateReleaseDescription, xr as addLabelsDescription, xt as listDiscussionsDescription, yi as getCommitInputSchema, yn as listReleasesInputSchema, yr as addIssueCommentInputSchema, yt as getDiscussionInputSchema, z as listIssueReactionsDescription, zi as createOrUpdateFileDescription, zn as listPullRequestFilesDescription, zr as getIssueDescription, zt as getWorkflowJobLogsDescription } from "./write-tools-BidBkLtv.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: await resolveGithubToken(token),
13
+ token: await resolveGithubToken(token, githubTokenCall("getRepository", args)),
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: await resolveGithubToken(token),
26
+ token: await resolveGithubToken(token, githubTokenCall("listBranches", args)),
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: await resolveGithubToken(token),
40
+ token: await resolveGithubToken(token, githubTokenCall("getFileContent", args)),
41
41
  ...args
42
42
  })
43
43
  });
@@ -51,7 +51,7 @@ const getRepositoryTree = (token) => tool({
51
51
  inputSchema: getRepositoryTreeInputSchema,
52
52
  toModelOutput: getRepositoryTreeToModelOutput,
53
53
  execute: async (args) => getRepositoryTreeStep({
54
- token: await resolveGithubToken(token),
54
+ token: await resolveGithubToken(token, githubTokenCall("getRepositoryTree", args)),
55
55
  ...args
56
56
  })
57
57
  });
@@ -65,7 +65,7 @@ const createBranch = (token, { needsApproval = true } = {}) => tool({
65
65
  needsApproval,
66
66
  inputSchema: createBranchInputSchema,
67
67
  execute: async (args) => createBranchStep({
68
- token: await resolveGithubToken(token),
68
+ token: await resolveGithubToken(token, githubTokenCall("createBranch", args)),
69
69
  ...args
70
70
  })
71
71
  });
@@ -79,7 +79,7 @@ const deleteBranch = (token, { needsApproval = true } = {}) => tool({
79
79
  needsApproval,
80
80
  inputSchema: deleteBranchInputSchema,
81
81
  execute: async (args) => deleteBranchStep({
82
- token: await resolveGithubToken(token),
82
+ token: await resolveGithubToken(token, githubTokenCall("deleteBranch", args)),
83
83
  ...args
84
84
  })
85
85
  });
@@ -93,7 +93,7 @@ const forkRepository = (token, { needsApproval = true } = {}) => tool({
93
93
  needsApproval,
94
94
  inputSchema: forkRepositoryInputSchema,
95
95
  execute: async (args) => forkRepositoryStep({
96
- token: await resolveGithubToken(token),
96
+ token: await resolveGithubToken(token, githubTokenCall("forkRepository", args)),
97
97
  ...args
98
98
  })
99
99
  });
@@ -107,7 +107,7 @@ const createRepository = (token, { needsApproval = true } = {}) => tool({
107
107
  needsApproval,
108
108
  inputSchema: createRepositoryInputSchema,
109
109
  execute: async (args) => createRepositoryStep({
110
- token: await resolveGithubToken(token),
110
+ token: await resolveGithubToken(token, githubTokenCall("createRepository", args)),
111
111
  ...args
112
112
  })
113
113
  });
@@ -121,7 +121,7 @@ const createOrUpdateFile = (token, { needsApproval = true, author, committer, co
121
121
  needsApproval,
122
122
  inputSchema: createOrUpdateFileInputSchema,
123
123
  execute: async (args) => createOrUpdateFileStep({
124
- token: await resolveGithubToken(token),
124
+ token: await resolveGithubToken(token, githubTokenCall("createOrUpdateFile", args)),
125
125
  author,
126
126
  committer,
127
127
  coAuthors,
@@ -139,7 +139,7 @@ const listPullRequests = (token) => tool({
139
139
  description: listPullRequestsDescription,
140
140
  inputSchema: listPullRequestsInputSchema,
141
141
  execute: async (args) => listPullRequestsStep({
142
- token: await resolveGithubToken(token),
142
+ token: await resolveGithubToken(token, githubTokenCall("listPullRequests", args)),
143
143
  ...args
144
144
  })
145
145
  });
@@ -152,7 +152,7 @@ const getPullRequest = (token) => tool({
152
152
  description: getPullRequestDescription,
153
153
  inputSchema: getPullRequestInputSchema,
154
154
  execute: async (args) => getPullRequestStep({
155
- token: await resolveGithubToken(token),
155
+ token: await resolveGithubToken(token, githubTokenCall("getPullRequest", args)),
156
156
  ...args
157
157
  })
158
158
  });
@@ -166,7 +166,7 @@ const createPullRequest = (token, { needsApproval = true } = {}) => tool({
166
166
  needsApproval,
167
167
  inputSchema: createPullRequestInputSchema,
168
168
  execute: async (args) => createPullRequestStep({
169
- token: await resolveGithubToken(token),
169
+ token: await resolveGithubToken(token, githubTokenCall("createPullRequest", args)),
170
170
  ...args
171
171
  })
172
172
  });
@@ -180,7 +180,7 @@ const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => to
180
180
  needsApproval,
181
181
  inputSchema: mergePullRequestInputSchema,
182
182
  execute: async (args) => mergePullRequestStep({
183
- token: await resolveGithubToken(token),
183
+ token: await resolveGithubToken(token, githubTokenCall("mergePullRequest", args)),
184
184
  coAuthors,
185
185
  ...args
186
186
  })
@@ -195,7 +195,7 @@ const updatePullRequest = (token, { needsApproval = true } = {}) => tool({
195
195
  needsApproval,
196
196
  inputSchema: updatePullRequestInputSchema,
197
197
  execute: async (args) => updatePullRequestStep({
198
- token: await resolveGithubToken(token),
198
+ token: await resolveGithubToken(token, githubTokenCall("updatePullRequest", args)),
199
199
  ...args
200
200
  })
201
201
  });
@@ -209,7 +209,7 @@ const addPullRequestComment = (token, { needsApproval = true } = {}) => tool({
209
209
  needsApproval,
210
210
  inputSchema: addPullRequestCommentInputSchema,
211
211
  execute: async (args) => addPullRequestCommentStep({
212
- token: await resolveGithubToken(token),
212
+ token: await resolveGithubToken(token, githubTokenCall("addPullRequestComment", args)),
213
213
  ...args
214
214
  })
215
215
  });
@@ -223,7 +223,7 @@ const updatePullRequestComment = (token, { needsApproval = true } = {}) => tool(
223
223
  needsApproval,
224
224
  inputSchema: updatePullRequestCommentInputSchema,
225
225
  execute: async (args) => updatePullRequestCommentStep({
226
- token: await resolveGithubToken(token),
226
+ token: await resolveGithubToken(token, githubTokenCall("updatePullRequestComment", args)),
227
227
  ...args
228
228
  })
229
229
  });
@@ -237,7 +237,7 @@ const deletePullRequestComment = (token, { needsApproval = true } = {}) => tool(
237
237
  needsApproval,
238
238
  inputSchema: deletePullRequestCommentInputSchema,
239
239
  execute: async (args) => deletePullRequestCommentStep({
240
- token: await resolveGithubToken(token),
240
+ token: await resolveGithubToken(token, githubTokenCall("deletePullRequestComment", args)),
241
241
  ...args
242
242
  })
243
243
  });
@@ -251,7 +251,7 @@ const listPullRequestFiles = (token) => tool({
251
251
  inputSchema: listPullRequestFilesInputSchema,
252
252
  toModelOutput: listPullRequestFilesToModelOutput,
253
253
  execute: async (args) => listPullRequestFilesStep({
254
- token: await resolveGithubToken(token),
254
+ token: await resolveGithubToken(token, githubTokenCall("listPullRequestFiles", args)),
255
255
  ...args
256
256
  })
257
257
  });
@@ -264,7 +264,7 @@ const listPullRequestReviews = (token) => tool({
264
264
  description: listPullRequestReviewsDescription,
265
265
  inputSchema: listPullRequestReviewsInputSchema,
266
266
  execute: async (args) => listPullRequestReviewsStep({
267
- token: await resolveGithubToken(token),
267
+ token: await resolveGithubToken(token, githubTokenCall("listPullRequestReviews", args)),
268
268
  ...args
269
269
  })
270
270
  });
@@ -278,7 +278,7 @@ const createPullRequestReview = (token, { needsApproval = true } = {}) => tool({
278
278
  needsApproval,
279
279
  inputSchema: createPullRequestReviewInputSchema,
280
280
  execute: async (args) => createPullRequestReviewStep({
281
- token: await resolveGithubToken(token),
281
+ token: await resolveGithubToken(token, githubTokenCall("createPullRequestReview", args)),
282
282
  ...args
283
283
  })
284
284
  });
@@ -291,7 +291,7 @@ const listPullRequestReviewThreads = (token) => tool({
291
291
  description: listPullRequestReviewThreadsDescription,
292
292
  inputSchema: listPullRequestReviewThreadsInputSchema,
293
293
  execute: async (args) => listPullRequestReviewThreadsStep({
294
- token: await resolveGithubToken(token),
294
+ token: await resolveGithubToken(token, githubTokenCall("listPullRequestReviewThreads", args)),
295
295
  ...args
296
296
  })
297
297
  });
@@ -305,7 +305,7 @@ const replyToReviewComment = (token, { needsApproval = true } = {}) => tool({
305
305
  needsApproval,
306
306
  inputSchema: replyToReviewCommentInputSchema,
307
307
  execute: async (args) => replyToReviewCommentStep({
308
- token: await resolveGithubToken(token),
308
+ token: await resolveGithubToken(token, githubTokenCall("replyToReviewComment", args)),
309
309
  ...args
310
310
  })
311
311
  });
@@ -319,7 +319,7 @@ const resolveReviewThread = (token, { needsApproval = true } = {}) => tool({
319
319
  needsApproval,
320
320
  inputSchema: resolveReviewThreadInputSchema,
321
321
  execute: async (args) => resolveReviewThreadStep({
322
- token: await resolveGithubToken(token),
322
+ token: await resolveGithubToken(token, githubTokenCall("resolveReviewThread", args)),
323
323
  ...args
324
324
  })
325
325
  });
@@ -333,7 +333,7 @@ const requestReviewers = (token, { needsApproval = true } = {}) => tool({
333
333
  needsApproval,
334
334
  inputSchema: requestReviewersInputSchema,
335
335
  execute: async (args) => requestReviewersStep({
336
- token: await resolveGithubToken(token),
336
+ token: await resolveGithubToken(token, githubTokenCall("requestReviewers", args)),
337
337
  ...args
338
338
  })
339
339
  });
@@ -348,7 +348,7 @@ const listIssues = (token) => tool({
348
348
  description: listIssuesDescription,
349
349
  inputSchema: listIssuesInputSchema,
350
350
  execute: async (args) => listIssuesStep({
351
- token: await resolveGithubToken(token),
351
+ token: await resolveGithubToken(token, githubTokenCall("listIssues", args)),
352
352
  ...args
353
353
  })
354
354
  });
@@ -361,7 +361,7 @@ const getIssue = (token) => tool({
361
361
  description: getIssueDescription,
362
362
  inputSchema: getIssueInputSchema,
363
363
  execute: async (args) => getIssueStep({
364
- token: await resolveGithubToken(token),
364
+ token: await resolveGithubToken(token, githubTokenCall("getIssue", args)),
365
365
  ...args
366
366
  })
367
367
  });
@@ -374,7 +374,7 @@ const listIssueComments = (token) => tool({
374
374
  description: listIssueCommentsDescription,
375
375
  inputSchema: listIssueCommentsInputSchema,
376
376
  execute: async (args) => listIssueCommentsStep({
377
- token: await resolveGithubToken(token),
377
+ token: await resolveGithubToken(token, githubTokenCall("listIssueComments", args)),
378
378
  ...args
379
379
  })
380
380
  });
@@ -388,7 +388,7 @@ const createIssue = (token, { needsApproval = true } = {}) => tool({
388
388
  needsApproval,
389
389
  inputSchema: createIssueInputSchema,
390
390
  execute: async (args) => createIssueStep({
391
- token: await resolveGithubToken(token),
391
+ token: await resolveGithubToken(token, githubTokenCall("createIssue", args)),
392
392
  ...args
393
393
  })
394
394
  });
@@ -402,7 +402,7 @@ const addIssueComment = (token, { needsApproval = true } = {}) => tool({
402
402
  needsApproval,
403
403
  inputSchema: addIssueCommentInputSchema,
404
404
  execute: async (args) => addIssueCommentStep({
405
- token: await resolveGithubToken(token),
405
+ token: await resolveGithubToken(token, githubTokenCall("addIssueComment", args)),
406
406
  ...args
407
407
  })
408
408
  });
@@ -416,7 +416,7 @@ const closeIssue = (token, { needsApproval = true } = {}) => tool({
416
416
  needsApproval,
417
417
  inputSchema: closeIssueInputSchema,
418
418
  execute: async (args) => closeIssueStep({
419
- token: await resolveGithubToken(token),
419
+ token: await resolveGithubToken(token, githubTokenCall("closeIssue", args)),
420
420
  ...args
421
421
  })
422
422
  });
@@ -430,7 +430,7 @@ const updateIssue = (token, { needsApproval = true } = {}) => tool({
430
430
  needsApproval,
431
431
  inputSchema: updateIssueInputSchema,
432
432
  execute: async (args) => updateIssueStep({
433
- token: await resolveGithubToken(token),
433
+ token: await resolveGithubToken(token, githubTokenCall("updateIssue", args)),
434
434
  ...args
435
435
  })
436
436
  });
@@ -444,7 +444,7 @@ const updateIssueComment = (token, { needsApproval = true } = {}) => tool({
444
444
  needsApproval,
445
445
  inputSchema: updateIssueCommentInputSchema,
446
446
  execute: async (args) => updateIssueCommentStep({
447
- token: await resolveGithubToken(token),
447
+ token: await resolveGithubToken(token, githubTokenCall("updateIssueComment", args)),
448
448
  ...args
449
449
  })
450
450
  });
@@ -458,7 +458,7 @@ const deleteIssueComment = (token, { needsApproval = true } = {}) => tool({
458
458
  needsApproval,
459
459
  inputSchema: deleteIssueCommentInputSchema,
460
460
  execute: async (args) => deleteIssueCommentStep({
461
- token: await resolveGithubToken(token),
461
+ token: await resolveGithubToken(token, githubTokenCall("deleteIssueComment", args)),
462
462
  ...args
463
463
  })
464
464
  });
@@ -471,7 +471,7 @@ const listLabels = (token) => tool({
471
471
  description: listLabelsDescription,
472
472
  inputSchema: listLabelsInputSchema,
473
473
  execute: async (args) => listLabelsStep({
474
- token: await resolveGithubToken(token),
474
+ token: await resolveGithubToken(token, githubTokenCall("listLabels", args)),
475
475
  ...args
476
476
  })
477
477
  });
@@ -485,7 +485,7 @@ const addLabels = (token, { needsApproval = true } = {}) => tool({
485
485
  needsApproval,
486
486
  inputSchema: addLabelsInputSchema,
487
487
  execute: async (args) => addLabelsStep({
488
- token: await resolveGithubToken(token),
488
+ token: await resolveGithubToken(token, githubTokenCall("addLabels", args)),
489
489
  ...args
490
490
  })
491
491
  });
@@ -499,7 +499,7 @@ const removeLabel = (token, { needsApproval = true } = {}) => tool({
499
499
  needsApproval,
500
500
  inputSchema: removeLabelInputSchema,
501
501
  execute: async (args) => removeLabelStep({
502
- token: await resolveGithubToken(token),
502
+ token: await resolveGithubToken(token, githubTokenCall("removeLabel", args)),
503
503
  ...args
504
504
  })
505
505
  });
@@ -513,7 +513,7 @@ const createLabel = (token, { needsApproval = true } = {}) => tool({
513
513
  needsApproval,
514
514
  inputSchema: createLabelInputSchema,
515
515
  execute: async (args) => createLabelStep({
516
- token: await resolveGithubToken(token),
516
+ token: await resolveGithubToken(token, githubTokenCall("createLabel", args)),
517
517
  ...args
518
518
  })
519
519
  });
@@ -527,7 +527,7 @@ const updateLabel = (token, { needsApproval = true } = {}) => tool({
527
527
  needsApproval,
528
528
  inputSchema: updateLabelInputSchema,
529
529
  execute: async (args) => updateLabelStep({
530
- token: await resolveGithubToken(token),
530
+ token: await resolveGithubToken(token, githubTokenCall("updateLabel", args)),
531
531
  ...args
532
532
  })
533
533
  });
@@ -541,7 +541,7 @@ const deleteLabel = (token, { needsApproval = true } = {}) => tool({
541
541
  needsApproval,
542
542
  inputSchema: deleteLabelInputSchema,
543
543
  execute: async (args) => deleteLabelStep({
544
- token: await resolveGithubToken(token),
544
+ token: await resolveGithubToken(token, githubTokenCall("deleteLabel", args)),
545
545
  ...args
546
546
  })
547
547
  });
@@ -555,7 +555,7 @@ const addAssignees = (token, { needsApproval = true } = {}) => tool({
555
555
  needsApproval,
556
556
  inputSchema: addAssigneesInputSchema,
557
557
  execute: async (args) => addAssigneesStep({
558
- token: await resolveGithubToken(token),
558
+ token: await resolveGithubToken(token, githubTokenCall("addAssignees", args)),
559
559
  ...args
560
560
  })
561
561
  });
@@ -569,7 +569,7 @@ const removeAssignees = (token, { needsApproval = true } = {}) => tool({
569
569
  needsApproval,
570
570
  inputSchema: removeAssigneesInputSchema,
571
571
  execute: async (args) => removeAssigneesStep({
572
- token: await resolveGithubToken(token),
572
+ token: await resolveGithubToken(token, githubTokenCall("removeAssignees", args)),
573
573
  ...args
574
574
  })
575
575
  });
@@ -584,7 +584,7 @@ const listIssueReactions = (token) => tool({
584
584
  description: listIssueReactionsDescription,
585
585
  inputSchema: listIssueReactionsInputSchema,
586
586
  execute: async (args) => listIssueReactionsStep({
587
- token: await resolveGithubToken(token),
587
+ token: await resolveGithubToken(token, githubTokenCall("listIssueReactions", args)),
588
588
  ...args
589
589
  })
590
590
  });
@@ -598,7 +598,7 @@ const addIssueReaction = (token, { needsApproval = true } = {}) => tool({
598
598
  needsApproval,
599
599
  inputSchema: addIssueReactionInputSchema,
600
600
  execute: async (args) => addIssueReactionStep({
601
- token: await resolveGithubToken(token),
601
+ token: await resolveGithubToken(token, githubTokenCall("addIssueReaction", args)),
602
602
  ...args
603
603
  })
604
604
  });
@@ -611,7 +611,7 @@ const listCommentReactions = (token) => tool({
611
611
  description: listCommentReactionsDescription,
612
612
  inputSchema: listCommentReactionsInputSchema,
613
613
  execute: async (args) => listCommentReactionsStep({
614
- token: await resolveGithubToken(token),
614
+ token: await resolveGithubToken(token, githubTokenCall("listCommentReactions", args)),
615
615
  ...args
616
616
  })
617
617
  });
@@ -625,7 +625,7 @@ const addCommentReaction = (token, { needsApproval = true } = {}) => tool({
625
625
  needsApproval,
626
626
  inputSchema: addCommentReactionInputSchema,
627
627
  execute: async (args) => addCommentReactionStep({
628
- token: await resolveGithubToken(token),
628
+ token: await resolveGithubToken(token, githubTokenCall("addCommentReaction", args)),
629
629
  ...args
630
630
  })
631
631
  });
@@ -640,7 +640,7 @@ const listDiscussions = (token) => tool({
640
640
  description: listDiscussionsDescription,
641
641
  inputSchema: listDiscussionsInputSchema,
642
642
  execute: async (args) => listDiscussionsStep({
643
- token: await resolveGithubToken(token),
643
+ token: await resolveGithubToken(token, githubTokenCall("listDiscussions", args)),
644
644
  ...args
645
645
  })
646
646
  });
@@ -653,7 +653,7 @@ const getDiscussion = (token) => tool({
653
653
  description: getDiscussionDescription,
654
654
  inputSchema: getDiscussionInputSchema,
655
655
  execute: async (args) => getDiscussionStep({
656
- token: await resolveGithubToken(token),
656
+ token: await resolveGithubToken(token, githubTokenCall("getDiscussion", args)),
657
657
  ...args
658
658
  })
659
659
  });
@@ -667,7 +667,7 @@ const addDiscussionComment = (token, { needsApproval = true } = {}) => tool({
667
667
  needsApproval,
668
668
  inputSchema: addDiscussionCommentInputSchema,
669
669
  execute: async (args) => addDiscussionCommentStep({
670
- token: await resolveGithubToken(token),
670
+ token: await resolveGithubToken(token, githubTokenCall("addDiscussionComment", args)),
671
671
  ...args
672
672
  })
673
673
  });
@@ -682,7 +682,7 @@ const listNotifications = (token) => tool({
682
682
  description: listNotificationsDescription,
683
683
  inputSchema: listNotificationsInputSchema,
684
684
  execute: async (args) => listNotificationsStep({
685
- token: await resolveGithubToken(token),
685
+ token: await resolveGithubToken(token, githubTokenCall("listNotifications", args)),
686
686
  ...args
687
687
  })
688
688
  });
@@ -696,7 +696,7 @@ const markNotificationRead = (token, { needsApproval = true } = {}) => tool({
696
696
  needsApproval,
697
697
  inputSchema: markNotificationReadInputSchema,
698
698
  execute: async (args) => markNotificationReadStep({
699
- token: await resolveGithubToken(token),
699
+ token: await resolveGithubToken(token, githubTokenCall("markNotificationRead", args)),
700
700
  ...args
701
701
  })
702
702
  });
@@ -711,7 +711,7 @@ const searchCode = (token) => tool({
711
711
  description: searchCodeDescription,
712
712
  inputSchema: searchCodeInputSchema,
713
713
  execute: async (args) => searchCodeStep({
714
- token: await resolveGithubToken(token),
714
+ token: await resolveGithubToken(token, githubTokenCall("searchCode", args)),
715
715
  ...args
716
716
  })
717
717
  });
@@ -724,7 +724,7 @@ const searchRepositories = (token) => tool({
724
724
  description: searchRepositoriesDescription,
725
725
  inputSchema: searchRepositoriesInputSchema,
726
726
  execute: async (args) => searchRepositoriesStep({
727
- token: await resolveGithubToken(token),
727
+ token: await resolveGithubToken(token, githubTokenCall("searchRepositories", args)),
728
728
  ...args
729
729
  })
730
730
  });
@@ -737,7 +737,7 @@ const searchIssues = (token) => tool({
737
737
  description: searchIssuesDescription,
738
738
  inputSchema: searchIssuesInputSchema,
739
739
  execute: async (args) => searchIssuesStep({
740
- token: await resolveGithubToken(token),
740
+ token: await resolveGithubToken(token, githubTokenCall("searchIssues", args)),
741
741
  ...args
742
742
  })
743
743
  });
@@ -752,7 +752,7 @@ const listCommits = (token) => tool({
752
752
  description: listCommitsDescription,
753
753
  inputSchema: listCommitsInputSchema,
754
754
  execute: async (args) => listCommitsStep({
755
- token: await resolveGithubToken(token),
755
+ token: await resolveGithubToken(token, githubTokenCall("listCommits", args)),
756
756
  ...args
757
757
  })
758
758
  });
@@ -766,7 +766,7 @@ const getCommit = (token) => tool({
766
766
  inputSchema: getCommitInputSchema,
767
767
  toModelOutput: getCommitToModelOutput,
768
768
  execute: async (args) => getCommitStep({
769
- token: await resolveGithubToken(token),
769
+ token: await resolveGithubToken(token, githubTokenCall("getCommit", args)),
770
770
  ...args
771
771
  })
772
772
  });
@@ -779,7 +779,7 @@ const getBlame = (token) => tool({
779
779
  description: getBlameDescription,
780
780
  inputSchema: getBlameInputSchema,
781
781
  execute: async (args) => getBlameStep({
782
- token: await resolveGithubToken(token),
782
+ token: await resolveGithubToken(token, githubTokenCall("getBlame", args)),
783
783
  ...args
784
784
  })
785
785
  });
@@ -793,7 +793,7 @@ const compareCommits = (token) => tool({
793
793
  inputSchema: compareCommitsInputSchema,
794
794
  toModelOutput: compareCommitsToModelOutput,
795
795
  execute: async (args) => compareCommitsStep({
796
- token: await resolveGithubToken(token),
796
+ token: await resolveGithubToken(token, githubTokenCall("compareCommits", args)),
797
797
  ...args
798
798
  })
799
799
  });
@@ -808,7 +808,7 @@ const listGists = (token) => tool({
808
808
  description: listGistsDescription,
809
809
  inputSchema: listGistsInputSchema,
810
810
  execute: async (args) => listGistsStep({
811
- token: await resolveGithubToken(token),
811
+ token: await resolveGithubToken(token, githubTokenCall("listGists", args)),
812
812
  ...args
813
813
  })
814
814
  });
@@ -821,7 +821,7 @@ const getGist = (token) => tool({
821
821
  description: getGistDescription,
822
822
  inputSchema: getGistInputSchema,
823
823
  execute: async (args) => getGistStep({
824
- token: await resolveGithubToken(token),
824
+ token: await resolveGithubToken(token, githubTokenCall("getGist", args)),
825
825
  ...args
826
826
  })
827
827
  });
@@ -834,7 +834,7 @@ const listGistComments = (token) => tool({
834
834
  description: listGistCommentsDescription,
835
835
  inputSchema: listGistCommentsInputSchema,
836
836
  execute: async (args) => listGistCommentsStep({
837
- token: await resolveGithubToken(token),
837
+ token: await resolveGithubToken(token, githubTokenCall("listGistComments", args)),
838
838
  ...args
839
839
  })
840
840
  });
@@ -848,7 +848,7 @@ const createGist = (token, { needsApproval = true } = {}) => tool({
848
848
  needsApproval,
849
849
  inputSchema: createGistInputSchema,
850
850
  execute: async (args) => createGistStep({
851
- token: await resolveGithubToken(token),
851
+ token: await resolveGithubToken(token, githubTokenCall("createGist", args)),
852
852
  ...args
853
853
  })
854
854
  });
@@ -862,7 +862,7 @@ const updateGist = (token, { needsApproval = true } = {}) => tool({
862
862
  needsApproval,
863
863
  inputSchema: updateGistInputSchema,
864
864
  execute: async (args) => updateGistStep({
865
- token: await resolveGithubToken(token),
865
+ token: await resolveGithubToken(token, githubTokenCall("updateGist", args)),
866
866
  ...args
867
867
  })
868
868
  });
@@ -876,7 +876,7 @@ const deleteGist = (token, { needsApproval = true } = {}) => tool({
876
876
  needsApproval,
877
877
  inputSchema: deleteGistInputSchema,
878
878
  execute: async (args) => deleteGistStep({
879
- token: await resolveGithubToken(token),
879
+ token: await resolveGithubToken(token, githubTokenCall("deleteGist", args)),
880
880
  ...args
881
881
  })
882
882
  });
@@ -890,7 +890,7 @@ const createGistComment = (token, { needsApproval = true } = {}) => tool({
890
890
  needsApproval,
891
891
  inputSchema: createGistCommentInputSchema,
892
892
  execute: async (args) => createGistCommentStep({
893
- token: await resolveGithubToken(token),
893
+ token: await resolveGithubToken(token, githubTokenCall("createGistComment", args)),
894
894
  ...args
895
895
  })
896
896
  });
@@ -905,7 +905,7 @@ const listWorkflows = (token) => tool({
905
905
  description: listWorkflowsDescription,
906
906
  inputSchema: listWorkflowsInputSchema,
907
907
  execute: async (args) => listWorkflowsStep({
908
- token: await resolveGithubToken(token),
908
+ token: await resolveGithubToken(token, githubTokenCall("listWorkflows", args)),
909
909
  ...args
910
910
  })
911
911
  });
@@ -918,7 +918,7 @@ const listWorkflowRuns = (token) => tool({
918
918
  description: listWorkflowRunsDescription,
919
919
  inputSchema: listWorkflowRunsInputSchema,
920
920
  execute: async (args) => listWorkflowRunsStep({
921
- token: await resolveGithubToken(token),
921
+ token: await resolveGithubToken(token, githubTokenCall("listWorkflowRuns", args)),
922
922
  ...args
923
923
  })
924
924
  });
@@ -931,7 +931,7 @@ const getWorkflowRun = (token) => tool({
931
931
  description: getWorkflowRunDescription,
932
932
  inputSchema: getWorkflowRunInputSchema,
933
933
  execute: async (args) => getWorkflowRunStep({
934
- token: await resolveGithubToken(token),
934
+ token: await resolveGithubToken(token, githubTokenCall("getWorkflowRun", args)),
935
935
  ...args
936
936
  })
937
937
  });
@@ -944,7 +944,7 @@ const listWorkflowJobs = (token) => tool({
944
944
  description: listWorkflowJobsDescription,
945
945
  inputSchema: listWorkflowJobsInputSchema,
946
946
  execute: async (args) => listWorkflowJobsStep({
947
- token: await resolveGithubToken(token),
947
+ token: await resolveGithubToken(token, githubTokenCall("listWorkflowJobs", args)),
948
948
  ...args
949
949
  })
950
950
  });
@@ -957,7 +957,7 @@ const getWorkflowJobLogs = (token) => tool({
957
957
  description: getWorkflowJobLogsDescription,
958
958
  inputSchema: getWorkflowJobLogsInputSchema,
959
959
  execute: async (args) => getWorkflowJobLogsStep({
960
- token: await resolveGithubToken(token),
960
+ token: await resolveGithubToken(token, githubTokenCall("getWorkflowJobLogs", args)),
961
961
  ...args
962
962
  })
963
963
  });
@@ -971,7 +971,7 @@ const triggerWorkflow = (token, { needsApproval = true } = {}) => tool({
971
971
  needsApproval,
972
972
  inputSchema: triggerWorkflowInputSchema,
973
973
  execute: async (args) => triggerWorkflowStep({
974
- token: await resolveGithubToken(token),
974
+ token: await resolveGithubToken(token, githubTokenCall("triggerWorkflow", args)),
975
975
  ...args
976
976
  })
977
977
  });
@@ -985,7 +985,7 @@ const cancelWorkflowRun = (token, { needsApproval = true } = {}) => tool({
985
985
  needsApproval,
986
986
  inputSchema: cancelWorkflowRunInputSchema,
987
987
  execute: async (args) => cancelWorkflowRunStep({
988
- token: await resolveGithubToken(token),
988
+ token: await resolveGithubToken(token, githubTokenCall("cancelWorkflowRun", args)),
989
989
  ...args
990
990
  })
991
991
  });
@@ -999,7 +999,7 @@ const rerunWorkflowRun = (token, { needsApproval = true } = {}) => tool({
999
999
  needsApproval,
1000
1000
  inputSchema: rerunWorkflowRunInputSchema,
1001
1001
  execute: async (args) => rerunWorkflowRunStep({
1002
- token: await resolveGithubToken(token),
1002
+ token: await resolveGithubToken(token, githubTokenCall("rerunWorkflowRun", args)),
1003
1003
  ...args
1004
1004
  })
1005
1005
  });
@@ -1014,7 +1014,7 @@ const listCheckRuns = (token) => tool({
1014
1014
  description: listCheckRunsDescription,
1015
1015
  inputSchema: listCheckRunsInputSchema,
1016
1016
  execute: async (args) => listCheckRunsStep({
1017
- token: await resolveGithubToken(token),
1017
+ token: await resolveGithubToken(token, githubTokenCall("listCheckRuns", args)),
1018
1018
  ...args
1019
1019
  })
1020
1020
  });
@@ -1027,7 +1027,7 @@ const getCombinedStatus = (token) => tool({
1027
1027
  description: getCombinedStatusDescription,
1028
1028
  inputSchema: getCombinedStatusInputSchema,
1029
1029
  execute: async (args) => getCombinedStatusStep({
1030
- token: await resolveGithubToken(token),
1030
+ token: await resolveGithubToken(token, githubTokenCall("getCombinedStatus", args)),
1031
1031
  ...args
1032
1032
  })
1033
1033
  });
@@ -1042,7 +1042,7 @@ const listReleases = (token) => tool({
1042
1042
  description: listReleasesDescription,
1043
1043
  inputSchema: listReleasesInputSchema,
1044
1044
  execute: async (args) => listReleasesStep({
1045
- token: await resolveGithubToken(token),
1045
+ token: await resolveGithubToken(token, githubTokenCall("listReleases", args)),
1046
1046
  ...args
1047
1047
  })
1048
1048
  });
@@ -1055,7 +1055,7 @@ const getLatestRelease = (token) => tool({
1055
1055
  description: getLatestReleaseDescription,
1056
1056
  inputSchema: getLatestReleaseInputSchema,
1057
1057
  execute: async (args) => getLatestReleaseStep({
1058
- token: await resolveGithubToken(token),
1058
+ token: await resolveGithubToken(token, githubTokenCall("getLatestRelease", args)),
1059
1059
  ...args
1060
1060
  })
1061
1061
  });
@@ -1068,7 +1068,7 @@ const getRelease = (token) => tool({
1068
1068
  description: getReleaseDescription,
1069
1069
  inputSchema: getReleaseInputSchema,
1070
1070
  execute: async (args) => getReleaseStep({
1071
- token: await resolveGithubToken(token),
1071
+ token: await resolveGithubToken(token, githubTokenCall("getRelease", args)),
1072
1072
  ...args
1073
1073
  })
1074
1074
  });
@@ -1082,7 +1082,7 @@ const createRelease = (token, { needsApproval = true } = {}) => tool({
1082
1082
  needsApproval,
1083
1083
  inputSchema: createReleaseInputSchema,
1084
1084
  execute: async (args) => createReleaseStep({
1085
- token: await resolveGithubToken(token),
1085
+ token: await resolveGithubToken(token, githubTokenCall("createRelease", args)),
1086
1086
  ...args
1087
1087
  })
1088
1088
  });
@@ -1096,7 +1096,7 @@ const updateRelease = (token, { needsApproval = true } = {}) => tool({
1096
1096
  needsApproval,
1097
1097
  inputSchema: updateReleaseInputSchema,
1098
1098
  execute: async (args) => updateReleaseStep({
1099
- token: await resolveGithubToken(token),
1099
+ token: await resolveGithubToken(token, githubTokenCall("updateRelease", args)),
1100
1100
  ...args
1101
1101
  })
1102
1102
  });
@@ -1110,7 +1110,7 @@ const deleteRelease = (token, { needsApproval = true } = {}) => tool({
1110
1110
  needsApproval,
1111
1111
  inputSchema: deleteReleaseInputSchema,
1112
1112
  execute: async (args) => deleteReleaseStep({
1113
- token: await resolveGithubToken(token),
1113
+ token: await resolveGithubToken(token, githubTokenCall("deleteRelease", args)),
1114
1114
  ...args
1115
1115
  })
1116
1116
  });
@@ -1126,7 +1126,7 @@ const getPullRequestContext = (token) => tool({
1126
1126
  inputSchema: getPullRequestContextInputSchema,
1127
1127
  toModelOutput: getPullRequestContextToModelOutput,
1128
1128
  execute: async (args) => getPullRequestContextStep({
1129
- token: await resolveGithubToken(token),
1129
+ token: await resolveGithubToken(token, githubTokenCall("getPullRequestContext", args)),
1130
1130
  ...args
1131
1131
  })
1132
1132
  });
@@ -1139,7 +1139,7 @@ const getIssueContext = (token) => tool({
1139
1139
  description: getIssueContextDescription,
1140
1140
  inputSchema: getIssueContextInputSchema,
1141
1141
  execute: async (args) => getIssueContextStep({
1142
- token: await resolveGithubToken(token),
1142
+ token: await resolveGithubToken(token, githubTokenCall("getIssueContext", args)),
1143
1143
  ...args
1144
1144
  })
1145
1145
  });
@@ -1152,7 +1152,7 @@ const getReleaseContext = (token) => tool({
1152
1152
  description: getReleaseContextDescription,
1153
1153
  inputSchema: getReleaseContextInputSchema,
1154
1154
  execute: async (args) => getReleaseContextStep({
1155
- token: await resolveGithubToken(token),
1155
+ token: await resolveGithubToken(token, githubTokenCall("getReleaseContext", args)),
1156
1156
  ...args
1157
1157
  })
1158
1158
  });
@@ -1165,23 +1165,32 @@ const getCiFailureContext = (token) => tool({
1165
1165
  description: getCiFailureContextDescription,
1166
1166
  inputSchema: getCiFailureContextInputSchema,
1167
1167
  execute: async (args) => getCiFailureContextStep({
1168
- token: await resolveGithubToken(token),
1168
+ token: await resolveGithubToken(token, githubTokenCall("getCiFailureContext", args)),
1169
1169
  ...args
1170
1170
  })
1171
1171
  });
1172
1172
  //#endregion
1173
1173
  //#region src/core/approval.ts
1174
+ const autoApprovalTools = new Set(AUTO_APPROVAL_TOOLS);
1174
1175
  /**
1175
- * Resolve whether a write tool requires approval for the AI SDK.
1176
+ * Resolve a write tool's approval mode from global or per-tool config.
1176
1177
  *
1177
- * @param toolName - The write tool to check.
1178
- * @param config - Global or per-tool approval config.
1179
- * @returns `true` when approval is required; defaults to `true` for unspecified write tools in object mode.
1178
+ * @returns `'auto'` only for tools that opt into evaluation; defaults to `true` for unspecified tools in object mode.
1180
1179
  */
1181
- function resolveAiSdkApproval(toolName, config) {
1180
+ function resolveApprovalMode(toolName, config) {
1181
+ if (config === "auto") return autoApprovalTools.has(toolName) ? "auto" : true;
1182
1182
  if (typeof config === "boolean") return config;
1183
1183
  return config[toolName] ?? true;
1184
1184
  }
1185
+ /**
1186
+ * Resolve the AI SDK `needsApproval` value for a write tool.
1187
+ * `'auto'` becomes a function that evaluates each call with {@link needsAutoApproval}.
1188
+ */
1189
+ function resolveAiSdkApproval(toolName, config, evaluation) {
1190
+ const mode = resolveApprovalMode(toolName, config);
1191
+ if (mode !== "auto") return mode;
1192
+ return (input, { messages }) => needsAutoApproval(toolName, input, messages, evaluation);
1193
+ }
1185
1194
  //#endregion
1186
1195
  //#region src/agents.ts
1187
1196
  const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.
@@ -1323,7 +1332,7 @@ function resolveInstructions(options) {
1323
1332
  * import { createGithubAgent } from '@github-tools/sdk'
1324
1333
  *
1325
1334
  * const agent = createGithubAgent({
1326
- * model: 'anthropic/claude-sonnet-4.6',
1335
+ * model: 'anthropic/claude-opus-5.5',
1327
1336
  * token: process.env.GITHUB_TOKEN!,
1328
1337
  * preset: 'code-review',
1329
1338
  * context: { owner: 'vercel', repo: 'ai', pullNumber: 42 },
@@ -1332,26 +1341,50 @@ function resolveInstructions(options) {
1332
1341
  * const result = await agent.generate({ prompt: 'Review this PR' })
1333
1342
  * ```
1334
1343
  */
1335
- function createGithubAgent({ token, preset, requireApproval, context, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
1344
+ function createGithubAgent({ token, preset, requireApproval, evaluation, context, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
1345
+ const staticPreset = preset === "auto" ? void 0 : preset;
1336
1346
  const tools = createGithubTools({
1337
1347
  token,
1338
1348
  requireApproval,
1339
- preset,
1349
+ evaluation,
1350
+ preset: staticPreset,
1340
1351
  context,
1341
1352
  author,
1342
1353
  committer,
1343
1354
  coAuthors
1344
1355
  });
1345
- return new ToolLoopAgent({
1356
+ const settings = {
1346
1357
  ...agentOptions,
1347
1358
  tools,
1348
1359
  instructions: resolveInstructions({
1349
- preset,
1360
+ preset: staticPreset,
1350
1361
  instructions,
1351
1362
  additionalInstructions,
1352
1363
  context
1353
1364
  })
1354
- });
1365
+ };
1366
+ if (preset === "auto") {
1367
+ const prepareCall = agentOptions.prepareCall;
1368
+ settings.prepareCall = async (call) => {
1369
+ const messages = typeof call.prompt === "string" ? [{
1370
+ role: "user",
1371
+ content: call.prompt
1372
+ }] : call.prompt ?? call.messages ?? [];
1373
+ const selected = await selectPresets(messages, evaluation);
1374
+ const next = {
1375
+ ...call,
1376
+ activeTools: [...resolvePresetTools(selected)],
1377
+ instructions: resolveInstructions({
1378
+ preset: selected.length === 1 ? selected[0] : selected,
1379
+ instructions,
1380
+ additionalInstructions,
1381
+ context
1382
+ })
1383
+ };
1384
+ return prepareCall ? prepareCall(next) : next;
1385
+ };
1386
+ }
1387
+ return new ToolLoopAgent(settings);
1355
1388
  }
1356
1389
  //#endregion
1357
1390
  //#region src/index.ts
@@ -1381,6 +1414,9 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
1381
1414
  * // Full catalog (same as omitting preset)
1382
1415
  * createGithubTools({ token, preset: 'maintainer' })
1383
1416
  *
1417
+ * // Ask only for risky or unrequested low-risk writes (evaluated by Jev)
1418
+ * createGithubTools({ token, requireApproval: 'auto' })
1419
+ *
1384
1420
  * // Granular approval
1385
1421
  * createGithubTools({
1386
1422
  * token,
@@ -1393,9 +1429,9 @@ function createGithubAgent({ token, preset, requireApproval, context, instructio
1393
1429
  * })
1394
1430
  * ```
1395
1431
  */
1396
- function createGithubTools({ token, requireApproval = true, preset, context, overrides, author, committer, coAuthors } = {}) {
1432
+ function createGithubTools({ token, requireApproval = true, evaluation, preset, context, overrides, author, committer, coAuthors } = {}) {
1397
1433
  const resolveToken = createGithubTokenResolver(token);
1398
- const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) });
1434
+ const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval, evaluation) });
1399
1435
  const allowed = preset ? resolvePresetTools(preset) : null;
1400
1436
  const allTools = {
1401
1437
  getRepository: getRepository(resolveToken),
@@ -1524,4 +1560,4 @@ function withStrippedRateLimit(tool) {
1524
1560
  //#endregion
1525
1561
  export { deleteIssueComment as $, updateGist as A, getFileContent as At, addDiscussionComment as B, triggerWorkflow as C, updatePullRequest as Ct, getGist as D, createRepository as Dt, deleteGist as E, createOrUpdateFile as Et, searchCode as F, listCommentReactions as G, listDiscussions as H, searchIssues as I, addIssueComment as J, listIssueReactions as K, searchRepositories as L, getBlame as M, getRepositoryTree as Mt, getCommit as N, listBranches as Nt, listGistComments as O, deleteBranch as Ot, listCommits as P, createLabel as Q, listNotifications as R, rerunWorkflowRun as S, resolveReviewThread as St, createGistComment as T, createBranch as Tt, addCommentReaction as U, getDiscussion as V, addIssueReaction as W, closeIssue as X, addLabels as Y, createIssue as Z, getWorkflowJobLogs as _, listPullRequestReviews as _t, getIssueContext as a, removeAssignees as at, listWorkflowRuns as b, replyToReviewComment as bt, createRelease as c, updateIssueComment as ct, getRelease as d, createPullRequest as dt, deleteLabel as et, listReleases as f, createPullRequestReview as ft, cancelWorkflowRun as g, listPullRequestReviewThreads as gt, listCheckRuns as h, listPullRequestFiles as ht, getCiFailureContext as i, listLabels as it, compareCommits as j, getRepository as jt, listGists as k, forkRepository as kt, deleteRelease as l, updateLabel as lt, getCombinedStatus as m, getPullRequest as mt, createGithubAgent as n, listIssueComments as nt, getPullRequestContext as o, removeLabel as ot, updateRelease as p, deletePullRequestComment as pt, addAssignees as q, resolveInstructions as r, listIssues as rt, getReleaseContext as s, updateIssue as st, createGithubTools as t, getIssue as tt, getLatestRelease as u, addPullRequestComment as ut, getWorkflowRun as v, listPullRequests as vt, createGist as w, updatePullRequestComment as wt, listWorkflows as x, requestReviewers as xt, listWorkflowJobs as y, mergePullRequest as yt, markNotificationRead as z };
1526
1562
 
1527
- //# sourceMappingURL=src-C54blWpT.mjs.map
1563
+ //# sourceMappingURL=src-SH7fl4eI.mjs.map