@github-tools/sdk 0.0.1
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 +201 -0
- package/README.md +175 -0
- package/dist/index.d.mts +689 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +626 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +58 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,689 @@
|
|
|
1
|
+
import { Octokit, Octokit as Octokit$1 } from "@octokit/rest";
|
|
2
|
+
import * as ai from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/client.d.ts
|
|
5
|
+
declare function createOctokit(token: string): Octokit$1;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/types.d.ts
|
|
8
|
+
type ToolOptions = {
|
|
9
|
+
needsApproval?: boolean;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/tools/repository.d.ts
|
|
13
|
+
declare const getRepository: (octokit: Octokit) => ai.Tool<{
|
|
14
|
+
owner: string;
|
|
15
|
+
repo: string;
|
|
16
|
+
}, {
|
|
17
|
+
name: string;
|
|
18
|
+
fullName: string;
|
|
19
|
+
description: string | null;
|
|
20
|
+
url: string;
|
|
21
|
+
defaultBranch: string;
|
|
22
|
+
stars: number;
|
|
23
|
+
forks: number;
|
|
24
|
+
openIssues: number;
|
|
25
|
+
language: string | null;
|
|
26
|
+
private: boolean;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}>;
|
|
30
|
+
declare const listBranches: (octokit: Octokit) => ai.Tool<{
|
|
31
|
+
owner: string;
|
|
32
|
+
repo: string;
|
|
33
|
+
perPage: number;
|
|
34
|
+
}, {
|
|
35
|
+
name: string;
|
|
36
|
+
sha: string;
|
|
37
|
+
protected: boolean;
|
|
38
|
+
}[]>;
|
|
39
|
+
declare const getFileContent: (octokit: Octokit) => ai.Tool<{
|
|
40
|
+
owner: string;
|
|
41
|
+
repo: string;
|
|
42
|
+
path: string;
|
|
43
|
+
ref?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
type: string;
|
|
46
|
+
entries: {
|
|
47
|
+
name: string;
|
|
48
|
+
type: "file" | "dir" | "submodule" | "symlink";
|
|
49
|
+
path: string;
|
|
50
|
+
}[];
|
|
51
|
+
path?: undefined;
|
|
52
|
+
sha?: undefined;
|
|
53
|
+
size?: undefined;
|
|
54
|
+
content?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
type: "submodule" | "symlink";
|
|
57
|
+
path: string;
|
|
58
|
+
entries?: undefined;
|
|
59
|
+
sha?: undefined;
|
|
60
|
+
size?: undefined;
|
|
61
|
+
content?: undefined;
|
|
62
|
+
} | {
|
|
63
|
+
type: string;
|
|
64
|
+
path: string;
|
|
65
|
+
sha: string;
|
|
66
|
+
size: number;
|
|
67
|
+
content: string;
|
|
68
|
+
entries?: undefined;
|
|
69
|
+
}>;
|
|
70
|
+
declare const createOrUpdateFile: (octokit: Octokit, {
|
|
71
|
+
needsApproval
|
|
72
|
+
}?: ToolOptions) => ai.Tool<{
|
|
73
|
+
owner: string;
|
|
74
|
+
repo: string;
|
|
75
|
+
path: string;
|
|
76
|
+
message: string;
|
|
77
|
+
content: string;
|
|
78
|
+
branch?: string | undefined;
|
|
79
|
+
sha?: string | undefined;
|
|
80
|
+
}, {
|
|
81
|
+
path: string | undefined;
|
|
82
|
+
sha: string | undefined;
|
|
83
|
+
commitSha: string | undefined;
|
|
84
|
+
commitUrl: string | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/tools/pull-requests.d.ts
|
|
88
|
+
declare const listPullRequests: (octokit: Octokit) => ai.Tool<{
|
|
89
|
+
owner: string;
|
|
90
|
+
repo: string;
|
|
91
|
+
state: "open" | "closed" | "all";
|
|
92
|
+
perPage: number;
|
|
93
|
+
}, {
|
|
94
|
+
number: number;
|
|
95
|
+
title: string;
|
|
96
|
+
state: string;
|
|
97
|
+
url: string;
|
|
98
|
+
author: string | undefined;
|
|
99
|
+
branch: string;
|
|
100
|
+
base: string;
|
|
101
|
+
draft: boolean | undefined;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
}[]>;
|
|
105
|
+
declare const getPullRequest: (octokit: Octokit) => ai.Tool<{
|
|
106
|
+
owner: string;
|
|
107
|
+
repo: string;
|
|
108
|
+
pullNumber: number;
|
|
109
|
+
}, {
|
|
110
|
+
number: number;
|
|
111
|
+
title: string;
|
|
112
|
+
body: string | null;
|
|
113
|
+
state: "open" | "closed";
|
|
114
|
+
url: string;
|
|
115
|
+
author: string;
|
|
116
|
+
branch: string;
|
|
117
|
+
base: string;
|
|
118
|
+
draft: boolean | undefined;
|
|
119
|
+
merged: boolean;
|
|
120
|
+
mergeable: boolean | null;
|
|
121
|
+
additions: number;
|
|
122
|
+
deletions: number;
|
|
123
|
+
changedFiles: number;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
mergedAt: string | null;
|
|
127
|
+
}>;
|
|
128
|
+
declare const createPullRequest: (octokit: Octokit, {
|
|
129
|
+
needsApproval
|
|
130
|
+
}?: ToolOptions) => ai.Tool<{
|
|
131
|
+
owner: string;
|
|
132
|
+
repo: string;
|
|
133
|
+
title: string;
|
|
134
|
+
head: string;
|
|
135
|
+
base: string;
|
|
136
|
+
draft: boolean;
|
|
137
|
+
body?: string | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
number: number;
|
|
140
|
+
title: string;
|
|
141
|
+
url: string;
|
|
142
|
+
state: "open" | "closed";
|
|
143
|
+
draft: boolean | undefined;
|
|
144
|
+
branch: string;
|
|
145
|
+
base: string;
|
|
146
|
+
}>;
|
|
147
|
+
declare const mergePullRequest: (octokit: Octokit, {
|
|
148
|
+
needsApproval
|
|
149
|
+
}?: ToolOptions) => ai.Tool<{
|
|
150
|
+
owner: string;
|
|
151
|
+
repo: string;
|
|
152
|
+
pullNumber: number;
|
|
153
|
+
mergeMethod: "merge" | "squash" | "rebase";
|
|
154
|
+
commitTitle?: string | undefined;
|
|
155
|
+
commitMessage?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
merged: boolean;
|
|
158
|
+
message: string;
|
|
159
|
+
sha: string;
|
|
160
|
+
}>;
|
|
161
|
+
declare const addPullRequestComment: (octokit: Octokit, {
|
|
162
|
+
needsApproval
|
|
163
|
+
}?: ToolOptions) => ai.Tool<{
|
|
164
|
+
owner: string;
|
|
165
|
+
repo: string;
|
|
166
|
+
pullNumber: number;
|
|
167
|
+
body: string;
|
|
168
|
+
}, {
|
|
169
|
+
id: number;
|
|
170
|
+
url: string;
|
|
171
|
+
body: string | undefined;
|
|
172
|
+
author: string | undefined;
|
|
173
|
+
createdAt: string;
|
|
174
|
+
}>;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/tools/issues.d.ts
|
|
177
|
+
declare const listIssues: (octokit: Octokit) => ai.Tool<{
|
|
178
|
+
owner: string;
|
|
179
|
+
repo: string;
|
|
180
|
+
state: "open" | "closed" | "all";
|
|
181
|
+
perPage: number;
|
|
182
|
+
labels?: string | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
number: number;
|
|
185
|
+
title: string;
|
|
186
|
+
state: string;
|
|
187
|
+
url: string;
|
|
188
|
+
author: string | undefined;
|
|
189
|
+
labels: (string | undefined)[];
|
|
190
|
+
createdAt: string;
|
|
191
|
+
updatedAt: string;
|
|
192
|
+
}[]>;
|
|
193
|
+
declare const getIssue: (octokit: Octokit) => ai.Tool<{
|
|
194
|
+
owner: string;
|
|
195
|
+
repo: string;
|
|
196
|
+
issueNumber: number;
|
|
197
|
+
}, {
|
|
198
|
+
number: number;
|
|
199
|
+
title: string;
|
|
200
|
+
body: string | null | undefined;
|
|
201
|
+
state: string;
|
|
202
|
+
url: string;
|
|
203
|
+
author: string | undefined;
|
|
204
|
+
assignees: string[] | undefined;
|
|
205
|
+
labels: (string | undefined)[];
|
|
206
|
+
comments: number;
|
|
207
|
+
createdAt: string;
|
|
208
|
+
updatedAt: string;
|
|
209
|
+
closedAt: string | null;
|
|
210
|
+
}>;
|
|
211
|
+
declare const createIssue: (octokit: Octokit, {
|
|
212
|
+
needsApproval
|
|
213
|
+
}?: ToolOptions) => ai.Tool<{
|
|
214
|
+
owner: string;
|
|
215
|
+
repo: string;
|
|
216
|
+
title: string;
|
|
217
|
+
body?: string | undefined;
|
|
218
|
+
labels?: string[] | undefined;
|
|
219
|
+
assignees?: string[] | undefined;
|
|
220
|
+
}, {
|
|
221
|
+
number: number;
|
|
222
|
+
title: string;
|
|
223
|
+
url: string;
|
|
224
|
+
state: string;
|
|
225
|
+
labels: (string | undefined)[];
|
|
226
|
+
}>;
|
|
227
|
+
declare const addIssueComment: (octokit: Octokit, {
|
|
228
|
+
needsApproval
|
|
229
|
+
}?: ToolOptions) => ai.Tool<{
|
|
230
|
+
owner: string;
|
|
231
|
+
repo: string;
|
|
232
|
+
issueNumber: number;
|
|
233
|
+
body: string;
|
|
234
|
+
}, {
|
|
235
|
+
id: number;
|
|
236
|
+
url: string;
|
|
237
|
+
body: string | undefined;
|
|
238
|
+
author: string | undefined;
|
|
239
|
+
createdAt: string;
|
|
240
|
+
}>;
|
|
241
|
+
declare const closeIssue: (octokit: Octokit, {
|
|
242
|
+
needsApproval
|
|
243
|
+
}?: ToolOptions) => ai.Tool<{
|
|
244
|
+
owner: string;
|
|
245
|
+
repo: string;
|
|
246
|
+
issueNumber: number;
|
|
247
|
+
stateReason: "completed" | "not_planned";
|
|
248
|
+
}, {
|
|
249
|
+
number: number;
|
|
250
|
+
title: string;
|
|
251
|
+
state: string;
|
|
252
|
+
url: string;
|
|
253
|
+
closedAt: string | null;
|
|
254
|
+
}>;
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/tools/search.d.ts
|
|
257
|
+
declare const searchCode: (octokit: Octokit) => ai.Tool<{
|
|
258
|
+
query: string;
|
|
259
|
+
perPage: number;
|
|
260
|
+
}, {
|
|
261
|
+
totalCount: number;
|
|
262
|
+
items: {
|
|
263
|
+
name: string;
|
|
264
|
+
path: string;
|
|
265
|
+
url: string;
|
|
266
|
+
repository: string;
|
|
267
|
+
sha: string;
|
|
268
|
+
}[];
|
|
269
|
+
}>;
|
|
270
|
+
declare const searchRepositories: (octokit: Octokit) => ai.Tool<{
|
|
271
|
+
query: string;
|
|
272
|
+
perPage: number;
|
|
273
|
+
order: "asc" | "desc";
|
|
274
|
+
sort?: "stars" | "forks" | "help-wanted-issues" | "updated" | undefined;
|
|
275
|
+
}, {
|
|
276
|
+
totalCount: number;
|
|
277
|
+
items: {
|
|
278
|
+
name: string;
|
|
279
|
+
fullName: string;
|
|
280
|
+
description: string | null;
|
|
281
|
+
url: string;
|
|
282
|
+
stars: number;
|
|
283
|
+
forks: number;
|
|
284
|
+
language: string | null;
|
|
285
|
+
topics: string[] | undefined;
|
|
286
|
+
}[];
|
|
287
|
+
}>;
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/tools/commits.d.ts
|
|
290
|
+
declare const listCommits: (octokit: Octokit) => ai.Tool<{
|
|
291
|
+
owner: string;
|
|
292
|
+
repo: string;
|
|
293
|
+
perPage: number;
|
|
294
|
+
path?: string | undefined;
|
|
295
|
+
sha?: string | undefined;
|
|
296
|
+
author?: string | undefined;
|
|
297
|
+
since?: string | undefined;
|
|
298
|
+
until?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
sha: string;
|
|
301
|
+
message: string;
|
|
302
|
+
author: string | undefined;
|
|
303
|
+
authorLogin: string | undefined;
|
|
304
|
+
date: string | undefined;
|
|
305
|
+
url: string;
|
|
306
|
+
}[]>;
|
|
307
|
+
declare const getCommit: (octokit: Octokit) => ai.Tool<{
|
|
308
|
+
owner: string;
|
|
309
|
+
repo: string;
|
|
310
|
+
ref: string;
|
|
311
|
+
}, {
|
|
312
|
+
sha: string;
|
|
313
|
+
message: string;
|
|
314
|
+
author: string | undefined;
|
|
315
|
+
authorLogin: string | undefined;
|
|
316
|
+
date: string | undefined;
|
|
317
|
+
url: string;
|
|
318
|
+
stats: {
|
|
319
|
+
additions: number | undefined;
|
|
320
|
+
deletions: number | undefined;
|
|
321
|
+
total: number | undefined;
|
|
322
|
+
} | null;
|
|
323
|
+
files: {
|
|
324
|
+
filename: string;
|
|
325
|
+
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
|
|
326
|
+
additions: number;
|
|
327
|
+
deletions: number;
|
|
328
|
+
patch: string | undefined;
|
|
329
|
+
}[] | undefined;
|
|
330
|
+
}>;
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/index.d.ts
|
|
333
|
+
type GithubWriteToolName = 'createOrUpdateFile' | 'createPullRequest' | 'mergePullRequest' | 'addPullRequestComment' | 'createIssue' | 'addIssueComment' | 'closeIssue';
|
|
334
|
+
/**
|
|
335
|
+
* Whether write operations require user approval.
|
|
336
|
+
* - `true` — all write tools need approval (default)
|
|
337
|
+
* - `false` — no approval needed for any write tool
|
|
338
|
+
* - object — per-tool override; unspecified write tools default to `true`
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```ts
|
|
342
|
+
* // Only merging and file changes need approval, comments are fine
|
|
343
|
+
* requireApproval: {
|
|
344
|
+
* mergePullRequest: true,
|
|
345
|
+
* createOrUpdateFile: true,
|
|
346
|
+
* addPullRequestComment: false,
|
|
347
|
+
* addIssueComment: false,
|
|
348
|
+
* }
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
|
|
352
|
+
type GithubToolsOptions = {
|
|
353
|
+
token: string;
|
|
354
|
+
requireApproval?: ApprovalConfig;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Create a set of GitHub tools for the Vercel AI SDK.
|
|
358
|
+
*
|
|
359
|
+
* Write operations require user approval by default.
|
|
360
|
+
* Control this globally or per-tool via `requireApproval`.
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
* ```ts
|
|
364
|
+
* // All writes need approval (default)
|
|
365
|
+
* createGithubTools({ token })
|
|
366
|
+
*
|
|
367
|
+
* // No approval at all
|
|
368
|
+
* createGithubTools({ token, requireApproval: false })
|
|
369
|
+
*
|
|
370
|
+
* // Granular: only destructive actions need approval
|
|
371
|
+
* createGithubTools({
|
|
372
|
+
* token,
|
|
373
|
+
* requireApproval: {
|
|
374
|
+
* mergePullRequest: true,
|
|
375
|
+
* createOrUpdateFile: true,
|
|
376
|
+
* closeIssue: true,
|
|
377
|
+
* createPullRequest: false,
|
|
378
|
+
* addPullRequestComment: false,
|
|
379
|
+
* createIssue: false,
|
|
380
|
+
* addIssueComment: false,
|
|
381
|
+
* }
|
|
382
|
+
* })
|
|
383
|
+
* ```
|
|
384
|
+
*/
|
|
385
|
+
declare function createGithubTools({
|
|
386
|
+
token,
|
|
387
|
+
requireApproval
|
|
388
|
+
}: GithubToolsOptions): {
|
|
389
|
+
getRepository: ai.Tool<{
|
|
390
|
+
owner: string;
|
|
391
|
+
repo: string;
|
|
392
|
+
}, {
|
|
393
|
+
name: string;
|
|
394
|
+
fullName: string;
|
|
395
|
+
description: string | null;
|
|
396
|
+
url: string;
|
|
397
|
+
defaultBranch: string;
|
|
398
|
+
stars: number;
|
|
399
|
+
forks: number;
|
|
400
|
+
openIssues: number;
|
|
401
|
+
language: string | null;
|
|
402
|
+
private: boolean;
|
|
403
|
+
createdAt: string;
|
|
404
|
+
updatedAt: string;
|
|
405
|
+
}>;
|
|
406
|
+
listBranches: ai.Tool<{
|
|
407
|
+
owner: string;
|
|
408
|
+
repo: string;
|
|
409
|
+
perPage: number;
|
|
410
|
+
}, {
|
|
411
|
+
name: string;
|
|
412
|
+
sha: string;
|
|
413
|
+
protected: boolean;
|
|
414
|
+
}[]>;
|
|
415
|
+
getFileContent: ai.Tool<{
|
|
416
|
+
owner: string;
|
|
417
|
+
repo: string;
|
|
418
|
+
path: string;
|
|
419
|
+
ref?: string | undefined;
|
|
420
|
+
}, {
|
|
421
|
+
type: string;
|
|
422
|
+
entries: {
|
|
423
|
+
name: string;
|
|
424
|
+
type: "file" | "dir" | "submodule" | "symlink";
|
|
425
|
+
path: string;
|
|
426
|
+
}[];
|
|
427
|
+
path?: undefined;
|
|
428
|
+
sha?: undefined;
|
|
429
|
+
size?: undefined;
|
|
430
|
+
content?: undefined;
|
|
431
|
+
} | {
|
|
432
|
+
type: "submodule" | "symlink";
|
|
433
|
+
path: string;
|
|
434
|
+
entries?: undefined;
|
|
435
|
+
sha?: undefined;
|
|
436
|
+
size?: undefined;
|
|
437
|
+
content?: undefined;
|
|
438
|
+
} | {
|
|
439
|
+
type: string;
|
|
440
|
+
path: string;
|
|
441
|
+
sha: string;
|
|
442
|
+
size: number;
|
|
443
|
+
content: string;
|
|
444
|
+
entries?: undefined;
|
|
445
|
+
}>;
|
|
446
|
+
listPullRequests: ai.Tool<{
|
|
447
|
+
owner: string;
|
|
448
|
+
repo: string;
|
|
449
|
+
state: "open" | "closed" | "all";
|
|
450
|
+
perPage: number;
|
|
451
|
+
}, {
|
|
452
|
+
number: number;
|
|
453
|
+
title: string;
|
|
454
|
+
state: string;
|
|
455
|
+
url: string;
|
|
456
|
+
author: string | undefined;
|
|
457
|
+
branch: string;
|
|
458
|
+
base: string;
|
|
459
|
+
draft: boolean | undefined;
|
|
460
|
+
createdAt: string;
|
|
461
|
+
updatedAt: string;
|
|
462
|
+
}[]>;
|
|
463
|
+
getPullRequest: ai.Tool<{
|
|
464
|
+
owner: string;
|
|
465
|
+
repo: string;
|
|
466
|
+
pullNumber: number;
|
|
467
|
+
}, {
|
|
468
|
+
number: number;
|
|
469
|
+
title: string;
|
|
470
|
+
body: string | null;
|
|
471
|
+
state: "open" | "closed";
|
|
472
|
+
url: string;
|
|
473
|
+
author: string;
|
|
474
|
+
branch: string;
|
|
475
|
+
base: string;
|
|
476
|
+
draft: boolean | undefined;
|
|
477
|
+
merged: boolean;
|
|
478
|
+
mergeable: boolean | null;
|
|
479
|
+
additions: number;
|
|
480
|
+
deletions: number;
|
|
481
|
+
changedFiles: number;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
mergedAt: string | null;
|
|
485
|
+
}>;
|
|
486
|
+
listIssues: ai.Tool<{
|
|
487
|
+
owner: string;
|
|
488
|
+
repo: string;
|
|
489
|
+
state: "open" | "closed" | "all";
|
|
490
|
+
perPage: number;
|
|
491
|
+
labels?: string | undefined;
|
|
492
|
+
}, {
|
|
493
|
+
number: number;
|
|
494
|
+
title: string;
|
|
495
|
+
state: string;
|
|
496
|
+
url: string;
|
|
497
|
+
author: string | undefined;
|
|
498
|
+
labels: (string | undefined)[];
|
|
499
|
+
createdAt: string;
|
|
500
|
+
updatedAt: string;
|
|
501
|
+
}[]>;
|
|
502
|
+
getIssue: ai.Tool<{
|
|
503
|
+
owner: string;
|
|
504
|
+
repo: string;
|
|
505
|
+
issueNumber: number;
|
|
506
|
+
}, {
|
|
507
|
+
number: number;
|
|
508
|
+
title: string;
|
|
509
|
+
body: string | null | undefined;
|
|
510
|
+
state: string;
|
|
511
|
+
url: string;
|
|
512
|
+
author: string | undefined;
|
|
513
|
+
assignees: string[] | undefined;
|
|
514
|
+
labels: (string | undefined)[];
|
|
515
|
+
comments: number;
|
|
516
|
+
createdAt: string;
|
|
517
|
+
updatedAt: string;
|
|
518
|
+
closedAt: string | null;
|
|
519
|
+
}>;
|
|
520
|
+
searchCode: ai.Tool<{
|
|
521
|
+
query: string;
|
|
522
|
+
perPage: number;
|
|
523
|
+
}, {
|
|
524
|
+
totalCount: number;
|
|
525
|
+
items: {
|
|
526
|
+
name: string;
|
|
527
|
+
path: string;
|
|
528
|
+
url: string;
|
|
529
|
+
repository: string;
|
|
530
|
+
sha: string;
|
|
531
|
+
}[];
|
|
532
|
+
}>;
|
|
533
|
+
searchRepositories: ai.Tool<{
|
|
534
|
+
query: string;
|
|
535
|
+
perPage: number;
|
|
536
|
+
order: "asc" | "desc";
|
|
537
|
+
sort?: "stars" | "forks" | "help-wanted-issues" | "updated" | undefined;
|
|
538
|
+
}, {
|
|
539
|
+
totalCount: number;
|
|
540
|
+
items: {
|
|
541
|
+
name: string;
|
|
542
|
+
fullName: string;
|
|
543
|
+
description: string | null;
|
|
544
|
+
url: string;
|
|
545
|
+
stars: number;
|
|
546
|
+
forks: number;
|
|
547
|
+
language: string | null;
|
|
548
|
+
topics: string[] | undefined;
|
|
549
|
+
}[];
|
|
550
|
+
}>;
|
|
551
|
+
listCommits: ai.Tool<{
|
|
552
|
+
owner: string;
|
|
553
|
+
repo: string;
|
|
554
|
+
perPage: number;
|
|
555
|
+
path?: string | undefined;
|
|
556
|
+
sha?: string | undefined;
|
|
557
|
+
author?: string | undefined;
|
|
558
|
+
since?: string | undefined;
|
|
559
|
+
until?: string | undefined;
|
|
560
|
+
}, {
|
|
561
|
+
sha: string;
|
|
562
|
+
message: string;
|
|
563
|
+
author: string | undefined;
|
|
564
|
+
authorLogin: string | undefined;
|
|
565
|
+
date: string | undefined;
|
|
566
|
+
url: string;
|
|
567
|
+
}[]>;
|
|
568
|
+
getCommit: ai.Tool<{
|
|
569
|
+
owner: string;
|
|
570
|
+
repo: string;
|
|
571
|
+
ref: string;
|
|
572
|
+
}, {
|
|
573
|
+
sha: string;
|
|
574
|
+
message: string;
|
|
575
|
+
author: string | undefined;
|
|
576
|
+
authorLogin: string | undefined;
|
|
577
|
+
date: string | undefined;
|
|
578
|
+
url: string;
|
|
579
|
+
stats: {
|
|
580
|
+
additions: number | undefined;
|
|
581
|
+
deletions: number | undefined;
|
|
582
|
+
total: number | undefined;
|
|
583
|
+
} | null;
|
|
584
|
+
files: {
|
|
585
|
+
filename: string;
|
|
586
|
+
status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
|
|
587
|
+
additions: number;
|
|
588
|
+
deletions: number;
|
|
589
|
+
patch: string | undefined;
|
|
590
|
+
}[] | undefined;
|
|
591
|
+
}>;
|
|
592
|
+
createOrUpdateFile: ai.Tool<{
|
|
593
|
+
owner: string;
|
|
594
|
+
repo: string;
|
|
595
|
+
path: string;
|
|
596
|
+
message: string;
|
|
597
|
+
content: string;
|
|
598
|
+
branch?: string | undefined;
|
|
599
|
+
sha?: string | undefined;
|
|
600
|
+
}, {
|
|
601
|
+
path: string | undefined;
|
|
602
|
+
sha: string | undefined;
|
|
603
|
+
commitSha: string | undefined;
|
|
604
|
+
commitUrl: string | undefined;
|
|
605
|
+
}>;
|
|
606
|
+
createPullRequest: ai.Tool<{
|
|
607
|
+
owner: string;
|
|
608
|
+
repo: string;
|
|
609
|
+
title: string;
|
|
610
|
+
head: string;
|
|
611
|
+
base: string;
|
|
612
|
+
draft: boolean;
|
|
613
|
+
body?: string | undefined;
|
|
614
|
+
}, {
|
|
615
|
+
number: number;
|
|
616
|
+
title: string;
|
|
617
|
+
url: string;
|
|
618
|
+
state: "open" | "closed";
|
|
619
|
+
draft: boolean | undefined;
|
|
620
|
+
branch: string;
|
|
621
|
+
base: string;
|
|
622
|
+
}>;
|
|
623
|
+
mergePullRequest: ai.Tool<{
|
|
624
|
+
owner: string;
|
|
625
|
+
repo: string;
|
|
626
|
+
pullNumber: number;
|
|
627
|
+
mergeMethod: "merge" | "squash" | "rebase";
|
|
628
|
+
commitTitle?: string | undefined;
|
|
629
|
+
commitMessage?: string | undefined;
|
|
630
|
+
}, {
|
|
631
|
+
merged: boolean;
|
|
632
|
+
message: string;
|
|
633
|
+
sha: string;
|
|
634
|
+
}>;
|
|
635
|
+
addPullRequestComment: ai.Tool<{
|
|
636
|
+
owner: string;
|
|
637
|
+
repo: string;
|
|
638
|
+
pullNumber: number;
|
|
639
|
+
body: string;
|
|
640
|
+
}, {
|
|
641
|
+
id: number;
|
|
642
|
+
url: string;
|
|
643
|
+
body: string | undefined;
|
|
644
|
+
author: string | undefined;
|
|
645
|
+
createdAt: string;
|
|
646
|
+
}>;
|
|
647
|
+
createIssue: ai.Tool<{
|
|
648
|
+
owner: string;
|
|
649
|
+
repo: string;
|
|
650
|
+
title: string;
|
|
651
|
+
body?: string | undefined;
|
|
652
|
+
labels?: string[] | undefined;
|
|
653
|
+
assignees?: string[] | undefined;
|
|
654
|
+
}, {
|
|
655
|
+
number: number;
|
|
656
|
+
title: string;
|
|
657
|
+
url: string;
|
|
658
|
+
state: string;
|
|
659
|
+
labels: (string | undefined)[];
|
|
660
|
+
}>;
|
|
661
|
+
addIssueComment: ai.Tool<{
|
|
662
|
+
owner: string;
|
|
663
|
+
repo: string;
|
|
664
|
+
issueNumber: number;
|
|
665
|
+
body: string;
|
|
666
|
+
}, {
|
|
667
|
+
id: number;
|
|
668
|
+
url: string;
|
|
669
|
+
body: string | undefined;
|
|
670
|
+
author: string | undefined;
|
|
671
|
+
createdAt: string;
|
|
672
|
+
}>;
|
|
673
|
+
closeIssue: ai.Tool<{
|
|
674
|
+
owner: string;
|
|
675
|
+
repo: string;
|
|
676
|
+
issueNumber: number;
|
|
677
|
+
stateReason: "completed" | "not_planned";
|
|
678
|
+
}, {
|
|
679
|
+
number: number;
|
|
680
|
+
title: string;
|
|
681
|
+
state: string;
|
|
682
|
+
url: string;
|
|
683
|
+
closedAt: string | null;
|
|
684
|
+
}>;
|
|
685
|
+
};
|
|
686
|
+
type GithubTools = ReturnType<typeof createGithubTools>;
|
|
687
|
+
//#endregion
|
|
688
|
+
export { ApprovalConfig, GithubTools, GithubToolsOptions, GithubWriteToolName, type Octokit, type ToolOptions, addIssueComment, addPullRequestComment, closeIssue, createGithubTools, createIssue, createOctokit, createOrUpdateFile, createPullRequest, getCommit, getFileContent, getIssue, getPullRequest, getRepository, listBranches, listCommits, listIssues, listPullRequests, mergePullRequest, searchCode, searchRepositories };
|
|
689
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.ts","../src/types.ts","../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/search.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