@github-tools/sdk 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -12
- package/dist/{approval-policy--kByBqhT.mjs → approval-policy-CEMMPq92.mjs} +2 -2
- package/dist/{approval-policy--kByBqhT.mjs.map → approval-policy-CEMMPq92.mjs.map} +1 -1
- package/dist/connect/eve.d.mts +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +5 -5
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/{cores-FLzAv2tu.mjs → cores-meFAMt2D.mjs} +20 -2
- package/dist/cores-meFAMt2D.mjs.map +1 -0
- package/dist/{tool-types-OFyE3z0C.d.mts → dry-run-DXckOam2.d.mts} +172 -18
- package/dist/dry-run-DXckOam2.d.mts.map +1 -0
- package/dist/{evaluation-BtoHbxuQ.mjs → evaluation-DJHINyAu.mjs} +2 -2
- package/dist/{evaluation-BtoHbxuQ.mjs.map → evaluation-DJHINyAu.mjs.map} +1 -1
- package/dist/{eve-runtime-CflZNuXD.d.mts → eve-runtime-B_CJE9JV.d.mts} +20 -6
- package/dist/eve-runtime-B_CJE9JV.d.mts.map +1 -0
- package/dist/{eve-runtime-C-0doyHq.mjs → eve-runtime-DPzMPCLt.mjs} +40 -12
- package/dist/eve-runtime-DPzMPCLt.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -4
- package/dist/eve.d.mts +45 -3
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +45 -3
- package/dist/eve.mjs.map +1 -1
- package/dist/{index-C3wlz660.d.mts → index-CzzrtCVj.d.mts} +32 -5
- package/dist/index-CzzrtCVj.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/{src-DyiAVHKl.mjs → src-BlhrSieS.mjs} +166 -21
- package/dist/src-BlhrSieS.mjs.map +1 -0
- package/dist/tanstack.d.mts +533 -190
- package/dist/tanstack.d.mts.map +1 -1
- package/dist/tanstack.mjs +32 -11
- package/dist/tanstack.mjs.map +1 -1
- package/dist/{token-DIwB-wtp.mjs → token-BLps09gm.mjs} +3 -2
- package/dist/token-BLps09gm.mjs.map +1 -0
- package/dist/{types-CJqhvQwi.d.mts → types-Bln8U42J.d.mts} +3 -3
- package/dist/{types-CJqhvQwi.d.mts.map → types-Bln8U42J.d.mts.map} +1 -1
- package/dist/{types-ITYfXMtY.d.mts → types-C7O2lwwz.d.mts} +14 -2
- package/dist/{types-ITYfXMtY.d.mts.map → types-C7O2lwwz.d.mts.map} +1 -1
- package/dist/workflow.d.mts +9 -2
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +6 -4
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-DnGZw-RD.mjs → write-tools-w-8tjnDQ.mjs} +440 -33
- package/dist/write-tools-w-8tjnDQ.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cores-FLzAv2tu.mjs.map +0 -1
- package/dist/eve-runtime-C-0doyHq.mjs.map +0 -1
- package/dist/eve-runtime-CflZNuXD.d.mts.map +0 -1
- package/dist/index-C3wlz660.d.mts.map +0 -1
- package/dist/src-DyiAVHKl.mjs.map +0 -1
- package/dist/token-DIwB-wtp.mjs.map +0 -1
- package/dist/tool-types-OFyE3z0C.d.mts.map +0 -1
- package/dist/write-tools-DnGZw-RD.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as GithubGuardrails, N as GithubTokenInput, R as CombinedPresetToolNames, V as PresetToolName, W as GithubToolName, c as CommitIdentity, f as ToolOptions, i as GithubToolsBaseOptions, l as CommitToolOptions, r as AllGithubTools, s as GithubToolsContext, u as GithubTool, z as GithubToolPreset } from "./dry-run-DXckOam2.mjs";
|
|
2
2
|
import { ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai";
|
|
3
3
|
import { Octokit } from "octokit";
|
|
4
4
|
import "evlog";
|
|
@@ -84,10 +84,18 @@ declare const createOrUpdateFile: (token: GithubTokenInput, { needsApproval, aut
|
|
|
84
84
|
declare const editFiles: (token: GithubTokenInput, { needsApproval, author, committer, coAuthors }?: CommitToolOptions) => GithubTool;
|
|
85
85
|
/** List the required checks, required reviews and other rules that protect a branch. */
|
|
86
86
|
declare const getBranchRules: (token: GithubTokenInput) => GithubTool;
|
|
87
|
+
/** Get a user's permission and role on a repository. */
|
|
88
|
+
declare const getCollaboratorPermission: (token: GithubTokenInput) => GithubTool;
|
|
87
89
|
//#endregion
|
|
88
90
|
//#region src/tools/pull-requests.d.ts
|
|
89
91
|
type MergeToolOptions = ToolOptions & {
|
|
90
92
|
coAuthors?: CommitIdentity[];
|
|
93
|
+
/** Base branches the pull request may be merged into, as in `guardrails.branches`. */
|
|
94
|
+
branches?: string[];
|
|
95
|
+
};
|
|
96
|
+
type UpdateBranchToolOptions = ToolOptions & {
|
|
97
|
+
/** Repositories and branches the pull request's head must match, as in `guardrails`. */
|
|
98
|
+
guardrails?: Pick<GithubGuardrails, 'repositories' | 'branches'>;
|
|
91
99
|
};
|
|
92
100
|
/** List pull requests for a GitHub repository. */
|
|
93
101
|
declare const listPullRequests: (token: GithubTokenInput) => GithubTool;
|
|
@@ -96,7 +104,7 @@ declare const getPullRequest: (token: GithubTokenInput) => GithubTool;
|
|
|
96
104
|
/** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
97
105
|
declare const createPullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
98
106
|
/** Merge a pull request. Requires approval by default. */
|
|
99
|
-
declare const mergePullRequest: (token: GithubTokenInput, { needsApproval, coAuthors }?: MergeToolOptions) => GithubTool;
|
|
107
|
+
declare const mergePullRequest: (token: GithubTokenInput, { needsApproval, coAuthors, branches }?: MergeToolOptions) => GithubTool;
|
|
100
108
|
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
101
109
|
declare const updatePullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
102
110
|
/** Add a comment to a pull request. Requires approval by default. */
|
|
@@ -120,9 +128,11 @@ declare const resolveReviewThread: (token: GithubTokenInput, { needsApproval }?:
|
|
|
120
128
|
/** Request reviews from users or teams on a pull request. Requires approval by default. */
|
|
121
129
|
declare const requestReviewers: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
122
130
|
/** Merge a pull request automatically once its required checks and reviews pass. Requires approval by default. */
|
|
123
|
-
declare const enablePullRequestAutoMerge: (token: GithubTokenInput, { needsApproval, coAuthors }?: MergeToolOptions) => GithubTool;
|
|
131
|
+
declare const enablePullRequestAutoMerge: (token: GithubTokenInput, { needsApproval, coAuthors, branches }?: MergeToolOptions) => GithubTool;
|
|
124
132
|
/** Cancel a pending auto-merge. Requires approval by default. */
|
|
125
133
|
declare const disablePullRequestAutoMerge: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
134
|
+
/** Merge a pull request's base branch into its head branch. Requires approval by default. */
|
|
135
|
+
declare const updatePullRequestBranch: (token: GithubTokenInput, { needsApproval, guardrails }?: UpdateBranchToolOptions) => GithubTool;
|
|
126
136
|
//#endregion
|
|
127
137
|
//#region src/tools/issues.d.ts
|
|
128
138
|
/** List issues for a GitHub repository (excludes pull requests). */
|
|
@@ -159,6 +169,12 @@ declare const deleteLabel: (token: GithubTokenInput, { needsApproval }?: ToolOpt
|
|
|
159
169
|
declare const addAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
160
170
|
/** Remove assignees from an issue or pull request. Requires approval by default. */
|
|
161
171
|
declare const removeAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
172
|
+
/** List milestones in a GitHub repository with their due dates and issue counts. */
|
|
173
|
+
declare const listMilestones: (token: GithubTokenInput) => GithubTool;
|
|
174
|
+
/** List the sub-issues of an issue. */
|
|
175
|
+
declare const listSubIssues: (token: GithubTokenInput) => GithubTool;
|
|
176
|
+
/** Add an existing issue as a sub-issue of another issue. Requires approval by default. */
|
|
177
|
+
declare const addSubIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
162
178
|
//#endregion
|
|
163
179
|
//#region src/tools/reactions.d.ts
|
|
164
180
|
/** List reactions on an issue or pull request conversation. */
|
|
@@ -241,6 +257,8 @@ declare const rerunWorkflowRun: (token: GithubTokenInput, { needsApproval }?: To
|
|
|
241
257
|
declare const listCheckRuns: (token: GithubTokenInput) => GithubTool;
|
|
242
258
|
/** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */
|
|
243
259
|
declare const getCombinedStatus: (token: GithubTokenInput) => GithubTool;
|
|
260
|
+
/** Report a result on a commit as a commit status. Requires approval by default. */
|
|
261
|
+
declare const createCommitStatus: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
244
262
|
//#endregion
|
|
245
263
|
//#region src/tools/security.d.ts
|
|
246
264
|
/** List code scanning alerts for a repository, with the rule, severity and location. */
|
|
@@ -361,6 +379,15 @@ declare const githubToolsErrors: import("evlog").ErrorCatalog<"github_tools", {
|
|
|
361
379
|
readonly fix: "Upgrade `@ai-sdk/workflow` to 2.0.59 or later, or call `.stream()` instead.";
|
|
362
380
|
readonly link: "https://github-tools.com/frameworks/vercel-workflow#non-streaming-bot-background-job";
|
|
363
381
|
};
|
|
382
|
+
readonly GUARDRAIL_BLOCKED: {
|
|
383
|
+
readonly status: 403;
|
|
384
|
+
readonly message: ({ reason }: {
|
|
385
|
+
reason: string;
|
|
386
|
+
}) => string;
|
|
387
|
+
readonly why: "The call targets a repository or branch outside the `guardrails` these tools were created with. Guardrails apply whoever approves the call.";
|
|
388
|
+
readonly fix: "Act on a repository and branch the guardrails allow, such as a branch matching the allowed patterns, or ask the user to change `guardrails`.";
|
|
389
|
+
readonly link: "https://github-tools.com/guide/approval-control#guardrails";
|
|
390
|
+
};
|
|
364
391
|
readonly EVALUATION_UNAVAILABLE: {
|
|
365
392
|
readonly status: 500;
|
|
366
393
|
readonly message: "`requireApproval: 'auto'` and `preset: 'auto'` need `experimental_decide` (or `experimental_evaluate`) from `ai` 7.0.105 or later.";
|
|
@@ -465,5 +492,5 @@ declare function createGithubTools<P extends readonly GithubToolPreset[]>(option
|
|
|
465
492
|
declare function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
|
|
466
493
|
type GithubTools = AllGithubTools & ToolSet;
|
|
467
494
|
//#endregion
|
|
468
|
-
export {
|
|
469
|
-
//# sourceMappingURL=index-
|
|
495
|
+
export { addAssignees as $, resolveToolGuidance as $t, createGist as A, mergePullRequest as At, listCommits as B, deleteBranch as Bt, getWorkflowJobLogs as C, disablePullRequestAutoMerge as Ct, listWorkflows as D, listPullRequestReviewThreads as Dt, listWorkflowRuns as E, listPullRequestFiles as Et, listGists as F, updatePullRequestBranch as Ft, markNotificationRead as G, getFileContent as Gt, searchIssues as H, forkRepository as Ht, updateGist as I, updatePullRequestComment as It, listDiscussions as J, listBranches as Jt, addDiscussionComment as K, getRepository as Kt, compareCommits as L, createBranch as Lt, deleteGist as M, requestReviewers as Mt, getGist as N, resolveReviewThread as Nt, rerunWorkflowRun as O, listPullRequestReviews as Ot, listGistComments as P, updatePullRequest as Pt, listIssueReactions as Q, createGithubAgent as Qt, getBlame as R, createOrUpdateFile as Rt, cancelWorkflowRun as S, deletePullRequestComment as St, listWorkflowJobs as T, getPullRequest as Tt, searchRepositories as U, getBranchRules as Ut, searchCode as V, editFiles as Vt, listNotifications as W, getCollaboratorPermission as Wt, addIssueReaction as X, CALL_GITHUB_TOOL as Xt, addCommentReaction as Y, createOctokit as Yt, listCommentReactions as Z, CreateGithubAgentOptions as Zt, listDependabotAlerts as _, updateIssueComment as _t, GithubRateLimit as a, createLabel as at, getCombinedStatus as b, createPullRequest as bt, getPullRequestContext as c, getIssue as ct, deleteRelease as d, listLabels as dt, addIssueComment as et, getLatestRelease as f, listMilestones as ft, listCodeScanningAlerts as g, updateIssue as gt, updateRelease as h, removeLabel as ht, githubToolsErrors as i, createIssue as it, createGistComment as j, replyToReviewComment as jt, triggerWorkflow as k, listPullRequests as kt, getReleaseContext as l, listIssueComments as lt, listReleases as m, removeAssignees as mt, GithubToolsOptions as n, addSubIssue as nt, getCiFailureContext as o, deleteIssueComment as ot, getRelease as p, listSubIssues as pt, getDiscussion as q, getRepositoryTree as qt, createGithubTools as r, closeIssue as rt, getIssueContext as s, deleteLabel as st, GithubTools as t, addLabels as tt, createRelease as u, listIssues as ut, listSecretScanningAlerts as v, updateLabel as vt, getWorkflowRun as w, enablePullRequestAutoMerge as wt, listCheckRuns as x, createPullRequestReview as xt, createCommitStatus as y, addPullRequestComment as yt, getCommit as z, createRepository as zt };
|
|
496
|
+
//# sourceMappingURL=index-CzzrtCVj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CzzrtCVj.d.mts","names":[],"sources":["../src/core/instructions.ts","../src/agents.ts","../src/client.ts","../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/reactions.ts","../src/tools/discussions.ts","../src/tools/notifications.ts","../src/tools/search.ts","../src/tools/commits.ts","../src/tools/gists.ts","../src/tools/workflows.ts","../src/tools/checks.ts","../src/tools/security.ts","../src/tools/releases.ts","../src/tools/bundles.ts","../src/core/rate-limit.ts","../src/core/errors.ts","../src/index.ts"],"mappings":";;;;;;;;;;;iBAmKgB,oBAAoB;EAClC,SAAS,mBAAmB;EAC5B,UAAU;;;;;cCjJC;KA+FR,eAAe,KAAK,sBAAsB;KAEnC,2BAA2B,eAAe;EACpD,OAAO,sBAAsB;;;;;;;;;;;;;;;;EAgB7B,SAAS,mBAAmB;;;;;;EAM5B;;;;;EAKA;;iBA2Dc,kBAAkB,SAAS;EAA6B;IAAgC,qBAAqB;iBAC7G,kBAAkB,UAAU,kBAC1C,SAAS;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+1,3 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { $ as
|
|
3
|
-
export { AUTO_APPROVAL_TOOLS, type AllGithubTools, type ApprovalConfig, CALL_GITHUB_TOOL, CORE_READ_TOOLS, type CombinedPresetToolNames, type CommitIdentity, type CommitToolOptions, type CreateGithubAgentOptions, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, type GithubEvaluationOptions, type GithubRateLimit, type GithubTokenCall, type GithubTokenInput, type GithubTool, type GithubToolName, type GithubToolPreset, GithubTools, type GithubToolsContext, type GithubToolsForPreset, GithubToolsOptions, type GithubWriteToolName, type Octokit, PRESET_TOOLS, type PickGithubTools, type PresetToolName, type StaticApprovalConfig, type ToolApprovalMode, type ToolOptions, type ToolOverrides, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createGist, createGistComment, createGithubAgent, createGithubTools, createIssue, createLabel, createOctokit, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, githubToolsErrors, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveGithubToken, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, selectTools, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestComment, updateRelease };
|
|
1
|
+
import { A as DEFAULT_EVALUATION_MODEL, B as PRESET_TOOLS, D as selectTools, E as selectPresets, F as withGithubGuardrails, G as GithubWriteToolName, H as GITHUB_TOOL_NAMES, I as GithubGuardrails, L as CORE_READ_TOOLS, M as GithubTokenCall, N as GithubTokenInput, O as GITHUB_WRITE_TOOLS, P as resolveGithubToken, R as CombinedPresetToolNames, V as PresetToolName, W as GithubToolName, a as GithubToolsForPreset, c as CommitIdentity, d as Octokit, f as ToolOptions, g as ToolApprovalMode, h as StaticApprovalConfig, k as AUTO_APPROVAL_TOOLS, l as CommitToolOptions, m as ApprovalConfig, n as GithubDryRunResult, o as PickGithubTools, p as ToolOverrides, r as AllGithubTools, s as GithubToolsContext, t as GithubDryRunApproval, u as GithubTool, v as GithubEvaluationOptions, z as GithubToolPreset } from "./dry-run-DXckOam2.mjs";
|
|
2
|
+
import { $ as addAssignees, A as createGist, At as mergePullRequest, B as listCommits, Bt as deleteBranch, C as getWorkflowJobLogs, Ct as disablePullRequestAutoMerge, D as listWorkflows, Dt as listPullRequestReviewThreads, E as listWorkflowRuns, Et as listPullRequestFiles, F as listGists, Ft as updatePullRequestBranch, G as markNotificationRead, Gt as getFileContent, H as searchIssues, Ht as forkRepository, I as updateGist, It as updatePullRequestComment, J as listDiscussions, Jt as listBranches, K as addDiscussionComment, Kt as getRepository, L as compareCommits, Lt as createBranch, M as deleteGist, Mt as requestReviewers, N as getGist, Nt as resolveReviewThread, O as rerunWorkflowRun, Ot as listPullRequestReviews, P as listGistComments, Pt as updatePullRequest, Q as listIssueReactions, Qt as createGithubAgent, R as getBlame, Rt as createOrUpdateFile, S as cancelWorkflowRun, St as deletePullRequestComment, T as listWorkflowJobs, Tt as getPullRequest, U as searchRepositories, Ut as getBranchRules, V as searchCode, Vt as editFiles, W as listNotifications, Wt as getCollaboratorPermission, X as addIssueReaction, Xt as CALL_GITHUB_TOOL, Y as addCommentReaction, Yt as createOctokit, Z as listCommentReactions, Zt as CreateGithubAgentOptions, _ as listDependabotAlerts, _t as updateIssueComment, a as GithubRateLimit, at as createLabel, b as getCombinedStatus, bt as createPullRequest, c as getPullRequestContext, ct as getIssue, d as deleteRelease, dt as listLabels, et as addIssueComment, f as getLatestRelease, ft as listMilestones, g as listCodeScanningAlerts, gt as updateIssue, h as updateRelease, ht as removeLabel, i as githubToolsErrors, it as createIssue, j as createGistComment, jt as replyToReviewComment, k as triggerWorkflow, kt as listPullRequests, l as getReleaseContext, lt as listIssueComments, m as listReleases, mt as removeAssignees, n as GithubToolsOptions, nt as addSubIssue, o as getCiFailureContext, ot as deleteIssueComment, p as getRelease, pt as listSubIssues, q as getDiscussion, qt as getRepositoryTree, r as createGithubTools, rt as closeIssue, s as getIssueContext, st as deleteLabel, t as GithubTools, tt as addLabels, u as createRelease, ut as listIssues, v as listSecretScanningAlerts, vt as updateLabel, w as getWorkflowRun, wt as enablePullRequestAutoMerge, x as listCheckRuns, xt as createPullRequestReview, y as createCommitStatus, yt as addPullRequestComment, z as getCommit, zt as createRepository } from "./index-CzzrtCVj.mjs";
|
|
3
|
+
export { AUTO_APPROVAL_TOOLS, type AllGithubTools, type ApprovalConfig, CALL_GITHUB_TOOL, CORE_READ_TOOLS, type CombinedPresetToolNames, type CommitIdentity, type CommitToolOptions, type CreateGithubAgentOptions, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, type GithubDryRunApproval, type GithubDryRunResult, type GithubEvaluationOptions, type GithubGuardrails, type GithubRateLimit, type GithubTokenCall, type GithubTokenInput, type GithubTool, type GithubToolName, type GithubToolPreset, GithubTools, type GithubToolsContext, type GithubToolsForPreset, GithubToolsOptions, type GithubWriteToolName, type Octokit, PRESET_TOOLS, type PickGithubTools, type PresetToolName, type StaticApprovalConfig, type ToolApprovalMode, type ToolOptions, type ToolOverrides, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, addSubIssue, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createCommitStatus, createGist, createGistComment, createGithubAgent, createGithubTools, createIssue, createLabel, createOctokit, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCollaboratorPermission, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, githubToolsErrors, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listMilestones, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listSubIssues, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveGithubToken, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, selectTools, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestBranch, updatePullRequestComment, updateRelease, withGithubGuardrails };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as selectTools, u as selectPresets } from "./evaluation-
|
|
3
|
-
import { $ as
|
|
4
|
-
export { AUTO_APPROVAL_TOOLS, CALL_GITHUB_TOOL, CORE_READ_TOOLS, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, PRESET_TOOLS, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createGist, createGistComment, createGithubAgent, createGithubTools, createIssue, createLabel, createOctokit, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, githubToolsErrors, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveGithubToken, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, selectTools, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestComment, updateRelease };
|
|
1
|
+
import { C as withGithubGuardrails, S as resolveGithubToken, Ya as createOctokit, Za as githubToolsErrors, _ as CORE_READ_TOOLS, c as AUTO_APPROVAL_TOOLS, g as GITHUB_TOOL_NAMES, l as DEFAULT_EVALUATION_MODEL, t as GITHUB_WRITE_TOOLS, v as PRESET_TOOLS } from "./write-tools-w-8tjnDQ.mjs";
|
|
2
|
+
import { d as selectTools, u as selectPresets } from "./evaluation-DJHINyAu.mjs";
|
|
3
|
+
import { $ as addLabels, A as deleteGist, At as requestReviewers, B as searchIssues, Bt as forkRepository, C as listWorkflowJobs, Ct as getPullRequest, D as triggerWorkflow, Dt as listPullRequests, E as rerunWorkflowRun, Et as listPullRequestReviews, F as compareCommits, Ft as createBranch, G as getDiscussion, Gt as getRepositoryTree, H as listNotifications, Ht as getCollaboratorPermission, I as getBlame, It as createOrUpdateFile, J as addIssueReaction, K as listDiscussions, Kt as listBranches, L as getCommit, Lt as createRepository, M as listGistComments, Mt as updatePullRequest, N as listGists, Nt as updatePullRequestBranch, O as createGist, Ot as mergePullRequest, P as updateGist, Pt as updatePullRequestComment, Q as addIssueComment, R as listCommits, Rt as deleteBranch, S as getWorkflowRun, St as enablePullRequestAutoMerge, T as listWorkflows, Tt as listPullRequestReviewThreads, U as markNotificationRead, Ut as getFileContent, V as searchRepositories, Vt as getBranchRules, W as addDiscussionComment, Wt as getRepository, X as listIssueReactions, Y as listCommentReactions, Z as addAssignees, _ as createCommitStatus, _t as addPullRequestComment, a as getIssueContext, at as deleteLabel, b as cancelWorkflowRun, bt as deletePullRequestComment, c as createRelease, ct as listIssues, d as getRelease, dt as listSubIssues, et as addSubIssue, f as listReleases, ft as removeAssignees, g as listSecretScanningAlerts, gt as updateLabel, h as listDependabotAlerts, ht as updateIssueComment, i as getCiFailureContext, it as deleteIssueComment, j as getGist, jt as resolveReviewThread, k as createGistComment, kt as replyToReviewComment, l as deleteRelease, lt as listLabels, m as listCodeScanningAlerts, mt as updateIssue, n as CALL_GITHUB_TOOL, nt as createIssue, o as getPullRequestContext, ot as getIssue, p as updateRelease, pt as removeLabel, q as addCommentReaction, r as createGithubAgent, rt as createLabel, s as getReleaseContext, st as listIssueComments, t as createGithubTools, tt as closeIssue, u as getLatestRelease, ut as listMilestones, v as getCombinedStatus, vt as createPullRequest, w as listWorkflowRuns, wt as listPullRequestFiles, x as getWorkflowJobLogs, xt as disablePullRequestAutoMerge, y as listCheckRuns, yt as createPullRequestReview, z as searchCode, zt as editFiles } from "./src-BlhrSieS.mjs";
|
|
4
|
+
export { AUTO_APPROVAL_TOOLS, CALL_GITHUB_TOOL, CORE_READ_TOOLS, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, PRESET_TOOLS, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, addSubIssue, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createCommitStatus, createGist, createGistComment, createGithubAgent, createGithubTools, createIssue, createLabel, createOctokit, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCollaboratorPermission, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, githubToolsErrors, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listMilestones, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listSubIssues, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveGithubToken, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, selectTools, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestBranch, updatePullRequestComment, updateRelease, withGithubGuardrails };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { _ as listPullRequestFilesToModelOutput, a as evaluationRequest, f as compareCommitsToModelOutput, g as getRepositoryTreeToModelOutput, h as getPullRequestContextToModelOutput, i as evaluateTools, m as getFileContentToModelOutput, n as autoApprovalDecision, o as fallbackPresets, p as getCommitToModelOutput, r as evaluatePresets, s as fallbackTools, t as assertEvaluationAvailable } from "./evaluation-
|
|
3
|
-
import { t as resolveApprovalMode } from "./approval-policy
|
|
1
|
+
import { $ as listCommentReactionsInputSchema, $a as stripRateLimit, $i as getCommitDescription, $n as disablePullRequestAutoMergeInputSchema, $r as closeIssueDescription, $t as cancelWorkflowRunInputSchema, A as listDependabotAlertsCore, Aa as forkRepositoryInputSchema, Ai as listSubIssuesInputSchema, An as getReleaseCore, Ar as updatePullRequestBranchCore, At as addDiscussionCommentCore, B as searchIssuesDescription, Ba as getRepositoryCore, Bi as updateIssueCore, Bn as addPullRequestCommentDescription, Br as addAssigneesCore, Bt as getCiFailureContextDescription, C as withGithubGuardrails, Ca as deleteBranchDescription, Ci as listLabelsDescription, Cn as createReleaseInputSchema, Cr as replyToReviewCommentInputSchema, Ct as listGistCommentsInputSchema, D as listCodeScanningAlertsCore, Da as editFilesInputSchema, Di as listMilestonesInputSchema, Dn as getLatestReleaseCore, Dr as resolveReviewThreadCore, Dt as updateGistCore, E as isGithubWriteToolName, Ea as editFilesDescription, Ei as listMilestonesDescription, En as deleteReleaseInputSchema, Er as requestReviewersInputSchema, Et as listGistsInputSchema, F as listSecretScanningAlertsInputSchema, Fa as getCollaboratorPermissionDescription, Fi as removeLabelDescription, Fn as listReleasesInputSchema, Fr as updatePullRequestCommentInputSchema, Ft as getDiscussionInputSchema, G as addCommentReactionCore, Ga as getRepositoryTreeInputSchema, Gi as updateLabelInputSchema, Gn as createPullRequestReviewCore, Gr as addIssueCommentInputSchema, Gt as getPullRequestContextCore, H as searchRepositoriesCore, Ha as getRepositoryInputSchema, Hi as updateIssueInputSchema, Hn as createPullRequestCore, Hr as addAssigneesInputSchema, Ht as getIssueContextCore, I as searchCodeCore, Ia as getCollaboratorPermissionInputSchema, Ii as removeLabelInputSchema, In as updateReleaseCore, Ir as updatePullRequestCore, It as listDiscussionsCore, J as addIssueReactionCore, Ja as listBranchesInputSchema, Ji as compareCommitsInputSchema, Jn as deletePullRequestCommentCore, Jr as addLabelsInputSchema, Jt as getReleaseContextCore, K as addCommentReactionDescription, Ka as listBranchesCore, Ki as compareCommitsCore, Kn as createPullRequestReviewDescription, Kr as addLabelsCore, Kt as getPullRequestContextDescription, L as searchCodeDescription, La as getFileContentCore, Li as updateIssueCommentCore, Ln as updateReleaseDescription, Lr as updatePullRequestDescription, Lt as listDiscussionsDescription, M as listDependabotAlertsInputSchema, Ma as getBranchRulesDescription, Mi as removeAssigneesDescription, Mn as getReleaseInputSchema, Mr as updatePullRequestBranchInputSchema, Mt as addDiscussionCommentInputSchema, N as listSecretScanningAlertsCore, Na as getBranchRulesInputSchema, Ni as removeAssigneesInputSchema, Nn as listReleasesCore, Nr as updatePullRequestCommentCore, Nt as getDiscussionCore, O as listCodeScanningAlertsDescription, Oa as forkRepositoryCore, Oi as listSubIssuesCore, On as getLatestReleaseDescription, Or as resolveReviewThreadDescription, Ot as updateGistDescription, P as listSecretScanningAlertsDescription, Pa as getCollaboratorPermissionCore, Pi as removeLabelCore, Pn as listReleasesDescription, Pr as updatePullRequestCommentDescription, Pt as getDiscussionDescription, Q as listCommentReactionsDescription, Qi as getCommitCore, Qn as disablePullRequestAutoMergeDescription, Qr as closeIssueCore, Qt as cancelWorkflowRunDescription, R as searchCodeInputSchema, Ra as getFileContentDescription, Ri as updateIssueCommentDescription, Rn as updateReleaseInputSchema, Rr as updatePullRequestInputSchema, Rt as listDiscussionsInputSchema, S as resolveGithubToken, Sa as deleteBranchCore, Si as listLabelsCore, Sn as createReleaseDescription, Sr as replyToReviewCommentDescription, St as listGistCommentsDescription, T as GITHUB_TOOL_CATALOG, Ta as editFilesCore, Ti as listMilestonesCore, Tn as deleteReleaseDescription, Tr as requestReviewersDescription, Tt as listGistsDescription, U as searchRepositoriesDescription, Ua as getRepositoryTreeCore, Ui as updateLabelCore, Un as createPullRequestDescription, Ur as addIssueCommentCore, Ut as getIssueContextDescription, V as searchIssuesInputSchema, Va as getRepositoryDescription, Vi as updateIssueDescription, Vn as addPullRequestCommentInputSchema, Vr as addAssigneesDescription, Vt as getCiFailureContextInputSchema, W as searchRepositoriesInputSchema, Wa as getRepositoryTreeDescription, Wi as updateLabelDescription, Wn as createPullRequestInputSchema, Wr as addIssueCommentDescription, Wt as getIssueContextInputSchema, X as addIssueReactionInputSchema, Xi as getBlameDescription, Xn as deletePullRequestCommentInputSchema, Xr as addSubIssueDescription, Xt as getReleaseContextInputSchema, Y as addIssueReactionDescription, Yi as getBlameCore, Yn as deletePullRequestCommentDescription, Yr as addSubIssueCore, Yt as getReleaseContextDescription, Z as listCommentReactionsCore, Za as githubToolsErrors, Zi as getBlameInputSchema, Zn as disablePullRequestAutoMergeCore, Zr as addSubIssueInputSchema, Zt as cancelWorkflowRunCore, _a as createOrUpdateFileDescription, _i as listIssueCommentsDescription, _n as rerunWorkflowRunInputSchema, _r as listPullRequestsInputSchema, _t as deleteGistInputSchema, a as bindToolsContext, aa as createCommitStatusDescription, ai as createLabelDescription, an as getWorkflowRunInputSchema, ar as getPullRequestInputSchema, at as listNotificationsInputSchema, ba as createRepositoryDescription, bi as listIssuesDescription, bn as triggerWorkflowInputSchema, br as mergePullRequestInputSchema, bt as getGistInputSchema, ca as getCombinedStatusDescription, ci as deleteIssueCommentDescription, cn as listWorkflowJobsInputSchema, cr as listPullRequestFilesInputSchema, ct as markNotificationReadInputSchema, da as listCheckRunsDescription, di as deleteLabelDescription, dn as listWorkflowRunsInputSchema, dr as listPullRequestReviewThreadsInputSchema, dt as createGistCommentInputSchema, ea as getCommitInputSchema, ei as closeIssueInputSchema, en as getWorkflowJobLogsCore, er as enablePullRequestAutoMergeCore, et as listIssueReactionsCore, fa as listCheckRunsInputSchema, fi as deleteLabelInputSchema, fn as listWorkflowsCore, fr as listPullRequestReviewsCore, ft as createGistCore, ga as createOrUpdateFileCore, gi as listIssueCommentsCore, gn as rerunWorkflowRunDescription, gr as listPullRequestsDescription, gt as deleteGistDescription, ha as createBranchInputSchema, hi as getIssueInputSchema, hn as rerunWorkflowRunCore, hr as listPullRequestsCore, ht as deleteGistCore, i as dryRunWrite, ia as createCommitStatusCore, ii as createLabelCore, in as getWorkflowRunDescription, ir as getPullRequestDescription, it as listNotificationsDescription, j as listDependabotAlertsDescription, ja as getBranchRulesCore, ji as removeAssigneesCore, jn as getReleaseDescription, jr as updatePullRequestBranchDescription, jt as addDiscussionCommentDescription, k as listCodeScanningAlertsInputSchema, ka as forkRepositoryDescription, ki as listSubIssuesDescription, kn as getLatestReleaseInputSchema, kr as resolveReviewThreadInputSchema, kt as updateGistInputSchema, l as DEFAULT_EVALUATION_MODEL, la as getCombinedStatusInputSchema, li as deleteIssueCommentInputSchema, ln as listWorkflowRunsCore, lr as listPullRequestReviewThreadsCore, lt as createGistCommentCore, ma as createBranchDescription, mi as getIssueDescription, mn as listWorkflowsInputSchema, mr as listPullRequestReviewsInputSchema, mt as createGistInputSchema, n as resolveInstructions, na as listCommitsDescription, ni as createIssueDescription, nn as getWorkflowJobLogsInputSchema, nr as enablePullRequestAutoMergeInputSchema, nt as listIssueReactionsInputSchema, oa as createCommitStatusInputSchema, oi as createLabelInputSchema, on as listWorkflowJobsCore, or as listPullRequestFilesCore, ot as markNotificationReadCore, pa as createBranchCore, pi as getIssueCore, pn as listWorkflowsDescription, pr as listPullRequestReviewsDescription, pt as createGistDescription, q as addCommentReactionInputSchema, qa as listBranchesDescription, qi as compareCommitsDescription, qn as createPullRequestReviewInputSchema, qr as addLabelsDescription, qt as getPullRequestContextInputSchema, ra as listCommitsInputSchema, ri as createIssueInputSchema, rn as getWorkflowRunCore, rr as getPullRequestCore, rt as listNotificationsCore, sa as getCombinedStatusCore, si as deleteIssueCommentCore, sn as listWorkflowJobsDescription, sr as listPullRequestFilesDescription, st as markNotificationReadDescription, ta as listCommitsCore, ti as createIssueCore, tn as getWorkflowJobLogsDescription, tr as enablePullRequestAutoMergeDescription, tt as listIssueReactionsDescription, ua as listCheckRunsCore, ui as deleteLabelCore, un as listWorkflowRunsDescription, ur as listPullRequestReviewThreadsDescription, ut as createGistCommentDescription, va as createOrUpdateFileInputSchema, vi as listIssueCommentsInputSchema, vn as triggerWorkflowCore, vr as mergePullRequestCore, vt as getGistCore, w as ALL_GITHUB_TOOL_NAMES, wa as deleteBranchInputSchema, wi as listLabelsInputSchema, wn as deleteReleaseCore, wr as requestReviewersCore, wt as listGistsCore, x as githubTokenCall, xa as createRepositoryInputSchema, xi as listIssuesInputSchema, xn as createReleaseCore, xr as replyToReviewCommentCore, xt as listGistCommentsCore, y as resolvePresetTools, ya as createRepositoryCore, yi as listIssuesCore, yn as triggerWorkflowDescription, yr as mergePullRequestDescription, yt as getGistDescription, z as searchIssuesCore, za as getFileContentInputSchema, zi as updateIssueCommentInputSchema, zn as addPullRequestCommentCore, zr as guardrailViolation, zt as getCiFailureContextCore } from "./write-tools-w-8tjnDQ.mjs";
|
|
2
|
+
import { _ as listPullRequestFilesToModelOutput, a as evaluationRequest, f as compareCommitsToModelOutput, g as getRepositoryTreeToModelOutput, h as getPullRequestContextToModelOutput, i as evaluateTools, m as getFileContentToModelOutput, n as autoApprovalDecision, o as fallbackPresets, p as getCommitToModelOutput, r as evaluatePresets, s as fallbackTools, t as assertEvaluationAvailable } from "./evaluation-DJHINyAu.mjs";
|
|
3
|
+
import { t as resolveApprovalMode } from "./approval-policy-CEMMPq92.mjs";
|
|
4
4
|
import { ToolLoopAgent, asSchema, tool } from "ai";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/tools/repository.ts
|
|
@@ -161,6 +161,19 @@ const getBranchRules = (token) => tool({
|
|
|
161
161
|
...args
|
|
162
162
|
})
|
|
163
163
|
});
|
|
164
|
+
async function getCollaboratorPermissionStep(args) {
|
|
165
|
+
"use step";
|
|
166
|
+
return getCollaboratorPermissionCore(args);
|
|
167
|
+
}
|
|
168
|
+
/** Get a user's permission and role on a repository. */
|
|
169
|
+
const getCollaboratorPermission = (token) => tool({
|
|
170
|
+
description: getCollaboratorPermissionDescription,
|
|
171
|
+
inputSchema: getCollaboratorPermissionInputSchema,
|
|
172
|
+
execute: async (args) => getCollaboratorPermissionStep({
|
|
173
|
+
token: await resolveGithubToken(token, githubTokenCall("getCollaboratorPermission", args)),
|
|
174
|
+
...args
|
|
175
|
+
})
|
|
176
|
+
});
|
|
164
177
|
//#endregion
|
|
165
178
|
//#region src/tools/pull-requests.ts
|
|
166
179
|
async function listPullRequestsStep(args) {
|
|
@@ -208,14 +221,15 @@ async function mergePullRequestStep(args) {
|
|
|
208
221
|
return mergePullRequestCore(args);
|
|
209
222
|
}
|
|
210
223
|
/** Merge a pull request. Requires approval by default. */
|
|
211
|
-
const mergePullRequest = (token, { needsApproval = true, coAuthors } = {}) => tool({
|
|
224
|
+
const mergePullRequest = (token, { needsApproval = true, coAuthors, branches } = {}) => tool({
|
|
212
225
|
description: mergePullRequestDescription,
|
|
213
226
|
needsApproval,
|
|
214
227
|
inputSchema: mergePullRequestInputSchema,
|
|
215
228
|
execute: async (args) => mergePullRequestStep({
|
|
216
229
|
token: await resolveGithubToken(token, githubTokenCall("mergePullRequest", args)),
|
|
217
230
|
coAuthors,
|
|
218
|
-
...args
|
|
231
|
+
...args,
|
|
232
|
+
branches
|
|
219
233
|
})
|
|
220
234
|
});
|
|
221
235
|
async function updatePullRequestStep(args) {
|
|
@@ -375,14 +389,15 @@ async function enablePullRequestAutoMergeStep(args) {
|
|
|
375
389
|
return enablePullRequestAutoMergeCore(args);
|
|
376
390
|
}
|
|
377
391
|
/** Merge a pull request automatically once its required checks and reviews pass. Requires approval by default. */
|
|
378
|
-
const enablePullRequestAutoMerge = (token, { needsApproval = true, coAuthors } = {}) => tool({
|
|
392
|
+
const enablePullRequestAutoMerge = (token, { needsApproval = true, coAuthors, branches } = {}) => tool({
|
|
379
393
|
description: enablePullRequestAutoMergeDescription,
|
|
380
394
|
needsApproval,
|
|
381
395
|
inputSchema: enablePullRequestAutoMergeInputSchema,
|
|
382
396
|
execute: async (args) => enablePullRequestAutoMergeStep({
|
|
383
397
|
token: await resolveGithubToken(token, githubTokenCall("enablePullRequestAutoMerge", args)),
|
|
384
398
|
coAuthors,
|
|
385
|
-
...args
|
|
399
|
+
...args,
|
|
400
|
+
branches
|
|
386
401
|
})
|
|
387
402
|
});
|
|
388
403
|
async function disablePullRequestAutoMergeStep(args) {
|
|
@@ -399,6 +414,21 @@ const disablePullRequestAutoMerge = (token, { needsApproval = true } = {}) => to
|
|
|
399
414
|
...args
|
|
400
415
|
})
|
|
401
416
|
});
|
|
417
|
+
async function updatePullRequestBranchStep(args) {
|
|
418
|
+
"use step";
|
|
419
|
+
return updatePullRequestBranchCore(args);
|
|
420
|
+
}
|
|
421
|
+
/** Merge a pull request's base branch into its head branch. Requires approval by default. */
|
|
422
|
+
const updatePullRequestBranch = (token, { needsApproval = true, guardrails } = {}) => tool({
|
|
423
|
+
description: updatePullRequestBranchDescription,
|
|
424
|
+
needsApproval,
|
|
425
|
+
inputSchema: updatePullRequestBranchInputSchema,
|
|
426
|
+
execute: async (args) => updatePullRequestBranchStep({
|
|
427
|
+
token: await resolveGithubToken(token, githubTokenCall("updatePullRequestBranch", args)),
|
|
428
|
+
...args,
|
|
429
|
+
guardrails
|
|
430
|
+
})
|
|
431
|
+
});
|
|
402
432
|
//#endregion
|
|
403
433
|
//#region src/tools/issues.ts
|
|
404
434
|
async function listIssuesStep(args) {
|
|
@@ -635,6 +665,46 @@ const removeAssignees = (token, { needsApproval = true } = {}) => tool({
|
|
|
635
665
|
...args
|
|
636
666
|
})
|
|
637
667
|
});
|
|
668
|
+
async function listMilestonesStep(args) {
|
|
669
|
+
"use step";
|
|
670
|
+
return listMilestonesCore(args);
|
|
671
|
+
}
|
|
672
|
+
/** List milestones in a GitHub repository with their due dates and issue counts. */
|
|
673
|
+
const listMilestones = (token) => tool({
|
|
674
|
+
description: listMilestonesDescription,
|
|
675
|
+
inputSchema: listMilestonesInputSchema,
|
|
676
|
+
execute: async (args) => listMilestonesStep({
|
|
677
|
+
token: await resolveGithubToken(token, githubTokenCall("listMilestones", args)),
|
|
678
|
+
...args
|
|
679
|
+
})
|
|
680
|
+
});
|
|
681
|
+
async function listSubIssuesStep(args) {
|
|
682
|
+
"use step";
|
|
683
|
+
return listSubIssuesCore(args);
|
|
684
|
+
}
|
|
685
|
+
/** List the sub-issues of an issue. */
|
|
686
|
+
const listSubIssues = (token) => tool({
|
|
687
|
+
description: listSubIssuesDescription,
|
|
688
|
+
inputSchema: listSubIssuesInputSchema,
|
|
689
|
+
execute: async (args) => listSubIssuesStep({
|
|
690
|
+
token: await resolveGithubToken(token, githubTokenCall("listSubIssues", args)),
|
|
691
|
+
...args
|
|
692
|
+
})
|
|
693
|
+
});
|
|
694
|
+
async function addSubIssueStep(args) {
|
|
695
|
+
"use step";
|
|
696
|
+
return addSubIssueCore(args);
|
|
697
|
+
}
|
|
698
|
+
/** Add an existing issue as a sub-issue of another issue. Requires approval by default. */
|
|
699
|
+
const addSubIssue = (token, { needsApproval = true } = {}) => tool({
|
|
700
|
+
description: addSubIssueDescription,
|
|
701
|
+
needsApproval,
|
|
702
|
+
inputSchema: addSubIssueInputSchema,
|
|
703
|
+
execute: async (args) => addSubIssueStep({
|
|
704
|
+
token: await resolveGithubToken(token, githubTokenCall("addSubIssue", args)),
|
|
705
|
+
...args
|
|
706
|
+
})
|
|
707
|
+
});
|
|
638
708
|
//#endregion
|
|
639
709
|
//#region src/tools/reactions.ts
|
|
640
710
|
async function listIssueReactionsStep(args) {
|
|
@@ -1093,6 +1163,20 @@ const getCombinedStatus = (token) => tool({
|
|
|
1093
1163
|
...args
|
|
1094
1164
|
})
|
|
1095
1165
|
});
|
|
1166
|
+
async function createCommitStatusStep(args) {
|
|
1167
|
+
"use step";
|
|
1168
|
+
return createCommitStatusCore(args);
|
|
1169
|
+
}
|
|
1170
|
+
/** Report a result on a commit as a commit status. Requires approval by default. */
|
|
1171
|
+
const createCommitStatus = (token, { needsApproval = true } = {}) => tool({
|
|
1172
|
+
description: createCommitStatusDescription,
|
|
1173
|
+
needsApproval,
|
|
1174
|
+
inputSchema: createCommitStatusInputSchema,
|
|
1175
|
+
execute: async (args) => createCommitStatusStep({
|
|
1176
|
+
token: await resolveGithubToken(token, githubTokenCall("createCommitStatus", args)),
|
|
1177
|
+
...args
|
|
1178
|
+
})
|
|
1179
|
+
});
|
|
1096
1180
|
//#endregion
|
|
1097
1181
|
//#region src/tools/security.ts
|
|
1098
1182
|
async function listCodeScanningAlertsStep(args) {
|
|
@@ -1381,7 +1465,7 @@ function callGithubTool(tools) {
|
|
|
1381
1465
|
* `requireApproval: 'auto'` puts the decision model's verdict on approval requests and records the
|
|
1382
1466
|
* calls it lets through as automatic approvals. Calls through `callGithubTool` follow the named tool.
|
|
1383
1467
|
*/
|
|
1384
|
-
function githubToolApproval({ tools, requireApproval, evaluation, overrides }) {
|
|
1468
|
+
function githubToolApproval({ tools, requireApproval, evaluation, overrides, guardrails, dryRun }) {
|
|
1385
1469
|
const policies = /* @__PURE__ */ new Map();
|
|
1386
1470
|
const policyFor = (name) => {
|
|
1387
1471
|
let policy = policies.get(name);
|
|
@@ -1395,6 +1479,14 @@ function githubToolApproval({ tools, requireApproval, evaluation, overrides }) {
|
|
|
1395
1479
|
}
|
|
1396
1480
|
return policy;
|
|
1397
1481
|
};
|
|
1482
|
+
const decide = (name, input, options) => {
|
|
1483
|
+
const reason = guardrailViolation(githubTokenCall(name, input), guardrails);
|
|
1484
|
+
if (reason) return {
|
|
1485
|
+
type: "denied",
|
|
1486
|
+
reason
|
|
1487
|
+
};
|
|
1488
|
+
return dryRun && isGithubWriteToolName(name) ? void 0 : policyFor(name)(input, options);
|
|
1489
|
+
};
|
|
1398
1490
|
return async ({ toolCall, messages, tools: available, toolsContext }) => {
|
|
1399
1491
|
if (toolCall.toolName !== "callGithubTool" && !Object.hasOwn(GITHUB_TOOL_CATALOG, toolCall.toolName)) {
|
|
1400
1492
|
const needsApproval = available?.[toolCall.toolName]?.needsApproval;
|
|
@@ -1404,14 +1496,14 @@ function githubToolApproval({ tools, requireApproval, evaluation, overrides }) {
|
|
|
1404
1496
|
context: toolsContext?.[toolCall.toolName]
|
|
1405
1497
|
}) : needsApproval) ? "user-approval" : void 0;
|
|
1406
1498
|
}
|
|
1407
|
-
if (toolCall.toolName !== "callGithubTool") return
|
|
1499
|
+
if (toolCall.toolName !== "callGithubTool") return decide(toolCall.toolName, toolCall.input, {
|
|
1408
1500
|
toolCallId: toolCall.toolCallId,
|
|
1409
1501
|
messages
|
|
1410
1502
|
});
|
|
1411
1503
|
const { name, input } = toolCall.input;
|
|
1412
1504
|
if (input === void 0) return void 0;
|
|
1413
1505
|
const parsed = await validateInput(tools, name, input);
|
|
1414
|
-
return parsed.success ?
|
|
1506
|
+
return parsed.success ? decide(name, parsed.value, {
|
|
1415
1507
|
toolCallId: toolCall.toolCallId,
|
|
1416
1508
|
messages
|
|
1417
1509
|
}) : void 0;
|
|
@@ -1479,7 +1571,7 @@ function cachedRouting(kind, settings, route, fallback, store) {
|
|
|
1479
1571
|
* const result = await agent.generate({ prompt: 'Review this PR' })
|
|
1480
1572
|
* ```
|
|
1481
1573
|
*/
|
|
1482
|
-
function createGithubAgent({ token, preset, requireApproval, evaluation, overrides, context, instructions, additionalInstructions, author, committer, coAuthors, ...agentOptions }) {
|
|
1574
|
+
function createGithubAgent({ token, preset, requireApproval, evaluation, overrides, context, instructions, additionalInstructions, author, committer, coAuthors, guardrails, dryRun, ...agentOptions }) {
|
|
1483
1575
|
const staticPreset = preset === "auto" ? void 0 : preset;
|
|
1484
1576
|
const tools = createGithubTools({
|
|
1485
1577
|
token,
|
|
@@ -1490,7 +1582,9 @@ function createGithubAgent({ token, preset, requireApproval, evaluation, overrid
|
|
|
1490
1582
|
context,
|
|
1491
1583
|
author,
|
|
1492
1584
|
committer,
|
|
1493
|
-
coAuthors
|
|
1585
|
+
coAuthors,
|
|
1586
|
+
guardrails,
|
|
1587
|
+
dryRun
|
|
1494
1588
|
});
|
|
1495
1589
|
const byTool = preset === "auto" && evaluation?.selection !== "presets";
|
|
1496
1590
|
const agentTools = byTool ? {
|
|
@@ -1502,7 +1596,9 @@ function createGithubAgent({ token, preset, requireApproval, evaluation, overrid
|
|
|
1502
1596
|
tools,
|
|
1503
1597
|
requireApproval,
|
|
1504
1598
|
evaluation,
|
|
1505
|
-
overrides
|
|
1599
|
+
overrides,
|
|
1600
|
+
guardrails,
|
|
1601
|
+
dryRun
|
|
1506
1602
|
}),
|
|
1507
1603
|
...agentOptions,
|
|
1508
1604
|
tools: agentTools,
|
|
@@ -1597,11 +1693,21 @@ function createGithubAgent({ token, preset, requireApproval, evaluation, overrid
|
|
|
1597
1693
|
* addPullRequestComment: false,
|
|
1598
1694
|
* }
|
|
1599
1695
|
* })
|
|
1696
|
+
*
|
|
1697
|
+
* // Try an agent on real repositories without changing them
|
|
1698
|
+
* createGithubTools({ token, dryRun: true })
|
|
1699
|
+
*
|
|
1700
|
+
* // Only act on one org, and only write to agent branches
|
|
1701
|
+
* createGithubTools({
|
|
1702
|
+
* token,
|
|
1703
|
+
* guardrails: { repositories: ['vercel-labs/*'], branches: ['agent/*'] },
|
|
1704
|
+
* })
|
|
1600
1705
|
* ```
|
|
1601
1706
|
*/
|
|
1602
|
-
function createGithubTools({ token, requireApproval = true, evaluation, preset, context, overrides, author, committer, coAuthors } = {}) {
|
|
1603
|
-
const resolveToken =
|
|
1604
|
-
const approval = (name) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval, evaluation) });
|
|
1707
|
+
function createGithubTools({ token, requireApproval = true, evaluation, preset, context, overrides, author, committer, coAuthors, guardrails, dryRun } = {}) {
|
|
1708
|
+
const resolveToken = withGithubGuardrails(token, guardrails);
|
|
1709
|
+
const approval = (name) => ({ needsApproval: guardedApproval(name, resolveAiSdkApproval(name, requireApproval, evaluation), guardrails) });
|
|
1710
|
+
const branches = guardrails?.branches;
|
|
1605
1711
|
const allowed = preset ? resolvePresetTools(preset) : null;
|
|
1606
1712
|
const allTools = {
|
|
1607
1713
|
getRepository: getRepository(resolveToken),
|
|
@@ -1636,20 +1742,27 @@ function createGithubTools({ token, requireApproval = true, evaluation, preset,
|
|
|
1636
1742
|
coAuthors
|
|
1637
1743
|
}),
|
|
1638
1744
|
getBranchRules: getBranchRules(resolveToken),
|
|
1745
|
+
getCollaboratorPermission: getCollaboratorPermission(resolveToken),
|
|
1639
1746
|
listCodeScanningAlerts: listCodeScanningAlerts(resolveToken),
|
|
1640
1747
|
listDependabotAlerts: listDependabotAlerts(resolveToken),
|
|
1641
1748
|
listSecretScanningAlerts: listSecretScanningAlerts(resolveToken),
|
|
1642
1749
|
createPullRequest: createPullRequest(resolveToken, approval("createPullRequest")),
|
|
1643
1750
|
mergePullRequest: mergePullRequest(resolveToken, {
|
|
1644
1751
|
...approval("mergePullRequest"),
|
|
1645
|
-
coAuthors
|
|
1752
|
+
coAuthors,
|
|
1753
|
+
branches
|
|
1646
1754
|
}),
|
|
1647
1755
|
enablePullRequestAutoMerge: enablePullRequestAutoMerge(resolveToken, {
|
|
1648
1756
|
...approval("enablePullRequestAutoMerge"),
|
|
1649
|
-
coAuthors
|
|
1757
|
+
coAuthors,
|
|
1758
|
+
branches
|
|
1650
1759
|
}),
|
|
1651
1760
|
disablePullRequestAutoMerge: disablePullRequestAutoMerge(resolveToken, approval("disablePullRequestAutoMerge")),
|
|
1652
1761
|
updatePullRequest: updatePullRequest(resolveToken, approval("updatePullRequest")),
|
|
1762
|
+
updatePullRequestBranch: updatePullRequestBranch(resolveToken, {
|
|
1763
|
+
...approval("updatePullRequestBranch"),
|
|
1764
|
+
guardrails
|
|
1765
|
+
}),
|
|
1653
1766
|
addPullRequestComment: addPullRequestComment(resolveToken, approval("addPullRequestComment")),
|
|
1654
1767
|
updatePullRequestComment: updatePullRequestComment(resolveToken, approval("updatePullRequestComment")),
|
|
1655
1768
|
deletePullRequestComment: deletePullRequestComment(resolveToken, approval("deletePullRequestComment")),
|
|
@@ -1677,6 +1790,9 @@ function createGithubTools({ token, requireApproval = true, evaluation, preset,
|
|
|
1677
1790
|
deleteLabel: deleteLabel(resolveToken, approval("deleteLabel")),
|
|
1678
1791
|
addAssignees: addAssignees(resolveToken, approval("addAssignees")),
|
|
1679
1792
|
removeAssignees: removeAssignees(resolveToken, approval("removeAssignees")),
|
|
1793
|
+
listMilestones: listMilestones(resolveToken),
|
|
1794
|
+
listSubIssues: listSubIssues(resolveToken),
|
|
1795
|
+
addSubIssue: addSubIssue(resolveToken, approval("addSubIssue")),
|
|
1680
1796
|
listIssueReactions: listIssueReactions(resolveToken),
|
|
1681
1797
|
addIssueReaction: addIssueReaction(resolveToken, approval("addIssueReaction")),
|
|
1682
1798
|
listCommentReactions: listCommentReactions(resolveToken),
|
|
@@ -1703,6 +1819,7 @@ function createGithubTools({ token, requireApproval = true, evaluation, preset,
|
|
|
1703
1819
|
rerunWorkflowRun: rerunWorkflowRun(resolveToken, approval("rerunWorkflowRun")),
|
|
1704
1820
|
listCheckRuns: listCheckRuns(resolveToken),
|
|
1705
1821
|
getCombinedStatus: getCombinedStatus(resolveToken),
|
|
1822
|
+
createCommitStatus: createCommitStatus(resolveToken, approval("createCommitStatus")),
|
|
1706
1823
|
getCiFailureContext: getCiFailureContext(resolveToken),
|
|
1707
1824
|
listReleases: listReleases(resolveToken),
|
|
1708
1825
|
getLatestRelease: getLatestRelease(resolveToken),
|
|
@@ -1721,10 +1838,38 @@ function createGithubTools({ token, requireApproval = true, evaluation, preset,
|
|
|
1721
1838
|
} });
|
|
1722
1839
|
}
|
|
1723
1840
|
}
|
|
1724
|
-
const
|
|
1841
|
+
const wouldApprove = async (name, input, options) => {
|
|
1842
|
+
const override = overrides?.[name]?.needsApproval;
|
|
1843
|
+
if (override !== void 0) return { required: (typeof override === "function" ? await override(input, {
|
|
1844
|
+
...options,
|
|
1845
|
+
context: void 0
|
|
1846
|
+
}) : override) === true };
|
|
1847
|
+
const status = await resolveAiSdkToolApproval(name, requireApproval, evaluation)(input, options);
|
|
1848
|
+
if (status === void 0 || status === "user-approval") return { required: status === "user-approval" };
|
|
1849
|
+
return {
|
|
1850
|
+
required: status.type === "user-approval",
|
|
1851
|
+
reason: status.reason
|
|
1852
|
+
};
|
|
1853
|
+
};
|
|
1854
|
+
const withDryRun = (name, tool) => dryRun && isGithubWriteToolName(name) ? {
|
|
1855
|
+
...tool,
|
|
1856
|
+
needsApproval: false,
|
|
1857
|
+
execute: async (args, { toolCallId, messages }) => dryRunWrite(name, args, guardrails, () => wouldApprove(name, args, {
|
|
1858
|
+
toolCallId,
|
|
1859
|
+
messages
|
|
1860
|
+
}))
|
|
1861
|
+
} : tool;
|
|
1862
|
+
const scoped = bindToolsContext(Object.fromEntries(Object.entries(allTools).map(([name, tool]) => [name, withStrippedRateLimit(withDryRun(name, tool))])), context);
|
|
1725
1863
|
if (!allowed) return scoped;
|
|
1726
1864
|
return Object.fromEntries(Object.entries(scoped).filter(([name]) => allowed.has(name)));
|
|
1727
1865
|
}
|
|
1866
|
+
function guardedApproval(name, needsApproval, guardrails) {
|
|
1867
|
+
if (!guardrails) return needsApproval;
|
|
1868
|
+
return async (input, options) => {
|
|
1869
|
+
if (guardrailViolation(githubTokenCall(name, input), guardrails)) return false;
|
|
1870
|
+
return typeof needsApproval === "function" ? needsApproval(input, options) : needsApproval === true;
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1728
1873
|
function withStrippedRateLimit(tool) {
|
|
1729
1874
|
const inner = tool.toModelOutput;
|
|
1730
1875
|
return {
|
|
@@ -1743,6 +1888,6 @@ function withStrippedRateLimit(tool) {
|
|
|
1743
1888
|
};
|
|
1744
1889
|
}
|
|
1745
1890
|
//#endregion
|
|
1746
|
-
export {
|
|
1891
|
+
export { addLabels as $, deleteGist as A, requestReviewers as At, searchIssues as B, forkRepository as Bt, listWorkflowJobs as C, getPullRequest as Ct, triggerWorkflow as D, listPullRequests as Dt, rerunWorkflowRun as E, listPullRequestReviews as Et, compareCommits as F, createBranch as Ft, getDiscussion as G, getRepositoryTree as Gt, listNotifications as H, getCollaboratorPermission as Ht, getBlame as I, createOrUpdateFile as It, addIssueReaction as J, listDiscussions as K, listBranches as Kt, getCommit as L, createRepository as Lt, listGistComments as M, updatePullRequest as Mt, listGists as N, updatePullRequestBranch as Nt, createGist as O, mergePullRequest as Ot, updateGist as P, updatePullRequestComment as Pt, addIssueComment as Q, listCommits as R, deleteBranch as Rt, getWorkflowRun as S, enablePullRequestAutoMerge as St, listWorkflows as T, listPullRequestReviewThreads as Tt, markNotificationRead as U, getFileContent as Ut, searchRepositories as V, getBranchRules as Vt, addDiscussionComment as W, getRepository as Wt, listIssueReactions as X, listCommentReactions as Y, addAssignees as Z, createCommitStatus as _, addPullRequestComment as _t, getIssueContext as a, deleteLabel as at, cancelWorkflowRun as b, deletePullRequestComment as bt, createRelease as c, listIssues as ct, getRelease as d, listSubIssues as dt, addSubIssue as et, listReleases as f, removeAssignees as ft, listSecretScanningAlerts as g, updateLabel as gt, listDependabotAlerts as h, updateIssueComment as ht, getCiFailureContext as i, deleteIssueComment as it, getGist as j, resolveReviewThread as jt, createGistComment as k, replyToReviewComment as kt, deleteRelease as l, listLabels as lt, listCodeScanningAlerts as m, updateIssue as mt, CALL_GITHUB_TOOL as n, createIssue as nt, getPullRequestContext as o, getIssue as ot, updateRelease as p, removeLabel as pt, addCommentReaction as q, createGithubAgent as r, createLabel as rt, getReleaseContext as s, listIssueComments as st, createGithubTools as t, closeIssue as tt, getLatestRelease as u, listMilestones as ut, getCombinedStatus as v, createPullRequest as vt, listWorkflowRuns as w, listPullRequestFiles as wt, getWorkflowJobLogs as x, disablePullRequestAutoMerge as xt, listCheckRuns as y, createPullRequestReview as yt, searchCode as z, editFiles as zt };
|
|
1747
1892
|
|
|
1748
|
-
//# sourceMappingURL=src-
|
|
1893
|
+
//# sourceMappingURL=src-BlhrSieS.mjs.map
|