@github-tools/sdk 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +97 -30
- package/dist/approval-policy-CEMMPq92.mjs +17 -0
- package/dist/approval-policy-CEMMPq92.mjs.map +1 -0
- package/dist/connect/eve.d.mts +2 -2
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +15 -24
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/{cores-BeLZwcde.mjs → cores-meFAMt2D.mjs} +41 -2
- package/dist/cores-meFAMt2D.mjs.map +1 -0
- package/dist/{tool-types-CrC80SIL.d.mts → dry-run-DXckOam2.d.mts} +437 -54
- package/dist/dry-run-DXckOam2.d.mts.map +1 -0
- package/dist/evaluation-DJHINyAu.mjs +311 -0
- package/dist/evaluation-DJHINyAu.mjs.map +1 -0
- package/dist/{eve-runtime-DRh2QJI7.d.mts → eve-runtime-B_CJE9JV.d.mts} +21 -7
- package/dist/eve-runtime-B_CJE9JV.d.mts.map +1 -0
- package/dist/{eve-runtime-YTxfrWP-.mjs → eve-runtime-DPzMPCLt.mjs} +49 -15
- package/dist/eve-runtime-DPzMPCLt.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -4
- package/dist/eve.d.mts +95 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +94 -3
- package/dist/eve.mjs.map +1 -1
- package/dist/{index-DkZvveZP.d.mts → index-CzzrtCVj.d.mts} +119 -348
- package/dist/index-CzzrtCVj.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -3
- package/dist/{interrupts-C_lUXMdd.d.mts → interrupts-BSDPwdJ2.d.mts} +2 -2
- package/dist/interrupts-BSDPwdJ2.d.mts.map +1 -0
- package/dist/{src-Bx5p1Unc.mjs → src-BlhrSieS.mjs} +491 -23
- package/dist/src-BlhrSieS.mjs.map +1 -0
- package/dist/tanstack/interrupts.d.mts +1 -1
- package/dist/tanstack.d.mts +1705 -204
- package/dist/tanstack.d.mts.map +1 -1
- package/dist/tanstack.mjs +53 -19
- package/dist/tanstack.mjs.map +1 -1
- package/dist/{token-Bh8nPj66.mjs → token-BLps09gm.mjs} +36 -116
- package/dist/token-BLps09gm.mjs.map +1 -0
- package/dist/{types-BmwOpI5-.d.mts → types-Bln8U42J.d.mts} +3 -3
- package/dist/{types-BmwOpI5-.d.mts.map → types-Bln8U42J.d.mts.map} +1 -1
- package/dist/{types-CPAsEMzx.d.mts → types-C7O2lwwz.d.mts} +14 -2
- package/dist/{types-CPAsEMzx.d.mts.map → types-C7O2lwwz.d.mts.map} +1 -1
- package/dist/workflow.d.mts +41 -40
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +20 -47
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-BaoTUCg7.mjs → write-tools-w-8tjnDQ.mjs} +1360 -124
- package/dist/write-tools-w-8tjnDQ.mjs.map +1 -0
- package/package.json +4 -6
- package/dist/cores-BeLZwcde.mjs.map +0 -1
- package/dist/evaluation-f-2QwBid.mjs +0 -210
- package/dist/evaluation-f-2QwBid.mjs.map +0 -1
- package/dist/eve-runtime-DRh2QJI7.d.mts.map +0 -1
- package/dist/eve-runtime-YTxfrWP-.mjs.map +0 -1
- package/dist/index-DkZvveZP.d.mts.map +0 -1
- package/dist/instructions-BuypoY0x.mjs +0 -148
- package/dist/instructions-BuypoY0x.mjs.map +0 -1
- package/dist/interrupts-C_lUXMdd.d.mts.map +0 -1
- package/dist/src-Bx5p1Unc.mjs.map +0 -1
- package/dist/token-Bh8nPj66.mjs.map +0 -1
- package/dist/tool-types-CrC80SIL.d.mts.map +0 -1
- package/dist/write-tools-BaoTUCg7.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_EvaluationModel, ModelMessage, Tool } from "ai";
|
|
1
|
+
import { Experimental_EvaluationModel, JSONValue, ModelMessage, Tool } from "ai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Octokit as Octokit$1 } from "octokit";
|
|
4
4
|
//#region src/core/catalog.d.ts
|
|
@@ -91,7 +91,7 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
91
91
|
name: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
93
|
write: true;
|
|
94
|
-
connectScopes: readonly ["contents:read", "metadata:read"];
|
|
94
|
+
connectScopes: readonly ["contents:read", "metadata:read", "administration:read", "administration:write"];
|
|
95
95
|
};
|
|
96
96
|
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
97
97
|
createRepository: {
|
|
@@ -123,6 +123,50 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
123
123
|
write: true;
|
|
124
124
|
connectScopes: readonly ["contents:read", "contents:write", "metadata:read"];
|
|
125
125
|
};
|
|
126
|
+
/** List the required checks, required reviews and other rules that protect a branch. */
|
|
127
|
+
getBranchRules: {
|
|
128
|
+
description: string;
|
|
129
|
+
inputSchema: z.ZodObject<{
|
|
130
|
+
owner: z.ZodString;
|
|
131
|
+
repo: z.ZodString;
|
|
132
|
+
branch: z.ZodString;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
connectScopes: readonly ["contents:read", "metadata:read"];
|
|
135
|
+
};
|
|
136
|
+
/** Get a user's permission and role on a repository, to check whether they may trigger the bot or approve an action. */
|
|
137
|
+
getCollaboratorPermission: {
|
|
138
|
+
description: string;
|
|
139
|
+
inputSchema: z.ZodObject<{
|
|
140
|
+
owner: z.ZodString;
|
|
141
|
+
repo: z.ZodString;
|
|
142
|
+
username: z.ZodString;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
connectScopes: readonly ["metadata:read"];
|
|
145
|
+
};
|
|
146
|
+
/** Edit files in one commit on a new or existing branch, and optionally open a pull request. Requires approval by default. */
|
|
147
|
+
editFiles: {
|
|
148
|
+
description: string;
|
|
149
|
+
inputSchema: z.ZodObject<{
|
|
150
|
+
owner: z.ZodString;
|
|
151
|
+
repo: z.ZodString;
|
|
152
|
+
branch: z.ZodString;
|
|
153
|
+
baseBranch: z.ZodOptional<z.ZodString>;
|
|
154
|
+
message: z.ZodString;
|
|
155
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
156
|
+
path: z.ZodString;
|
|
157
|
+
find: z.ZodOptional<z.ZodString>;
|
|
158
|
+
replace: z.ZodOptional<z.ZodString>;
|
|
159
|
+
content: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
pullRequest: z.ZodOptional<z.ZodObject<{
|
|
162
|
+
title: z.ZodString;
|
|
163
|
+
body: z.ZodOptional<z.ZodString>;
|
|
164
|
+
draft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
write: true;
|
|
168
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
169
|
+
};
|
|
126
170
|
/** List pull requests for a GitHub repository. */
|
|
127
171
|
listPullRequests: {
|
|
128
172
|
description: string;
|
|
@@ -185,6 +229,35 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
185
229
|
}>>>;
|
|
186
230
|
}, z.core.$strip>;
|
|
187
231
|
write: true;
|
|
232
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
233
|
+
};
|
|
234
|
+
/** Merge a pull request once its required checks and reviews pass. Requires approval by default. */
|
|
235
|
+
enablePullRequestAutoMerge: {
|
|
236
|
+
description: string;
|
|
237
|
+
inputSchema: z.ZodObject<{
|
|
238
|
+
owner: z.ZodString;
|
|
239
|
+
repo: z.ZodString;
|
|
240
|
+
pullNumber: z.ZodNumber;
|
|
241
|
+
mergeMethod: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
242
|
+
merge: "merge";
|
|
243
|
+
squash: "squash";
|
|
244
|
+
rebase: "rebase";
|
|
245
|
+
}>>>;
|
|
246
|
+
commitTitle: z.ZodOptional<z.ZodString>;
|
|
247
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
write: true;
|
|
250
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
251
|
+
};
|
|
252
|
+
/** Cancel a pending auto-merge. Requires approval by default. */
|
|
253
|
+
disablePullRequestAutoMerge: {
|
|
254
|
+
description: string;
|
|
255
|
+
inputSchema: z.ZodObject<{
|
|
256
|
+
owner: z.ZodString;
|
|
257
|
+
repo: z.ZodString;
|
|
258
|
+
pullNumber: z.ZodNumber;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
write: true;
|
|
188
261
|
connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
189
262
|
};
|
|
190
263
|
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
@@ -206,6 +279,18 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
206
279
|
write: true;
|
|
207
280
|
connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
208
281
|
};
|
|
282
|
+
/** Bring a pull request branch up to date by merging its base branch into it. Requires approval by default. */
|
|
283
|
+
updatePullRequestBranch: {
|
|
284
|
+
description: string;
|
|
285
|
+
inputSchema: z.ZodObject<{
|
|
286
|
+
owner: z.ZodString;
|
|
287
|
+
repo: z.ZodString;
|
|
288
|
+
pullNumber: z.ZodNumber;
|
|
289
|
+
expectedHeadSha: z.ZodOptional<z.ZodString>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
write: true;
|
|
292
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
293
|
+
};
|
|
209
294
|
/** Add a comment to a pull request. Requires approval by default. */
|
|
210
295
|
addPullRequestComment: {
|
|
211
296
|
description: string;
|
|
@@ -288,6 +373,11 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
288
373
|
LEFT: "LEFT";
|
|
289
374
|
RIGHT: "RIGHT";
|
|
290
375
|
}>>;
|
|
376
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
377
|
+
startSide: z.ZodOptional<z.ZodEnum<{
|
|
378
|
+
LEFT: "LEFT";
|
|
379
|
+
RIGHT: "RIGHT";
|
|
380
|
+
}>>;
|
|
291
381
|
}, z.core.$strip>>>;
|
|
292
382
|
}, z.core.$strip>;
|
|
293
383
|
write: true;
|
|
@@ -360,6 +450,7 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
360
450
|
includeChecks: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
361
451
|
includePatch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
362
452
|
filesPerPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
453
|
+
includeLinkedIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
363
454
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
364
455
|
summary: "summary";
|
|
365
456
|
full: "full";
|
|
@@ -442,6 +533,7 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
442
533
|
body: z.ZodOptional<z.ZodString>;
|
|
443
534
|
labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
444
535
|
assignees: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
536
|
+
milestone: z.ZodOptional<z.ZodNumber>;
|
|
445
537
|
}, z.core.$strip>;
|
|
446
538
|
write: true;
|
|
447
539
|
connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
|
|
@@ -618,6 +710,48 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
618
710
|
write: true;
|
|
619
711
|
connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
|
|
620
712
|
};
|
|
713
|
+
/** List milestones in a GitHub repository with their due dates and issue counts. */
|
|
714
|
+
listMilestones: {
|
|
715
|
+
description: string;
|
|
716
|
+
inputSchema: z.ZodObject<{
|
|
717
|
+
owner: z.ZodString;
|
|
718
|
+
repo: z.ZodString;
|
|
719
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
720
|
+
open: "open";
|
|
721
|
+
closed: "closed";
|
|
722
|
+
all: "all";
|
|
723
|
+
}>>>;
|
|
724
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
725
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
726
|
+
}, z.core.$strip>;
|
|
727
|
+
connectScopes: readonly ["contents:read", "metadata:read", "issues:read"];
|
|
728
|
+
};
|
|
729
|
+
/** List the sub-issues of an issue. */
|
|
730
|
+
listSubIssues: {
|
|
731
|
+
description: string;
|
|
732
|
+
inputSchema: z.ZodObject<{
|
|
733
|
+
owner: z.ZodString;
|
|
734
|
+
repo: z.ZodString;
|
|
735
|
+
issueNumber: z.ZodNumber;
|
|
736
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
737
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
connectScopes: readonly ["contents:read", "metadata:read", "issues:read"];
|
|
740
|
+
};
|
|
741
|
+
/** Add an existing issue as a sub-issue of another issue. Requires approval by default. */
|
|
742
|
+
addSubIssue: {
|
|
743
|
+
description: string;
|
|
744
|
+
inputSchema: z.ZodObject<{
|
|
745
|
+
owner: z.ZodString;
|
|
746
|
+
repo: z.ZodString;
|
|
747
|
+
issueNumber: z.ZodNumber;
|
|
748
|
+
subIssueNumber: z.ZodNumber;
|
|
749
|
+
subIssueRepo: z.ZodOptional<z.ZodString>;
|
|
750
|
+
replaceParent: z.ZodOptional<z.ZodBoolean>;
|
|
751
|
+
}, z.core.$strip>;
|
|
752
|
+
write: true;
|
|
753
|
+
connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
|
|
754
|
+
};
|
|
621
755
|
/** List reactions on an issue or pull request conversation, with per-emoji counts. */
|
|
622
756
|
listIssueReactions: {
|
|
623
757
|
description: string;
|
|
@@ -1076,15 +1210,37 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1076
1210
|
}, z.core.$strip>;
|
|
1077
1211
|
connectScopes: readonly ["contents:read", "metadata:read", "checks:read", "statuses:read"];
|
|
1078
1212
|
};
|
|
1213
|
+
/** Report a result on a commit as a commit status. Works with personal access tokens and GitHub Apps. Requires approval by default. */
|
|
1214
|
+
createCommitStatus: {
|
|
1215
|
+
description: string;
|
|
1216
|
+
inputSchema: z.ZodObject<{
|
|
1217
|
+
owner: z.ZodString;
|
|
1218
|
+
repo: z.ZodString;
|
|
1219
|
+
sha: z.ZodString;
|
|
1220
|
+
state: z.ZodEnum<{
|
|
1221
|
+
error: "error";
|
|
1222
|
+
success: "success";
|
|
1223
|
+
failure: "failure";
|
|
1224
|
+
pending: "pending";
|
|
1225
|
+
}>;
|
|
1226
|
+
context: z.ZodString;
|
|
1227
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1228
|
+
targetUrl: z.ZodOptional<z.ZodString>;
|
|
1229
|
+
}, z.core.$strip>;
|
|
1230
|
+
write: true;
|
|
1231
|
+
connectScopes: readonly ["contents:read", "metadata:read", "statuses:read", "statuses:write"];
|
|
1232
|
+
};
|
|
1079
1233
|
/** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs in one call. */
|
|
1080
1234
|
getCiFailureContext: {
|
|
1081
1235
|
description: string;
|
|
1082
1236
|
inputSchema: z.ZodObject<{
|
|
1083
1237
|
owner: z.ZodString;
|
|
1084
1238
|
repo: z.ZodString;
|
|
1085
|
-
ref: z.ZodString
|
|
1239
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
1240
|
+
runId: z.ZodOptional<z.ZodNumber>;
|
|
1086
1241
|
maxFailedRuns: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1087
1242
|
maxFailedJobs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1243
|
+
logLines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1088
1244
|
}, z.core.$strip>;
|
|
1089
1245
|
connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "checks:read", "statuses:read"];
|
|
1090
1246
|
};
|
|
@@ -1123,7 +1279,8 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1123
1279
|
inputSchema: z.ZodObject<{
|
|
1124
1280
|
owner: z.ZodString;
|
|
1125
1281
|
repo: z.ZodString;
|
|
1126
|
-
releaseId: z.ZodNumber
|
|
1282
|
+
releaseId: z.ZodOptional<z.ZodNumber>;
|
|
1283
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
1127
1284
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1128
1285
|
summary: "summary";
|
|
1129
1286
|
full: "full";
|
|
@@ -1138,6 +1295,8 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1138
1295
|
owner: z.ZodString;
|
|
1139
1296
|
repo: z.ZodString;
|
|
1140
1297
|
releaseId: z.ZodOptional<z.ZodNumber>;
|
|
1298
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
1299
|
+
previousTag: z.ZodOptional<z.ZodString>;
|
|
1141
1300
|
includePrevious: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1142
1301
|
includeCompare: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1143
1302
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
@@ -1192,6 +1351,74 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1192
1351
|
write: true;
|
|
1193
1352
|
connectScopes: readonly ["contents:read", "contents:write", "metadata:read"];
|
|
1194
1353
|
};
|
|
1354
|
+
/** List code scanning alerts for a repository. */
|
|
1355
|
+
listCodeScanningAlerts: {
|
|
1356
|
+
description: string;
|
|
1357
|
+
inputSchema: z.ZodObject<{
|
|
1358
|
+
owner: z.ZodString;
|
|
1359
|
+
repo: z.ZodString;
|
|
1360
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1361
|
+
open: "open";
|
|
1362
|
+
dismissed: "dismissed";
|
|
1363
|
+
fixed: "fixed";
|
|
1364
|
+
}>>>;
|
|
1365
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1366
|
+
error: "error";
|
|
1367
|
+
critical: "critical";
|
|
1368
|
+
high: "high";
|
|
1369
|
+
medium: "medium";
|
|
1370
|
+
low: "low";
|
|
1371
|
+
warning: "warning";
|
|
1372
|
+
note: "note";
|
|
1373
|
+
}>>;
|
|
1374
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
1375
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1376
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1377
|
+
maxPages: z.ZodOptional<z.ZodNumber>;
|
|
1378
|
+
}, z.core.$strip>;
|
|
1379
|
+
connectScopes: readonly ["contents:read", "metadata:read", "security_events:read"];
|
|
1380
|
+
};
|
|
1381
|
+
/** List Dependabot alerts for vulnerable dependencies. */
|
|
1382
|
+
listDependabotAlerts: {
|
|
1383
|
+
description: string;
|
|
1384
|
+
inputSchema: z.ZodObject<{
|
|
1385
|
+
owner: z.ZodString;
|
|
1386
|
+
repo: z.ZodString;
|
|
1387
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1388
|
+
open: "open";
|
|
1389
|
+
dismissed: "dismissed";
|
|
1390
|
+
fixed: "fixed";
|
|
1391
|
+
auto_dismissed: "auto_dismissed";
|
|
1392
|
+
}>>>;
|
|
1393
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1394
|
+
critical: "critical";
|
|
1395
|
+
high: "high";
|
|
1396
|
+
medium: "medium";
|
|
1397
|
+
low: "low";
|
|
1398
|
+
}>>;
|
|
1399
|
+
ecosystem: z.ZodOptional<z.ZodString>;
|
|
1400
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1401
|
+
after: z.ZodOptional<z.ZodString>;
|
|
1402
|
+
}, z.core.$strip>;
|
|
1403
|
+
connectScopes: readonly ["contents:read", "metadata:read", "vulnerability_alerts:read"];
|
|
1404
|
+
};
|
|
1405
|
+
/** List secret scanning alerts, without the secrets. */
|
|
1406
|
+
listSecretScanningAlerts: {
|
|
1407
|
+
description: string;
|
|
1408
|
+
inputSchema: z.ZodObject<{
|
|
1409
|
+
owner: z.ZodString;
|
|
1410
|
+
repo: z.ZodString;
|
|
1411
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1412
|
+
open: "open";
|
|
1413
|
+
resolved: "resolved";
|
|
1414
|
+
}>>>;
|
|
1415
|
+
secretType: z.ZodOptional<z.ZodString>;
|
|
1416
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1417
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1418
|
+
maxPages: z.ZodOptional<z.ZodNumber>;
|
|
1419
|
+
}, z.core.$strip>;
|
|
1420
|
+
connectScopes: readonly ["contents:read", "metadata:read", "secret_scanning_alerts:read"];
|
|
1421
|
+
};
|
|
1195
1422
|
};
|
|
1196
1423
|
type GithubToolName = keyof typeof GITHUB_TOOL_CATALOG;
|
|
1197
1424
|
/** Tool names whose catalog entry is marked `write: true`. */
|
|
@@ -1212,26 +1439,30 @@ declare const GITHUB_TOOL_NAMES: { [K in GithubToolName]: K; };
|
|
|
1212
1439
|
* Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}.
|
|
1213
1440
|
* Presets can be combined by passing an array.
|
|
1214
1441
|
*/
|
|
1442
|
+
/** Read tools every task preset, and every `selection: 'tools'` result, includes, so a task never stalls on context. */
|
|
1443
|
+
declare const CORE_READ_TOOLS: readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits"];
|
|
1215
1444
|
declare const PRESET_TOOLS: {
|
|
1216
1445
|
/**
|
|
1217
1446
|
* **Code review** — review pull requests and submit feedback.
|
|
1218
1447
|
*
|
|
1219
|
-
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
|
|
1220
|
-
* `
|
|
1221
|
-
* `
|
|
1222
|
-
* `
|
|
1448
|
+
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
|
|
1449
|
+
* `listPullRequestReviewThreads`, `getPullRequestContext`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`,
|
|
1450
|
+
* `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`, `getCollaboratorPermission`,
|
|
1451
|
+
* `listCheckRuns`, `getCombinedStatus`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`,
|
|
1452
|
+
* `deletePullRequestComment`, `createPullRequestReview`, `replyToReviewComment`, `resolveReviewThread`, `requestReviewers`,
|
|
1453
|
+
* `createCommitStatus`.
|
|
1223
1454
|
*
|
|
1224
1455
|
* Agent prompt: optimized for thorough PR review with inline feedback.
|
|
1225
1456
|
*/
|
|
1226
|
-
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "
|
|
1457
|
+
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "getCommit", "getBlame", "compareCommits", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "getCollaboratorPermission", "listCheckRuns", "getCombinedStatus", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "createCommitStatus"];
|
|
1227
1458
|
/**
|
|
1228
1459
|
* **Issue triage** — manage and organize GitHub issues.
|
|
1229
1460
|
*
|
|
1230
|
-
* Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`,
|
|
1231
|
-
* `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`,
|
|
1232
|
-
* `addAssignees`, `removeAssignees`,
|
|
1233
|
-
* `
|
|
1234
|
-
* `searchRepositories`, `
|
|
1461
|
+
* Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`,
|
|
1462
|
+
* `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`,
|
|
1463
|
+
* `addAssignees`, `removeAssignees`, `listMilestones`, `listSubIssues`, `addSubIssue`, `listIssueReactions`, `addIssueReaction`,
|
|
1464
|
+
* `listCommentReactions`, `addCommentReaction`, `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`,
|
|
1465
|
+
* `searchRepositories`, `searchIssues`, `getPullRequest`, `getCollaboratorPermission`.
|
|
1235
1466
|
*
|
|
1236
1467
|
* Prefer `getIssueContext` (issue + `labelNames` + recent comments) over separate get/list calls.
|
|
1237
1468
|
* Use `listIssueComments` to paginate beyond the comments returned by `getIssueContext`.
|
|
@@ -1239,18 +1470,19 @@ declare const PRESET_TOOLS: {
|
|
|
1239
1470
|
* Acknowledge a report with `addIssueReaction` / `addCommentReaction` instead of a comment when no reply is needed.
|
|
1240
1471
|
* Agent prompt: optimized for categorizing, labeling, and responding to issues.
|
|
1241
1472
|
*/
|
|
1242
|
-
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", "
|
|
1473
|
+
readonly 'issue-triage': readonly ["listIssues", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listMilestones", "listSubIssues", "addSubIssue", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "searchRepositories", "searchIssues", "getPullRequest", "getCollaboratorPermission"];
|
|
1243
1474
|
/**
|
|
1244
1475
|
* **CI operations** — monitor and manage GitHub Actions workflows.
|
|
1245
1476
|
*
|
|
1246
|
-
* Tools: `getRepository`, `
|
|
1247
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`,
|
|
1248
|
-
* `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun
|
|
1477
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`, `getCommit`,
|
|
1478
|
+
* `getPullRequest`, `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`,
|
|
1479
|
+
* `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`,
|
|
1480
|
+
* `createCommitStatus`.
|
|
1249
1481
|
*
|
|
1250
1482
|
* Diagnose a failure with `getCiFailureContext` first, then read the failing job's output with `getWorkflowJobLogs`.
|
|
1251
1483
|
* Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
|
|
1252
1484
|
*/
|
|
1253
|
-
readonly 'ci-ops': readonly ["getRepository", "
|
|
1485
|
+
readonly 'ci-ops': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "getCommit", "getPullRequest", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "createCommitStatus"];
|
|
1254
1486
|
/**
|
|
1255
1487
|
* **Repository explorer** — read-only access to browse codebases.
|
|
1256
1488
|
*
|
|
@@ -1267,54 +1499,56 @@ declare const PRESET_TOOLS: {
|
|
|
1267
1499
|
* `getBlame`, `compareCommits`), PR and CI visibility (`listPullRequests`, `getPullRequest`, `listPullRequestFiles`,
|
|
1268
1500
|
* `getPullRequestContext`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `listWorkflows`, `listWorkflowRuns`,
|
|
1269
1501
|
* `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs` — logs can leak secrets, so auditing them matters),
|
|
1502
|
+
* the repository's alerts (`listCodeScanningAlerts`, `listDependabotAlerts`, `listSecretScanningAlerts`),
|
|
1270
1503
|
* plus `createIssue`, `addIssueComment`, and `addLabels` to report findings.
|
|
1271
1504
|
* No destructive writes.
|
|
1272
1505
|
*
|
|
1273
1506
|
* Agent prompt: optimized for finding and reporting security risks without making changes.
|
|
1274
1507
|
*/
|
|
1275
|
-
readonly 'security-audit': readonly ["getRepository", "
|
|
1508
|
+
readonly 'security-audit': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getCommit", "getBlame", "compareCommits", "searchRepositories", "searchIssues", "listPullRequests", "getPullRequest", "listPullRequestFiles", "getPullRequestContext", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listIssues", "getIssue", "getIssueContext", "createIssue", "addIssueComment", "addLabels", "listCodeScanningAlerts", "listDependabotAlerts", "listSecretScanningAlerts"];
|
|
1276
1509
|
/**
|
|
1277
1510
|
* **Release manager** — prepare and publish GitHub releases.
|
|
1278
1511
|
*
|
|
1279
|
-
* Tools: `getRepository`, `
|
|
1280
|
-
* `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`,
|
|
1281
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`,
|
|
1282
|
-
* `listPullRequests`, `getPullRequest`.
|
|
1512
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getCommit`,
|
|
1513
|
+
* `compareCommits`, `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`,
|
|
1514
|
+
* `deleteRelease`, `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`,
|
|
1515
|
+
* `getCombinedStatus`, `getCiFailureContext`, `listPullRequests`, `getPullRequest`.
|
|
1283
1516
|
*
|
|
1284
1517
|
* Agent prompt: optimized for summarizing changes and cutting releases safely.
|
|
1285
1518
|
*/
|
|
1286
|
-
readonly 'release-manager': readonly ["getRepository", "
|
|
1519
|
+
readonly 'release-manager': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getCommit", "compareCommits", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "getCombinedStatus", "getCiFailureContext", "listPullRequests", "getPullRequest"];
|
|
1287
1520
|
/**
|
|
1288
1521
|
* **Discussion moderator** — answer and moderate repository Discussions.
|
|
1289
1522
|
*
|
|
1290
|
-
* Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`,
|
|
1291
|
-
* `
|
|
1523
|
+
* Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`, `getRepository`, `getFileContent`, `getRepositoryTree`,
|
|
1524
|
+
* `searchCode`, `listCommits`, `searchIssues`, `getIssueContext`, `addIssueComment`.
|
|
1292
1525
|
*
|
|
1293
1526
|
* Prefer discussions for Q&A; link related issues with `getIssueContext` / `addIssueComment` when needed.
|
|
1294
1527
|
* Agent prompt: optimized for clear, on-topic discussion replies.
|
|
1295
1528
|
*/
|
|
1296
|
-
readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "searchIssues", "getIssueContext", "addIssueComment"];
|
|
1529
|
+
readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "searchIssues", "getIssueContext", "addIssueComment"];
|
|
1297
1530
|
/**
|
|
1298
1531
|
* **Notification inbox** — triage authenticated-user notification threads.
|
|
1299
1532
|
*
|
|
1300
|
-
* Tools: `listNotifications`, `markNotificationRead`, `
|
|
1533
|
+
* Tools: `listNotifications`, `markNotificationRead`, `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`,
|
|
1534
|
+
* `listCommits`, `getIssue`, `getIssueContext`, `getPullRequest`, `getDiscussion`.
|
|
1301
1535
|
*
|
|
1302
1536
|
* Requires a user PAT with the Notifications account permission — not available on Connect installation tokens.
|
|
1303
1537
|
* Agent prompt: optimized for clearing inbox noise and following up on actionable threads.
|
|
1304
1538
|
*/
|
|
1305
|
-
readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getIssue", "getPullRequest", "
|
|
1539
|
+
readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "getIssue", "getIssueContext", "getPullRequest", "getDiscussion"];
|
|
1306
1540
|
/**
|
|
1307
1541
|
* **PR author** — open pull requests without the full write surface.
|
|
1308
1542
|
*
|
|
1309
|
-
* Tools: `getRepository`, `
|
|
1310
|
-
* `
|
|
1311
|
-
* `
|
|
1312
|
-
* `compareCommits`, `getCommit`.
|
|
1543
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`,
|
|
1544
|
+
* `getCollaboratorPermission`, `createBranch`, `deleteBranch`, `createOrUpdateFile`, `editFiles`, `createPullRequest`,
|
|
1545
|
+
* `updatePullRequest`, `updatePullRequestBranch`, `listPullRequests`, `getPullRequest`, `listPullRequestFiles`,
|
|
1546
|
+
* `listPullRequestReviewThreads`, `replyToReviewComment`, `resolveReviewThread`, `compareCommits`, `getCommit`.
|
|
1313
1547
|
*
|
|
1314
1548
|
* Respond to review feedback with `listPullRequestReviewThreads` → `replyToReviewComment` → `resolveReviewThread`.
|
|
1315
1549
|
* Agent prompt: optimized for branching, editing files, and opening focused PRs.
|
|
1316
1550
|
*/
|
|
1317
|
-
readonly 'pr-author': readonly ["getRepository", "listBranches", "
|
|
1551
|
+
readonly 'pr-author': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "getCollaboratorPermission", "createBranch", "deleteBranch", "createOrUpdateFile", "editFiles", "createPullRequest", "updatePullRequest", "updatePullRequestBranch", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviewThreads", "replyToReviewComment", "resolveReviewThread", "compareCommits", "getCommit"];
|
|
1318
1552
|
/**
|
|
1319
1553
|
* **Maintainer** — full repository maintenance with all read and write tools.
|
|
1320
1554
|
*
|
|
@@ -1322,7 +1556,7 @@ declare const PRESET_TOOLS: {
|
|
|
1322
1556
|
*
|
|
1323
1557
|
* Agent prompt: optimized for day-to-day repo maintenance with careful write operations.
|
|
1324
1558
|
*/
|
|
1325
|
-
readonly maintainer: readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "createBranch", "deleteBranch", "forkRepository", "createRepository", "createOrUpdateFile", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "createPullRequest", "mergePullRequest", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "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", "getWorkflowJobLogs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease"];
|
|
1559
|
+
readonly maintainer: readonly ["getRepository", "listBranches", "getBranchRules", "getCollaboratorPermission", "getFileContent", "getRepositoryTree", "createBranch", "deleteBranch", "forkRepository", "createRepository", "createOrUpdateFile", "editFiles", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "createPullRequest", "mergePullRequest", "enablePullRequestAutoMerge", "disablePullRequestAutoMerge", "updatePullRequest", "updatePullRequestBranch", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "listLabels", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listMilestones", "listSubIssues", "addSubIssue", "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", "getWorkflowJobLogs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "listCheckRuns", "getCombinedStatus", "createCommitStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listCodeScanningAlerts", "listDependabotAlerts", "listSecretScanningAlerts"];
|
|
1326
1560
|
};
|
|
1327
1561
|
type GithubToolPreset = keyof typeof PRESET_TOOLS;
|
|
1328
1562
|
/** Tool names included in a single preset. */
|
|
@@ -1330,6 +1564,35 @@ type PresetToolName<P extends GithubToolPreset> = Extract<(typeof PRESET_TOOLS)[
|
|
|
1330
1564
|
/** Tool names included when combining multiple presets. */
|
|
1331
1565
|
type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetToolName<P[number]>;
|
|
1332
1566
|
//#endregion
|
|
1567
|
+
//#region src/core/guardrails.d.ts
|
|
1568
|
+
/**
|
|
1569
|
+
* Limits on where GitHub tools can act, checked on every call before it reaches GitHub.
|
|
1570
|
+
* Unlike approval, they hold whoever approves a call and whatever the model asks for.
|
|
1571
|
+
*/
|
|
1572
|
+
type GithubGuardrails = {
|
|
1573
|
+
/**
|
|
1574
|
+
* Repositories the tools may act on, as `owner/repo` or `owner/*`, matched case-insensitively.
|
|
1575
|
+
* A call to any other repository fails. Tools without a repository target (search, gists,
|
|
1576
|
+
* notifications) are not restricted. `createRepository` and `forkRepository` run only when the
|
|
1577
|
+
* new repository's full name matches, so they need `org` or `organization`. `addSubIssue` also
|
|
1578
|
+
* checks the sub-issue's repository, and `updatePullRequestBranch` the head's repository, which can be a fork.
|
|
1579
|
+
*/
|
|
1580
|
+
repositories?: string[];
|
|
1581
|
+
/**
|
|
1582
|
+
* Branches the tools may write to, as names or patterns where `*` matches any characters,
|
|
1583
|
+
* such as `agent/*`. Covers creating, deleting and committing to a branch, merging or enabling
|
|
1584
|
+
* auto-merge into a pull request's base branch, and updating a pull request's head branch.
|
|
1585
|
+
* A commit that doesn't name its branch fails.
|
|
1586
|
+
*/
|
|
1587
|
+
branches?: string[];
|
|
1588
|
+
/**
|
|
1589
|
+
* `'block'` (default) fails any call whose input contains what looks like a credential, such as a
|
|
1590
|
+
* GitHub token, a private key or a cloud API key, so the agent can't post one to GitHub. `'allow'`
|
|
1591
|
+
* turns the check off, for example when a repository's fixtures contain fake keys.
|
|
1592
|
+
*/
|
|
1593
|
+
secrets?: 'block' | 'allow';
|
|
1594
|
+
};
|
|
1595
|
+
//#endregion
|
|
1333
1596
|
//#region src/core/token.d.ts
|
|
1334
1597
|
/**
|
|
1335
1598
|
* The tool call a token is requested for. Passed to token providers so they
|
|
@@ -1351,18 +1614,30 @@ type GithubTokenCall = {
|
|
|
1351
1614
|
* outside a tool call.
|
|
1352
1615
|
*/
|
|
1353
1616
|
type GithubTokenInput = string | ((call?: GithubTokenCall) => Promise<string>);
|
|
1617
|
+
type GithubTokenResolver = (call?: GithubTokenCall) => Promise<string>;
|
|
1354
1618
|
/** Resolves a {@link GithubTokenInput} to a token string for an optional tool call. */
|
|
1355
1619
|
declare function resolveGithubToken(token?: GithubTokenInput, call?: GithubTokenCall): Promise<string>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Wrap a token so every call it resolves for is checked against `guardrails` first, including the
|
|
1622
|
+
* default check for credentials in the input. A blocked call
|
|
1623
|
+
* throws `github_tools.GUARDRAIL_BLOCKED` before any request reaches GitHub. Use it when you build
|
|
1624
|
+
* tools from individual factories; `createGithubTools({ guardrails })` applies it for you.
|
|
1625
|
+
*/
|
|
1626
|
+
declare function withGithubGuardrails(token: GithubTokenInput | undefined, guardrails: GithubGuardrails | undefined): GithubTokenResolver;
|
|
1356
1627
|
//#endregion
|
|
1357
1628
|
//#region src/core/evaluation-policy.d.ts
|
|
1358
|
-
/**
|
|
1359
|
-
|
|
1629
|
+
/**
|
|
1630
|
+
* Decision model used by `'auto'` approval and `preset: 'auto'` unless `evaluation.model` is set.
|
|
1631
|
+
* Pinned to a Jev release so the default thresholds keep matching the model they were set for;
|
|
1632
|
+
* `'typesafe-ai/jev'` follows the latest release instead.
|
|
1633
|
+
*/
|
|
1634
|
+
declare const DEFAULT_EVALUATION_MODEL = "typesafe-ai/jev-1.14.0";
|
|
1360
1635
|
/**
|
|
1361
1636
|
* Write tools `requireApproval: 'auto'` evaluates: labels, assignees, reactions, comments,
|
|
1362
|
-
* review-thread replies, reviewer requests, notification reads
|
|
1637
|
+
* review-thread replies, reviewer requests, and notification reads.
|
|
1363
1638
|
* Every other write tool keeps requiring approval.
|
|
1364
1639
|
*/
|
|
1365
|
-
declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead"
|
|
1640
|
+
declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead"];
|
|
1366
1641
|
type RoutablePreset = Exclude<GithubToolPreset, 'maintainer'>;
|
|
1367
1642
|
//#endregion
|
|
1368
1643
|
//#region src/core/write-tools.d.ts
|
|
@@ -1378,10 +1653,15 @@ declare const GITHUB_WRITE_TOOLS: { [K in GithubWriteToolName]: K; };
|
|
|
1378
1653
|
*/
|
|
1379
1654
|
type GithubEvaluationOptions = {
|
|
1380
1655
|
/**
|
|
1381
|
-
*
|
|
1382
|
-
* @default 'typesafe-ai/jev'
|
|
1656
|
+
* Decision model for AI SDK `experimental_decide`: an AI Gateway ID or a model instance.
|
|
1657
|
+
* @default 'typesafe-ai/jev-1.14.0'
|
|
1383
1658
|
*/
|
|
1384
1659
|
model?: Experimental_EvaluationModel;
|
|
1660
|
+
/**
|
|
1661
|
+
* Provider options passed to every decision call, for example AI Gateway settings such as
|
|
1662
|
+
* `{ gateway: { zeroDataRetention: true } }`.
|
|
1663
|
+
*/
|
|
1664
|
+
providerOptions?: Record<string, Record<string, JSONValue>>;
|
|
1385
1665
|
/**
|
|
1386
1666
|
* Highest risk an `'auto'` tool call can have and still run without approval, on a 0–2 scale
|
|
1387
1667
|
* (0 negligible, 1 visible but reversible, 2 hard to undo).
|
|
@@ -1395,7 +1675,7 @@ type GithubEvaluationOptions = {
|
|
|
1395
1675
|
minIntent?: number;
|
|
1396
1676
|
/**
|
|
1397
1677
|
* Lowest probability for `preset: 'auto'` to select a preset. When no preset reaches it,
|
|
1398
|
-
*
|
|
1678
|
+
* read-only `repo-explorer` is used.
|
|
1399
1679
|
* @default 0.7
|
|
1400
1680
|
*/
|
|
1401
1681
|
minPresetProbability?: number;
|
|
@@ -1404,22 +1684,95 @@ type GithubEvaluationOptions = {
|
|
|
1404
1684
|
* @default 2
|
|
1405
1685
|
*/
|
|
1406
1686
|
maxPresets?: number;
|
|
1687
|
+
/**
|
|
1688
|
+
* What `preset: 'auto'` picks. `'tools'` asks the decision model about each tool and lists only
|
|
1689
|
+
* the likely ones plus the core read tools (`CORE_READ_TOOLS`), so the model sees far fewer tool
|
|
1690
|
+
* definitions. The rest stays reachable: eve defers it, and `createGithubAgent` adds a
|
|
1691
|
+
* `callGithubTool` tool. `'presets'` lists the tools of up to `maxPresets` presets and, on
|
|
1692
|
+
* `createGithubAgent`, uses their system prompts.
|
|
1693
|
+
* @default 'tools'
|
|
1694
|
+
*/
|
|
1695
|
+
selection?: 'presets' | 'tools';
|
|
1696
|
+
/**
|
|
1697
|
+
* How long a `preset: 'auto'` decision lasts. `'session'` decides once, on the conversation's
|
|
1698
|
+
* first request, so the listed tools, and the provider's cached prompt prefix they start, stay
|
|
1699
|
+
* the same for the rest of the conversation; later needs go through deferred tools (eve) or
|
|
1700
|
+
* `callGithubTool` (`createGithubAgent`, which doesn't support it with `selection: 'presets'`).
|
|
1701
|
+
* `'turn'` decides again for each new request, which changes the tool list and makes the
|
|
1702
|
+
* provider write the whole conversation to its prompt cache again.
|
|
1703
|
+
* @default 'session', except `'turn'` for presets on `createGithubAgent`
|
|
1704
|
+
*/
|
|
1705
|
+
scope?: 'turn' | 'session';
|
|
1706
|
+
/**
|
|
1707
|
+
* Keeps `createGithubAgent`'s `preset: 'auto'` decisions across processes, such as serverless
|
|
1708
|
+
* instances, under keys derived from the request and the routing settings (decision model,
|
|
1709
|
+
* thresholds and caps), so agents configured differently don't share decisions. Without it, a decision
|
|
1710
|
+
* lives in this process's memory, and another process decides again: that costs a decision
|
|
1711
|
+
* call, and a different pick changes the tool list and invalidates the provider's prompt cache.
|
|
1712
|
+
* The eve extension keeps decisions in the session and ignores this option.
|
|
1713
|
+
*/
|
|
1714
|
+
store?: {
|
|
1715
|
+
get: (key: string) => Promise<readonly string[] | undefined>;
|
|
1716
|
+
set: (key: string, value: readonly string[]) => Promise<void>;
|
|
1717
|
+
};
|
|
1718
|
+
/**
|
|
1719
|
+
* Lowest probability for `selection: 'tools'` to list a tool beyond the core read tools.
|
|
1720
|
+
* @default 0.5
|
|
1721
|
+
*/
|
|
1722
|
+
minToolProbability?: number;
|
|
1723
|
+
/**
|
|
1724
|
+
* Most tools `selection: 'tools'` lists beyond the core read tools, keeping the most likely ones.
|
|
1725
|
+
* @default 8
|
|
1726
|
+
*/
|
|
1727
|
+
maxTools?: number;
|
|
1728
|
+
};
|
|
1729
|
+
/** Whether a person should approve a GitHub write, and why, as a short sentence for the approval request. */
|
|
1730
|
+
type AutoApprovalDecision = {
|
|
1731
|
+
ask: boolean;
|
|
1732
|
+
reason: string;
|
|
1407
1733
|
};
|
|
1408
1734
|
/**
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
1735
|
+
* Asks the decision model how risky a GitHub write is and whether the user asked for it, and
|
|
1736
|
+
* explains the outcome: `ask` is true when a person should approve the call. A failed or refused
|
|
1737
|
+
* decision asks, since it gives no evidence that the call is safe.
|
|
1412
1738
|
*/
|
|
1413
|
-
declare function
|
|
1739
|
+
declare function autoApprovalDecision(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], { model, maxRisk, minIntent, providerOptions }?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<AutoApprovalDecision>;
|
|
1740
|
+
/** Whether a GitHub write needs a person's approval; see {@link autoApprovalDecision}. */
|
|
1741
|
+
declare function needsAutoApproval(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<boolean>;
|
|
1414
1742
|
/**
|
|
1415
1743
|
* Presets the latest user message needs, from one evaluation call with an independent
|
|
1416
1744
|
* yes/no question per preset. Returns up to `maxPresets` presets at or above
|
|
1417
|
-
* `minPresetProbability`, most likely first
|
|
1418
|
-
* `repo-explorer` is only
|
|
1419
|
-
*
|
|
1420
|
-
|
|
1745
|
+
* `minPresetProbability`, most likely first, and read-only `repo-explorer` when none qualifies.
|
|
1746
|
+
* `repo-explorer` is only combined with no other preset. Rejects when the evaluation call fails;
|
|
1747
|
+
* {@link selectPresets} falls back instead. Never returns `maintainer`, so the full catalog is never exposed.
|
|
1748
|
+
*/
|
|
1749
|
+
declare function evaluatePresets(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<RoutablePreset[]>;
|
|
1750
|
+
/**
|
|
1751
|
+
* Tools the latest user message needs, from one decision call with a yes/no question per tool:
|
|
1752
|
+
* the core read tools, plus up to `maxTools` others at or above `minToolProbability`, most likely
|
|
1753
|
+
* first. Rejects when the decision call fails; {@link selectTools} falls back instead.
|
|
1754
|
+
*/
|
|
1755
|
+
declare function evaluateTools(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<GithubToolName[]>;
|
|
1756
|
+
/**
|
|
1757
|
+
* Logs `EVALUATION_FAILED` for a failed {@link evaluatePresets} call and returns the read-only
|
|
1758
|
+
* `repo-explorer` fallback. Rethrows when `abortSignal` is aborted.
|
|
1759
|
+
*/
|
|
1760
|
+
declare function fallbackPresets(error: unknown, { model }?: GithubEvaluationOptions, abortSignal?: AbortSignal): RoutablePreset[];
|
|
1761
|
+
/**
|
|
1762
|
+
* Logs `EVALUATION_FAILED` for a failed {@link evaluateTools} call and returns the read-only
|
|
1763
|
+
* `repo-explorer` tools. Rethrows when `abortSignal` is aborted.
|
|
1764
|
+
*/
|
|
1765
|
+
declare function fallbackTools(error: unknown, { model }?: GithubEvaluationOptions, abortSignal?: AbortSignal): GithubToolName[];
|
|
1766
|
+
/**
|
|
1767
|
+
* {@link evaluateTools}, falling back to the read-only `repo-explorer` tools (and logging
|
|
1768
|
+
* `EVALUATION_FAILED`) when the decision call fails.
|
|
1421
1769
|
*/
|
|
1422
|
-
declare function
|
|
1770
|
+
declare function selectTools(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<GithubToolName[]>;
|
|
1771
|
+
/**
|
|
1772
|
+
* {@link evaluatePresets}, falling back to read-only `repo-explorer` (and logging
|
|
1773
|
+
* `EVALUATION_FAILED`) when the evaluation call fails.
|
|
1774
|
+
*/
|
|
1775
|
+
declare function selectPresets(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<RoutablePreset[]>;
|
|
1423
1776
|
declare function latestUserText(messages: readonly ModelMessage[]): string;
|
|
1424
1777
|
//#endregion
|
|
1425
1778
|
//#region src/core/approval-policy.d.ts
|
|
@@ -1563,11 +1916,41 @@ type GithubToolsBaseOptions = {
|
|
|
1563
1916
|
committer?: CommitIdentity;
|
|
1564
1917
|
/** Co-authors to attribute on all commits created by tools. */
|
|
1565
1918
|
coAuthors?: CommitIdentity[];
|
|
1919
|
+
/**
|
|
1920
|
+
* Repositories and branches the tools may act on, checked before each call reaches GitHub.
|
|
1921
|
+
* A blocked call fails with `github_tools.GUARDRAIL_BLOCKED`, whoever approves it.
|
|
1922
|
+
* @see {@link GithubGuardrails}
|
|
1923
|
+
*/
|
|
1924
|
+
guardrails?: GithubGuardrails;
|
|
1925
|
+
/**
|
|
1926
|
+
* Run reads as usual but send no write to GitHub: each write tool returns a
|
|
1927
|
+
* `GithubDryRunResult` instead, after the approval and guardrail checks. Use it to try an
|
|
1928
|
+
* agent on real repositories without changing them.
|
|
1929
|
+
*/
|
|
1930
|
+
dryRun?: boolean;
|
|
1566
1931
|
};
|
|
1567
1932
|
/** Tool set shape for a given preset option (single, combined, or all tools). */
|
|
1568
1933
|
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;
|
|
1569
1934
|
/** Pick a subset of GitHub tools by tool name. */
|
|
1570
1935
|
type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
|
|
1571
1936
|
//#endregion
|
|
1572
|
-
|
|
1573
|
-
|
|
1937
|
+
//#region src/core/dry-run.d.ts
|
|
1938
|
+
/** What approval would have decided for a write, had it run for real. */
|
|
1939
|
+
type GithubDryRunApproval = {
|
|
1940
|
+
/** `true` when a person would have been asked to approve the call. */
|
|
1941
|
+
required: boolean;
|
|
1942
|
+
/** The evaluation model's verdict, with `requireApproval: 'auto'`. */
|
|
1943
|
+
reason?: string;
|
|
1944
|
+
};
|
|
1945
|
+
/** What a write tool returns under `dryRun`: nothing is sent to GitHub, and nobody is asked to approve it. */
|
|
1946
|
+
type GithubDryRunResult = {
|
|
1947
|
+
dryRun: true;
|
|
1948
|
+
tool: GithubWriteToolName;
|
|
1949
|
+
input: Record<string, unknown>;
|
|
1950
|
+
/** What approval would have decided, when the integration can tell. */
|
|
1951
|
+
approval?: GithubDryRunApproval;
|
|
1952
|
+
message: string;
|
|
1953
|
+
};
|
|
1954
|
+
//#endregion
|
|
1955
|
+
export { DEFAULT_EVALUATION_MODEL as A, PRESET_TOOLS as B, fallbackTools as C, selectTools as D, selectPresets as E, withGithubGuardrails as F, GithubWriteToolName as G, GITHUB_TOOL_NAMES as H, GithubGuardrails as I, CORE_READ_TOOLS as L, GithubTokenCall as M, GithubTokenInput as N, GITHUB_WRITE_TOOLS as O, resolveGithubToken as P, CombinedPresetToolNames as R, fallbackPresets as S, needsAutoApproval as T, GITHUB_TOOL_CATALOG as U, PresetToolName as V, GithubToolName as W, AutoApprovalDecision as _, GithubToolsForPreset as a, evaluatePresets as b, CommitIdentity as c, Octokit$1 as d, ToolOptions as f, ToolApprovalMode as g, StaticApprovalConfig as h, GithubToolsBaseOptions as i, RoutablePreset as j, AUTO_APPROVAL_TOOLS as k, CommitToolOptions as l, ApprovalConfig as m, GithubDryRunResult as n, PickGithubTools as o, ToolOverrides as p, AllGithubTools as r, GithubToolsContext as s, GithubDryRunApproval as t, GithubTool as u, GithubEvaluationOptions as v, latestUserText as w, evaluateTools as x, autoApprovalDecision as y, GithubToolPreset as z };
|
|
1956
|
+
//# sourceMappingURL=dry-run-DXckOam2.d.mts.map
|