@github-tools/sdk 1.1.0 → 1.3.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/LICENSE +21 -201
- package/README.md +132 -19
- package/dist/agents-Cdb0a8CP.mjs +1455 -0
- package/dist/agents-Cdb0a8CP.mjs.map +1 -0
- package/dist/agents-CnwdZ0Wk.d.mts +692 -0
- package/dist/agents-CnwdZ0Wk.d.mts.map +1 -0
- package/dist/index.d.mts +297 -374
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +80 -669
- package/dist/index.mjs.map +1 -1
- package/dist/workflow.d.mts +649 -0
- package/dist/workflow.d.mts.map +1 -0
- package/dist/workflow.mjs +55 -0
- package/dist/workflow.mjs.map +1 -0
- package/package.json +31 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,378 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as listPullRequests, B as ToolOptions, C as closeIssue, D as addPullRequestComment, E as listIssues, F as forkRepository, I as getFileContent, L as getRepository, M as createBranch, N as createOrUpdateFile, O as createPullRequest, P as createRepository, R as listBranches, S as addIssueComment, T as getIssue, V as createOctokit, _ as getBlame, a as listWorkflowJobs, b as searchCode, c as rerunWorkflowRun, d as createGistComment, f as deleteGist, g as updateGist, h as listGists, i as getWorkflowRun, j as mergePullRequest, k as getPullRequest, l as triggerWorkflow, m as listGistComments, n as createGithubAgent, o as listWorkflowRuns, p as getGist, r as cancelWorkflowRun, s as listWorkflows, t as CreateGithubAgentOptions, u as createGist, v as getCommit, w as createIssue, x as searchRepositories, y as listCommits, z as Octokit } from "./agents-CnwdZ0Wk.mjs";
|
|
2
2
|
import * as ai from "ai";
|
|
3
|
-
import { ToolLoopAgent, ToolLoopAgentSettings } from "ai";
|
|
4
3
|
|
|
5
|
-
//#region src/client.d.ts
|
|
6
|
-
declare function createOctokit(token: string): Octokit$1;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/types.d.ts
|
|
9
|
-
type ToolOptions = {
|
|
10
|
-
needsApproval?: boolean;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/tools/repository.d.ts
|
|
14
|
-
declare const getRepository: (octokit: Octokit) => ai.Tool<{
|
|
15
|
-
owner: string;
|
|
16
|
-
repo: string;
|
|
17
|
-
}, {
|
|
18
|
-
name: string;
|
|
19
|
-
fullName: string;
|
|
20
|
-
description: string | null;
|
|
21
|
-
url: string;
|
|
22
|
-
defaultBranch: string;
|
|
23
|
-
stars: number;
|
|
24
|
-
forks: number;
|
|
25
|
-
openIssues: number;
|
|
26
|
-
language: string | null;
|
|
27
|
-
private: boolean;
|
|
28
|
-
createdAt: string;
|
|
29
|
-
updatedAt: string;
|
|
30
|
-
}>;
|
|
31
|
-
declare const listBranches: (octokit: Octokit) => ai.Tool<{
|
|
32
|
-
owner: string;
|
|
33
|
-
repo: string;
|
|
34
|
-
perPage: number;
|
|
35
|
-
}, {
|
|
36
|
-
name: string;
|
|
37
|
-
sha: string;
|
|
38
|
-
protected: boolean;
|
|
39
|
-
}[]>;
|
|
40
|
-
declare const getFileContent: (octokit: Octokit) => ai.Tool<{
|
|
41
|
-
owner: string;
|
|
42
|
-
repo: string;
|
|
43
|
-
path: string;
|
|
44
|
-
ref?: string | undefined;
|
|
45
|
-
}, {
|
|
46
|
-
type: string;
|
|
47
|
-
entries: {
|
|
48
|
-
name: string;
|
|
49
|
-
type: "file" | "dir" | "submodule" | "symlink";
|
|
50
|
-
path: string;
|
|
51
|
-
}[];
|
|
52
|
-
path?: undefined;
|
|
53
|
-
sha?: undefined;
|
|
54
|
-
size?: undefined;
|
|
55
|
-
content?: undefined;
|
|
56
|
-
} | {
|
|
57
|
-
type: "submodule" | "symlink";
|
|
58
|
-
path: string;
|
|
59
|
-
entries?: undefined;
|
|
60
|
-
sha?: undefined;
|
|
61
|
-
size?: undefined;
|
|
62
|
-
content?: undefined;
|
|
63
|
-
} | {
|
|
64
|
-
type: string;
|
|
65
|
-
path: string;
|
|
66
|
-
sha: string;
|
|
67
|
-
size: number;
|
|
68
|
-
content: string;
|
|
69
|
-
entries?: undefined;
|
|
70
|
-
}>;
|
|
71
|
-
declare const createOrUpdateFile: (octokit: Octokit, {
|
|
72
|
-
needsApproval
|
|
73
|
-
}?: ToolOptions) => ai.Tool<{
|
|
74
|
-
owner: string;
|
|
75
|
-
repo: string;
|
|
76
|
-
path: string;
|
|
77
|
-
message: string;
|
|
78
|
-
content: string;
|
|
79
|
-
branch?: string | undefined;
|
|
80
|
-
sha?: string | undefined;
|
|
81
|
-
}, {
|
|
82
|
-
path: string | undefined;
|
|
83
|
-
sha: string | undefined;
|
|
84
|
-
commitSha: string | undefined;
|
|
85
|
-
commitUrl: string | undefined;
|
|
86
|
-
}>;
|
|
87
|
-
//#endregion
|
|
88
|
-
//#region src/tools/pull-requests.d.ts
|
|
89
|
-
declare const listPullRequests: (octokit: Octokit) => ai.Tool<{
|
|
90
|
-
owner: string;
|
|
91
|
-
repo: string;
|
|
92
|
-
state: "open" | "closed" | "all";
|
|
93
|
-
perPage: number;
|
|
94
|
-
}, {
|
|
95
|
-
number: number;
|
|
96
|
-
title: string;
|
|
97
|
-
state: string;
|
|
98
|
-
url: string;
|
|
99
|
-
author: string | undefined;
|
|
100
|
-
branch: string;
|
|
101
|
-
base: string;
|
|
102
|
-
draft: boolean | undefined;
|
|
103
|
-
createdAt: string;
|
|
104
|
-
updatedAt: string;
|
|
105
|
-
}[]>;
|
|
106
|
-
declare const getPullRequest: (octokit: Octokit) => ai.Tool<{
|
|
107
|
-
owner: string;
|
|
108
|
-
repo: string;
|
|
109
|
-
pullNumber: number;
|
|
110
|
-
}, {
|
|
111
|
-
number: number;
|
|
112
|
-
title: string;
|
|
113
|
-
body: string | null;
|
|
114
|
-
state: "open" | "closed";
|
|
115
|
-
url: string;
|
|
116
|
-
author: string;
|
|
117
|
-
branch: string;
|
|
118
|
-
base: string;
|
|
119
|
-
draft: boolean | undefined;
|
|
120
|
-
merged: boolean;
|
|
121
|
-
mergeable: boolean | null;
|
|
122
|
-
additions: number;
|
|
123
|
-
deletions: number;
|
|
124
|
-
changedFiles: number;
|
|
125
|
-
createdAt: string;
|
|
126
|
-
updatedAt: string;
|
|
127
|
-
mergedAt: string | null;
|
|
128
|
-
}>;
|
|
129
|
-
declare const createPullRequest: (octokit: Octokit, {
|
|
130
|
-
needsApproval
|
|
131
|
-
}?: ToolOptions) => ai.Tool<{
|
|
132
|
-
owner: string;
|
|
133
|
-
repo: string;
|
|
134
|
-
title: string;
|
|
135
|
-
head: string;
|
|
136
|
-
base: string;
|
|
137
|
-
draft: boolean;
|
|
138
|
-
body?: string | undefined;
|
|
139
|
-
}, {
|
|
140
|
-
number: number;
|
|
141
|
-
title: string;
|
|
142
|
-
url: string;
|
|
143
|
-
state: "open" | "closed";
|
|
144
|
-
draft: boolean | undefined;
|
|
145
|
-
branch: string;
|
|
146
|
-
base: string;
|
|
147
|
-
}>;
|
|
148
|
-
declare const mergePullRequest: (octokit: Octokit, {
|
|
149
|
-
needsApproval
|
|
150
|
-
}?: ToolOptions) => ai.Tool<{
|
|
151
|
-
owner: string;
|
|
152
|
-
repo: string;
|
|
153
|
-
pullNumber: number;
|
|
154
|
-
mergeMethod: "merge" | "squash" | "rebase";
|
|
155
|
-
commitTitle?: string | undefined;
|
|
156
|
-
commitMessage?: string | undefined;
|
|
157
|
-
}, {
|
|
158
|
-
merged: boolean;
|
|
159
|
-
message: string;
|
|
160
|
-
sha: string;
|
|
161
|
-
}>;
|
|
162
|
-
declare const addPullRequestComment: (octokit: Octokit, {
|
|
163
|
-
needsApproval
|
|
164
|
-
}?: ToolOptions) => ai.Tool<{
|
|
165
|
-
owner: string;
|
|
166
|
-
repo: string;
|
|
167
|
-
pullNumber: number;
|
|
168
|
-
body: string;
|
|
169
|
-
}, {
|
|
170
|
-
id: number;
|
|
171
|
-
url: string;
|
|
172
|
-
body: string | undefined;
|
|
173
|
-
author: string | undefined;
|
|
174
|
-
createdAt: string;
|
|
175
|
-
}>;
|
|
176
|
-
//#endregion
|
|
177
|
-
//#region src/tools/issues.d.ts
|
|
178
|
-
declare const listIssues: (octokit: Octokit) => ai.Tool<{
|
|
179
|
-
owner: string;
|
|
180
|
-
repo: string;
|
|
181
|
-
state: "open" | "closed" | "all";
|
|
182
|
-
perPage: number;
|
|
183
|
-
labels?: string | undefined;
|
|
184
|
-
}, {
|
|
185
|
-
number: number;
|
|
186
|
-
title: string;
|
|
187
|
-
state: string;
|
|
188
|
-
url: string;
|
|
189
|
-
author: string | undefined;
|
|
190
|
-
labels: (string | undefined)[];
|
|
191
|
-
createdAt: string;
|
|
192
|
-
updatedAt: string;
|
|
193
|
-
}[]>;
|
|
194
|
-
declare const getIssue: (octokit: Octokit) => ai.Tool<{
|
|
195
|
-
owner: string;
|
|
196
|
-
repo: string;
|
|
197
|
-
issueNumber: number;
|
|
198
|
-
}, {
|
|
199
|
-
number: number;
|
|
200
|
-
title: string;
|
|
201
|
-
body: string | null | undefined;
|
|
202
|
-
state: string;
|
|
203
|
-
url: string;
|
|
204
|
-
author: string | undefined;
|
|
205
|
-
assignees: string[] | undefined;
|
|
206
|
-
labels: (string | undefined)[];
|
|
207
|
-
comments: number;
|
|
208
|
-
createdAt: string;
|
|
209
|
-
updatedAt: string;
|
|
210
|
-
closedAt: string | null;
|
|
211
|
-
}>;
|
|
212
|
-
declare const createIssue: (octokit: Octokit, {
|
|
213
|
-
needsApproval
|
|
214
|
-
}?: ToolOptions) => ai.Tool<{
|
|
215
|
-
owner: string;
|
|
216
|
-
repo: string;
|
|
217
|
-
title: string;
|
|
218
|
-
body?: string | undefined;
|
|
219
|
-
labels?: string[] | undefined;
|
|
220
|
-
assignees?: string[] | undefined;
|
|
221
|
-
}, {
|
|
222
|
-
number: number;
|
|
223
|
-
title: string;
|
|
224
|
-
url: string;
|
|
225
|
-
state: string;
|
|
226
|
-
labels: (string | undefined)[];
|
|
227
|
-
}>;
|
|
228
|
-
declare const addIssueComment: (octokit: Octokit, {
|
|
229
|
-
needsApproval
|
|
230
|
-
}?: ToolOptions) => ai.Tool<{
|
|
231
|
-
owner: string;
|
|
232
|
-
repo: string;
|
|
233
|
-
issueNumber: number;
|
|
234
|
-
body: string;
|
|
235
|
-
}, {
|
|
236
|
-
id: number;
|
|
237
|
-
url: string;
|
|
238
|
-
body: string | undefined;
|
|
239
|
-
author: string | undefined;
|
|
240
|
-
createdAt: string;
|
|
241
|
-
}>;
|
|
242
|
-
declare const closeIssue: (octokit: Octokit, {
|
|
243
|
-
needsApproval
|
|
244
|
-
}?: ToolOptions) => ai.Tool<{
|
|
245
|
-
owner: string;
|
|
246
|
-
repo: string;
|
|
247
|
-
issueNumber: number;
|
|
248
|
-
stateReason: "completed" | "not_planned";
|
|
249
|
-
}, {
|
|
250
|
-
number: number;
|
|
251
|
-
title: string;
|
|
252
|
-
state: string;
|
|
253
|
-
url: string;
|
|
254
|
-
closedAt: string | null;
|
|
255
|
-
}>;
|
|
256
|
-
//#endregion
|
|
257
|
-
//#region src/tools/search.d.ts
|
|
258
|
-
declare const searchCode: (octokit: Octokit) => ai.Tool<{
|
|
259
|
-
query: string;
|
|
260
|
-
perPage: number;
|
|
261
|
-
}, {
|
|
262
|
-
totalCount: number;
|
|
263
|
-
items: {
|
|
264
|
-
name: string;
|
|
265
|
-
path: string;
|
|
266
|
-
url: string;
|
|
267
|
-
repository: string;
|
|
268
|
-
sha: string;
|
|
269
|
-
}[];
|
|
270
|
-
}>;
|
|
271
|
-
declare const searchRepositories: (octokit: Octokit) => ai.Tool<{
|
|
272
|
-
query: string;
|
|
273
|
-
perPage: number;
|
|
274
|
-
order: "asc" | "desc";
|
|
275
|
-
sort?: "stars" | "forks" | "help-wanted-issues" | "updated" | undefined;
|
|
276
|
-
}, {
|
|
277
|
-
totalCount: number;
|
|
278
|
-
items: {
|
|
279
|
-
name: string;
|
|
280
|
-
fullName: string;
|
|
281
|
-
description: string | null;
|
|
282
|
-
url: string;
|
|
283
|
-
stars: number;
|
|
284
|
-
forks: number;
|
|
285
|
-
language: string | null;
|
|
286
|
-
topics: string[] | undefined;
|
|
287
|
-
}[];
|
|
288
|
-
}>;
|
|
289
|
-
//#endregion
|
|
290
|
-
//#region src/tools/commits.d.ts
|
|
291
|
-
declare const listCommits: (octokit: Octokit) => ai.Tool<{
|
|
292
|
-
owner: string;
|
|
293
|
-
repo: string;
|
|
294
|
-
perPage: number;
|
|
295
|
-
path?: string | undefined;
|
|
296
|
-
sha?: string | undefined;
|
|
297
|
-
author?: string | undefined;
|
|
298
|
-
since?: string | undefined;
|
|
299
|
-
until?: string | undefined;
|
|
300
|
-
}, {
|
|
301
|
-
sha: string;
|
|
302
|
-
message: string;
|
|
303
|
-
author: string | undefined;
|
|
304
|
-
authorLogin: string | undefined;
|
|
305
|
-
date: string | undefined;
|
|
306
|
-
url: string;
|
|
307
|
-
}[]>;
|
|
308
|
-
declare const getCommit: (octokit: Octokit) => ai.Tool<{
|
|
309
|
-
owner: string;
|
|
310
|
-
repo: string;
|
|
311
|
-
ref: string;
|
|
312
|
-
}, {
|
|
313
|
-
sha: string;
|
|
314
|
-
message: string;
|
|
315
|
-
author: string | undefined;
|
|
316
|
-
authorLogin: string | undefined;
|
|
317
|
-
date: string | undefined;
|
|
318
|
-
url: string;
|
|
319
|
-
stats: {
|
|
320
|
-
additions: number | undefined;
|
|
321
|
-
deletions: number | undefined;
|
|
322
|
-
total: number | undefined;
|
|
323
|
-
} | null;
|
|
324
|
-
files: {
|
|
325
|
-
filename: string;
|
|
326
|
-
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
|
|
327
|
-
additions: number;
|
|
328
|
-
deletions: number;
|
|
329
|
-
patch: string | undefined;
|
|
330
|
-
}[] | undefined;
|
|
331
|
-
}>;
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region src/agents.d.ts
|
|
334
|
-
type AgentOptions = Omit<ToolLoopAgentSettings, 'model' | 'tools' | 'instructions'>;
|
|
335
|
-
type CreateGithubAgentOptions = AgentOptions & {
|
|
336
|
-
model: ToolLoopAgentSettings['model'];
|
|
337
|
-
/**
|
|
338
|
-
* GitHub personal access token.
|
|
339
|
-
* Falls back to `process.env.GITHUB_TOKEN` when omitted.
|
|
340
|
-
*/
|
|
341
|
-
token?: string;
|
|
342
|
-
preset?: GithubToolPreset | GithubToolPreset[];
|
|
343
|
-
requireApproval?: ApprovalConfig;
|
|
344
|
-
instructions?: string;
|
|
345
|
-
additionalInstructions?: string;
|
|
346
|
-
};
|
|
347
|
-
/**
|
|
348
|
-
* Create a pre-configured GitHub agent powered by the AI SDK's `ToolLoopAgent`.
|
|
349
|
-
*
|
|
350
|
-
* Returns a `ToolLoopAgent` instance with `.generate()` and `.stream()` methods.
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* ```ts
|
|
354
|
-
* import { createGithubAgent } from '@github-tools/sdk'
|
|
355
|
-
*
|
|
356
|
-
* const agent = createGithubAgent({
|
|
357
|
-
* model: 'anthropic/claude-sonnet-4-6',
|
|
358
|
-
* token: process.env.GITHUB_TOKEN!,
|
|
359
|
-
* preset: 'code-review',
|
|
360
|
-
* })
|
|
361
|
-
*
|
|
362
|
-
* const result = await agent.generate({ prompt: 'Review PR #42 on vercel/ai' })
|
|
363
|
-
* ```
|
|
364
|
-
*/
|
|
365
|
-
declare function createGithubAgent({
|
|
366
|
-
token,
|
|
367
|
-
preset,
|
|
368
|
-
requireApproval,
|
|
369
|
-
instructions,
|
|
370
|
-
additionalInstructions,
|
|
371
|
-
...agentOptions
|
|
372
|
-
}: CreateGithubAgentOptions): ToolLoopAgent<never, {}, never>;
|
|
373
|
-
//#endregion
|
|
374
4
|
//#region src/index.d.ts
|
|
375
|
-
type GithubWriteToolName = 'createOrUpdateFile' | 'createPullRequest' | 'mergePullRequest' | 'addPullRequestComment' | 'createIssue' | 'addIssueComment' | 'closeIssue';
|
|
5
|
+
type GithubWriteToolName = 'createBranch' | 'forkRepository' | 'createRepository' | 'createOrUpdateFile' | 'createPullRequest' | 'mergePullRequest' | 'addPullRequestComment' | 'createIssue' | 'addIssueComment' | 'closeIssue' | 'createGist' | 'updateGist' | 'deleteGist' | 'createGistComment' | 'triggerWorkflow' | 'cancelWorkflowRun' | 'rerunWorkflowRun';
|
|
376
6
|
/**
|
|
377
7
|
* Whether write operations require user approval.
|
|
378
8
|
* - `true` — all write tools need approval (default)
|
|
@@ -396,9 +26,10 @@ type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
|
|
|
396
26
|
* - `'code-review'` — Review PRs: read PRs, file content, commits, and post comments
|
|
397
27
|
* - `'issue-triage'` — Triage issues: read/create/close issues, search, and comment
|
|
398
28
|
* - `'repo-explorer'` — Explore repos: read-only access to repos, branches, code, and search
|
|
29
|
+
* - `'ci-ops'` — CI operations: monitor and manage GitHub Actions workflows
|
|
399
30
|
* - `'maintainer'` — Full maintenance: all read + create PRs, merge, manage issues
|
|
400
31
|
*/
|
|
401
|
-
type GithubToolPreset = 'code-review' | 'issue-triage' | 'repo-explorer' | 'maintainer';
|
|
32
|
+
type GithubToolPreset = 'code-review' | 'issue-triage' | 'repo-explorer' | 'ci-ops' | 'maintainer';
|
|
402
33
|
type GithubToolsOptions = {
|
|
403
34
|
/**
|
|
404
35
|
* GitHub personal access token.
|
|
@@ -659,6 +290,90 @@ declare function createGithubTools({
|
|
|
659
290
|
patch: string | undefined;
|
|
660
291
|
}[] | undefined;
|
|
661
292
|
}>;
|
|
293
|
+
getBlame: ai.Tool<{
|
|
294
|
+
owner: string;
|
|
295
|
+
repo: string;
|
|
296
|
+
path: string;
|
|
297
|
+
ref?: string | undefined;
|
|
298
|
+
line?: number | undefined;
|
|
299
|
+
lineStart?: number | undefined;
|
|
300
|
+
lineEnd?: number | undefined;
|
|
301
|
+
}, {
|
|
302
|
+
error: string;
|
|
303
|
+
ref?: undefined;
|
|
304
|
+
tipSha?: undefined;
|
|
305
|
+
path?: undefined;
|
|
306
|
+
rangeCount?: undefined;
|
|
307
|
+
ranges?: undefined;
|
|
308
|
+
} | {
|
|
309
|
+
ref: string;
|
|
310
|
+
tipSha: string;
|
|
311
|
+
path: string;
|
|
312
|
+
rangeCount: number;
|
|
313
|
+
ranges: {
|
|
314
|
+
startingLine: number;
|
|
315
|
+
endingLine: number;
|
|
316
|
+
age: number;
|
|
317
|
+
commit: {
|
|
318
|
+
sha: string;
|
|
319
|
+
abbreviatedSha: string;
|
|
320
|
+
messageHeadline: string;
|
|
321
|
+
authoredDate: string;
|
|
322
|
+
url: string;
|
|
323
|
+
authorName: string | null;
|
|
324
|
+
authorEmail: string | null;
|
|
325
|
+
authorLogin: string | null;
|
|
326
|
+
};
|
|
327
|
+
}[];
|
|
328
|
+
error?: undefined;
|
|
329
|
+
}>;
|
|
330
|
+
createBranch: ai.Tool<{
|
|
331
|
+
owner: string;
|
|
332
|
+
repo: string;
|
|
333
|
+
branch: string;
|
|
334
|
+
from?: string | undefined;
|
|
335
|
+
}, {
|
|
336
|
+
ref: string;
|
|
337
|
+
sha: string;
|
|
338
|
+
url: string;
|
|
339
|
+
}>;
|
|
340
|
+
forkRepository: ai.Tool<{
|
|
341
|
+
owner: string;
|
|
342
|
+
repo: string;
|
|
343
|
+
organization?: string | undefined;
|
|
344
|
+
name?: string | undefined;
|
|
345
|
+
}, {
|
|
346
|
+
name: string;
|
|
347
|
+
fullName: string;
|
|
348
|
+
url: string;
|
|
349
|
+
cloneUrl: string;
|
|
350
|
+
sshUrl: string;
|
|
351
|
+
defaultBranch: string;
|
|
352
|
+
private: boolean;
|
|
353
|
+
parent: {
|
|
354
|
+
fullName: string;
|
|
355
|
+
url: string;
|
|
356
|
+
} | null;
|
|
357
|
+
}>;
|
|
358
|
+
createRepository: ai.Tool<{
|
|
359
|
+
name: string;
|
|
360
|
+
isPrivate: boolean;
|
|
361
|
+
autoInit: boolean;
|
|
362
|
+
description?: string | undefined;
|
|
363
|
+
gitignoreTemplate?: string | undefined;
|
|
364
|
+
licenseTemplate?: string | undefined;
|
|
365
|
+
org?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
name: string;
|
|
368
|
+
fullName: string;
|
|
369
|
+
description: string | null;
|
|
370
|
+
url: string;
|
|
371
|
+
cloneUrl: string;
|
|
372
|
+
sshUrl: string;
|
|
373
|
+
defaultBranch: string;
|
|
374
|
+
private: boolean;
|
|
375
|
+
createdAt: string;
|
|
376
|
+
}>;
|
|
662
377
|
createOrUpdateFile: ai.Tool<{
|
|
663
378
|
owner: string;
|
|
664
379
|
repo: string;
|
|
@@ -752,8 +467,216 @@ declare function createGithubTools({
|
|
|
752
467
|
url: string;
|
|
753
468
|
closedAt: string | null;
|
|
754
469
|
}>;
|
|
470
|
+
listGists: ai.Tool<{
|
|
471
|
+
perPage: number;
|
|
472
|
+
page: number;
|
|
473
|
+
username?: string | undefined;
|
|
474
|
+
}, {
|
|
475
|
+
id: string;
|
|
476
|
+
description: string | null;
|
|
477
|
+
public: boolean;
|
|
478
|
+
url: string;
|
|
479
|
+
files: string[];
|
|
480
|
+
owner: string | undefined;
|
|
481
|
+
comments: number;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
}[]>;
|
|
485
|
+
getGist: ai.Tool<{
|
|
486
|
+
gistId: string;
|
|
487
|
+
}, {
|
|
488
|
+
id: string | undefined;
|
|
489
|
+
description: string | null | undefined;
|
|
490
|
+
public: boolean | undefined;
|
|
491
|
+
url: string | undefined;
|
|
492
|
+
owner: string | undefined;
|
|
493
|
+
files: {
|
|
494
|
+
filename: string | undefined;
|
|
495
|
+
language: string | undefined;
|
|
496
|
+
size: number | undefined;
|
|
497
|
+
content: string | undefined;
|
|
498
|
+
}[];
|
|
499
|
+
comments: number | undefined;
|
|
500
|
+
createdAt: string | undefined;
|
|
501
|
+
updatedAt: string | undefined;
|
|
502
|
+
}>;
|
|
503
|
+
listGistComments: ai.Tool<{
|
|
504
|
+
gistId: string;
|
|
505
|
+
perPage: number;
|
|
506
|
+
page: number;
|
|
507
|
+
}, {
|
|
508
|
+
id: number;
|
|
509
|
+
body: string;
|
|
510
|
+
author: string | undefined;
|
|
511
|
+
url: string;
|
|
512
|
+
createdAt: string;
|
|
513
|
+
updatedAt: string;
|
|
514
|
+
}[]>;
|
|
515
|
+
createGist: ai.Tool<{
|
|
516
|
+
files: Record<string, {
|
|
517
|
+
content: string;
|
|
518
|
+
}>;
|
|
519
|
+
isPublic: boolean;
|
|
520
|
+
description?: string | undefined;
|
|
521
|
+
}, {
|
|
522
|
+
id: string | undefined;
|
|
523
|
+
description: string | null | undefined;
|
|
524
|
+
public: boolean | undefined;
|
|
525
|
+
url: string | undefined;
|
|
526
|
+
files: string[];
|
|
527
|
+
owner: string | undefined;
|
|
528
|
+
}>;
|
|
529
|
+
updateGist: ai.Tool<{
|
|
530
|
+
gistId: string;
|
|
531
|
+
description?: string | undefined;
|
|
532
|
+
files?: Record<string, {
|
|
533
|
+
content: string;
|
|
534
|
+
}> | undefined;
|
|
535
|
+
filesToDelete?: string[] | undefined;
|
|
536
|
+
}, {
|
|
537
|
+
id: string | undefined;
|
|
538
|
+
description: string | null | undefined;
|
|
539
|
+
url: string | undefined;
|
|
540
|
+
files: string[];
|
|
541
|
+
}>;
|
|
542
|
+
deleteGist: ai.Tool<{
|
|
543
|
+
gistId: string;
|
|
544
|
+
}, {
|
|
545
|
+
deleted: boolean;
|
|
546
|
+
gistId: string;
|
|
547
|
+
}>;
|
|
548
|
+
createGistComment: ai.Tool<{
|
|
549
|
+
gistId: string;
|
|
550
|
+
body: string;
|
|
551
|
+
}, {
|
|
552
|
+
id: number;
|
|
553
|
+
url: string;
|
|
554
|
+
body: string;
|
|
555
|
+
author: string | undefined;
|
|
556
|
+
createdAt: string;
|
|
557
|
+
}>;
|
|
558
|
+
listWorkflows: ai.Tool<{
|
|
559
|
+
owner: string;
|
|
560
|
+
repo: string;
|
|
561
|
+
perPage: number;
|
|
562
|
+
page: number;
|
|
563
|
+
}, {
|
|
564
|
+
totalCount: number;
|
|
565
|
+
workflows: {
|
|
566
|
+
id: number;
|
|
567
|
+
name: string;
|
|
568
|
+
path: string;
|
|
569
|
+
state: "active" | "deleted" | "disabled_fork" | "disabled_inactivity" | "disabled_manually";
|
|
570
|
+
url: string;
|
|
571
|
+
createdAt: string;
|
|
572
|
+
updatedAt: string;
|
|
573
|
+
}[];
|
|
574
|
+
}>;
|
|
575
|
+
listWorkflowRuns: ai.Tool<{
|
|
576
|
+
owner: string;
|
|
577
|
+
repo: string;
|
|
578
|
+
perPage: number;
|
|
579
|
+
page: number;
|
|
580
|
+
workflowId?: string | number | undefined;
|
|
581
|
+
branch?: string | undefined;
|
|
582
|
+
event?: string | undefined;
|
|
583
|
+
status?: "success" | "completed" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "stale" | "timed_out" | "in_progress" | "queued" | "requested" | "waiting" | "pending" | undefined;
|
|
584
|
+
}, {
|
|
585
|
+
totalCount: number;
|
|
586
|
+
runs: {
|
|
587
|
+
id: number;
|
|
588
|
+
name: string | null | undefined;
|
|
589
|
+
status: string | null;
|
|
590
|
+
conclusion: string | null;
|
|
591
|
+
branch: string | null;
|
|
592
|
+
event: string;
|
|
593
|
+
url: string;
|
|
594
|
+
actor: string | undefined;
|
|
595
|
+
createdAt: string;
|
|
596
|
+
updatedAt: string;
|
|
597
|
+
runNumber: number;
|
|
598
|
+
runAttempt: number | undefined;
|
|
599
|
+
}[];
|
|
600
|
+
}>;
|
|
601
|
+
getWorkflowRun: ai.Tool<{
|
|
602
|
+
owner: string;
|
|
603
|
+
repo: string;
|
|
604
|
+
runId: number;
|
|
605
|
+
}, {
|
|
606
|
+
id: number;
|
|
607
|
+
name: string | null | undefined;
|
|
608
|
+
status: string | null;
|
|
609
|
+
conclusion: string | null;
|
|
610
|
+
branch: string | null;
|
|
611
|
+
sha: string;
|
|
612
|
+
event: string;
|
|
613
|
+
url: string;
|
|
614
|
+
actor: string | undefined;
|
|
615
|
+
runNumber: number;
|
|
616
|
+
runAttempt: number | undefined;
|
|
617
|
+
createdAt: string;
|
|
618
|
+
updatedAt: string;
|
|
619
|
+
runStartedAt: string | undefined;
|
|
620
|
+
}>;
|
|
621
|
+
listWorkflowJobs: ai.Tool<{
|
|
622
|
+
owner: string;
|
|
623
|
+
repo: string;
|
|
624
|
+
runId: number;
|
|
625
|
+
filter: "all" | "latest";
|
|
626
|
+
perPage: number;
|
|
627
|
+
page: number;
|
|
628
|
+
}, {
|
|
629
|
+
totalCount: number;
|
|
630
|
+
jobs: {
|
|
631
|
+
id: number;
|
|
632
|
+
name: string;
|
|
633
|
+
status: "completed" | "in_progress" | "queued" | "requested" | "waiting" | "pending";
|
|
634
|
+
conclusion: "success" | "action_required" | "cancelled" | "failure" | "neutral" | "skipped" | "timed_out" | null;
|
|
635
|
+
url: string | null;
|
|
636
|
+
startedAt: string;
|
|
637
|
+
completedAt: string | null;
|
|
638
|
+
runnerName: string | null;
|
|
639
|
+
steps: {
|
|
640
|
+
name: string;
|
|
641
|
+
status: "completed" | "in_progress" | "queued";
|
|
642
|
+
conclusion: string | null;
|
|
643
|
+
number: number;
|
|
644
|
+
startedAt: string | null | undefined;
|
|
645
|
+
completedAt: string | null | undefined;
|
|
646
|
+
}[] | undefined;
|
|
647
|
+
}[];
|
|
648
|
+
}>;
|
|
649
|
+
triggerWorkflow: ai.Tool<{
|
|
650
|
+
owner: string;
|
|
651
|
+
repo: string;
|
|
652
|
+
workflowId: string | number;
|
|
653
|
+
ref: string;
|
|
654
|
+
inputs?: Record<string, string> | undefined;
|
|
655
|
+
}, {
|
|
656
|
+
triggered: boolean;
|
|
657
|
+
workflowId: string | number;
|
|
658
|
+
ref: string;
|
|
659
|
+
}>;
|
|
660
|
+
cancelWorkflowRun: ai.Tool<{
|
|
661
|
+
owner: string;
|
|
662
|
+
repo: string;
|
|
663
|
+
runId: number;
|
|
664
|
+
}, {
|
|
665
|
+
cancelled: boolean;
|
|
666
|
+
runId: number;
|
|
667
|
+
}>;
|
|
668
|
+
rerunWorkflowRun: ai.Tool<{
|
|
669
|
+
owner: string;
|
|
670
|
+
repo: string;
|
|
671
|
+
runId: number;
|
|
672
|
+
onlyFailedJobs: boolean;
|
|
673
|
+
}, {
|
|
674
|
+
rerun: boolean;
|
|
675
|
+
runId: number;
|
|
676
|
+
onlyFailedJobs: boolean;
|
|
677
|
+
}>;
|
|
755
678
|
}>;
|
|
756
679
|
type GithubTools = ReturnType<typeof createGithubTools>;
|
|
757
680
|
//#endregion
|
|
758
|
-
export { ApprovalConfig, type CreateGithubAgentOptions, GithubToolPreset, GithubTools, GithubToolsOptions, GithubWriteToolName, type Octokit, type ToolOptions, addIssueComment, addPullRequestComment, closeIssue, createGithubAgent, createGithubTools, createIssue, createOctokit, createOrUpdateFile, createPullRequest, getCommit, getFileContent, getIssue, getPullRequest, getRepository, listBranches, listCommits, listIssues, listPullRequests, mergePullRequest, searchCode, searchRepositories };
|
|
681
|
+
export { ApprovalConfig, type CreateGithubAgentOptions, GithubToolPreset, GithubTools, GithubToolsOptions, GithubWriteToolName, type Octokit, type ToolOptions, addIssueComment, addPullRequestComment, cancelWorkflowRun, closeIssue, createBranch, createGist, createGistComment, createGithubAgent, createGithubTools, createIssue, createOctokit, createOrUpdateFile, createPullRequest, createRepository, deleteGist, forkRepository, getBlame, getCommit, getFileContent, getGist, getIssue, getPullRequest, getRepository, getWorkflowRun, listBranches, listCommits, listGistComments, listGists, listIssues, listPullRequests, listWorkflowJobs, listWorkflowRuns, listWorkflows, mergePullRequest, rerunWorkflowRun, searchCode, searchRepositories, triggerWorkflow, updateGist };
|
|
759
682
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;KAQY,mBAAA;;;;AAAZ;;;;;AAmCA;;;;;;;;KAAY,cAAA,aAA2B,OAAA,CAAQ,MAAA,CAAO,mBAAA;;;;;AAWtD;;;;;KAAY,gBAAA;AAAA,KAsCA,kBAAA;;;;;EAKV,KAAA;EACA,eAAA,GAAkB,cAAA;EADlB;;;;;;;;AA+DF;;;;;EAhDE,MAAA,GAAS,gBAAA,GAAmB,gBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgDd,iBAAA,CAAA;EAAoB,KAAA;EAAO,eAAA;EAAwB;AAAA,IAAU,kBAAA,GAAuB,OAAA;iBAAA,EAAA,CAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsDxF,WAAA,GAAc,UAAA,QAAkB,iBAAA"}
|