@github-tools/sdk 1.8.2 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +247 -78
  2. package/dist/connect/eve.d.mts +18 -7
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +17 -4
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +31 -11
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +6 -3
  9. package/dist/connect.mjs.map +1 -1
  10. package/dist/eve-runtime-CI4dR_hI.d.mts +54 -0
  11. package/dist/eve-runtime-CI4dR_hI.d.mts.map +1 -0
  12. package/dist/eve-runtime-CIcrt7MD.mjs +674 -0
  13. package/dist/eve-runtime-CIcrt7MD.mjs.map +1 -0
  14. package/dist/eve-runtime.d.mts +4 -0
  15. package/dist/eve-runtime.mjs +3 -0
  16. package/dist/eve.d.mts +331 -112
  17. package/dist/eve.d.mts.map +1 -1
  18. package/dist/eve.mjs +356 -3
  19. package/dist/eve.mjs.map +1 -0
  20. package/dist/index-B0nL0C00.d.mts +746 -0
  21. package/dist/index-B0nL0C00.d.mts.map +1 -0
  22. package/dist/index.d.mts +2 -2
  23. package/dist/index.mjs +3 -3
  24. package/dist/src-v-LjzPpR.mjs +1371 -0
  25. package/dist/src-v-LjzPpR.mjs.map +1 -0
  26. package/dist/{token-CW8lQBND.mjs → token-DDMlEkK-.mjs} +74 -7
  27. package/dist/token-DDMlEkK-.mjs.map +1 -0
  28. package/dist/types-VW0m0Uxl.d.mts +39 -0
  29. package/dist/types-VW0m0Uxl.d.mts.map +1 -0
  30. package/dist/{types-B0mvQgJf.d.mts → types-Ygt1pw1N.d.mts} +30 -9
  31. package/dist/types-Ygt1pw1N.d.mts.map +1 -0
  32. package/dist/workflow.d.mts +7 -7
  33. package/dist/workflow.d.mts.map +1 -1
  34. package/dist/workflow.mjs +6 -4
  35. package/dist/workflow.mjs.map +1 -1
  36. package/dist/write-tools-uIVfURVp.mjs +3509 -0
  37. package/dist/write-tools-uIVfURVp.mjs.map +1 -0
  38. package/package.json +17 -13
  39. package/dist/eve-UPaHEGVi.mjs +0 -512
  40. package/dist/eve-UPaHEGVi.mjs.map +0 -1
  41. package/dist/index-Cs1Kebmt.d.mts +0 -463
  42. package/dist/index-Cs1Kebmt.d.mts.map +0 -1
  43. package/dist/src-CfzZfU82.mjs +0 -812
  44. package/dist/src-CfzZfU82.mjs.map +0 -1
  45. package/dist/token-CW8lQBND.mjs.map +0 -1
  46. package/dist/types-B0mvQgJf.d.mts.map +0 -1
  47. package/dist/types-DwHrGKWO.d.mts +0 -27
  48. package/dist/types-DwHrGKWO.d.mts.map +0 -1
  49. package/dist/write-tools-Dx9LfYlU.mjs +0 -1840
  50. package/dist/write-tools-Dx9LfYlU.mjs.map +0 -1
@@ -1,463 +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
-
5
- //#region src/core/tool-names.d.ts
6
- /**
7
- * All GitHub tool names available via {@link createGithubTools}.
8
- * Each key maps to its own string literal for IDE autocomplete and hover docs.
9
- */
10
- declare const GITHUB_TOOL_NAMES: {
11
- /** Get information about a GitHub repository including description, stars, forks, language, and default branch. */readonly getRepository: "getRepository"; /** List branches in a GitHub repository. */
12
- readonly listBranches: "listBranches"; /** Get the content of a file from a GitHub repository. */
13
- readonly getFileContent: "getFileContent"; /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
14
- readonly createBranch: "createBranch"; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
15
- readonly forkRepository: "forkRepository"; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
16
- readonly createRepository: "createRepository"; /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
17
- readonly createOrUpdateFile: "createOrUpdateFile"; /** List pull requests for a GitHub repository. */
18
- readonly listPullRequests: "listPullRequests"; /** Get detailed information about a specific pull request. */
19
- readonly getPullRequest: "getPullRequest"; /** Create a new pull request in a GitHub repository. Requires approval by default. */
20
- readonly createPullRequest: "createPullRequest"; /** Merge a pull request. Requires approval by default. */
21
- readonly mergePullRequest: "mergePullRequest"; /** Add a comment to a pull request. Requires approval by default. */
22
- readonly addPullRequestComment: "addPullRequestComment"; /** List files changed in a pull request, including diff status and patch content. */
23
- readonly listPullRequestFiles: "listPullRequestFiles"; /** List reviews on a pull request (approvals, change requests, and comments). */
24
- readonly listPullRequestReviews: "listPullRequestReviews"; /** Submit a pull request review — approve, request changes, or comment with optional inline comments on specific lines. Requires approval by default. */
25
- readonly createPullRequestReview: "createPullRequestReview"; /** List issues for a GitHub repository (excludes pull requests). */
26
- readonly listIssues: "listIssues"; /** Get detailed information about a specific issue. */
27
- readonly getIssue: "getIssue"; /** Create a new issue in a GitHub repository. Requires approval by default. */
28
- readonly createIssue: "createIssue"; /** Add a comment to a GitHub issue. Requires approval by default. */
29
- readonly addIssueComment: "addIssueComment"; /** Close an open GitHub issue. Requires approval by default. */
30
- readonly closeIssue: "closeIssue"; /** List labels available in a GitHub repository. */
31
- readonly listLabels: "listLabels"; /** Add labels to an issue or pull request. Requires approval by default. */
32
- readonly addLabels: "addLabels"; /** Remove a label from an issue or pull request. Requires approval by default. */
33
- readonly removeLabel: "removeLabel"; /** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. */
34
- readonly searchCode: "searchCode"; /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
35
- readonly searchRepositories: "searchRepositories"; /** 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. */
36
- readonly listCommits: "listCommits"; /** Get detailed information about a specific commit, including the list of files changed with additions and deletions. */
37
- readonly getCommit: "getCommit"; /** 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. */
38
- readonly getBlame: "getBlame"; /** List gists for the authenticated user or a specific user. */
39
- readonly listGists: "listGists"; /** Get a gist by ID, including file contents. */
40
- readonly getGist: "getGist"; /** List comments on a gist. */
41
- readonly listGistComments: "listGistComments"; /** Create a new gist with one or more files. Requires approval by default. */
42
- readonly createGist: "createGist"; /** Update an existing gist — edit description, update files, or remove files. Requires approval by default. */
43
- readonly updateGist: "updateGist"; /** Delete a gist permanently. Requires approval by default. */
44
- readonly deleteGist: "deleteGist"; /** Add a comment to a gist. Requires approval by default. */
45
- readonly createGistComment: "createGistComment"; /** List GitHub Actions workflows in a repository. */
46
- readonly listWorkflows: "listWorkflows"; /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
47
- readonly listWorkflowRuns: "listWorkflowRuns"; /** Get details of a specific workflow run including status, timing, and trigger info. */
48
- readonly getWorkflowRun: "getWorkflowRun"; /** List jobs for a workflow run, including step-level status and timing. */
49
- readonly listWorkflowJobs: "listWorkflowJobs"; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
50
- readonly triggerWorkflow: "triggerWorkflow"; /** Cancel an in-progress workflow run. Requires approval by default. */
51
- readonly cancelWorkflowRun: "cancelWorkflowRun"; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
52
- readonly rerunWorkflowRun: "rerunWorkflowRun";
53
- };
54
- type GithubToolName = typeof GITHUB_TOOL_NAMES[keyof typeof GITHUB_TOOL_NAMES];
55
- //#endregion
56
- //#region src/core/presets.d.ts
57
- /**
58
- * Predefined tool presets for common use cases.
59
- * Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}.
60
- * Presets can be combined by passing an array.
61
- */
62
- declare const PRESET_TOOLS: {
63
- /**
64
- * **Code review** — review pull requests and submit feedback.
65
- *
66
- * Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
67
- * `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `getRepository`, `listBranches`,
68
- * `searchCode`, `addPullRequestComment`, `createPullRequestReview`.
69
- *
70
- * Agent prompt: optimized for thorough PR review with inline feedback.
71
- */
72
- readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "getFileContent", "listCommits", "getCommit", "getBlame", "getRepository", "listBranches", "searchCode", "addPullRequestComment", "createPullRequestReview"];
73
- /**
74
- * **Issue triage** — manage and organize GitHub issues.
75
- *
76
- * Tools: `listIssues`, `getIssue`, `createIssue`, `addIssueComment`, `closeIssue`,
77
- * `listLabels`, `addLabels`, `removeLabel`, `getRepository`, `searchRepositories`, `searchCode`.
78
- *
79
- * Agent prompt: optimized for categorizing, labeling, and responding to issues.
80
- */
81
- readonly 'issue-triage': readonly ["listIssues", "getIssue", "createIssue", "addIssueComment", "closeIssue", "listLabels", "addLabels", "removeLabel", "getRepository", "searchRepositories", "searchCode"];
82
- /**
83
- * **CI operations** — monitor and manage GitHub Actions workflows.
84
- *
85
- * Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`,
86
- * `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`,
87
- * `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
88
- *
89
- * Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
90
- */
91
- readonly 'ci-ops': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
92
- /**
93
- * **Repository explorer** — read-only access to browse codebases.
94
- *
95
- * Tools: all read-only tools including repos, branches, PRs, issues, commits, blame,
96
- * search, gists, and workflows. No write operations.
97
- *
98
- * Agent prompt: optimized for answering questions about code structure and history.
99
- */
100
- readonly 'repo-explorer': readonly ["getRepository", "listBranches", "getFileContent", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listIssues", "getIssue", "listLabels", "listCommits", "getCommit", "getBlame", "searchCode", "searchRepositories", "listGists", "getGist", "listGistComments", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs"];
101
- /**
102
- * **Maintainer** — full repository maintenance with all read and write tools.
103
- *
104
- * Tools: all 42 tools (same as omitting `preset`).
105
- *
106
- * Agent prompt: optimized for day-to-day repo maintenance with careful write operations.
107
- */
108
- readonly maintainer: readonly ["getRepository", "listBranches", "getFileContent", "createBranch", "forkRepository", "createRepository", "createOrUpdateFile", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "createPullRequest", "mergePullRequest", "addPullRequestComment", "createPullRequestReview", "listIssues", "getIssue", "createIssue", "addIssueComment", "closeIssue", "listLabels", "addLabels", "removeLabel", "listCommits", "getCommit", "getBlame", "searchCode", "searchRepositories", "listGists", "getGist", "listGistComments", "createGist", "updateGist", "deleteGist", "createGistComment", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
109
- };
110
- type GithubToolPreset = keyof typeof PRESET_TOOLS;
111
- /** Tool names included in a single preset. */
112
- type PresetToolName<P extends GithubToolPreset> = Extract<(typeof PRESET_TOOLS)[P][number], GithubToolName>;
113
- /** Tool names included when combining multiple presets. */
114
- type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetToolName<P[number]>;
115
- //#endregion
116
- //#region src/core/write-tools.d.ts
117
- /**
118
- * Write tools that mutate GitHub state. All require user approval by default
119
- * unless overridden via {@link ApprovalConfig}.
120
- */
121
- declare const GITHUB_WRITE_TOOLS: {
122
- /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */readonly createBranch: "createBranch"; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
123
- readonly forkRepository: "forkRepository"; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
124
- readonly createRepository: "createRepository"; /** Create or update a file in a GitHub repository. Requires approval by default. */
125
- readonly createOrUpdateFile: "createOrUpdateFile"; /** Create a new pull request in a GitHub repository. Requires approval by default. */
126
- readonly createPullRequest: "createPullRequest"; /** Merge a pull request. Requires approval by default. */
127
- readonly mergePullRequest: "mergePullRequest"; /** Add a comment to a pull request. Requires approval by default. */
128
- readonly addPullRequestComment: "addPullRequestComment"; /** Submit a pull request review with optional inline comments. Requires approval by default. */
129
- readonly createPullRequestReview: "createPullRequestReview"; /** Create a new issue in a GitHub repository. Requires approval by default. */
130
- readonly createIssue: "createIssue"; /** Add a comment to a GitHub issue. Requires approval by default. */
131
- readonly addIssueComment: "addIssueComment"; /** Close an open GitHub issue. Requires approval by default. */
132
- readonly closeIssue: "closeIssue"; /** Add labels to an issue or pull request. Requires approval by default. */
133
- readonly addLabels: "addLabels"; /** Remove a label from an issue or pull request. Requires approval by default. */
134
- readonly removeLabel: "removeLabel"; /** Create a new gist with one or more files. Requires approval by default. */
135
- readonly createGist: "createGist"; /** Update an existing gist. Requires approval by default. */
136
- readonly updateGist: "updateGist"; /** Delete a gist permanently. Requires approval by default. */
137
- readonly deleteGist: "deleteGist"; /** Add a comment to a gist. Requires approval by default. */
138
- readonly createGistComment: "createGistComment"; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
139
- readonly triggerWorkflow: "triggerWorkflow"; /** Cancel an in-progress workflow run. Requires approval by default. */
140
- readonly cancelWorkflowRun: "cancelWorkflowRun"; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
141
- readonly rerunWorkflowRun: "rerunWorkflowRun";
142
- };
143
- type GithubWriteToolName = typeof GITHUB_WRITE_TOOLS[keyof typeof GITHUB_WRITE_TOOLS];
144
- //#endregion
145
- //#region src/core/approval.d.ts
146
- /**
147
- * Whether write operations require user approval.
148
- *
149
- * - `true` — all write tools need approval (default)
150
- * - `false` — no approval needed for any write tool
151
- * - object — per-tool override via {@link GithubWriteToolName}; unspecified write tools default to `true`
152
- *
153
- * @example Global disable
154
- * ```ts
155
- * createGithubTools({ token, requireApproval: false })
156
- * ```
157
- *
158
- * @example Granular per write tool
159
- * ```ts
160
- * createGithubTools({
161
- * token,
162
- * requireApproval: {
163
- * mergePullRequest: true,
164
- * createOrUpdateFile: true,
165
- * addPullRequestComment: false,
166
- * },
167
- * })
168
- * ```
169
- */
170
- type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
171
- //#endregion
172
- //#region src/core/token.d.ts
173
- type GithubTokenInput = string | (() => Promise<string>);
174
- /** Resolves a {@link GithubTokenInput} to a token string. */
175
- declare function resolveGithubToken(token?: GithubTokenInput): Promise<string>;
176
- //#endregion
177
- //#region src/types.d.ts
178
- type GithubTool = Tool<any, any>;
179
- type ToolOptions = {
180
- needsApproval?: boolean;
181
- };
182
- /**
183
- * Identity for a commit author or committer on GitHub.
184
- *
185
- * - **Author** — the person who originally wrote the code patch.
186
- * - **Committer** — the person who applied the commit to the repository.
187
- */
188
- type CommitIdentity = {
189
- name: string;
190
- email: string;
191
- };
192
- /**
193
- * Options for commit-creating tools (`createOrUpdateFile`, `mergePullRequest`).
194
- */
195
- type CommitToolOptions = ToolOptions & {
196
- /**
197
- * The author of the commit — the person who wrote the code patch.
198
- * Falls back to the authenticated user when omitted.
199
- */
200
- author?: CommitIdentity;
201
- /**
202
- * The committer of the commit — the person who applied the commit.
203
- * Falls back to the authenticated user when omitted.
204
- */
205
- committer?: CommitIdentity;
206
- /**
207
- * Co-authors to attribute on commits.
208
- * Added as "Co-authored-by" trailers to commit messages.
209
- */
210
- coAuthors?: CommitIdentity[];
211
- };
212
- /**
213
- * Per-tool overrides for customizing tool behavior without changing the underlying implementation.
214
- *
215
- * Overridable properties: `description`, `title`, `needsApproval`, `strict`, `providerOptions`,
216
- * `toModelOutput`, and input lifecycle callbacks (`onInputStart`, `onInputDelta`, `onInputAvailable`).
217
- *
218
- * `execute`, `inputSchema`, and `outputSchema` cannot be overridden.
219
- *
220
- * @example
221
- * ```ts
222
- * createGithubTools({
223
- * overrides: {
224
- * mergePullRequest: { needsApproval: true, title: 'Merge PR' },
225
- * listIssues: { description: 'List open bugs' },
226
- * },
227
- * })
228
- * ```
229
- */
230
- type ToolOverrides = Partial<Pick<Tool, 'description' | 'needsApproval' | 'onInputAvailable' | 'onInputDelta' | 'onInputStart' | 'providerOptions' | 'strict' | 'title' | 'toModelOutput'>>;
231
- //#endregion
232
- //#region src/core/tool-types.d.ts
233
- /** Full tool set returned when no `preset` is specified. */
234
- type AllGithubTools = Record<GithubToolName, GithubTool>;
235
- /** Base options shared by all {@link createGithubTools} overloads. */
236
- type GithubToolsBaseOptions = {
237
- /** GitHub token string or async provider. Falls back to `process.env.GITHUB_TOKEN` when omitted. */token?: GithubTokenInput; /** Control whether write operations require user approval. @see {@link ApprovalConfig} */
238
- requireApproval?: ApprovalConfig; /** Per-tool overrides for description, title, needsApproval, and related AI SDK tool fields. */
239
- overrides?: Partial<Record<GithubToolName, ToolOverrides>>; /** Default author for commit-creating tools. Falls back to the authenticated user when omitted. */
240
- author?: CommitIdentity; /** Default committer for commit-creating tools. Falls back to the authenticated user when omitted. */
241
- committer?: CommitIdentity; /** Co-authors to attribute on all commits created by tools. */
242
- coAuthors?: CommitIdentity[];
243
- };
244
- /** Tool set shape for a given preset option (single, combined, or all tools). */
245
- 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;
246
- /** Pick a subset of GitHub tools by tool name. */
247
- type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
248
- //#endregion
249
- //#region src/client.d.ts
250
- declare function createOctokit(token: string): Octokit;
251
- //#endregion
252
- //#region src/tools/repository.d.ts
253
- /** Get information about a GitHub repository including description, stars, forks, language, and default branch. */
254
- declare const getRepository: (token: GithubTokenInput) => GithubTool;
255
- /** List branches in a GitHub repository. */
256
- declare const listBranches: (token: GithubTokenInput) => GithubTool;
257
- /** Get the content of a file from a GitHub repository. */
258
- declare const getFileContent: (token: GithubTokenInput) => GithubTool;
259
- /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
260
- declare const createBranch: (token: GithubTokenInput, {
261
- needsApproval
262
- }?: ToolOptions) => GithubTool;
263
- /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
264
- declare const forkRepository: (token: GithubTokenInput, {
265
- needsApproval
266
- }?: ToolOptions) => GithubTool;
267
- /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
268
- declare const createRepository: (token: GithubTokenInput, {
269
- needsApproval
270
- }?: ToolOptions) => GithubTool;
271
- /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
272
- declare const createOrUpdateFile: (token: GithubTokenInput, {
273
- needsApproval,
274
- author,
275
- committer,
276
- coAuthors
277
- }?: CommitToolOptions) => GithubTool;
278
- //#endregion
279
- //#region src/tools/pull-requests.d.ts
280
- type MergeToolOptions = ToolOptions & {
281
- coAuthors?: CommitIdentity[];
282
- };
283
- /** List pull requests for a GitHub repository. */
284
- declare const listPullRequests: (token: GithubTokenInput) => GithubTool;
285
- /** Get detailed information about a specific pull request. */
286
- declare const getPullRequest: (token: GithubTokenInput) => GithubTool;
287
- /** Create a new pull request in a GitHub repository. Requires approval by default. */
288
- declare const createPullRequest: (token: GithubTokenInput, {
289
- needsApproval
290
- }?: ToolOptions) => GithubTool;
291
- /** Merge a pull request. Requires approval by default. */
292
- declare const mergePullRequest: (token: GithubTokenInput, {
293
- needsApproval,
294
- coAuthors
295
- }?: MergeToolOptions) => GithubTool;
296
- /** Add a comment to a pull request. Requires approval by default. */
297
- declare const addPullRequestComment: (token: GithubTokenInput, {
298
- needsApproval
299
- }?: ToolOptions) => GithubTool;
300
- /** List files changed in a pull request, including diff status and patch content. */
301
- declare const listPullRequestFiles: (token: GithubTokenInput) => GithubTool;
302
- /** List reviews on a pull request (approvals, change requests, and comments). */
303
- declare const listPullRequestReviews: (token: GithubTokenInput) => GithubTool;
304
- /** Submit a pull request review with optional inline comments. Requires approval by default. */
305
- declare const createPullRequestReview: (token: GithubTokenInput, {
306
- needsApproval
307
- }?: ToolOptions) => GithubTool;
308
- //#endregion
309
- //#region src/tools/issues.d.ts
310
- /** List issues for a GitHub repository (excludes pull requests). */
311
- declare const listIssues: (token: GithubTokenInput) => GithubTool;
312
- /** Get detailed information about a specific issue. */
313
- declare const getIssue: (token: GithubTokenInput) => GithubTool;
314
- /** Create a new issue in a GitHub repository. Requires approval by default. */
315
- declare const createIssue: (token: GithubTokenInput, {
316
- needsApproval
317
- }?: ToolOptions) => GithubTool;
318
- /** Add a comment to a GitHub issue. Requires approval by default. */
319
- declare const addIssueComment: (token: GithubTokenInput, {
320
- needsApproval
321
- }?: ToolOptions) => GithubTool;
322
- /** Close an open GitHub issue. Requires approval by default. */
323
- declare const closeIssue: (token: GithubTokenInput, {
324
- needsApproval
325
- }?: ToolOptions) => GithubTool;
326
- /** List labels available in a GitHub repository. */
327
- declare const listLabels: (token: GithubTokenInput) => GithubTool;
328
- /** Add labels to an issue or pull request. Requires approval by default. */
329
- declare const addLabels: (token: GithubTokenInput, {
330
- needsApproval
331
- }?: ToolOptions) => GithubTool;
332
- /** Remove a label from an issue or pull request. Requires approval by default. */
333
- declare const removeLabel: (token: GithubTokenInput, {
334
- needsApproval
335
- }?: ToolOptions) => GithubTool;
336
- //#endregion
337
- //#region src/tools/search.d.ts
338
- /** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. */
339
- declare const searchCode: (token: GithubTokenInput) => GithubTool;
340
- /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
341
- declare const searchRepositories: (token: GithubTokenInput) => GithubTool;
342
- //#endregion
343
- //#region src/tools/commits.d.ts
344
- /** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */
345
- declare const listCommits: (token: GithubTokenInput) => GithubTool;
346
- /** Get detailed information about a specific commit, including files changed with additions and deletions. */
347
- declare const getCommit: (token: GithubTokenInput) => GithubTool;
348
- /** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */
349
- declare const getBlame: (token: GithubTokenInput) => GithubTool;
350
- //#endregion
351
- //#region src/tools/gists.d.ts
352
- /** List gists for the authenticated user or a specific user. */
353
- declare const listGists: (token: GithubTokenInput) => GithubTool;
354
- /** Get a gist by ID, including file contents. */
355
- declare const getGist: (token: GithubTokenInput) => GithubTool;
356
- /** List comments on a gist. */
357
- declare const listGistComments: (token: GithubTokenInput) => GithubTool;
358
- /** Create a new gist with one or more files. Requires approval by default. */
359
- declare const createGist: (token: GithubTokenInput, {
360
- needsApproval
361
- }?: ToolOptions) => GithubTool;
362
- /** Update an existing gist. Requires approval by default. */
363
- declare const updateGist: (token: GithubTokenInput, {
364
- needsApproval
365
- }?: ToolOptions) => GithubTool;
366
- /** Delete a gist permanently. Requires approval by default. */
367
- declare const deleteGist: (token: GithubTokenInput, {
368
- needsApproval
369
- }?: ToolOptions) => GithubTool;
370
- /** Add a comment to a gist. Requires approval by default. */
371
- declare const createGistComment: (token: GithubTokenInput, {
372
- needsApproval
373
- }?: ToolOptions) => GithubTool;
374
- //#endregion
375
- //#region src/tools/workflows.d.ts
376
- /** List GitHub Actions workflows in a repository. */
377
- declare const listWorkflows: (token: GithubTokenInput) => GithubTool;
378
- /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
379
- declare const listWorkflowRuns: (token: GithubTokenInput) => GithubTool;
380
- /** Get details of a specific workflow run including status, timing, and trigger info. */
381
- declare const getWorkflowRun: (token: GithubTokenInput) => GithubTool;
382
- /** List jobs for a workflow run, including step-level status and timing. */
383
- declare const listWorkflowJobs: (token: GithubTokenInput) => GithubTool;
384
- /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
385
- declare const triggerWorkflow: (token: GithubTokenInput, {
386
- needsApproval
387
- }?: ToolOptions) => GithubTool;
388
- /** Cancel an in-progress workflow run. Requires approval by default. */
389
- declare const cancelWorkflowRun: (token: GithubTokenInput, {
390
- needsApproval
391
- }?: ToolOptions) => GithubTool;
392
- /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
393
- declare const rerunWorkflowRun: (token: GithubTokenInput, {
394
- needsApproval
395
- }?: ToolOptions) => GithubTool;
396
- //#endregion
397
- //#region src/agents.d.ts
398
- type AgentOptions = Omit<ToolLoopAgentSettings<ToolSet>, 'model' | 'tools' | 'instructions'>;
399
- type CreateGithubAgentOptions = AgentOptions & GithubToolsBaseOptions & {
400
- model: ToolLoopAgentSettings<ToolSet>['model'];
401
- /**
402
- * Restrict tools and system prompt to a predefined preset.
403
- *
404
- * Selects a subset of tools and, when a single preset is passed,
405
- * sets a matching system prompt. Combine presets with an array to merge tool sets.
406
- *
407
- * @see {@link GithubToolPreset} for available presets and included tools.
408
- */
409
- preset?: GithubToolPreset | GithubToolPreset[];
410
- /**
411
- * Fully replace the default system prompt.
412
- * When set, `preset` system prompts and `additionalInstructions` are ignored.
413
- */
414
- instructions?: string;
415
- /**
416
- * Append text to the preset-specific (or default) system prompt.
417
- * Ignored when `instructions` is set.
418
- */
419
- additionalInstructions?: string;
420
- };
421
- declare function createGithubAgent(options: CreateGithubAgentOptions & {
422
- preset?: undefined;
423
- }): ToolLoopAgent<never, AllGithubTools>;
424
- declare function createGithubAgent<P extends GithubToolPreset>(options: CreateGithubAgentOptions & {
425
- preset: P;
426
- }): ToolLoopAgent<never, Pick<AllGithubTools, PresetToolName<P>>>;
427
- declare function createGithubAgent<P extends readonly GithubToolPreset[]>(options: CreateGithubAgentOptions & {
428
- preset: P;
429
- }): ToolLoopAgent<never, Pick<AllGithubTools, CombinedPresetToolNames<P>>>;
430
- //#endregion
431
- //#region src/index.d.ts
432
- type GithubToolsOptions = GithubToolsBaseOptions & {
433
- /**
434
- * Restrict the returned tools to a predefined preset.
435
- * Omit to get all tools.
436
- *
437
- * @see {@link GithubToolPreset} for available presets and included tools.
438
- *
439
- * @example
440
- * ```ts
441
- * // Only code-review tools
442
- * createGithubTools({ token, preset: 'code-review' })
443
- *
444
- * // Combine presets
445
- * createGithubTools({ token, preset: ['code-review', 'issue-triage'] })
446
- * ```
447
- */
448
- preset?: GithubToolPreset | GithubToolPreset[];
449
- };
450
- declare function createGithubTools(options?: GithubToolsBaseOptions & {
451
- preset?: undefined;
452
- }): AllGithubTools;
453
- declare function createGithubTools<P extends GithubToolPreset>(options: GithubToolsBaseOptions & {
454
- preset: P;
455
- }): Pick<AllGithubTools, PresetToolName<P>>;
456
- declare function createGithubTools<P extends readonly GithubToolPreset[]>(options: GithubToolsBaseOptions & {
457
- preset: P;
458
- }): Pick<AllGithubTools, CombinedPresetToolNames<P>>;
459
- declare function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
460
- type GithubTools = AllGithubTools & ToolSet;
461
- //#endregion
462
- export { CommitIdentity as $, listIssues as A, mergePullRequest as B, searchCode as C, closeIssue as D, addLabels as E, createPullRequestReview as F, getFileContent as G, createOrUpdateFile as H, getPullRequest as I, createOctokit as J, getRepository as K, listPullRequestFiles as L, removeLabel as M, addPullRequestComment as N, createIssue as O, createPullRequest as P, PickGithubTools as Q, listPullRequestReviews as R, listCommits as S, addIssueComment as T, createRepository as U, createBranch as V, forkRepository as W, GithubToolsBaseOptions as X, AllGithubTools as Y, GithubToolsForPreset as Z, listGistComments as _, createGithubAgent as a, GithubTokenInput as at, getBlame as b, listWorkflowJobs as c, GITHUB_WRITE_TOOLS as ct, rerunWorkflowRun as d, GithubToolPreset as dt, CommitToolOptions as et, triggerWorkflow as f, PRESET_TOOLS as ft, getGist as g, deleteGist as h, GithubToolName as ht, CreateGithubAgentOptions as i, ToolOverrides as it, listLabels as j, getIssue as k, listWorkflowRuns as l, GithubWriteToolName as lt, createGistComment as m, GITHUB_TOOL_NAMES as mt, GithubToolsOptions as n, Octokit$1 as nt, cancelWorkflowRun as o, resolveGithubToken as ot, createGist as p, PresetToolName as pt, listBranches as q, createGithubTools as r, ToolOptions as rt, getWorkflowRun as s, ApprovalConfig as st, GithubTools as t, GithubTool as tt, listWorkflows as u, CombinedPresetToolNames as ut, listGists as v, searchRepositories as w, getCommit as x, updateGist as y, listPullRequests as z };
463
- //# sourceMappingURL=index-Cs1Kebmt.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-Cs1Kebmt.d.mts","names":[],"sources":["../src/core/tool-names.ts","../src/core/presets.ts","../src/core/write-tools.ts","../src/core/approval.ts","../src/core/token.ts","../src/types.ts","../src/core/tool-types.ts","../src/client.ts","../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/search.ts","../src/tools/commits.ts","../src/tools/gists.ts","../src/tools/workflows.ts","../src/agents.ts","../src/index.ts"],"mappings":";;;;;;;;;cAIa,iBAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;qCAuFD;EAAA;uCAAwE;EAAA;iCCpFvE;EAAA;;;;;qCAgFe;EAAA,iDAAgB;EAAA,yCAGhC;EAAA,+CAAc;EAAA,2CAA+C;EAAA,+CAA0B;EAAA,6CAAnC;EAAA,iDAArC;EAAA;;KDCf,cAAA,UAAwB,iBAAA,cAA+B,iBAAA;;;;;;;AAvFnE;cCGa,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgFD,gBAAA,gBAAgC,YAAA;;KAGhC,cAAA,WAAyB,gBAAA,IAAoB,OAAA,SAAgB,YAAA,EAAc,CAAA,WAAY,cAAA;;KAGvF,uBAAA,oBAA2C,gBAAA,MAAsB,cAAA,CAAe,CAAA;;;;;;;cCzF/E,kBAAA;EFAA;;;;;;;;;;;;;;;;;;;;;KE2CD,mBAAA,UAA6B,kBAAA,cAAgC,kBAAA;;;;;;;AF3CzE;;;;;;;;;;;;;;;;;;;;KGsBY,cAAA,aAA2B,OAAA,CAAQ,MAAA,CAAO,mBAAA;;;KC1B1C,gBAAA,mBAAmC,OAAA;;iBA+B/B,kBAAA,C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