@github-tools/sdk 1.11.1 → 1.13.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 +31 -14
- package/dist/connect/eve.d.mts +2 -3
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +8 -86
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/eve-runtime-BkzmgsI2.mjs +274 -0
- package/dist/eve-runtime-BkzmgsI2.mjs.map +1 -0
- package/dist/eve-runtime-C5HaKmOP.d.mts +85 -0
- package/dist/eve-runtime-C5HaKmOP.d.mts.map +1 -0
- package/dist/eve-runtime.d.mts +5 -4
- package/dist/eve-runtime.mjs +3 -3
- package/dist/eve.d.mts +4 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +2 -2
- package/dist/index-BjRUOM2Z.d.mts +287 -0
- package/dist/index-BjRUOM2Z.d.mts.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +3 -3
- package/dist/{src-jQWS2Txw.mjs → src-DPcwVTf-.mjs} +98 -4
- package/dist/src-DPcwVTf-.mjs.map +1 -0
- package/dist/{token-1uPUq_g-.mjs → token-qesvchbI.mjs} +23 -169
- package/dist/token-qesvchbI.mjs.map +1 -0
- package/dist/tool-types-K8i--5D9.d.mts +3255 -0
- package/dist/tool-types-K8i--5D9.d.mts.map +1 -0
- package/dist/{types-BD5YvGxm.d.mts → types-6aWpzNzg.d.mts} +3 -3
- package/dist/{types-BD5YvGxm.d.mts.map → types-6aWpzNzg.d.mts.map} +1 -1
- package/dist/{types-BDO-Mmn6.d.mts → types-BVSe0Zey.d.mts} +4 -3
- package/dist/types-BVSe0Zey.d.mts.map +1 -0
- package/dist/workflow.d.mts +2 -1
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +2 -2
- package/dist/{write-tools-Dk32V9Hl.mjs → write-tools-BEcL5Fv6.mjs} +2626 -1513
- package/dist/write-tools-BEcL5Fv6.mjs.map +1 -0
- package/package.json +5 -5
- package/dist/eve-runtime-Cb0LVEvS.d.mts +0 -66
- package/dist/eve-runtime-Cb0LVEvS.d.mts.map +0 -1
- package/dist/eve-runtime-DInXr4h5.mjs +0 -734
- package/dist/eve-runtime-DInXr4h5.mjs.map +0 -1
- package/dist/index-BNeMjmgp.d.mts +0 -770
- package/dist/index-BNeMjmgp.d.mts.map +0 -1
- package/dist/src-jQWS2Txw.mjs.map +0 -1
- package/dist/token-1uPUq_g-.mjs.map +0 -1
- package/dist/types-BDO-Mmn6.d.mts.map +0 -1
- package/dist/write-tools-Dk32V9Hl.mjs.map +0 -1
|
@@ -1,770 +0,0 @@
|
|
|
1
|
-
import { Tool, ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { Octokit, Octokit as Octokit$1 } from "octokit";
|
|
4
|
-
//#region src/core/tool-names.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* All GitHub tool names available via {@link createGithubTools}.
|
|
7
|
-
* Each key maps to its own string literal for IDE autocomplete and hover docs.
|
|
8
|
-
*/
|
|
9
|
-
declare const GITHUB_TOOL_NAMES: {
|
|
10
|
-
/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */
|
|
11
|
-
readonly getRepository: "getRepository";
|
|
12
|
-
/** List branches in a GitHub repository. */
|
|
13
|
-
readonly listBranches: "listBranches";
|
|
14
|
-
/** Get the content of a file from a GitHub repository. Prefer startLine/endLine or maxLines for large files. */
|
|
15
|
-
readonly getFileContent: "getFileContent";
|
|
16
|
-
/** List the file and directory structure of a repository at a given ref. */
|
|
17
|
-
readonly getRepositoryTree: "getRepositoryTree";
|
|
18
|
-
/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
|
|
19
|
-
readonly createBranch: "createBranch";
|
|
20
|
-
/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
21
|
-
readonly forkRepository: "forkRepository";
|
|
22
|
-
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
23
|
-
readonly createRepository: "createRepository";
|
|
24
|
-
/** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
|
|
25
|
-
readonly createOrUpdateFile: "createOrUpdateFile";
|
|
26
|
-
/** List pull requests for a GitHub repository. */
|
|
27
|
-
readonly listPullRequests: "listPullRequests";
|
|
28
|
-
/** Get detailed information about a specific pull request. Body truncated by default (detail: summary). */
|
|
29
|
-
readonly getPullRequest: "getPullRequest";
|
|
30
|
-
/** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
31
|
-
readonly createPullRequest: "createPullRequest";
|
|
32
|
-
/** Merge a pull request. Requires approval by default. */
|
|
33
|
-
readonly mergePullRequest: "mergePullRequest";
|
|
34
|
-
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
35
|
-
readonly updatePullRequest: "updatePullRequest";
|
|
36
|
-
/** Add a comment to a pull request. Requires approval by default. */
|
|
37
|
-
readonly addPullRequestComment: "addPullRequestComment";
|
|
38
|
-
/** Update the body of a comment on a pull request. Requires approval by default. */
|
|
39
|
-
readonly updatePullRequestComment: "updatePullRequestComment";
|
|
40
|
-
/** Delete a comment from a pull request permanently. Requires approval by default. */
|
|
41
|
-
readonly deletePullRequestComment: "deletePullRequestComment";
|
|
42
|
-
/** List files changed in a pull request with status and stats. Patches omitted by default — set includePatch true for diffs. */
|
|
43
|
-
readonly listPullRequestFiles: "listPullRequestFiles";
|
|
44
|
-
/** List reviews on a pull request (approvals, change requests, and comments). */
|
|
45
|
-
readonly listPullRequestReviews: "listPullRequestReviews";
|
|
46
|
-
/** Submit a pull request review — approve, request changes, or comment with optional inline comments on specific lines. Requires approval by default. */
|
|
47
|
-
readonly createPullRequestReview: "createPullRequestReview";
|
|
48
|
-
/** Request reviews from users or teams on a pull request. Requires approval by default. */
|
|
49
|
-
readonly requestReviewers: "requestReviewers";
|
|
50
|
-
/** Fetch pull request details plus files, reviews, and optional CI checks in one call. */
|
|
51
|
-
readonly getPullRequestContext: "getPullRequestContext";
|
|
52
|
-
/** List issues for a GitHub repository (excludes pull requests). */
|
|
53
|
-
readonly listIssues: "listIssues";
|
|
54
|
-
/** Get detailed information about a specific issue. Body truncated by default (detail: summary). */
|
|
55
|
-
readonly getIssue: "getIssue";
|
|
56
|
-
/** Fetch an issue plus available label names and recent comments in one call. */
|
|
57
|
-
readonly getIssueContext: "getIssueContext";
|
|
58
|
-
/** List comments on a GitHub issue. Bodies are truncated by default (detail: summary). Prefer getIssueContext for the first page when triaging. */
|
|
59
|
-
readonly listIssueComments: "listIssueComments";
|
|
60
|
-
/** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
61
|
-
readonly createIssue: "createIssue";
|
|
62
|
-
/** Add a comment to a GitHub issue. Requires approval by default. */
|
|
63
|
-
readonly addIssueComment: "addIssueComment";
|
|
64
|
-
/** Update the body of a comment on a GitHub issue. Requires approval by default. */
|
|
65
|
-
readonly updateIssueComment: "updateIssueComment";
|
|
66
|
-
/** Delete a comment from a GitHub issue permanently. Requires approval by default. */
|
|
67
|
-
readonly deleteIssueComment: "deleteIssueComment";
|
|
68
|
-
/** Close an open GitHub issue. Requires approval by default. */
|
|
69
|
-
readonly closeIssue: "closeIssue";
|
|
70
|
-
/** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */
|
|
71
|
-
readonly updateIssue: "updateIssue";
|
|
72
|
-
/** List labels available in a GitHub repository. */
|
|
73
|
-
readonly listLabels: "listLabels";
|
|
74
|
-
/** Add labels to an issue or pull request. Requires approval by default. */
|
|
75
|
-
readonly addLabels: "addLabels";
|
|
76
|
-
/** Remove a label from an issue or pull request. Requires approval by default. */
|
|
77
|
-
readonly removeLabel: "removeLabel";
|
|
78
|
-
/** Create a label in a GitHub repository. Requires approval by default. */
|
|
79
|
-
readonly createLabel: "createLabel";
|
|
80
|
-
/** Update a label in a GitHub repository — name, color, or description. Requires approval by default. */
|
|
81
|
-
readonly updateLabel: "updateLabel";
|
|
82
|
-
/** Delete a label from a GitHub repository permanently. Requires approval by default. */
|
|
83
|
-
readonly deleteLabel: "deleteLabel";
|
|
84
|
-
/** Assign users to an issue or pull request. Requires approval by default. */
|
|
85
|
-
readonly addAssignees: "addAssignees";
|
|
86
|
-
/** Remove assignees from an issue or pull request. Requires approval by default. */
|
|
87
|
-
readonly removeAssignees: "removeAssignees";
|
|
88
|
-
/** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. Results include matching text snippets when GitHub returns them. */
|
|
89
|
-
readonly searchCode: "searchCode";
|
|
90
|
-
/** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
|
|
91
|
-
readonly searchRepositories: "searchRepositories";
|
|
92
|
-
/** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */
|
|
93
|
-
readonly searchIssues: "searchIssues";
|
|
94
|
-
/** List commits for a GitHub repository. Filter by file path to see commits that touched a file. For line-by-line attribution at a given ref, use getBlame instead. */
|
|
95
|
-
readonly listCommits: "listCommits";
|
|
96
|
-
/** Get detailed information about a specific commit, including the list of files changed. Patches omitted by default. */
|
|
97
|
-
readonly getCommit: "getCommit";
|
|
98
|
-
/** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). Returns contiguous ranges mapping lines to the commits that last modified them. */
|
|
99
|
-
readonly getBlame: "getBlame";
|
|
100
|
-
/** Compare two branches, tags, or commits — ahead/behind counts, commits in between, and differing files. Patches omitted by default. */
|
|
101
|
-
readonly compareCommits: "compareCommits";
|
|
102
|
-
/** List gists for the authenticated user or a specific user. */
|
|
103
|
-
readonly listGists: "listGists";
|
|
104
|
-
/** Get a gist by ID, including file contents. */
|
|
105
|
-
readonly getGist: "getGist";
|
|
106
|
-
/** List comments on a gist. */
|
|
107
|
-
readonly listGistComments: "listGistComments";
|
|
108
|
-
/** Create a new gist with one or more files. Requires approval by default. */
|
|
109
|
-
readonly createGist: "createGist";
|
|
110
|
-
/** Update an existing gist — edit description, update files, or remove files. Requires approval by default. */
|
|
111
|
-
readonly updateGist: "updateGist";
|
|
112
|
-
/** Delete a gist permanently. Requires approval by default. */
|
|
113
|
-
readonly deleteGist: "deleteGist";
|
|
114
|
-
/** Add a comment to a gist. Requires approval by default. */
|
|
115
|
-
readonly createGistComment: "createGistComment";
|
|
116
|
-
/** List GitHub Actions workflows in a repository. */
|
|
117
|
-
readonly listWorkflows: "listWorkflows";
|
|
118
|
-
/** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
|
|
119
|
-
readonly listWorkflowRuns: "listWorkflowRuns";
|
|
120
|
-
/** Get details of a specific workflow run including status, timing, and trigger info. */
|
|
121
|
-
readonly getWorkflowRun: "getWorkflowRun";
|
|
122
|
-
/** List jobs for a workflow run, including step-level status and timing. */
|
|
123
|
-
readonly listWorkflowJobs: "listWorkflowJobs";
|
|
124
|
-
/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
125
|
-
readonly triggerWorkflow: "triggerWorkflow";
|
|
126
|
-
/** Cancel an in-progress workflow run. Requires approval by default. */
|
|
127
|
-
readonly cancelWorkflowRun: "cancelWorkflowRun";
|
|
128
|
-
/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
129
|
-
readonly rerunWorkflowRun: "rerunWorkflowRun";
|
|
130
|
-
/** List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. */
|
|
131
|
-
readonly listCheckRuns: "listCheckRuns";
|
|
132
|
-
/** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */
|
|
133
|
-
readonly getCombinedStatus: "getCombinedStatus";
|
|
134
|
-
/** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs in one call. */
|
|
135
|
-
readonly getCiFailureContext: "getCiFailureContext";
|
|
136
|
-
/** List discussions in a GitHub repository, most recently updated first, optionally filtered by category. */
|
|
137
|
-
readonly listDiscussions: "listDiscussions";
|
|
138
|
-
/** Get a GitHub discussion by number. Body truncated by default (detail: summary). */
|
|
139
|
-
readonly getDiscussion: "getDiscussion";
|
|
140
|
-
/** Add a comment to a GitHub discussion. Requires approval by default. */
|
|
141
|
-
readonly addDiscussionComment: "addDiscussionComment";
|
|
142
|
-
/** List notification threads for the authenticated user. Requires a token with notifications access. */
|
|
143
|
-
readonly listNotifications: "listNotifications";
|
|
144
|
-
/** Mark a single notification thread as read. Requires approval by default. */
|
|
145
|
-
readonly markNotificationRead: "markNotificationRead";
|
|
146
|
-
/** List reactions on an issue or pull request conversation, with per-emoji counts. */
|
|
147
|
-
readonly listIssueReactions: "listIssueReactions";
|
|
148
|
-
/** React to an issue or pull request with an emoji. Requires approval by default. */
|
|
149
|
-
readonly addIssueReaction: "addIssueReaction";
|
|
150
|
-
/** List reactions on an issue or pull request comment, with per-emoji counts. */
|
|
151
|
-
readonly listCommentReactions: "listCommentReactions";
|
|
152
|
-
/** React to an issue or pull request comment with an emoji. Requires approval by default. */
|
|
153
|
-
readonly addCommentReaction: "addCommentReaction";
|
|
154
|
-
/** List releases for a GitHub repository, newest first (includes drafts and prereleases). */
|
|
155
|
-
readonly listReleases: "listReleases";
|
|
156
|
-
/** Get the latest published release for a GitHub repository (excludes drafts and prereleases). Body truncated by default. */
|
|
157
|
-
readonly getLatestRelease: "getLatestRelease";
|
|
158
|
-
/** Get a specific release by ID, including its assets. Body truncated by default. */
|
|
159
|
-
readonly getRelease: "getRelease";
|
|
160
|
-
/** Fetch a release plus the previous release and tag comparison in one call. */
|
|
161
|
-
readonly getReleaseContext: "getReleaseContext";
|
|
162
|
-
/** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */
|
|
163
|
-
readonly createRelease: "createRelease";
|
|
164
|
-
/** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */
|
|
165
|
-
readonly updateRelease: "updateRelease";
|
|
166
|
-
/** Delete a release permanently. Requires approval by default. */
|
|
167
|
-
readonly deleteRelease: "deleteRelease";
|
|
168
|
-
};
|
|
169
|
-
type GithubToolName = typeof GITHUB_TOOL_NAMES[keyof typeof GITHUB_TOOL_NAMES];
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/core/presets.d.ts
|
|
172
|
-
/**
|
|
173
|
-
* Predefined tool presets for common use cases.
|
|
174
|
-
* Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}.
|
|
175
|
-
* Presets can be combined by passing an array.
|
|
176
|
-
*/
|
|
177
|
-
declare const PRESET_TOOLS: {
|
|
178
|
-
/**
|
|
179
|
-
* **Code review** — review pull requests and submit feedback.
|
|
180
|
-
*
|
|
181
|
-
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `getPullRequestContext`,
|
|
182
|
-
* `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`, `listBranches`,
|
|
183
|
-
* `searchCode`, `listCheckRuns`, `getCombinedStatus`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`,
|
|
184
|
-
* `deletePullRequestComment`, `createPullRequestReview`, `requestReviewers`.
|
|
185
|
-
*
|
|
186
|
-
* Agent prompt: optimized for thorough PR review with inline feedback.
|
|
187
|
-
*/
|
|
188
|
-
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "getPullRequestContext", "getFileContent", "listCommits", "getCommit", "getBlame", "compareCommits", "getRepository", "listBranches", "searchCode", "listCheckRuns", "getCombinedStatus", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "requestReviewers"];
|
|
189
|
-
/**
|
|
190
|
-
* **Issue triage** — manage and organize GitHub issues.
|
|
191
|
-
*
|
|
192
|
-
* Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`,
|
|
193
|
-
* `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`,
|
|
194
|
-
* `addAssignees`, `removeAssignees`,
|
|
195
|
-
* `listIssueReactions`, `addIssueReaction`, `listCommentReactions`, `addCommentReaction`, `getRepository`,
|
|
196
|
-
* `searchRepositories`, `searchCode`, `searchIssues`.
|
|
197
|
-
*
|
|
198
|
-
* Prefer `getIssueContext` (issue + `labelNames` + recent comments) over separate get/list calls.
|
|
199
|
-
* Use `listIssueComments` to paginate beyond the comments returned by `getIssueContext`.
|
|
200
|
-
* Reopen a closed issue with `updateIssue` (`state: 'open'`) — there is no separate reopen tool.
|
|
201
|
-
* Acknowledge a report with `addIssueReaction` / `addCommentReaction` instead of a comment when no reply is needed.
|
|
202
|
-
* Agent prompt: optimized for categorizing, labeling, and responding to issues.
|
|
203
|
-
*/
|
|
204
|
-
readonly 'issue-triage': readonly ["listIssues", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "getRepository", "searchRepositories", "searchCode", "searchIssues"];
|
|
205
|
-
/**
|
|
206
|
-
* **CI operations** — monitor and manage GitHub Actions workflows.
|
|
207
|
-
*
|
|
208
|
-
* Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`,
|
|
209
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`,
|
|
210
|
-
* `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
|
|
211
|
-
*
|
|
212
|
-
* Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
|
|
213
|
-
*/
|
|
214
|
-
readonly 'ci-ops': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
|
|
215
|
-
/**
|
|
216
|
-
* **Repository explorer** — read-only access to browse codebases.
|
|
217
|
-
*
|
|
218
|
-
* Tools: all read-only tools including repos, branches, PRs, issues, discussions, commits, blame, comparisons,
|
|
219
|
-
* search, gists, workflows, checks, and releases. No write operations.
|
|
220
|
-
*
|
|
221
|
-
* Agent prompt: optimized for answering questions about code structure and history.
|
|
222
|
-
*/
|
|
223
|
-
readonly 'repo-explorer': readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "getPullRequestContext", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "listDiscussions", "getDiscussion", "listLabels", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listGists", "getGist", "listGistComments", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext"];
|
|
224
|
-
/**
|
|
225
|
-
* **Security audit** — review repositories for security risks and report findings.
|
|
226
|
-
*
|
|
227
|
-
* Tools: read-only exploration (`getFileContent`, `getRepositoryTree`, `searchCode`, `searchIssues`, `listCommits`, `getCommit`,
|
|
228
|
-
* `getBlame`, `compareCommits`), PR and CI visibility (`listPullRequests`, `getPullRequest`, `listPullRequestFiles`,
|
|
229
|
-
* `getPullRequestContext`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `listWorkflows`, `listWorkflowRuns`,
|
|
230
|
-
* `getWorkflowRun`, `listWorkflowJobs`), plus `createIssue`, `addIssueComment`, and `addLabels` to report findings.
|
|
231
|
-
* No destructive writes.
|
|
232
|
-
*
|
|
233
|
-
* Agent prompt: optimized for finding and reporting security risks without making changes.
|
|
234
|
-
*/
|
|
235
|
-
readonly 'security-audit': readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listPullRequests", "getPullRequest", "listPullRequestFiles", "getPullRequestContext", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "listIssues", "getIssue", "getIssueContext", "createIssue", "addIssueComment", "addLabels"];
|
|
236
|
-
/**
|
|
237
|
-
* **Release manager** — prepare and publish GitHub releases.
|
|
238
|
-
*
|
|
239
|
-
* Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`, `compareCommits`,
|
|
240
|
-
* `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`, `deleteRelease`,
|
|
241
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`,
|
|
242
|
-
* `listPullRequests`, `getPullRequest`.
|
|
243
|
-
*
|
|
244
|
-
* Agent prompt: optimized for summarizing changes and cutting releases safely.
|
|
245
|
-
*/
|
|
246
|
-
readonly 'release-manager': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "compareCommits", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "listPullRequests", "getPullRequest"];
|
|
247
|
-
/**
|
|
248
|
-
* **Discussion moderator** — answer and moderate repository Discussions.
|
|
249
|
-
*
|
|
250
|
-
* Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`,
|
|
251
|
-
* `getRepository`, `searchIssues`, `getIssueContext`, `addIssueComment`.
|
|
252
|
-
*
|
|
253
|
-
* Prefer discussions for Q&A; link related issues with `getIssueContext` / `addIssueComment` when needed.
|
|
254
|
-
* Agent prompt: optimized for clear, on-topic discussion replies.
|
|
255
|
-
*/
|
|
256
|
-
readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "searchIssues", "getIssueContext", "addIssueComment"];
|
|
257
|
-
/**
|
|
258
|
-
* **Notification inbox** — triage authenticated-user notification threads.
|
|
259
|
-
*
|
|
260
|
-
* Tools: `listNotifications`, `markNotificationRead`, `getIssue`, `getPullRequest`, `getRepository`.
|
|
261
|
-
*
|
|
262
|
-
* Requires a user PAT with the Notifications account permission — not available on Connect installation tokens.
|
|
263
|
-
* Agent prompt: optimized for clearing inbox noise and following up on actionable threads.
|
|
264
|
-
*/
|
|
265
|
-
readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getIssue", "getPullRequest", "getRepository"];
|
|
266
|
-
/**
|
|
267
|
-
* **PR author** — open pull requests without the full write surface.
|
|
268
|
-
*
|
|
269
|
-
* Tools: `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `createOrUpdateFile`,
|
|
270
|
-
* `createPullRequest`, `updatePullRequest`, `getPullRequest`, `listPullRequestFiles`,
|
|
271
|
-
* `compareCommits`, `getCommit`.
|
|
272
|
-
*
|
|
273
|
-
* Agent prompt: optimized for branching, editing files, and opening focused PRs.
|
|
274
|
-
*/
|
|
275
|
-
readonly 'pr-author': readonly ["getRepository", "listBranches", "getFileContent", "createBranch", "createOrUpdateFile", "createPullRequest", "updatePullRequest", "getPullRequest", "listPullRequestFiles", "compareCommits", "getCommit"];
|
|
276
|
-
/**
|
|
277
|
-
* **Maintainer** — full repository maintenance with all read and write tools.
|
|
278
|
-
*
|
|
279
|
-
* Tools: all tools (same as omitting `preset`).
|
|
280
|
-
*
|
|
281
|
-
* Agent prompt: optimized for day-to-day repo maintenance with careful write operations.
|
|
282
|
-
*/
|
|
283
|
-
readonly maintainer: readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "createBranch", "forkRepository", "createRepository", "createOrUpdateFile", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "getPullRequestContext", "createPullRequest", "mergePullRequest", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "requestReviewers", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "listLabels", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "listDiscussions", "getDiscussion", "addDiscussionComment", "listNotifications", "markNotificationRead", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listGists", "getGist", "listGistComments", "createGist", "updateGist", "deleteGist", "createGistComment", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease"];
|
|
284
|
-
};
|
|
285
|
-
type GithubToolPreset = keyof typeof PRESET_TOOLS;
|
|
286
|
-
/** Tool names included in a single preset. */
|
|
287
|
-
type PresetToolName<P extends GithubToolPreset> = Extract<(typeof PRESET_TOOLS)[P][number], GithubToolName>;
|
|
288
|
-
/** Tool names included when combining multiple presets. */
|
|
289
|
-
type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetToolName<P[number]>;
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region src/core/write-tools.d.ts
|
|
292
|
-
/**
|
|
293
|
-
* Write tools that mutate GitHub state. All require user approval by default
|
|
294
|
-
* unless overridden via {@link ApprovalConfig}.
|
|
295
|
-
*/
|
|
296
|
-
declare const GITHUB_WRITE_TOOLS: {
|
|
297
|
-
/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
|
|
298
|
-
readonly createBranch: "createBranch";
|
|
299
|
-
/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
300
|
-
readonly forkRepository: "forkRepository";
|
|
301
|
-
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
302
|
-
readonly createRepository: "createRepository";
|
|
303
|
-
/** Create or update a file in a GitHub repository. Requires approval by default. */
|
|
304
|
-
readonly createOrUpdateFile: "createOrUpdateFile";
|
|
305
|
-
/** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
306
|
-
readonly createPullRequest: "createPullRequest";
|
|
307
|
-
/** Merge a pull request. Requires approval by default. */
|
|
308
|
-
readonly mergePullRequest: "mergePullRequest";
|
|
309
|
-
/** Update a pull request. Requires approval by default. */
|
|
310
|
-
readonly updatePullRequest: "updatePullRequest";
|
|
311
|
-
/** Add a comment to a pull request. Requires approval by default. */
|
|
312
|
-
readonly addPullRequestComment: "addPullRequestComment";
|
|
313
|
-
/** Update a pull request comment. Requires approval by default. */
|
|
314
|
-
readonly updatePullRequestComment: "updatePullRequestComment";
|
|
315
|
-
/** Delete a pull request comment. Requires approval by default. */
|
|
316
|
-
readonly deletePullRequestComment: "deletePullRequestComment";
|
|
317
|
-
/** Submit a pull request review with optional inline comments. Requires approval by default. */
|
|
318
|
-
readonly createPullRequestReview: "createPullRequestReview";
|
|
319
|
-
/** Request reviews from users or teams on a pull request. Requires approval by default. */
|
|
320
|
-
readonly requestReviewers: "requestReviewers";
|
|
321
|
-
/** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
322
|
-
readonly createIssue: "createIssue";
|
|
323
|
-
/** Add a comment to a GitHub issue. Requires approval by default. */
|
|
324
|
-
readonly addIssueComment: "addIssueComment";
|
|
325
|
-
/** Update a GitHub issue comment. Requires approval by default. */
|
|
326
|
-
readonly updateIssueComment: "updateIssueComment";
|
|
327
|
-
/** Delete a GitHub issue comment. Requires approval by default. */
|
|
328
|
-
readonly deleteIssueComment: "deleteIssueComment";
|
|
329
|
-
/** Close an open GitHub issue. Requires approval by default. */
|
|
330
|
-
readonly closeIssue: "closeIssue";
|
|
331
|
-
/** Update a GitHub issue. Requires approval by default. */
|
|
332
|
-
readonly updateIssue: "updateIssue";
|
|
333
|
-
/** Add labels to an issue or pull request. Requires approval by default. */
|
|
334
|
-
readonly addLabels: "addLabels";
|
|
335
|
-
/** Remove a label from an issue or pull request. Requires approval by default. */
|
|
336
|
-
readonly removeLabel: "removeLabel";
|
|
337
|
-
/** Create a label in a GitHub repository. Requires approval by default. */
|
|
338
|
-
readonly createLabel: "createLabel";
|
|
339
|
-
/** Update a label in a GitHub repository. Requires approval by default. */
|
|
340
|
-
readonly updateLabel: "updateLabel";
|
|
341
|
-
/** Delete a label from a GitHub repository permanently. Requires approval by default. */
|
|
342
|
-
readonly deleteLabel: "deleteLabel";
|
|
343
|
-
/** Assign users to an issue or pull request. Requires approval by default. */
|
|
344
|
-
readonly addAssignees: "addAssignees";
|
|
345
|
-
/** Remove assignees from an issue or pull request. Requires approval by default. */
|
|
346
|
-
readonly removeAssignees: "removeAssignees";
|
|
347
|
-
/** Create a new gist with one or more files. Requires approval by default. */
|
|
348
|
-
readonly createGist: "createGist";
|
|
349
|
-
/** Update an existing gist. Requires approval by default. */
|
|
350
|
-
readonly updateGist: "updateGist";
|
|
351
|
-
/** Delete a gist permanently. Requires approval by default. */
|
|
352
|
-
readonly deleteGist: "deleteGist";
|
|
353
|
-
/** Add a comment to a gist. Requires approval by default. */
|
|
354
|
-
readonly createGistComment: "createGistComment";
|
|
355
|
-
/** Add a comment to a GitHub discussion. Requires approval by default. */
|
|
356
|
-
readonly addDiscussionComment: "addDiscussionComment";
|
|
357
|
-
/** Mark a single notification thread as read. Requires approval by default. */
|
|
358
|
-
readonly markNotificationRead: "markNotificationRead";
|
|
359
|
-
/** React to an issue or pull request with an emoji. Requires approval by default. */
|
|
360
|
-
readonly addIssueReaction: "addIssueReaction";
|
|
361
|
-
/** React to an issue or pull request comment with an emoji. Requires approval by default. */
|
|
362
|
-
readonly addCommentReaction: "addCommentReaction";
|
|
363
|
-
/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
364
|
-
readonly triggerWorkflow: "triggerWorkflow";
|
|
365
|
-
/** Cancel an in-progress workflow run. Requires approval by default. */
|
|
366
|
-
readonly cancelWorkflowRun: "cancelWorkflowRun";
|
|
367
|
-
/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
368
|
-
readonly rerunWorkflowRun: "rerunWorkflowRun";
|
|
369
|
-
/** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */
|
|
370
|
-
readonly createRelease: "createRelease";
|
|
371
|
-
/** Update an existing release. Requires approval by default. */
|
|
372
|
-
readonly updateRelease: "updateRelease";
|
|
373
|
-
/** Delete a release permanently. Requires approval by default. */
|
|
374
|
-
readonly deleteRelease: "deleteRelease";
|
|
375
|
-
};
|
|
376
|
-
type GithubWriteToolName = typeof GITHUB_WRITE_TOOLS[keyof typeof GITHUB_WRITE_TOOLS];
|
|
377
|
-
//#endregion
|
|
378
|
-
//#region src/core/approval.d.ts
|
|
379
|
-
/**
|
|
380
|
-
* Whether write operations require user approval.
|
|
381
|
-
*
|
|
382
|
-
* - `true` — all write tools need approval (default)
|
|
383
|
-
* - `false` — no approval needed for any write tool
|
|
384
|
-
* - object — per-tool override via {@link GithubWriteToolName}; unspecified write tools default to `true`
|
|
385
|
-
*
|
|
386
|
-
* @example Global disable
|
|
387
|
-
* ```ts
|
|
388
|
-
* createGithubTools({ token, requireApproval: false })
|
|
389
|
-
* ```
|
|
390
|
-
*
|
|
391
|
-
* @example Granular per write tool
|
|
392
|
-
* ```ts
|
|
393
|
-
* createGithubTools({
|
|
394
|
-
* token,
|
|
395
|
-
* requireApproval: {
|
|
396
|
-
* mergePullRequest: true,
|
|
397
|
-
* createOrUpdateFile: true,
|
|
398
|
-
* addPullRequestComment: false,
|
|
399
|
-
* },
|
|
400
|
-
* })
|
|
401
|
-
* ```
|
|
402
|
-
*/
|
|
403
|
-
type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
|
|
404
|
-
//#endregion
|
|
405
|
-
//#region src/types.d.ts
|
|
406
|
-
type GithubTool = Tool<any, any>;
|
|
407
|
-
type ToolOptions = {
|
|
408
|
-
needsApproval?: boolean;
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* Identity for a commit author or committer on GitHub.
|
|
412
|
-
*
|
|
413
|
-
* - **Author** — the person who originally wrote the code patch.
|
|
414
|
-
* - **Committer** — the person who applied the commit to the repository.
|
|
415
|
-
*/
|
|
416
|
-
type CommitIdentity = {
|
|
417
|
-
name: string;
|
|
418
|
-
email: string;
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* Options for commit-creating tools (`createOrUpdateFile`, `mergePullRequest`).
|
|
422
|
-
*/
|
|
423
|
-
type CommitToolOptions = ToolOptions & {
|
|
424
|
-
/**
|
|
425
|
-
* The author of the commit — the person who wrote the code patch.
|
|
426
|
-
* Falls back to the authenticated user when omitted.
|
|
427
|
-
*/
|
|
428
|
-
author?: CommitIdentity;
|
|
429
|
-
/**
|
|
430
|
-
* The committer of the commit — the person who applied the commit.
|
|
431
|
-
* Falls back to the authenticated user when omitted.
|
|
432
|
-
*/
|
|
433
|
-
committer?: CommitIdentity;
|
|
434
|
-
/**
|
|
435
|
-
* Co-authors to attribute on commits.
|
|
436
|
-
* Added as "Co-authored-by" trailers to commit messages.
|
|
437
|
-
*/
|
|
438
|
-
coAuthors?: CommitIdentity[];
|
|
439
|
-
};
|
|
440
|
-
/**
|
|
441
|
-
* Per-tool overrides for customizing tool behavior without changing the underlying implementation.
|
|
442
|
-
*
|
|
443
|
-
* Overridable properties: `description`, `title`, `needsApproval`, `strict`, `providerOptions`,
|
|
444
|
-
* `toModelOutput`, and input lifecycle callbacks (`onInputStart`, `onInputDelta`, `onInputAvailable`).
|
|
445
|
-
*
|
|
446
|
-
* `execute`, `inputSchema`, and `outputSchema` cannot be overridden.
|
|
447
|
-
*
|
|
448
|
-
* @example
|
|
449
|
-
* ```ts
|
|
450
|
-
* createGithubTools({
|
|
451
|
-
* overrides: {
|
|
452
|
-
* mergePullRequest: { needsApproval: true, title: 'Merge PR' },
|
|
453
|
-
* listIssues: { description: 'List open bugs' },
|
|
454
|
-
* },
|
|
455
|
-
* })
|
|
456
|
-
* ```
|
|
457
|
-
*/
|
|
458
|
-
type ToolOverrides = Partial<Pick<Tool, 'description' | 'needsApproval' | 'onInputAvailable' | 'onInputDelta' | 'onInputStart' | 'providerOptions' | 'strict' | 'title' | 'toModelOutput'>>;
|
|
459
|
-
//#endregion
|
|
460
|
-
//#region src/core/context.d.ts
|
|
461
|
-
/**
|
|
462
|
-
* Default repository / issue / PR / ref values applied to tool inputs and
|
|
463
|
-
* injected into agent system prompts.
|
|
464
|
-
*
|
|
465
|
-
* When a field is set here, matching tool schema fields become optional and
|
|
466
|
-
* default to this value if the model omits them.
|
|
467
|
-
*/
|
|
468
|
-
type GithubToolsContext = {
|
|
469
|
-
owner?: string;
|
|
470
|
-
repo?: string;
|
|
471
|
-
pullNumber?: number;
|
|
472
|
-
issueNumber?: number;
|
|
473
|
-
ref?: string;
|
|
474
|
-
};
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region src/core/token.d.ts
|
|
477
|
-
type GithubTokenInput = string | (() => Promise<string>);
|
|
478
|
-
/** Resolves a {@link GithubTokenInput} to a token string. */
|
|
479
|
-
declare function resolveGithubToken(token?: GithubTokenInput): Promise<string>;
|
|
480
|
-
//#endregion
|
|
481
|
-
//#region src/core/tool-types.d.ts
|
|
482
|
-
/** Full tool set returned when no `preset` is specified. */
|
|
483
|
-
type AllGithubTools = Record<GithubToolName, GithubTool>;
|
|
484
|
-
/** Base options shared by all {@link createGithubTools} overloads. */
|
|
485
|
-
type GithubToolsBaseOptions = {
|
|
486
|
-
/** GitHub token string or async provider. Falls back to `process.env.GITHUB_TOKEN` when omitted. */
|
|
487
|
-
token?: GithubTokenInput;
|
|
488
|
-
/** Control whether write operations require user approval. @see {@link ApprovalConfig} */
|
|
489
|
-
requireApproval?: ApprovalConfig;
|
|
490
|
-
/**
|
|
491
|
-
* Default owner / repo / PR / issue / ref values.
|
|
492
|
-
* Softens matching tool input fields and fills them when the model omits them.
|
|
493
|
-
* Also injected into agent system prompts via {@link createGithubAgent}.
|
|
494
|
-
*/
|
|
495
|
-
context?: GithubToolsContext;
|
|
496
|
-
/** Per-tool overrides for description, title, needsApproval, and related AI SDK tool fields. */
|
|
497
|
-
overrides?: Partial<Record<GithubToolName, ToolOverrides>>;
|
|
498
|
-
/** Default author for commit-creating tools. Falls back to the authenticated user when omitted. */
|
|
499
|
-
author?: CommitIdentity;
|
|
500
|
-
/** Default committer for commit-creating tools. Falls back to the authenticated user when omitted. */
|
|
501
|
-
committer?: CommitIdentity;
|
|
502
|
-
/** Co-authors to attribute on all commits created by tools. */
|
|
503
|
-
coAuthors?: CommitIdentity[];
|
|
504
|
-
};
|
|
505
|
-
/** Tool set shape for a given preset option (single, combined, or all tools). */
|
|
506
|
-
type GithubToolsForPreset<P extends GithubToolPreset | readonly GithubToolPreset[] | undefined> = P extends GithubToolPreset ? Pick<AllGithubTools, PresetToolName<P> & GithubToolName> : P extends readonly GithubToolPreset[] ? Pick<AllGithubTools, CombinedPresetToolNames<P> & GithubToolName> : AllGithubTools;
|
|
507
|
-
/** Pick a subset of GitHub tools by tool name. */
|
|
508
|
-
type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
|
|
509
|
-
//#endregion
|
|
510
|
-
//#region src/client.d.ts
|
|
511
|
-
declare function createOctokit(token: string): Octokit;
|
|
512
|
-
//#endregion
|
|
513
|
-
//#region src/tools/repository.d.ts
|
|
514
|
-
/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */
|
|
515
|
-
declare const getRepository: (token: GithubTokenInput) => GithubTool;
|
|
516
|
-
/** List branches in a GitHub repository. */
|
|
517
|
-
declare const listBranches: (token: GithubTokenInput) => GithubTool;
|
|
518
|
-
/** Get the content of a file from a GitHub repository. */
|
|
519
|
-
declare const getFileContent: (token: GithubTokenInput) => GithubTool;
|
|
520
|
-
/** List the file and directory structure of a repository at a given ref. */
|
|
521
|
-
declare const getRepositoryTree: (token: GithubTokenInput) => GithubTool;
|
|
522
|
-
/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
|
|
523
|
-
declare const createBranch: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
524
|
-
/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
525
|
-
declare const forkRepository: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
526
|
-
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
527
|
-
declare const createRepository: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
528
|
-
/** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
|
|
529
|
-
declare const createOrUpdateFile: (token: GithubTokenInput, { needsApproval, author, committer, coAuthors }?: CommitToolOptions) => GithubTool;
|
|
530
|
-
//#endregion
|
|
531
|
-
//#region src/tools/pull-requests.d.ts
|
|
532
|
-
type MergeToolOptions = ToolOptions & {
|
|
533
|
-
coAuthors?: CommitIdentity[];
|
|
534
|
-
};
|
|
535
|
-
/** List pull requests for a GitHub repository. */
|
|
536
|
-
declare const listPullRequests: (token: GithubTokenInput) => GithubTool;
|
|
537
|
-
/** Get detailed information about a specific pull request. */
|
|
538
|
-
declare const getPullRequest: (token: GithubTokenInput) => GithubTool;
|
|
539
|
-
/** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
540
|
-
declare const createPullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
541
|
-
/** Merge a pull request. Requires approval by default. */
|
|
542
|
-
declare const mergePullRequest: (token: GithubTokenInput, { needsApproval, coAuthors }?: MergeToolOptions) => GithubTool;
|
|
543
|
-
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
544
|
-
declare const updatePullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
545
|
-
/** Add a comment to a pull request. Requires approval by default. */
|
|
546
|
-
declare const addPullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
547
|
-
/** Update the body of a comment on a pull request. Requires approval by default. */
|
|
548
|
-
declare const updatePullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
549
|
-
/** Delete a comment from a pull request permanently. Requires approval by default. */
|
|
550
|
-
declare const deletePullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
551
|
-
/** List files changed in a pull request with status and stats. Patches omitted by default. */
|
|
552
|
-
declare const listPullRequestFiles: (token: GithubTokenInput) => GithubTool;
|
|
553
|
-
/** List reviews on a pull request (approvals, change requests, and comments). */
|
|
554
|
-
declare const listPullRequestReviews: (token: GithubTokenInput) => GithubTool;
|
|
555
|
-
/** Submit a pull request review with optional inline comments. Requires approval by default. */
|
|
556
|
-
declare const createPullRequestReview: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
557
|
-
/** Request reviews from users or teams on a pull request. Requires approval by default. */
|
|
558
|
-
declare const requestReviewers: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
559
|
-
//#endregion
|
|
560
|
-
//#region src/tools/issues.d.ts
|
|
561
|
-
/** List issues for a GitHub repository (excludes pull requests). */
|
|
562
|
-
declare const listIssues: (token: GithubTokenInput) => GithubTool;
|
|
563
|
-
/** Get detailed information about a specific issue. */
|
|
564
|
-
declare const getIssue: (token: GithubTokenInput) => GithubTool;
|
|
565
|
-
/** List comments on a GitHub issue. Prefer getIssueContext for the first page when triaging. */
|
|
566
|
-
declare const listIssueComments: (token: GithubTokenInput) => GithubTool;
|
|
567
|
-
/** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
568
|
-
declare const createIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
569
|
-
/** Add a comment to a GitHub issue. Requires approval by default. */
|
|
570
|
-
declare const addIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
571
|
-
/** Close an open GitHub issue. Requires approval by default. */
|
|
572
|
-
declare const closeIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
573
|
-
/** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */
|
|
574
|
-
declare const updateIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
575
|
-
/** Update the body of a comment on a GitHub issue. Requires approval by default. */
|
|
576
|
-
declare const updateIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
577
|
-
/** Delete a comment from a GitHub issue permanently. Requires approval by default. */
|
|
578
|
-
declare const deleteIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
579
|
-
/** List labels available in a GitHub repository. */
|
|
580
|
-
declare const listLabels: (token: GithubTokenInput) => GithubTool;
|
|
581
|
-
/** Add labels to an issue or pull request. Requires approval by default. */
|
|
582
|
-
declare const addLabels: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
583
|
-
/** Remove a label from an issue or pull request. Requires approval by default. */
|
|
584
|
-
declare const removeLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
585
|
-
/** Create a label in a GitHub repository. Requires approval by default. */
|
|
586
|
-
declare const createLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
587
|
-
/** Update a label in a GitHub repository. Requires approval by default. */
|
|
588
|
-
declare const updateLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
589
|
-
/** Delete a label from a GitHub repository permanently. Requires approval by default. */
|
|
590
|
-
declare const deleteLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
591
|
-
/** Assign users to an issue or pull request. Requires approval by default. */
|
|
592
|
-
declare const addAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
593
|
-
/** Remove assignees from an issue or pull request. Requires approval by default. */
|
|
594
|
-
declare const removeAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
595
|
-
//#endregion
|
|
596
|
-
//#region src/tools/reactions.d.ts
|
|
597
|
-
/** List reactions on an issue or pull request conversation. */
|
|
598
|
-
declare const listIssueReactions: (token: GithubTokenInput) => GithubTool;
|
|
599
|
-
/** React to an issue or pull request with an emoji. Requires approval by default. */
|
|
600
|
-
declare const addIssueReaction: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
601
|
-
/** List reactions on an issue or pull request comment. */
|
|
602
|
-
declare const listCommentReactions: (token: GithubTokenInput) => GithubTool;
|
|
603
|
-
/** React to an issue or pull request comment with an emoji. Requires approval by default. */
|
|
604
|
-
declare const addCommentReaction: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region src/tools/discussions.d.ts
|
|
607
|
-
/** List discussions in a repository, optionally filtered by category. */
|
|
608
|
-
declare const listDiscussions: (token: GithubTokenInput) => GithubTool;
|
|
609
|
-
/** Get a discussion by number. */
|
|
610
|
-
declare const getDiscussion: (token: GithubTokenInput) => GithubTool;
|
|
611
|
-
/** Add a comment to a discussion. Requires approval by default. */
|
|
612
|
-
declare const addDiscussionComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region src/tools/notifications.d.ts
|
|
615
|
-
/** List notification threads for the authenticated user. */
|
|
616
|
-
declare const listNotifications: (token: GithubTokenInput) => GithubTool;
|
|
617
|
-
/** Mark a notification thread as read. Requires approval by default. */
|
|
618
|
-
declare const markNotificationRead: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region src/tools/search.d.ts
|
|
621
|
-
/** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. Results include matching text snippets when GitHub returns them. */
|
|
622
|
-
declare const searchCode: (token: GithubTokenInput) => GithubTool;
|
|
623
|
-
/** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
|
|
624
|
-
declare const searchRepositories: (token: GithubTokenInput) => GithubTool;
|
|
625
|
-
/** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */
|
|
626
|
-
declare const searchIssues: (token: GithubTokenInput) => GithubTool;
|
|
627
|
-
//#endregion
|
|
628
|
-
//#region src/tools/commits.d.ts
|
|
629
|
-
/** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */
|
|
630
|
-
declare const listCommits: (token: GithubTokenInput) => GithubTool;
|
|
631
|
-
/** Get detailed information about a specific commit. Patches omitted by default. */
|
|
632
|
-
declare const getCommit: (token: GithubTokenInput) => GithubTool;
|
|
633
|
-
/** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */
|
|
634
|
-
declare const getBlame: (token: GithubTokenInput) => GithubTool;
|
|
635
|
-
/** Compare two branches, tags, or commits. Patches omitted by default. */
|
|
636
|
-
declare const compareCommits: (token: GithubTokenInput) => GithubTool;
|
|
637
|
-
//#endregion
|
|
638
|
-
//#region src/tools/gists.d.ts
|
|
639
|
-
/** List gists for the authenticated user or a specific user. */
|
|
640
|
-
declare const listGists: (token: GithubTokenInput) => GithubTool;
|
|
641
|
-
/** Get a gist by ID, including file contents. */
|
|
642
|
-
declare const getGist: (token: GithubTokenInput) => GithubTool;
|
|
643
|
-
/** List comments on a gist. */
|
|
644
|
-
declare const listGistComments: (token: GithubTokenInput) => GithubTool;
|
|
645
|
-
/** Create a new gist with one or more files. Requires approval by default. */
|
|
646
|
-
declare const createGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
647
|
-
/** Update an existing gist. Requires approval by default. */
|
|
648
|
-
declare const updateGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
649
|
-
/** Delete a gist permanently. Requires approval by default. */
|
|
650
|
-
declare const deleteGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
651
|
-
/** Add a comment to a gist. Requires approval by default. */
|
|
652
|
-
declare const createGistComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
653
|
-
//#endregion
|
|
654
|
-
//#region src/tools/workflows.d.ts
|
|
655
|
-
/** List GitHub Actions workflows in a repository. */
|
|
656
|
-
declare const listWorkflows: (token: GithubTokenInput) => GithubTool;
|
|
657
|
-
/** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
|
|
658
|
-
declare const listWorkflowRuns: (token: GithubTokenInput) => GithubTool;
|
|
659
|
-
/** Get details of a specific workflow run including status, timing, and trigger info. */
|
|
660
|
-
declare const getWorkflowRun: (token: GithubTokenInput) => GithubTool;
|
|
661
|
-
/** List jobs for a workflow run, including step-level status and timing. */
|
|
662
|
-
declare const listWorkflowJobs: (token: GithubTokenInput) => GithubTool;
|
|
663
|
-
/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
664
|
-
declare const triggerWorkflow: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
665
|
-
/** Cancel an in-progress workflow run. Requires approval by default. */
|
|
666
|
-
declare const cancelWorkflowRun: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
667
|
-
/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
668
|
-
declare const rerunWorkflowRun: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/tools/checks.d.ts
|
|
671
|
-
/** List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. */
|
|
672
|
-
declare const listCheckRuns: (token: GithubTokenInput) => GithubTool;
|
|
673
|
-
/** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */
|
|
674
|
-
declare const getCombinedStatus: (token: GithubTokenInput) => GithubTool;
|
|
675
|
-
//#endregion
|
|
676
|
-
//#region src/tools/releases.d.ts
|
|
677
|
-
/** List releases for a GitHub repository, newest first (includes drafts and prereleases). */
|
|
678
|
-
declare const listReleases: (token: GithubTokenInput) => GithubTool;
|
|
679
|
-
/** Get the latest published release for a GitHub repository (excludes drafts and prereleases). */
|
|
680
|
-
declare const getLatestRelease: (token: GithubTokenInput) => GithubTool;
|
|
681
|
-
/** Get a specific release by ID, including its assets. */
|
|
682
|
-
declare const getRelease: (token: GithubTokenInput) => GithubTool;
|
|
683
|
-
/** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */
|
|
684
|
-
declare const createRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
685
|
-
/** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */
|
|
686
|
-
declare const updateRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
687
|
-
/** Delete a release permanently. Requires approval by default. */
|
|
688
|
-
declare const deleteRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool;
|
|
689
|
-
//#endregion
|
|
690
|
-
//#region src/tools/bundles.d.ts
|
|
691
|
-
/** Fetch pull request details plus files, reviews, and optional CI checks in one call. */
|
|
692
|
-
declare const getPullRequestContext: (token: GithubTokenInput) => GithubTool;
|
|
693
|
-
/** Fetch an issue plus available label names and recent comments in one call. */
|
|
694
|
-
declare const getIssueContext: (token: GithubTokenInput) => GithubTool;
|
|
695
|
-
/** Fetch a release plus the previous release and tag comparison in one call. */
|
|
696
|
-
declare const getReleaseContext: (token: GithubTokenInput) => GithubTool;
|
|
697
|
-
/** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs. */
|
|
698
|
-
declare const getCiFailureContext: (token: GithubTokenInput) => GithubTool;
|
|
699
|
-
//#endregion
|
|
700
|
-
//#region src/agents.d.ts
|
|
701
|
-
type AgentOptions = Omit<ToolLoopAgentSettings<ToolSet>, 'model' | 'tools' | 'instructions'>;
|
|
702
|
-
type CreateGithubAgentOptions = AgentOptions & GithubToolsBaseOptions & {
|
|
703
|
-
model: ToolLoopAgentSettings<ToolSet>['model'];
|
|
704
|
-
/**
|
|
705
|
-
* Restrict tools and system prompt to a predefined preset.
|
|
706
|
-
*
|
|
707
|
-
* Selects a subset of tools and, when a single preset is passed,
|
|
708
|
-
* sets a matching system prompt. Combine presets with an array to merge tool sets.
|
|
709
|
-
*
|
|
710
|
-
* @see {@link GithubToolPreset} for available presets and included tools.
|
|
711
|
-
*/
|
|
712
|
-
preset?: GithubToolPreset | GithubToolPreset[];
|
|
713
|
-
/**
|
|
714
|
-
* Fully replace the default system prompt.
|
|
715
|
-
* When set, `preset` system prompts and `additionalInstructions` are ignored.
|
|
716
|
-
* `context` is still appended when provided.
|
|
717
|
-
*/
|
|
718
|
-
instructions?: string;
|
|
719
|
-
/**
|
|
720
|
-
* Append text to the preset-specific (or default) system prompt.
|
|
721
|
-
* Ignored when `instructions` is set.
|
|
722
|
-
*/
|
|
723
|
-
additionalInstructions?: string;
|
|
724
|
-
};
|
|
725
|
-
declare function createGithubAgent(options: CreateGithubAgentOptions & {
|
|
726
|
-
preset?: undefined;
|
|
727
|
-
}): ToolLoopAgent<never, AllGithubTools>;
|
|
728
|
-
declare function createGithubAgent<P extends GithubToolPreset>(options: CreateGithubAgentOptions & {
|
|
729
|
-
preset: P;
|
|
730
|
-
}): ToolLoopAgent<never, Pick<AllGithubTools, PresetToolName<P>>>;
|
|
731
|
-
declare function createGithubAgent<P extends readonly GithubToolPreset[]>(options: CreateGithubAgentOptions & {
|
|
732
|
-
preset: P;
|
|
733
|
-
}): ToolLoopAgent<never, Pick<AllGithubTools, CombinedPresetToolNames<P>>>;
|
|
734
|
-
//#endregion
|
|
735
|
-
//#region src/index.d.ts
|
|
736
|
-
type GithubToolsOptions = GithubToolsBaseOptions & {
|
|
737
|
-
/**
|
|
738
|
-
* Restrict the returned tools to a predefined preset.
|
|
739
|
-
* Prefer a focused preset for most agents. Omit or use `maintainer` for the full catalog.
|
|
740
|
-
*
|
|
741
|
-
* @see {@link GithubToolPreset} for available presets and included tools.
|
|
742
|
-
*
|
|
743
|
-
* @example
|
|
744
|
-
* ```ts
|
|
745
|
-
* // Only code-review tools
|
|
746
|
-
* createGithubTools({ token, preset: 'code-review' })
|
|
747
|
-
*
|
|
748
|
-
* // Combine presets
|
|
749
|
-
* createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
|
|
750
|
-
*
|
|
751
|
-
* // Full catalog
|
|
752
|
-
* createGithubTools({ token, preset: 'maintainer' })
|
|
753
|
-
* ```
|
|
754
|
-
*/
|
|
755
|
-
preset?: GithubToolPreset | GithubToolPreset[];
|
|
756
|
-
};
|
|
757
|
-
declare function createGithubTools(options?: GithubToolsBaseOptions & {
|
|
758
|
-
preset?: undefined;
|
|
759
|
-
}): AllGithubTools;
|
|
760
|
-
declare function createGithubTools<P extends GithubToolPreset>(options: GithubToolsBaseOptions & {
|
|
761
|
-
preset: P;
|
|
762
|
-
}): Pick<AllGithubTools, PresetToolName<P>>;
|
|
763
|
-
declare function createGithubTools<P extends readonly GithubToolPreset[]>(options: GithubToolsBaseOptions & {
|
|
764
|
-
preset: P;
|
|
765
|
-
}): Pick<AllGithubTools, CombinedPresetToolNames<P>>;
|
|
766
|
-
declare function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
|
|
767
|
-
type GithubTools = AllGithubTools & ToolSet;
|
|
768
|
-
//#endregion
|
|
769
|
-
export { createLabel as $, GithubToolName as $t, listGists as A, listBranches as At, markNotificationRead as B, CommitToolOptions as Bt, rerunWorkflowRun as C, createBranch as Ct, deleteGist as D, getFileContent as Dt, createGistComment as E, forkRepository as Et, listCommits as F, PickGithubTools as Ft, addIssueReaction as G, ApprovalConfig as Gt, getDiscussion as H, Octokit$1 as Ht, searchCode as I, GithubTokenInput as It, addAssignees as J, CombinedPresetToolNames as Jt, listCommentReactions as K, GITHUB_WRITE_TOOLS as Kt, searchIssues as L, resolveGithubToken as Lt, compareCommits as M, AllGithubTools as Mt, getBlame as N, GithubToolsBaseOptions as Nt, getGist as O, getRepository as Ot, getCommit as P, GithubToolsForPreset as Pt, createIssue as Q, GITHUB_TOOL_NAMES as Qt, searchRepositories as R, GithubToolsContext as Rt, listWorkflows as S, updatePullRequestComment as St, createGist as T, createRepository as Tt, listDiscussions as U, ToolOptions as Ut, addDiscussionComment as V, GithubTool as Vt, addCommentReaction as W, ToolOverrides as Wt, addLabels as X, PRESET_TOOLS as Xt, addIssueComment as Y, GithubToolPreset as Yt, closeIssue as Z, PresetToolName as Zt, listCheckRuns as _, listPullRequestReviews as _t, createGithubAgent as a, listLabels as at, listWorkflowJobs as b, requestReviewers as bt, getPullRequestContext as c, updateIssue as ct, deleteRelease as d, addPullRequestComment as dt, deleteIssueComment as et, getLatestRelease as f, createPullRequest as ft, getCombinedStatus as g, listPullRequestFiles as gt, updateRelease as h, getPullRequest as ht, CreateGithubAgentOptions as i, listIssues as it, updateGist as j, createOctokit as jt, listGistComments as k, getRepositoryTree as kt, getReleaseContext as l, updateIssueComment as lt, listReleases as m, deletePullRequestComment as mt, GithubToolsOptions as n, getIssue as nt, getCiFailureContext as o, removeAssignees as ot, getRelease as p, createPullRequestReview as pt, listIssueReactions as q, GithubWriteToolName as qt, createGithubTools as r, listIssueComments as rt, getIssueContext as s, removeLabel as st, GithubTools as t, deleteLabel as tt, createRelease as u, updateLabel as ut, cancelWorkflowRun as v, listPullRequests as vt, triggerWorkflow as w, createOrUpdateFile as wt, listWorkflowRuns as x, updatePullRequest as xt, getWorkflowRun as y, mergePullRequest as yt, listNotifications as z, CommitIdentity as zt };
|
|
770
|
-
//# sourceMappingURL=index-BNeMjmgp.d.mts.map
|