@github-tools/sdk 1.19.0 → 1.20.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 +60 -26
- package/dist/approval-policy--kByBqhT.mjs +17 -0
- package/dist/approval-policy--kByBqhT.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-FLzAv2tu.mjs} +23 -2
- package/dist/cores-FLzAv2tu.mjs.map +1 -0
- package/dist/evaluation-BtoHbxuQ.mjs +311 -0
- package/dist/evaluation-BtoHbxuQ.mjs.map +1 -0
- package/dist/{eve-runtime-YTxfrWP-.mjs → eve-runtime-C-0doyHq.mjs} +13 -7
- package/dist/eve-runtime-C-0doyHq.mjs.map +1 -0
- package/dist/{eve-runtime-DRh2QJI7.d.mts → eve-runtime-CflZNuXD.d.mts} +6 -6
- package/dist/{eve-runtime-DRh2QJI7.d.mts.map → eve-runtime-CflZNuXD.d.mts.map} +1 -1
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -4
- package/dist/eve.d.mts +53 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +52 -3
- package/dist/eve.mjs.map +1 -1
- package/dist/{index-DkZvveZP.d.mts → index-C3wlz660.d.mts} +91 -347
- package/dist/index-C3wlz660.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-DyiAVHKl.mjs} +338 -15
- package/dist/src-DyiAVHKl.mjs.map +1 -0
- package/dist/tanstack/interrupts.d.mts +1 -1
- package/dist/tanstack.d.mts +1214 -56
- package/dist/tanstack.d.mts.map +1 -1
- package/dist/tanstack.mjs +26 -13
- package/dist/tanstack.mjs.map +1 -1
- package/dist/{token-Bh8nPj66.mjs → token-DIwB-wtp.mjs} +35 -116
- package/dist/token-DIwB-wtp.mjs.map +1 -0
- package/dist/{tool-types-CrC80SIL.d.mts → tool-types-OFyE3z0C.d.mts} +283 -54
- package/dist/tool-types-OFyE3z0C.d.mts.map +1 -0
- package/dist/{types-BmwOpI5-.d.mts → types-CJqhvQwi.d.mts} +3 -3
- package/dist/{types-BmwOpI5-.d.mts.map → types-CJqhvQwi.d.mts.map} +1 -1
- package/dist/{types-CPAsEMzx.d.mts → types-ITYfXMtY.d.mts} +2 -2
- package/dist/{types-CPAsEMzx.d.mts.map → types-ITYfXMtY.d.mts.map} +1 -1
- package/dist/workflow.d.mts +34 -40
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +17 -46
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-BaoTUCg7.mjs → write-tools-DnGZw-RD.mjs} +941 -112
- package/dist/write-tools-DnGZw-RD.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-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
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@github-tools/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "A typed tool layer for GitHub AI agents, with presets, human approval, and durable execution. Works with eve, the AI SDK, TanStack AI, Vercel Workflow, and Chat SDK",
|
|
5
|
-
"author": "HugoRCD <hugo.richard@vercel.com",
|
|
5
|
+
"author": "HugoRCD <hugo.richard@vercel.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/vercel-labs/github-tools.git",
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
"url": "https://github.com/vercel-labs/github-tools/issues"
|
|
14
14
|
},
|
|
15
15
|
"type": "module",
|
|
16
|
-
"sideEffects":
|
|
17
|
-
"./dist/agents-*.mjs"
|
|
18
|
-
],
|
|
16
|
+
"sideEffects": false,
|
|
19
17
|
"exports": {
|
|
20
18
|
".": {
|
|
21
19
|
"types": "./dist/index.d.mts",
|
|
@@ -111,7 +109,7 @@
|
|
|
111
109
|
"@vercel/connect": "^2.7.0",
|
|
112
110
|
"ai": "^7.0.148",
|
|
113
111
|
"eslint": "^10.10.0",
|
|
114
|
-
"eve": "^1.0.0-rc.
|
|
112
|
+
"eve": "^1.0.0-rc.6",
|
|
115
113
|
"tsdown": "^0.23.0",
|
|
116
114
|
"typescript": "^6.0.3",
|
|
117
115
|
"typescript-eslint": "^8.70.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cores-BeLZwcde.mjs","names":["repository.getRepositoryCore","repository.listBranchesCore","repository.getFileContentCore","repository.getRepositoryTreeCore","repository.createBranchCore","repository.deleteBranchCore","repository.forkRepositoryCore","repository.createRepositoryCore","repository.createOrUpdateFileCore","pullRequests.listPullRequestsCore","pullRequests.getPullRequestCore","pullRequests.createPullRequestCore","pullRequests.mergePullRequestCore","pullRequests.updatePullRequestCore","pullRequests.addPullRequestCommentCore","pullRequests.updatePullRequestCommentCore","pullRequests.deletePullRequestCommentCore","pullRequests.listPullRequestFilesCore","pullRequests.listPullRequestReviewsCore","pullRequests.createPullRequestReviewCore","pullRequests.listPullRequestReviewThreadsCore","pullRequests.replyToReviewCommentCore","pullRequests.resolveReviewThreadCore","pullRequests.requestReviewersCore","bundles.getPullRequestContextCore","bundles.getIssueContextCore","issues.listIssuesCore","issues.getIssueCore","issues.listIssueCommentsCore","issues.createIssueCore","issues.addIssueCommentCore","issues.updateIssueCommentCore","issues.deleteIssueCommentCore","issues.closeIssueCore","issues.updateIssueCore","issues.listLabelsCore","issues.addLabelsCore","issues.removeLabelCore","issues.createLabelCore","issues.updateLabelCore","issues.deleteLabelCore","issues.addAssigneesCore","issues.removeAssigneesCore","reactions.listIssueReactionsCore","reactions.addIssueReactionCore","reactions.listCommentReactionsCore","reactions.addCommentReactionCore","discussions.listDiscussionsCore","discussions.getDiscussionCore","discussions.addDiscussionCommentCore","notifications.listNotificationsCore","notifications.markNotificationReadCore","search.searchCodeCore","search.searchRepositoriesCore","search.searchIssuesCore","commits.listCommitsCore","commits.getCommitCore","commits.getBlameCore","commits.compareCommitsCore","gists.listGistsCore","gists.getGistCore","gists.listGistCommentsCore","gists.createGistCore","gists.updateGistCore","gists.deleteGistCore","gists.createGistCommentCore","workflows.listWorkflowsCore","workflows.listWorkflowRunsCore","workflows.getWorkflowRunCore","workflows.listWorkflowJobsCore","workflows.getWorkflowJobLogsCore","workflows.triggerWorkflowCore","workflows.cancelWorkflowRunCore","workflows.rerunWorkflowRunCore","checks.listCheckRunsCore","checks.getCombinedStatusCore","bundles.getCiFailureContextCore","releases.listReleasesCore","releases.getLatestReleaseCore","releases.getReleaseCore","bundles.getReleaseContextCore","releases.createReleaseCore","releases.updateReleaseCore","releases.deleteReleaseCore"],"sources":["../src/core/cores.ts"],"sourcesContent":["import * as bundles from './bundles'\nimport * as checks from './checks'\nimport * as commits from './commits'\nimport * as discussions from './discussions'\nimport * as gists from './gists'\nimport * as issues from './issues'\nimport * as notifications from './notifications'\nimport * as pullRequests from './pull-requests'\nimport * as reactions from './reactions'\nimport * as releases from './releases'\nimport * as repository from './repository'\nimport * as search from './search'\nimport * as workflows from './workflows'\nimport type { GithubToolName } from './catalog'\n\n/**\n * The `*Core` implementation of every tool, keyed by tool name.\n *\n * Kept apart from `GITHUB_TOOL_CATALOG` so that importing tool metadata does\n * not pull Octokit into a Vercel Workflow flow bundle, which cannot load\n * Node.js built-ins. Argument types vary per tool, so callers cast at the\n * dispatch boundary. Entries are getters so the ESM binding stays live\n * (module spies in tests).\n */\nexport const GITHUB_TOOL_CORES = {\n get getRepository() { return repository.getRepositoryCore },\n get listBranches() { return repository.listBranchesCore },\n get getFileContent() { return repository.getFileContentCore },\n get getRepositoryTree() { return repository.getRepositoryTreeCore },\n get createBranch() { return repository.createBranchCore },\n get deleteBranch() { return repository.deleteBranchCore },\n get forkRepository() { return repository.forkRepositoryCore },\n get createRepository() { return repository.createRepositoryCore },\n get createOrUpdateFile() { return repository.createOrUpdateFileCore },\n get listPullRequests() { return pullRequests.listPullRequestsCore },\n get getPullRequest() { return pullRequests.getPullRequestCore },\n get createPullRequest() { return pullRequests.createPullRequestCore },\n get mergePullRequest() { return pullRequests.mergePullRequestCore },\n get updatePullRequest() { return pullRequests.updatePullRequestCore },\n get addPullRequestComment() { return pullRequests.addPullRequestCommentCore },\n get updatePullRequestComment() { return pullRequests.updatePullRequestCommentCore },\n get deletePullRequestComment() { return pullRequests.deletePullRequestCommentCore },\n get listPullRequestFiles() { return pullRequests.listPullRequestFilesCore },\n get listPullRequestReviews() { return pullRequests.listPullRequestReviewsCore },\n get createPullRequestReview() { return pullRequests.createPullRequestReviewCore },\n get listPullRequestReviewThreads() { return pullRequests.listPullRequestReviewThreadsCore },\n get replyToReviewComment() { return pullRequests.replyToReviewCommentCore },\n get resolveReviewThread() { return pullRequests.resolveReviewThreadCore },\n get requestReviewers() { return pullRequests.requestReviewersCore },\n get getPullRequestContext() { return bundles.getPullRequestContextCore },\n get getIssueContext() { return bundles.getIssueContextCore },\n get listIssues() { return issues.listIssuesCore },\n get getIssue() { return issues.getIssueCore },\n get listIssueComments() { return issues.listIssueCommentsCore },\n get createIssue() { return issues.createIssueCore },\n get addIssueComment() { return issues.addIssueCommentCore },\n get updateIssueComment() { return issues.updateIssueCommentCore },\n get deleteIssueComment() { return issues.deleteIssueCommentCore },\n get closeIssue() { return issues.closeIssueCore },\n get updateIssue() { return issues.updateIssueCore },\n get listLabels() { return issues.listLabelsCore },\n get addLabels() { return issues.addLabelsCore },\n get removeLabel() { return issues.removeLabelCore },\n get createLabel() { return issues.createLabelCore },\n get updateLabel() { return issues.updateLabelCore },\n get deleteLabel() { return issues.deleteLabelCore },\n get addAssignees() { return issues.addAssigneesCore },\n get removeAssignees() { return issues.removeAssigneesCore },\n get listIssueReactions() { return reactions.listIssueReactionsCore },\n get addIssueReaction() { return reactions.addIssueReactionCore },\n get listCommentReactions() { return reactions.listCommentReactionsCore },\n get addCommentReaction() { return reactions.addCommentReactionCore },\n get listDiscussions() { return discussions.listDiscussionsCore },\n get getDiscussion() { return discussions.getDiscussionCore },\n get addDiscussionComment() { return discussions.addDiscussionCommentCore },\n get listNotifications() { return notifications.listNotificationsCore },\n get markNotificationRead() { return notifications.markNotificationReadCore },\n get searchCode() { return search.searchCodeCore },\n get searchRepositories() { return search.searchRepositoriesCore },\n get searchIssues() { return search.searchIssuesCore },\n get listCommits() { return commits.listCommitsCore },\n get getCommit() { return commits.getCommitCore },\n get getBlame() { return commits.getBlameCore },\n get compareCommits() { return commits.compareCommitsCore },\n get listGists() { return gists.listGistsCore },\n get getGist() { return gists.getGistCore },\n get listGistComments() { return gists.listGistCommentsCore },\n get createGist() { return gists.createGistCore },\n get updateGist() { return gists.updateGistCore },\n get deleteGist() { return gists.deleteGistCore },\n get createGistComment() { return gists.createGistCommentCore },\n get listWorkflows() { return workflows.listWorkflowsCore },\n get listWorkflowRuns() { return workflows.listWorkflowRunsCore },\n get getWorkflowRun() { return workflows.getWorkflowRunCore },\n get listWorkflowJobs() { return workflows.listWorkflowJobsCore },\n get getWorkflowJobLogs() { return workflows.getWorkflowJobLogsCore },\n get triggerWorkflow() { return workflows.triggerWorkflowCore },\n get cancelWorkflowRun() { return workflows.cancelWorkflowRunCore },\n get rerunWorkflowRun() { return workflows.rerunWorkflowRunCore },\n get listCheckRuns() { return checks.listCheckRunsCore },\n get getCombinedStatus() { return checks.getCombinedStatusCore },\n get getCiFailureContext() { return bundles.getCiFailureContextCore },\n get listReleases() { return releases.listReleasesCore },\n get getLatestRelease() { return releases.getLatestReleaseCore },\n get getRelease() { return releases.getReleaseCore },\n get getReleaseContext() { return bundles.getReleaseContextCore },\n get createRelease() { return releases.createReleaseCore },\n get updateRelease() { return releases.updateReleaseCore },\n get deleteRelease() { return releases.deleteReleaseCore },\n} satisfies Record<GithubToolName, (args: never) => Promise<unknown>>\n"],"mappings":";;;;;;;;;;;AAwBA,MAAa,oBAAoB;CAC/B,IAAI,gBAAgB;EAAE,OAAOA;CAA6B;CAC1D,IAAI,eAAe;EAAE,OAAOC;CAA4B;CACxD,IAAI,iBAAiB;EAAE,OAAOC;CAA8B;CAC5D,IAAI,oBAAoB;EAAE,OAAOC;CAAiC;CAClE,IAAI,eAAe;EAAE,OAAOC;CAA4B;CACxD,IAAI,eAAe;EAAE,OAAOC;CAA4B;CACxD,IAAI,iBAAiB;EAAE,OAAOC;CAA8B;CAC5D,IAAI,mBAAmB;EAAE,OAAOC;CAAgC;CAChE,IAAI,qBAAqB;EAAE,OAAOC;CAAkC;CACpE,IAAI,mBAAmB;EAAE,OAAOC;CAAkC;CAClE,IAAI,iBAAiB;EAAE,OAAOC;CAAgC;CAC9D,IAAI,oBAAoB;EAAE,OAAOC;CAAmC;CACpE,IAAI,mBAAmB;EAAE,OAAOC;CAAkC;CAClE,IAAI,oBAAoB;EAAE,OAAOC;CAAmC;CACpE,IAAI,wBAAwB;EAAE,OAAOC;CAAuC;CAC5E,IAAI,2BAA2B;EAAE,OAAOC;CAA0C;CAClF,IAAI,2BAA2B;EA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,eAAe;EAAE,OAAOC;CAA0B;CACtD,IAAI,mBAAmB;EAAE,OAAOC;CAA8B;CAC9D,IAAI,aAAa;EAAE,OAAOC;CAAwB;CAClD,IAAI,oBAAoB;EAAE,OAAOC;CAA8B;CAC/D,IAAI,gBAAgB;EAAE,OAAOC;CAA2B;CACxD,IAAI,gBAAgB;EAAE,OAAOC;CAA2B;CACxD,IAAI,gBAAgB;EAAE,OAAOC;CAA2B;AAC1D"}
|
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import { b as GITHUB_TOOL_CATALOG, c as DEFAULT_EVALUATION_MODEL, d as RISK_QUESTION, f as rankPresets, l as INTENT_QUESTION, m as PRESET_TOOLS, oa as githubToolsErrors, p as requiresApproval, u as PRESET_PURPOSES } from "./write-tools-BaoTUCg7.mjs";
|
|
2
|
-
import * as ai from "ai";
|
|
3
|
-
//#region src/core/model-output.ts
|
|
4
|
-
const MAX_PATCH_LENGTH = 4e3;
|
|
5
|
-
const MAX_CONTENT_LENGTH = 2e4;
|
|
6
|
-
const MAX_MODEL_TREE_ENTRIES = 200;
|
|
7
|
-
const MAX_MODEL_DIFF_FILES = 80;
|
|
8
|
-
function truncateText(text, maxLength) {
|
|
9
|
-
if (text.length <= maxLength) return text;
|
|
10
|
-
return `${text.slice(0, maxLength)}\n\n[truncated: ${text.length - maxLength} more characters]`;
|
|
11
|
-
}
|
|
12
|
-
function truncatePatchFields(files) {
|
|
13
|
-
return files.map((file) => ({
|
|
14
|
-
...file,
|
|
15
|
-
patch: file.patch ? truncateText(file.patch, MAX_PATCH_LENGTH) : file.patch
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
|
-
function capDiffFiles(files) {
|
|
19
|
-
if (!files) return {
|
|
20
|
-
files,
|
|
21
|
-
filesOmitted: 0
|
|
22
|
-
};
|
|
23
|
-
const truncated = truncatePatchFields(files);
|
|
24
|
-
if (truncated.length <= MAX_MODEL_DIFF_FILES) return {
|
|
25
|
-
files: truncated,
|
|
26
|
-
filesOmitted: 0
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
files: truncated.slice(0, MAX_MODEL_DIFF_FILES),
|
|
30
|
-
filesOmitted: truncated.length - MAX_MODEL_DIFF_FILES
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function listPullRequestFilesToModelOutput({ output }) {
|
|
34
|
-
const result = output;
|
|
35
|
-
return {
|
|
36
|
-
type: "json",
|
|
37
|
-
value: {
|
|
38
|
-
...result,
|
|
39
|
-
items: truncatePatchFields(result.items)
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function getCommitToModelOutput({ output }) {
|
|
44
|
-
const commit = output;
|
|
45
|
-
const { files, filesOmitted } = capDiffFiles(commit.files);
|
|
46
|
-
return {
|
|
47
|
-
type: "json",
|
|
48
|
-
value: {
|
|
49
|
-
...commit,
|
|
50
|
-
files,
|
|
51
|
-
...filesOmitted > 0 ? { filesOmitted } : {}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function compareCommitsToModelOutput({ output }) {
|
|
56
|
-
const comparison = output;
|
|
57
|
-
const { files, filesOmitted } = capDiffFiles(comparison.files);
|
|
58
|
-
return {
|
|
59
|
-
type: "json",
|
|
60
|
-
value: {
|
|
61
|
-
...comparison,
|
|
62
|
-
files,
|
|
63
|
-
...filesOmitted > 0 ? { filesOmitted } : {}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
function getFileContentToModelOutput({ output }) {
|
|
68
|
-
const result = output;
|
|
69
|
-
if (result.type === "directory" && "entries" in result && result.entries.length > MAX_MODEL_TREE_ENTRIES) return {
|
|
70
|
-
type: "json",
|
|
71
|
-
value: {
|
|
72
|
-
...result,
|
|
73
|
-
truncated: true,
|
|
74
|
-
entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),
|
|
75
|
-
entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
if ("content" in result && result.content.length > MAX_CONTENT_LENGTH) return {
|
|
79
|
-
type: "json",
|
|
80
|
-
value: {
|
|
81
|
-
...result,
|
|
82
|
-
content: truncateText(result.content, MAX_CONTENT_LENGTH)
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
return {
|
|
86
|
-
type: "json",
|
|
87
|
-
value: result
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function getRepositoryTreeToModelOutput({ output }) {
|
|
91
|
-
const result = output;
|
|
92
|
-
if (result.entries.length <= MAX_MODEL_TREE_ENTRIES) return {
|
|
93
|
-
type: "json",
|
|
94
|
-
value: result
|
|
95
|
-
};
|
|
96
|
-
return {
|
|
97
|
-
type: "json",
|
|
98
|
-
value: {
|
|
99
|
-
...result,
|
|
100
|
-
truncated: true,
|
|
101
|
-
entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),
|
|
102
|
-
entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
function getPullRequestContextToModelOutput({ output }) {
|
|
107
|
-
const result = output;
|
|
108
|
-
const { files, filesOmitted } = capDiffFiles(result.files);
|
|
109
|
-
return {
|
|
110
|
-
type: "json",
|
|
111
|
-
value: {
|
|
112
|
-
...result,
|
|
113
|
-
files,
|
|
114
|
-
...filesOmitted > 0 ? { filesOmitted } : {}
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
//#endregion
|
|
119
|
-
//#region src/core/evaluation.ts
|
|
120
|
-
function loadEvaluate() {
|
|
121
|
-
if (!("experimental_evaluate" in ai)) throw githubToolsErrors.EVALUATION_UNAVAILABLE();
|
|
122
|
-
return ai.experimental_evaluate;
|
|
123
|
-
}
|
|
124
|
-
function warnEvaluationFailed(model, fallback, error) {
|
|
125
|
-
const cause = error instanceof Error ? error : new Error(String(error));
|
|
126
|
-
console.warn("[github-tools]", githubToolsErrors.EVALUATION_FAILED({
|
|
127
|
-
model: typeof model === "string" ? model : model.modelId,
|
|
128
|
-
fallback,
|
|
129
|
-
detail: cause.message,
|
|
130
|
-
cause
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Whether an `'auto'` write tool call needs human approval: `false` only when the model
|
|
135
|
-
* rates it low-risk and asked for by the latest user message. When the evaluation call
|
|
136
|
-
* fails, logs `EVALUATION_FAILED` and asks for approval.
|
|
137
|
-
*/
|
|
138
|
-
async function needsAutoApproval(toolName, input, messages, { model = DEFAULT_EVALUATION_MODEL, maxRisk = 1, minIntent = .6 } = {}) {
|
|
139
|
-
const result = await loadEvaluate()({
|
|
140
|
-
model,
|
|
141
|
-
state: {
|
|
142
|
-
request: latestUserText(messages),
|
|
143
|
-
toolCall: {
|
|
144
|
-
tool: toolName,
|
|
145
|
-
description: GITHUB_TOOL_CATALOG[toolName].description,
|
|
146
|
-
input
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
questions: {
|
|
150
|
-
risk: {
|
|
151
|
-
type: "score",
|
|
152
|
-
...RISK_QUESTION
|
|
153
|
-
},
|
|
154
|
-
intent: {
|
|
155
|
-
type: "boolean",
|
|
156
|
-
...INTENT_QUESTION
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}).catch((error) => {
|
|
160
|
-
warnEvaluationFailed(model, `asking approval for ${toolName}`, error);
|
|
161
|
-
});
|
|
162
|
-
if (!result) return true;
|
|
163
|
-
const { answers } = result;
|
|
164
|
-
return requiresApproval(answers.risk.score, answers.intent.probability, {
|
|
165
|
-
maxRisk,
|
|
166
|
-
minIntent
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Presets the latest user message needs, from one evaluation call with an independent
|
|
171
|
-
* yes/no question per preset. Returns up to `maxPresets` presets at or above
|
|
172
|
-
* `minPresetProbability`, most likely first; when none qualifies, the single most likely preset.
|
|
173
|
-
* `repo-explorer` is only returned when no other preset qualifies.
|
|
174
|
-
* When the evaluation call fails, logs `EVALUATION_FAILED` and returns read-only `repo-explorer`.
|
|
175
|
-
* Never returns `maintainer`, so the full catalog is never exposed.
|
|
176
|
-
*/
|
|
177
|
-
async function selectPresets(messages, { model = DEFAULT_EVALUATION_MODEL, minPresetProbability = .7, maxPresets = 2 } = {}) {
|
|
178
|
-
const evaluate = loadEvaluate();
|
|
179
|
-
const presets = Object.keys(PRESET_PURPOSES);
|
|
180
|
-
const result = await evaluate({
|
|
181
|
-
model,
|
|
182
|
-
state: { request: latestUserText(messages) },
|
|
183
|
-
questions: Object.fromEntries(presets.map((preset) => [preset, {
|
|
184
|
-
type: "boolean",
|
|
185
|
-
instructions: "Does handling this GitHub request need the tools of this preset?",
|
|
186
|
-
criteria: { true: {
|
|
187
|
-
purpose: PRESET_PURPOSES[preset],
|
|
188
|
-
tools: [...PRESET_TOOLS[preset]]
|
|
189
|
-
} }
|
|
190
|
-
}]))
|
|
191
|
-
}).catch((error) => {
|
|
192
|
-
warnEvaluationFailed(model, "using the repo-explorer preset", error);
|
|
193
|
-
});
|
|
194
|
-
if (!result) return ["repo-explorer"];
|
|
195
|
-
const { answers } = result;
|
|
196
|
-
return rankPresets(Object.fromEntries(presets.map((preset) => [preset, answers[preset].probability])), {
|
|
197
|
-
minPresetProbability,
|
|
198
|
-
maxPresets
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
function latestUserText(messages) {
|
|
202
|
-
const message = messages.findLast((m) => m.role === "user");
|
|
203
|
-
if (!message) return "";
|
|
204
|
-
if (typeof message.content === "string") return message.content;
|
|
205
|
-
return message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n");
|
|
206
|
-
}
|
|
207
|
-
//#endregion
|
|
208
|
-
export { getCommitToModelOutput as a, getRepositoryTreeToModelOutput as c, compareCommitsToModelOutput as i, listPullRequestFilesToModelOutput as l, needsAutoApproval as n, getFileContentToModelOutput as o, selectPresets as r, getPullRequestContextToModelOutput as s, latestUserText as t };
|
|
209
|
-
|
|
210
|
-
//# sourceMappingURL=evaluation-f-2QwBid.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation-f-2QwBid.mjs","names":[],"sources":["../src/core/model-output.ts","../src/core/evaluation.ts"],"sourcesContent":["const MAX_PATCH_LENGTH = 4000\nconst MAX_CONTENT_LENGTH = 20000\nconst MAX_MODEL_TREE_ENTRIES = 200\nconst MAX_MODEL_DIFF_FILES = 80\n\nfunction truncateText(text: string, maxLength: number): string {\n if (text.length <= maxLength) return text\n return `${text.slice(0, maxLength)}\\n\\n[truncated: ${text.length - maxLength} more characters]`\n}\n\nfunction truncatePatchFields<T extends { patch?: string }>(files: T[]): T[] {\n return files.map(file => ({\n ...file,\n patch: file.patch ? truncateText(file.patch, MAX_PATCH_LENGTH) : file.patch,\n }))\n}\n\nfunction capDiffFiles<T extends { patch?: string }>(files: T[] | undefined) {\n if (!files) return { files, filesOmitted: 0 }\n const truncated = truncatePatchFields(files)\n if (truncated.length <= MAX_MODEL_DIFF_FILES) return { files: truncated, filesOmitted: 0 }\n return {\n files: truncated.slice(0, MAX_MODEL_DIFF_FILES),\n filesOmitted: truncated.length - MAX_MODEL_DIFF_FILES,\n }\n}\n\ntype ToModelOutputOptions = {\n toolCallId: string\n input: unknown\n output: unknown\n}\n\ntype ListPullRequestFile = {\n filename: string\n status: string\n additions: number\n deletions: number\n changes: number\n patch?: string\n}\n\ntype ListPullRequestFilesOutput = {\n items: ListPullRequestFile[]\n hasMore: boolean\n page: number\n perPage: number\n nextPage?: number\n}\n\ntype GetCommitOutput = {\n sha: string\n message: string\n author?: string\n authorLogin?: string\n date?: string\n url: string\n stats: { additions: number, deletions: number, total: number } | null\n files?: Array<{\n filename: string\n status: string\n additions: number\n deletions: number\n patch?: string\n }>\n}\n\ntype GetFileContentOutput =\n | { type: 'directory', entries: Array<{ name: string, type: string, path: string }> }\n | { type: string, path: string }\n | {\n type: 'file'\n path: string\n sha: string\n size: number\n content: string\n totalLines?: number\n startLine?: number\n endLine?: number\n truncated?: boolean\n }\n\nexport function listPullRequestFilesToModelOutput({ output }: ToModelOutputOptions) {\n const result = output as ListPullRequestFilesOutput\n return {\n type: 'json' as const,\n value: {\n ...result,\n items: truncatePatchFields(result.items),\n },\n }\n}\n\nexport function getCommitToModelOutput({ output }: ToModelOutputOptions) {\n const commit = output as GetCommitOutput\n const { files, filesOmitted } = capDiffFiles(commit.files)\n return {\n type: 'json' as const,\n value: {\n ...commit,\n files,\n ...filesOmitted > 0 ? { filesOmitted } : {},\n },\n }\n}\n\ntype CompareCommitsOutput = {\n status: string\n aheadBy: number\n behindBy: number\n totalCommits: number\n url: string\n commits: Array<{ sha: string, message: string, author?: string, authorLogin?: string }>\n files?: Array<{\n filename: string\n status: string\n additions: number\n deletions: number\n patch?: string\n }>\n}\n\nexport function compareCommitsToModelOutput({ output }: ToModelOutputOptions) {\n const comparison = output as CompareCommitsOutput\n const { files, filesOmitted } = capDiffFiles(comparison.files)\n return {\n type: 'json' as const,\n value: {\n ...comparison,\n files,\n ...filesOmitted > 0 ? { filesOmitted } : {},\n },\n }\n}\n\nexport function getFileContentToModelOutput({ output }: ToModelOutputOptions) {\n const result = output as GetFileContentOutput\n if (result.type === 'directory' && 'entries' in result && result.entries.length > MAX_MODEL_TREE_ENTRIES) {\n return {\n type: 'json' as const,\n value: {\n ...result,\n truncated: true,\n entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),\n entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES,\n },\n }\n }\n if ('content' in result && result.content.length > MAX_CONTENT_LENGTH) {\n return {\n type: 'json' as const,\n value: {\n ...result,\n content: truncateText(result.content, MAX_CONTENT_LENGTH),\n },\n }\n }\n return { type: 'json' as const, value: result }\n}\n\ntype GetRepositoryTreeOutput = {\n sha: string\n truncated: boolean\n path?: string\n entries: Array<{ path?: string, type?: string, size?: number, sha?: string }>\n}\n\nexport function getRepositoryTreeToModelOutput({ output }: ToModelOutputOptions) {\n const result = output as GetRepositoryTreeOutput\n if (result.entries.length <= MAX_MODEL_TREE_ENTRIES) {\n return { type: 'json' as const, value: result }\n }\n return {\n type: 'json' as const,\n value: {\n ...result,\n truncated: true,\n entries: result.entries.slice(0, MAX_MODEL_TREE_ENTRIES),\n entriesOmitted: result.entries.length - MAX_MODEL_TREE_ENTRIES,\n },\n }\n}\n\ntype GetPullRequestContextOutput = {\n pullRequest: {\n number: number\n title: string\n body: string | null\n state: string\n url: string\n author?: string\n branch: string\n headSha: string\n base: string\n draft?: boolean\n merged: boolean\n mergeable: boolean | null\n additions: number\n deletions: number\n changedFiles: number\n createdAt: string\n updatedAt: string\n mergedAt: string | null\n }\n files?: ListPullRequestFile[]\n filesHasMore?: boolean\n reviews?: Array<{\n id: number\n state: string\n body: string\n author?: string\n url: string\n submittedAt?: string | null\n }>\n checks?: {\n checkRuns: {\n totalCount: number\n checkRuns: Array<{\n id: number\n name: string\n status: string\n conclusion: string | null\n url: string | null\n startedAt: string | null\n completedAt: string | null\n }>\n }\n combinedStatus: {\n state: string\n totalCount: number\n statuses: Array<{\n context: string\n state: string\n description: string | null\n url: string | null\n }>\n }\n }\n}\n\nexport function getPullRequestContextToModelOutput({ output }: ToModelOutputOptions) {\n const result = output as GetPullRequestContextOutput\n const { files, filesOmitted } = capDiffFiles(result.files)\n return {\n type: 'json' as const,\n value: {\n ...result,\n files,\n ...filesOmitted > 0 ? { filesOmitted } : {},\n },\n }\n}\n","import * as ai from 'ai'\nimport type { Experimental_EvaluationModel, JSONValue, ModelMessage } from 'ai'\nimport { GITHUB_TOOL_CATALOG } from './catalog'\nimport { githubToolsErrors } from './errors'\nimport { PRESET_TOOLS } from './presets'\nimport { DEFAULT_EVALUATION_MODEL, RISK_QUESTION, INTENT_QUESTION, PRESET_PURPOSES, rankPresets, requiresApproval, type RoutablePreset } from './evaluation-policy'\nexport { DEFAULT_EVALUATION_MODEL, AUTO_APPROVAL_TOOLS } from './evaluation-policy'\nimport type { GithubWriteToolName } from './write-tools'\n\n/**\n * Tuning for `requireApproval: 'auto'` and `preset: 'auto'`. Every field is optional.\n */\nexport type GithubEvaluationOptions = {\n /**\n * Evaluation model for AI SDK `experimental_evaluate`: an AI Gateway ID or a model instance.\n * @default 'typesafe-ai/jev'\n */\n model?: Experimental_EvaluationModel\n /**\n * Highest risk an `'auto'` tool call can have and still run without approval, on a 0–2 scale\n * (0 negligible, 1 visible but reversible, 2 hard to undo).\n * @default 1\n */\n maxRisk?: number\n /**\n * Lowest probability that the latest user message asked for the call, for it to run without approval.\n * @default 0.6\n */\n minIntent?: number\n /**\n * Lowest probability for `preset: 'auto'` to select a preset. When no preset reaches it,\n * the single most likely preset is used.\n * @default 0.7\n */\n minPresetProbability?: number\n /**\n * Most presets `preset: 'auto'` combines in one call, keeping the most likely ones.\n * @default 2\n */\n maxPresets?: number\n}\n\nfunction loadEvaluate() {\n if (!('experimental_evaluate' in ai)) throw githubToolsErrors.EVALUATION_UNAVAILABLE()\n return ai.experimental_evaluate\n}\n\nfunction warnEvaluationFailed(model: Experimental_EvaluationModel, fallback: string, error: unknown) {\n const cause = error instanceof Error ? error : new Error(String(error))\n console.warn('[github-tools]', githubToolsErrors.EVALUATION_FAILED({\n model: typeof model === 'string' ? model : model.modelId,\n fallback,\n detail: cause.message,\n cause,\n }))\n}\n\n/**\n * Whether an `'auto'` write tool call needs human approval: `false` only when the model\n * rates it low-risk and asked for by the latest user message. When the evaluation call\n * fails, logs `EVALUATION_FAILED` and asks for approval.\n */\nexport async function needsAutoApproval(\n toolName: GithubWriteToolName,\n input: unknown,\n messages: readonly ModelMessage[],\n { model = DEFAULT_EVALUATION_MODEL, maxRisk = 1, minIntent = 0.6 }: GithubEvaluationOptions = {},\n): Promise<boolean> {\n const evaluate = loadEvaluate()\n const result = await evaluate({\n model,\n state: {\n request: latestUserText(messages),\n toolCall: {\n tool: toolName,\n description: GITHUB_TOOL_CATALOG[toolName].description,\n input: input as JSONValue,\n },\n },\n questions: {\n risk: { type: 'score', ...RISK_QUESTION },\n intent: { type: 'boolean', ...INTENT_QUESTION },\n },\n }).catch((error: unknown) => {\n warnEvaluationFailed(model, `asking approval for ${toolName}`, error)\n return undefined\n })\n if (!result) return true\n const { answers } = result\n return requiresApproval(answers.risk.score, answers.intent.probability, { maxRisk, minIntent })\n}\n\n/**\n * Presets the latest user message needs, from one evaluation call with an independent\n * yes/no question per preset. Returns up to `maxPresets` presets at or above\n * `minPresetProbability`, most likely first; when none qualifies, the single most likely preset.\n * `repo-explorer` is only returned when no other preset qualifies.\n * When the evaluation call fails, logs `EVALUATION_FAILED` and returns read-only `repo-explorer`.\n * Never returns `maintainer`, so the full catalog is never exposed.\n */\nexport async function selectPresets(\n messages: readonly ModelMessage[],\n { model = DEFAULT_EVALUATION_MODEL, minPresetProbability = 0.7, maxPresets = 2 }: GithubEvaluationOptions = {},\n): Promise<RoutablePreset[]> {\n const evaluate = loadEvaluate()\n const presets = Object.keys(PRESET_PURPOSES) as RoutablePreset[]\n const result = await evaluate({\n model,\n state: { request: latestUserText(messages) },\n questions: Object.fromEntries(presets.map(preset => [preset, {\n type: 'boolean' as const,\n instructions: 'Does handling this GitHub request need the tools of this preset?',\n criteria: { true: { purpose: PRESET_PURPOSES[preset], tools: [...PRESET_TOOLS[preset]] } },\n }])),\n }).catch((error: unknown) => {\n warnEvaluationFailed(model, 'using the repo-explorer preset', error)\n return undefined\n })\n if (!result) return ['repo-explorer']\n const { answers } = result\n return rankPresets(Object.fromEntries(presets.map(preset => [preset, answers[preset].probability])) as Record<RoutablePreset, number>, { minPresetProbability, maxPresets })\n}\n\nexport function latestUserText(messages: readonly ModelMessage[]): string {\n const message = messages.findLast(m => m.role === 'user')\n if (!message) return ''\n if (typeof message.content === 'string') return message.content\n return message.content.flatMap(part => part.type === 'text' ? [part.text] : []).join('\\n')\n}\n"],"mappings":";;;AAAA,MAAM,mBAAmB;AACzB,MAAM,qBAAqB;AAC3B,MAAM,yBAAyB;AAC/B,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AAC,QAAQ,QAAQ,OAAO,CAAC,WAAW,CAAC,CAAC,GAAqC;EAAE;EAAsB;CAAW,CAAC;AAC7K;AAEA,SAAgB,eAAe,UAA2C;CACxE,MAAM,UAAU,SAAS,UAAS,MAAK,EAAE,SAAS,MAAM;CACxD,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,QAAQ;CACxD,OAAO,QAAQ,QAAQ,SAAQ,SAAQ,KAAK,SAAS,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;AAC3F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eve-runtime-YTxfrWP-.mjs","names":[],"sources":["../src/eve/load-eve.ts","../src/eve/approval.ts","../src/eve/registry.ts","../src/eve/steps.ts","../src/eve/build.ts"],"sourcesContent":["import * as eveTools from 'eve/tools'\nimport * as eveApproval from 'eve/tools/approval'\n\n/**\n * Static ESM imports so bundlers (eve/Nitro/Vercel) can resolve `eve` when it is\n * compiled into the output rather than left as `node_modules/eve` at runtime.\n * Runtime `createRequire(\"eve/tools\")` fails in those targets.\n */\nexport type EveToolsModule = typeof import('eve/tools')\nexport type EveApprovalModule = typeof import('eve/tools/approval')\n\n/**\n * @deprecated Never thrown since eve moved to static ESM imports — a missing\n * `eve` package now fails at module resolution with the bundler/runtime's own\n * error. Kept only for backward compatibility of the public export; do not\n * match on it. Will be removed in the next major.\n */\nexport const MISSING_EVE_MESSAGE =\n 'The \"eve\" package is required to use @github-tools/sdk/eve. Install it with: pnpm add eve'\n\nexport function getEveTools(): EveToolsModule {\n return eveTools\n}\n\nexport function getEveApprovalHelpers(): EveApprovalModule {\n return eveApproval\n}\n","import type { Approval, ApprovalPolicy } from 'eve/tools/approval'\nimport type { GithubWriteToolName } from '../core/write-tools'\nimport { getEveApprovalHelpers } from './load-eve'\nimport type { EveApprovalConfig, EveApprovalValue } from './types'\n\n/**\n * `false` / `'never'` should omit the tool `approval` field entirely.\n * eve treats a missing `approval` like `never()`; attaching `never()` is\n * redundant and has caused approval UI noise on some channels.\n */\nexport function isEveApprovalDisabled(value: EveApprovalValue | undefined): boolean {\n return value === false || value === 'never'\n}\n\nexport function mapEveApprovalValue(value: EveApprovalValue): ApprovalPolicy {\n if (typeof value === 'function') return value\n // Object-shaped eve `ApprovalConfiguration` — the request-time policy lives on `request`.\n if (typeof value === 'object') return value.request\n\n const { always, never, once } = getEveApprovalHelpers()\n\n if (value === true || value === 'always') return always()\n if (value === false || value === 'never') return never()\n return once()\n}\n\nexport function resolveEveApproval(\n toolName: GithubWriteToolName,\n config: EveApprovalConfig | undefined,\n): ApprovalPolicy {\n if (config === undefined) return getEveApprovalHelpers().always()\n if (config === true) return getEveApprovalHelpers().always()\n if (config === false) return getEveApprovalHelpers().never()\n\n const value = config[toolName]\n if (value === undefined) return getEveApprovalHelpers().always()\n\n return mapEveApprovalValue(value)\n}\n\n/**\n * Approval to attach on a write tool, or `undefined` to omit the field.\n * Prefer this when building `defineTool` values so `false` / `'never'` do not\n * attach a redundant `never()` handler.\n */\nexport function resolveEveToolApproval(\n toolName: GithubWriteToolName,\n config: EveApprovalConfig | undefined,\n override?: EveApprovalValue,\n): Approval | undefined {\n const value = override !== undefined\n ? override\n : typeof config === 'object' && config !== null\n ? config[toolName]\n : config\n\n if (value === undefined) return getEveApprovalHelpers().always()\n if (isEveApprovalDisabled(value)) return undefined\n // Pass policies and `ApprovalConfiguration` objects through unchanged so a\n // response-time authorizer (`response`) survives onto `defineTool`.\n if (typeof value === 'function' || typeof value === 'object') return value\n return mapEveApprovalValue(value)\n}\n","import type { ToolModelOutput } from 'eve/tools'\nimport type { z } from 'zod'\nimport type { CommitIdentity } from '../types'\nimport { GITHUB_TOOL_CATALOG, isGithubWriteToolName } from '../core/catalog'\nimport { GITHUB_TOOL_CORES } from '../core/cores'\nimport { mergeContextArgs, softenContextSchema, type GithubToolsContext } from '../core/context'\nimport {\n compareCommitsToModelOutput,\n getCommitToModelOutput,\n getFileContentToModelOutput,\n getPullRequestContextToModelOutput,\n getRepositoryTreeToModelOutput,\n listPullRequestFilesToModelOutput,\n} from '../core/model-output'\nimport { stripRateLimit } from '../core/rate-limit'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { GithubWriteToolName } from '../core/write-tools'\nimport { ALL_GITHUB_TOOL_NAMES, type GithubToolName } from '../core/tool-names'\nexport type { GithubToolName } from '../core/tool-names'\nexport { ALL_GITHUB_TOOL_NAMES } from '../core/tool-names'\n\nexport type ToolBuildContext = {\n token: GithubTokenInput\n context?: GithubToolsContext\n author?: CommitIdentity\n committer?: CommitIdentity\n coAuthors?: CommitIdentity[]\n}\n\ntype ToolRegistryEntry = {\n name: GithubToolName\n writeTool?: GithubWriteToolName\n description: string\n inputSchema: z.ZodType\n execute: (args: Record<string, unknown>) => Promise<unknown>\n toModelOutput?: (output: unknown) => ToolModelOutput\n}\n\nfunction withToken<T extends Record<string, unknown>>(\n core: (args: T & { token: string }) => Promise<unknown>,\n ctx: ToolBuildContext,\n extra?: Record<string, unknown>,\n) {\n return async (input: Record<string, unknown>) =>\n core({\n token: await resolveGithubToken(ctx.token),\n ...extra,\n ...mergeContextArgs(input, ctx.context ?? {}),\n } as T & { token: string })\n}\n\nfunction modelOutputAdapter(\n fn: (options: { toolCallId: string, input: unknown, output: unknown }) => { type: 'json' | 'text', value: unknown },\n) {\n return (output: unknown) => fn({ toolCallId: '', input: {}, output }) as ToolModelOutput\n}\n\nconst GITHUB_EVE_TOOL_MODEL_OUTPUT = {\n getFileContent: modelOutputAdapter(getFileContentToModelOutput),\n getRepositoryTree: modelOutputAdapter(getRepositoryTreeToModelOutput),\n listPullRequestFiles: modelOutputAdapter(listPullRequestFilesToModelOutput),\n getPullRequestContext: modelOutputAdapter(getPullRequestContextToModelOutput),\n getCommit: modelOutputAdapter(getCommitToModelOutput),\n compareCommits: modelOutputAdapter(compareCommitsToModelOutput),\n} satisfies Partial<Record<GithubToolName, (output: unknown) => ToolModelOutput>>\n\nconst EVE_TOOL_MODEL_OUTPUTS: Partial<Record<GithubToolName, (output: unknown) => ToolModelOutput>> = GITHUB_EVE_TOOL_MODEL_OUTPUT\n\n/** Whether a GitHub tool has a built-in eve `toModelOutput` projection. */\nexport function hasGithubEveToolModelOutput(name: GithubToolName): boolean {\n return Object.hasOwn(GITHUB_EVE_TOOL_MODEL_OUTPUT, name)\n}\n\n/**\n * Apply the built-in eve `toModelOutput` projection for a tool.\n * Strips `rateLimit` so it never reaches the model. Tools without a dedicated\n * formatter get `{ type: 'json', value }` of the remaining payload.\n * Used by `@github-tools/eve-extension` so the callback only closes over a serializable tool name.\n */\nexport function formatGithubEveToolOutput(name: GithubToolName, output: unknown): ToolModelOutput {\n const stripped = stripRateLimit(output)\n // `runGithubToolStep` returns `{ error }` when execute throws. The per-tool\n // formatters assume the success shape (e.g. `listPullRequestFilesToModelOutput`\n // calls `.map` on the payload), so dispatching an error payload would throw a\n // second time inside model-output formatting and re-break the tool loop.\n if (isErrorPayload(stripped)) {\n return { type: 'json', value: stripped }\n }\n const format = GITHUB_EVE_TOOL_MODEL_OUTPUT[name as keyof typeof GITHUB_EVE_TOOL_MODEL_OUTPUT]\n if (!format) {\n return { type: 'json', value: stripped }\n }\n return format(stripped)\n}\n\nfunction isErrorPayload(output: unknown): output is { error: string | Record<string, string> } {\n if (output == null || typeof output !== 'object' || Array.isArray(output)) return false\n const { error } = output as { error?: unknown }\n return typeof error === 'string' || (error != null && typeof error === 'object')\n}\n\nexport function createToolRegistry(\n ctx: ToolBuildContext,\n names: readonly GithubToolName[] = ALL_GITHUB_TOOL_NAMES,\n): ToolRegistryEntry[] {\n // Commit-identity options are session-level, not model inputs, so they ride\n // alongside the token instead of living in the tool's input schema.\n const commitExtras: Partial<Record<GithubToolName, Record<string, unknown>>> = {\n createOrUpdateFile: { author: ctx.author, committer: ctx.committer, coAuthors: ctx.coAuthors },\n mergePullRequest: { coAuthors: ctx.coAuthors },\n }\n\n const entries = names.map((name): ToolRegistryEntry => {\n const descriptor = GITHUB_TOOL_CATALOG[name]\n // Argument types vary per tool; `withToken` re-narrows at the dispatch boundary.\n const core = GITHUB_TOOL_CORES[name] as (args: Record<string, unknown> & { token: string }) => Promise<unknown>\n const toModelOutput = EVE_TOOL_MODEL_OUTPUTS[name]\n return {\n name,\n ...(isGithubWriteToolName(name) && { writeTool: name }),\n description: descriptor.description,\n inputSchema: descriptor.inputSchema,\n execute: withToken(core, ctx, commitExtras[name]),\n ...(toModelOutput && { toModelOutput }),\n }\n })\n\n if (!ctx.context) return entries\n\n return entries.map(entry => ({\n ...entry,\n inputSchema: softenContextSchema(entry.inputSchema, ctx.context!),\n }))\n}\n","import { mergeContextArgs } from '../core/context'\nimport { EvlogError, toModelErrorPayload } from '../core/errors'\nimport { githubTokenCall, resolveGithubToken } from '../core/token'\nimport { createToolRegistry, type GithubToolName, type ToolBuildContext } from './registry'\n\nasync function executeGithubToolStep(\n name: GithubToolName,\n input: Record<string, unknown>,\n ctx: ToolBuildContext,\n) {\n 'use step'\n const entry = createToolRegistry(ctx).find(tool => tool.name === name)\n if (!entry) {\n throw new Error(`Unknown GitHub tool: ${name}`)\n }\n return entry.execute(input)\n}\n\nexport async function runGithubToolStep(\n name: GithubToolName,\n input: Record<string, unknown>,\n ctx: ToolBuildContext,\n) {\n try {\n // Resolve the token before entering the step so only a serializable string crosses the boundary.\n const call = githubTokenCall(name, mergeContextArgs(input, ctx.context ?? {}))\n const token = await resolveGithubToken(ctx.token, call)\n return await executeGithubToolStep(name, input, { ...ctx, token })\n } catch (error) {\n // Eve's tool-loop logs thrown execute errors but does not always append a\n // tool_result. Returning a payload keeps the Anthropic tool_use/tool_result pairing intact.\n // Catalog errors keep their { code, why, fix, link } structure so the model can recover.\n if (EvlogError.isEvlogError(error)) {\n return { error: toModelErrorPayload(error) }\n }\n return { error: error instanceof Error ? error.message : String(error) }\n }\n}\n","import type { ToolDefinition } from 'eve/tools'\nimport { resolvePresetTools, type CombinedPresetToolNames, type GithubToolPreset, type PresetToolName } from '../core/presets'\nimport { createGithubTokenResolver } from '../core/token'\nimport { isEveApprovalDisabled, mapEveApprovalValue, resolveEveToolApproval } from './approval'\nimport { getEveTools } from './load-eve'\nimport { ALL_GITHUB_TOOL_NAMES, createToolRegistry, formatGithubEveToolOutput, hasGithubEveToolModelOutput, type GithubToolName, type ToolBuildContext } from './registry'\nimport { runGithubToolStep } from './steps'\nimport type { EveGithubToolsOptions, EveToolFactoryOptions, EveToolOverrides } from './types'\n\ntype BuildOptions = EveGithubToolsOptions | (EveToolFactoryOptions & { preset?: EveGithubToolsOptions['preset'] })\ntype EveToolMap = Partial<Record<GithubToolName, ToolDefinition>>\n\nfunction resolveAllowedToolNames(\n options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>,\n): (name: GithubToolName) => boolean {\n const presetAllowed = options.preset ? resolvePresetTools(options.preset) : null\n const includeAllowed = options.include ? new Set(options.include) : null\n const excluded = options.exclude ? new Set(options.exclude) : null\n\n // `preset` and `include` compose as a union (add tools a preset is missing);\n // `exclude` always subtracts from that combined set afterward.\n const allowed = presetAllowed && includeAllowed\n ? new Set([...presetAllowed, ...includeAllowed])\n : presetAllowed ?? includeAllowed\n\n return name => (!allowed || allowed.has(name)) && !excluded?.has(name)\n}\n\nfunction applyOverrides<T extends ToolDefinition>(\n tool: T,\n name: GithubToolName,\n overrides?: EveToolOverrides,\n): T {\n const override = overrides?.[name]\n if (!override) return tool\n\n const next: T = {\n ...tool,\n ...override.description !== undefined && { description: override.description },\n ...override.toModelOutput !== undefined && { toModelOutput: override.toModelOutput },\n ...override.outputSchema !== undefined && { outputSchema: override.outputSchema },\n }\n\n if (override.approval === undefined) return next\n if (isEveApprovalDisabled(override.approval)) {\n const rest = { ...next }\n delete (rest as { approval?: unknown }).approval\n return rest\n }\n // Preserve policies and `ApprovalConfiguration` objects as-is; only literals need mapping.\n const approval = typeof override.approval === 'function' || typeof override.approval === 'object'\n ? override.approval\n : mapEveApprovalValue(override.approval)\n return { ...next, approval }\n}\n\nexport function buildEveToolDefinition(\n name: GithubToolName,\n options: BuildOptions = {},\n): ToolDefinition {\n const { defineTool } = getEveTools()\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n }\n\n const entry = createToolRegistry(ctx).find(tool => tool.name === name)\n if (!entry) {\n throw new Error(`Unknown GitHub tool: ${name}`)\n }\n\n const approval = entry.writeTool\n ? resolveEveToolApproval(entry.writeTool, options.requireApproval)\n : undefined\n\n // Annotated so defineTool resolves to its ToolDefinition overload — inference\n // from the bare literal picks the background-tool overload on eve 0.45+.\n const definition: ToolDefinition = {\n description: entry.description,\n inputSchema: entry.inputSchema,\n ...(approval && { approval }),\n toModelOutput: (output: unknown) => formatGithubEveToolOutput(name, output),\n execute: async (input) => runGithubToolStep(name, input as Record<string, unknown>, ctx),\n }\n\n return applyOverrides(defineTool(definition), name, options.overrides)\n}\n\nexport function buildEveToolMap(options: EveGithubToolsOptions = {}): EveToolMap {\n const { defineTool } = getEveTools()\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n }\n\n const isAllowed = resolveAllowedToolNames(options)\n const registry = createToolRegistry(ctx)\n const tools = {} as EveToolMap\n\n for (const entry of registry) {\n if (!isAllowed(entry.name)) continue\n\n const approval = entry.writeTool\n ? resolveEveToolApproval(entry.writeTool, options.requireApproval)\n : undefined\n\n const definition: ToolDefinition = {\n description: entry.description,\n inputSchema: entry.inputSchema,\n ...(approval && { approval }),\n toModelOutput: (output: unknown) => formatGithubEveToolOutput(entry.name, output),\n execute: async (input) => runGithubToolStep(entry.name, input as Record<string, unknown>, ctx),\n }\n\n tools[entry.name] = applyOverrides(defineTool(definition), entry.name, options.overrides)\n }\n\n return tools\n}\n\nexport function createEveGithubToolsDynamic(options: EveGithubToolsOptions = {}) {\n const { defineDynamic } = getEveTools()\n\n // TODO(eve-auth): resolve token from ctx.getToken('github') when eve-managed auth lands.\n // Deferred — eve does not yet expose managed GitHub tokens on the session context.\n return defineDynamic(() => buildEveToolMap(options))\n}\n\nexport function listResolvedEveToolNames(options?: { preset?: undefined, include?: undefined, exclude?: undefined }): GithubToolName[]\nexport function listResolvedEveToolNames<P extends GithubToolPreset>(options: { preset: P, include?: undefined, exclude?: undefined }): PresetToolName<P>[]\nexport function listResolvedEveToolNames<P extends readonly GithubToolPreset[]>(options: { preset: P, include?: undefined, exclude?: undefined }): CombinedPresetToolNames<P>[]\nexport function listResolvedEveToolNames(options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>): GithubToolName[]\nexport function listResolvedEveToolNames(options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'> = {}): GithubToolName[] {\n const isAllowed = resolveAllowedToolNames(options)\n return ALL_GITHUB_TOOL_NAMES.filter(isAllowed)\n}\n\n/**\n * Tool descriptors (no `execute`) for authored eve `defineTool` loops.\n * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.\n */\nexport function listEveToolDescriptors(options: EveGithubToolsOptions = {}) {\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n }\n\n const names = listResolvedEveToolNames(options)\n return createToolRegistry(ctx, names)\n .map(entry => ({\n name: entry.name,\n description: entry.description,\n inputSchema: entry.inputSchema,\n writeTool: entry.writeTool,\n toModelOutput: entry.toModelOutput,\n }))\n}\n\nexport { formatGithubEveToolOutput, hasGithubEveToolModelOutput }\n\n/**\n * Execute a GitHub tool by name with the given eve options (token/context/attribution).\n * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.\n */\nexport async function executeGithubEveTool(\n name: GithubToolName,\n input: Record<string, unknown>,\n options: EveGithubToolsOptions = {},\n) {\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n }\n return runGithubToolStep(name, input, ctx)\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,sBACX;AAEF,SAAgB,cAA8B;CAC5C,OAAO;AACT;AAEA,SAAgB,wBAA2C;CACzD,OAAO;AACT;;;;;;;;AChBA,SAAgB,sBAAsB,OAA8C;CAClF,OAAO,UAAU,SAAS,UAAU;AACtC;AAEA,SAAgB,oBAAoB,OAAyC;CAC3E,IAAI,OAAO,UAAU,YAAY,OAAO;CAExC,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM;CAE5C,MAAM,EAAE,QAAQ,OAAO,SAAS,sBAAsB;CAEtD,IAAI,UAAU,QAAQ,UAAU,UAAU,OAAO,OAAO;CACxD,IAAI,UAAU,SAAS,UAAU,SAAS,OAAO,MAAM;CACvD,OAAO,KAAK;AACd;AAEA,SAAgB,mBACd,UACA,QACgB;CAChB,IAAI,WAAW,KAAA,GAAW,OAAO,sBAAsB,CAAC,CAAC,OAAO;CAChE,IAAI,WAAW,MAAM,OAAO,sBAAsB,CAAC,CAAC,OAAO;CAC3D,IAAI,WAAW,OAAO,OAAO,sBAAsB,CAAC,CAAC,MAAM;CAE3D,MAAM,QAAQ,OAAO;CACrB,IAAI,UAAU,KAAA,GAAW,OAAO,sBAAsB,CAAC,CAAC,OAAO;CAE/D,OAAO,oBAAoB,KAAK;AAClC;;;;;;AAOA,SAAgB,uBACd,UACA,QACA,UACsB;CACtB,MAAM,QAAQ,aAAa,KAAA,IACvB,WACA,OAAO,WAAW,YAAY,WAAW,OACvC,OAAO,YACP;CAEN,IAAI,UAAU,KAAA,GAAW,OAAO,sBAAsB,CAAC,CAAC,OAAO;CAC/D,IAAI,sBAAsB,KAAK,GAAG,OAAO,KAAA;CAGzC,IAAI,OAAO,UAAU,cAAc,OAAO,UAAU,UAAU,OAAO;CACrE,OAAO,oBAAoB,KAAK;AAClC;;;ACxBA,SAAS,UACP,MACA,K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sB,OAAO,SAAS;AAC/C;;;;;AAMA,SAAgB,uBAAuB,UAAiC,CAAC,GAAG;CAU1E,OAAO,mBAAmB;EARxB,OAAO,0BAA0B,QAAQ,KAAK;EAC9C,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACnB,WAAW,QAAQ;CAIK,GADZ,yBAAyB,OACR,CAAK,CAAC,CAClC,KAAI,WAAU;EACb,MAAM,MAAM;EACZ,aAAa,MAAM;EACnB,aAAa,MAAM;EACnB,WAAW,MAAM;EACjB,eAAe,MAAM;CACvB,EAAE;AACN;;;;;AAQA,eAAsB,qBACpB,MACA,OACA,UAAiC,CAAC,GAClC;CAQA,OAAO,kBAAkB,MAAM,OAAO;EANpC,OAAO,0BAA0B,QAAQ,KAAK;EAC9C,SAAS,QAAQ;EACjB,QAAQ,QAAQ;EAChB,WAAW,QAAQ;EACnB,WAAW,QAAQ;CAEiB,CAAG;AAC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-DkZvveZP.d.mts","names":[],"sources":["../src/client.ts","../src/core/pagination.ts","../src/core/repository.ts","../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/reactions.ts","../src/tools/discussions.ts","../src/tools/notifications.ts","../src/tools/search.ts","../src/tools/commits.ts","../src/tools/gists.ts","../src/tools/workflows.ts","../src/tools/checks.ts","../src/tools/releases.ts","../src/tools/bundles.ts","../src/core/rate-limit.ts","../src/core/errors.ts","../src/agents.ts","../src/index.ts"],"mappings":";;;;;;;iBAiBgB,cAAc,gBAAgB;;;KCTlC;EACV;EACA;EACA;EACA;;KAGU,UAAU;EAAO,OAAO;IAAQ;;;;iBCKtB,qBAAqB,SAAS,WAAS;EAC3D;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;IAAQ;IAAc;;EAClC,YAAY;IAAQ;;IAClB;EAAU;EAAmB;;iBAsBjB,qBACd,iBACA,YAAY;cASD,0BAAwB,EAAA;;;GAG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;;;;;;;;;;;;;;;aAwBR,YAAA,OAAA,UAAA;MAAE;MAAe;MAAkB;;;;;;;;aAQpD,YAAA;MAAE;;;;;;;;aAOF,YAAA;MAAE;;;;;;;;aAOF,YAAA;MAAE;;;;;;;;aAOF,YAAA;MAAE;;;;;;;;aAOF,YAAA;MAAE;;;;;;;;YAQhB;IACR,qBAAqB;;;;;KCvGpB,eAAe,KAAK,sBAAsB;KAEnC,2BAA2B,eAAe;EACpD,OAAO,sBAAsB;;;;;;;;;;;;;;;EAe7B,SAAS,mBAAmB;;;;;;EAM5B;;;;;EAKA;;iBAGc,kBAAkB,SAAS;EAA6B;IAAgC,qBAAqB;iBAC7G,kBAAkB,UAAU,kBAC1C,SAAS;EAA6B,QAAQ;IAC7C,qBAAqB,KAAK,gBAAgB,eAAe;iBAC5C,kBAAkB,mBAAmB,oBACnD,SAAS;EAA6B,QAAQ;IAC7C,qBAAqB,KAAK,gBAAgB,wBAAwB;;;KCZzD,qBAAqB;;;;;;;;;;;;;;;;;;;EAmB/B,SAAS,mBAAmB;;iBAGd,kBAAkB,UAAU;EAA2B;IAAuB;iBAC9E,kBAAkB,UAAU,kBAC1C,SAAS;EAA2B,QAAQ;IAC3C,KAAK,gBAAgB,eAAe;iBACvB,kBAAkB,mBAAmB,oBACnD,SAAS;EAA2B,QAAQ;IAC3C,KAAK,gBAAgB,wBAAwB;iBAChC,kBAAkB,UAAU,qBAAqB,iBAAiB,KAAK,gBAAgB;KAmL3F,cAAc,iBAAiB"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { i as formatContextInstructions, s as AUTO_APPROVAL_TOOLS } from "./write-tools-BaoTUCg7.mjs";
|
|
2
|
-
//#region src/core/approval-policy.ts
|
|
3
|
-
const autoApprovalTools = new Set(AUTO_APPROVAL_TOOLS);
|
|
4
|
-
/**
|
|
5
|
-
* Resolve a write tool's approval mode from global or per-tool config.
|
|
6
|
-
*
|
|
7
|
-
* @returns `'auto'` only for tools that opt into evaluation; defaults to `true` for unspecified tools in object mode.
|
|
8
|
-
*/
|
|
9
|
-
function resolveApprovalMode(toolName, config) {
|
|
10
|
-
if (config === "auto") return autoApprovalTools.has(toolName) ? "auto" : true;
|
|
11
|
-
if (typeof config === "boolean") return config;
|
|
12
|
-
return config[toolName] ?? true;
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/core/instructions.ts
|
|
16
|
-
const SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.
|
|
17
|
-
Call independent read tools in the same step when you already know the arguments — never serialize reads that could run in parallel.
|
|
18
|
-
Bodies default to detail summary; patches default to includePatch false; prefer getFileContent with startLine/endLine or maxLines for large files.
|
|
19
|
-
Paged lists return { items, hasMore, page, nextPage }. When hasMore, call with nextPage or raise maxPages — never the same page. Prefer path/author/since/until on listCommits instead of walking history. Prefer a path prefix on getRepositoryTree over recursive true.`;
|
|
20
|
-
const DEFAULT_INSTRUCTIONS = `You are a helpful GitHub assistant. You can read and explore repositories, issues, pull requests, discussions, commits, code, gists, and workflows. You can also create issues, pull requests, comments, gists, reactions, trigger workflows, and update files when asked.
|
|
21
|
-
|
|
22
|
-
Prefer getPullRequestContext, getIssueContext, getReleaseContext, or getCiFailureContext for multi-part reads instead of chaining separate tools.
|
|
23
|
-
|
|
24
|
-
${SHARED_RULES}`;
|
|
25
|
-
const PRESET_INSTRUCTIONS = {
|
|
26
|
-
"code-review": `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.
|
|
27
|
-
|
|
28
|
-
When reviewing a PR:
|
|
29
|
-
- Start with getPullRequestContext (set includeChecks true when CI matters)
|
|
30
|
-
- Then listPullRequestFiles with includePatch true and filenames for only the files you need — in the same step as any getFileContent / getBlame calls when possible
|
|
31
|
-
- Use getBlame then getCommit(includePatch true) only when line history matters
|
|
32
|
-
- Check for bugs, logic errors, and edge cases; be constructive
|
|
33
|
-
- Use createPullRequestReview for formal reviews when asked
|
|
34
|
-
- Use listPullRequestReviewThreads (unresolved by default) to see open feedback; replyToReviewComment to answer in a thread and resolveReviewThread once it is addressed
|
|
35
|
-
- Use updatePullRequest to change title, body, base branch, or draft status; addPullRequestComment / updatePullRequestComment / deletePullRequestComment to manage comments
|
|
36
|
-
|
|
37
|
-
${SHARED_RULES}`,
|
|
38
|
-
"issue-triage": `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.
|
|
39
|
-
|
|
40
|
-
When triaging issues:
|
|
41
|
-
- Call getIssueContext exactly once (full body + labelNames + recent comments). In that same step, call listIssues or searchIssues if you need duplicate checks
|
|
42
|
-
- Never re-call getIssueContext for the same issue
|
|
43
|
-
- Use listIssueComments to paginate beyond the comments returned by getIssueContext
|
|
44
|
-
- Pick labels from labelNames; use addLabels / removeLabel to apply them. Use createLabel / updateLabel / deleteLabel when the repository taxonomy itself needs changing
|
|
45
|
-
- Create issues with clear titles and descriptions when asked
|
|
46
|
-
- Use updateIssue to edit title, body, labels, milestone, or assignees, and to reopen a closed issue (state: 'open') — there is no separate reopen tool
|
|
47
|
-
- Use updateIssueComment / deleteIssueComment to correct or remove existing comments
|
|
48
|
-
- Acknowledge a report or a comment with addIssueReaction / addCommentReaction instead of posting a comment that says nothing new
|
|
49
|
-
|
|
50
|
-
${SHARED_RULES}`,
|
|
51
|
-
"ci-ops": `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.
|
|
52
|
-
|
|
53
|
-
When working with workflows:
|
|
54
|
-
- Prefer getCiFailureContext first when diagnosing a failing ref
|
|
55
|
-
- Read the failing job's output with getWorkflowJobLogs (the default 200-line tail is usually enough; raise maxLines only when the error is higher up)
|
|
56
|
-
- Use listCheckRuns / getCombinedStatus for narrower follow-ups
|
|
57
|
-
- Inspect job steps to find the failing step; confirm before cancel/re-run
|
|
58
|
-
- Trigger workflow_dispatch with the correct inputs and branch when asked
|
|
59
|
-
|
|
60
|
-
${SHARED_RULES}`,
|
|
61
|
-
"security-audit": `You are a security audit assistant. Your job is to review repositories for security risks and report findings clearly — you never make destructive changes.
|
|
62
|
-
|
|
63
|
-
When auditing a repository:
|
|
64
|
-
- Use searchCode for secrets and unsafe patterns; getBlame / listCommits to trace introductions
|
|
65
|
-
- Use searchIssues to check for prior reports of the same vulnerability before filing a duplicate
|
|
66
|
-
- Prefer getCiFailureContext or getPullRequestContext for CI / PR context
|
|
67
|
-
- Use compareCommits to scope changes (includePatch only when you need diffs)
|
|
68
|
-
- Report findings as issues with reproduction, impact, and severity
|
|
69
|
-
- Read-only plus createIssue / addIssueComment / addLabels — never assume you can fix code directly
|
|
70
|
-
|
|
71
|
-
${SHARED_RULES}`,
|
|
72
|
-
"repo-explorer": `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.
|
|
73
|
-
|
|
74
|
-
When exploring repos:
|
|
75
|
-
- Answer questions about structure and organization; find files and patterns with searchCode / getFileContent
|
|
76
|
-
- Use searchIssues to find issues or pull requests by qualifier across a repository or organization
|
|
77
|
-
- Use listDiscussions / getDiscussion for questions answered in the repository's discussions rather than its issues
|
|
78
|
-
- Prefer getPullRequestContext or getCiFailureContext when summarizing a PR or failing CI
|
|
79
|
-
- Use getBlame for line ownership; summarize recent commits / PRs / issues when asked
|
|
80
|
-
- Read-only — you cannot make changes
|
|
81
|
-
|
|
82
|
-
${SHARED_RULES}`,
|
|
83
|
-
"release-manager": `You are a release management assistant. Your job is to help prepare and publish GitHub releases.
|
|
84
|
-
|
|
85
|
-
When preparing a release:
|
|
86
|
-
- Prefer getReleaseContext first (current/latest release, previous release, tag compare)
|
|
87
|
-
- Use compareCommits / listCommits for more changelog detail; getCiFailureContext before cutting
|
|
88
|
-
- createRelease with generateReleaseNotes when there is no manual changelog
|
|
89
|
-
- Double-check the target branch or SHA — releases and tags are hard to undo
|
|
90
|
-
- Use updateRelease to fix notes or toggle draft/prerelease after publishing; deleteRelease only when explicitly asked — it does not delete the underlying tag
|
|
91
|
-
|
|
92
|
-
${SHARED_RULES}`,
|
|
93
|
-
"discussion-moderator": `You are a discussion moderator. Your job is to answer and guide repository Discussions clearly and on-topic.
|
|
94
|
-
|
|
95
|
-
When working in discussions:
|
|
96
|
-
- Use listDiscussions / getDiscussion to load the thread before replying
|
|
97
|
-
- Prefer addDiscussionComment for answers that belong in Discussions
|
|
98
|
-
- Use searchIssues / getIssueContext when the question overlaps an existing issue; addIssueComment only when the follow-up belongs on that issue
|
|
99
|
-
- Keep replies concise and point to docs or code when helpful
|
|
100
|
-
|
|
101
|
-
${SHARED_RULES}`,
|
|
102
|
-
"notification-inbox": `You are a notification inbox assistant. Your job is to help triage GitHub notification threads for the authenticated user.
|
|
103
|
-
|
|
104
|
-
When clearing the inbox:
|
|
105
|
-
- Use listNotifications to see unread threads (set all true only when asked)
|
|
106
|
-
- Open the related getIssue or getPullRequest when you need context before acting
|
|
107
|
-
- Use markNotificationRead once a thread is handled or is noise
|
|
108
|
-
- These tools need a user PAT with Notifications access — say so if calls fail for that reason
|
|
109
|
-
|
|
110
|
-
${SHARED_RULES}`,
|
|
111
|
-
"pr-author": `You are a pull request authoring assistant. Your job is to prepare branches, edit files, and open focused PRs.
|
|
112
|
-
|
|
113
|
-
When opening a PR:
|
|
114
|
-
- Inspect the repo with getRepository / listBranches / getFileContent before editing
|
|
115
|
-
- createBranch from a sensible base, then createOrUpdateFile for the change set
|
|
116
|
-
- createPullRequest with a clear title and body; updatePullRequest if the draft or description needs a fix
|
|
117
|
-
- Use listPullRequestFiles / compareCommits / getCommit to verify what will land
|
|
118
|
-
- Address review feedback: listPullRequestReviewThreads for open threads, replyToReviewComment to answer, resolveReviewThread once fixed
|
|
119
|
-
- Use deleteBranch to clean up a merged or abandoned branch when asked
|
|
120
|
-
- Stay scoped to authoring — you do not review, merge, or manage issues
|
|
121
|
-
|
|
122
|
-
${SHARED_RULES}`,
|
|
123
|
-
"maintainer": `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, discussions, notifications, gists, and workflows.
|
|
124
|
-
|
|
125
|
-
When maintaining repos:
|
|
126
|
-
- Prefer getPullRequestContext or getCiFailureContext for multi-part reads
|
|
127
|
-
- Be careful with writes — review before acting
|
|
128
|
-
- Keep issues, PRs, and commits clear and well-structured
|
|
129
|
-
- Use listNotifications to find what needs attention, then markNotificationRead once a thread is handled
|
|
130
|
-
- Acknowledge a thread with addIssueReaction / addCommentReaction instead of a comment that adds nothing
|
|
131
|
-
- Answer questions in discussions with addDiscussionComment
|
|
132
|
-
|
|
133
|
-
${SHARED_RULES}`
|
|
134
|
-
};
|
|
135
|
-
function resolveInstructions(options) {
|
|
136
|
-
const defaultPrompt = options.preset && !Array.isArray(options.preset) ? PRESET_INSTRUCTIONS[options.preset] : DEFAULT_INSTRUCTIONS;
|
|
137
|
-
let prompt;
|
|
138
|
-
if (options.instructions) prompt = options.instructions;
|
|
139
|
-
else if (options.additionalInstructions) prompt = `${defaultPrompt}\n\n${options.additionalInstructions}`;
|
|
140
|
-
else prompt = defaultPrompt;
|
|
141
|
-
const contextBlock = options.context ? formatContextInstructions(options.context) : "";
|
|
142
|
-
if (contextBlock) return `${prompt}\n\n${contextBlock}`;
|
|
143
|
-
return prompt;
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
|
-
export { resolveApprovalMode as n, resolveInstructions as t };
|
|
147
|
-
|
|
148
|
-
//# sourceMappingURL=instructions-BuypoY0x.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instructions-BuypoY0x.mjs","names":[],"sources":["../src/core/approval-policy.ts","../src/core/instructions.ts"],"sourcesContent":["import { AUTO_APPROVAL_TOOLS } from './evaluation-policy'\nimport type { GithubWriteToolName } from './write-tools'\n\n/**\n * Approval for a single write tool.\n *\n * - `true` — always ask the user\n * - `false` — never ask\n * - `'auto'` — ask only when an evaluation model (Jev by default) rates the call risky\n * or not asked for by the latest user message. AI SDK evaluation needs `ai` 7.0.105 or later.\n */\nexport type ToolApprovalMode = boolean | 'auto'\n\n/**\n * Whether write operations require user approval.\n *\n * - `true` — all write tools need approval (default)\n * - `false` — no approval needed for any write tool\n * - `'auto'` — low-risk write tools ({@link AUTO_APPROVAL_TOOLS}) are evaluated per call;\n * every other write tool needs approval\n * - object — per-tool {@link ToolApprovalMode} via {@link GithubWriteToolName}; unspecified write tools default to `true`\n *\n * @example Global disable\n * ```ts\n * createGithubTools({ token, requireApproval: false })\n * ```\n *\n * @example Auto approval for low-risk writes\n * ```ts\n * createGithubTools({ token, requireApproval: 'auto' })\n * ```\n *\n * @example Granular per write tool\n * ```ts\n * createGithubTools({\n * token,\n * requireApproval: {\n * mergePullRequest: true,\n * createOrUpdateFile: true,\n * addPullRequestComment: 'auto',\n * },\n * })\n * ```\n */\nexport type ApprovalConfig = ToolApprovalMode | Partial<Record<GithubWriteToolName, ToolApprovalMode>>\n\n/** {@link ApprovalConfig} without `'auto'`, for runtimes that cannot run the evaluation model. */\nexport type StaticApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>\n\nconst autoApprovalTools: ReadonlySet<string> = new Set(AUTO_APPROVAL_TOOLS)\n\n/**\n * Resolve a write tool's approval mode from global or per-tool config.\n *\n * @returns `'auto'` only for tools that opt into evaluation; defaults to `true` for unspecified tools in object mode.\n */\nexport function resolveApprovalMode(toolName: GithubWriteToolName, config: ApprovalConfig): ToolApprovalMode {\n if (config === 'auto') return autoApprovalTools.has(toolName) ? 'auto' : true\n if (typeof config === 'boolean') return config\n return config[toolName] ?? true\n}\n","import type { GithubToolPreset } from './presets'\nimport { formatContextInstructions, type GithubToolsContext } from './context'\n\nconst SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.\nCall independent read tools in the same step when you already know the arguments — never serialize reads that could run in parallel.\nBodies default to detail summary; patches default to includePatch false; prefer getFileContent with startLine/endLine or maxLines for large files.\nPaged lists return { items, hasMore, page, nextPage }. When hasMore, call with nextPage or raise maxPages — never the same page. Prefer path/author/since/until on listCommits instead of walking history. Prefer a path prefix on getRepositoryTree over recursive true.`\n\nconst DEFAULT_INSTRUCTIONS = `You are a helpful GitHub assistant. You can read and explore repositories, issues, pull requests, discussions, commits, code, gists, and workflows. You can also create issues, pull requests, comments, gists, reactions, trigger workflows, and update files when asked.\n\nPrefer getPullRequestContext, getIssueContext, getReleaseContext, or getCiFailureContext for multi-part reads instead of chaining separate tools.\n\n${SHARED_RULES}`\n\nconst PRESET_INSTRUCTIONS: Record<GithubToolPreset, string> = {\n 'code-review': `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.\n\nWhen reviewing a PR:\n- Start with getPullRequestContext (set includeChecks true when CI matters)\n- Then listPullRequestFiles with includePatch true and filenames for only the files you need — in the same step as any getFileContent / getBlame calls when possible\n- Use getBlame then getCommit(includePatch true) only when line history matters\n- Check for bugs, logic errors, and edge cases; be constructive\n- Use createPullRequestReview for formal reviews when asked\n- Use listPullRequestReviewThreads (unresolved by default) to see open feedback; replyToReviewComment to answer in a thread and resolveReviewThread once it is addressed\n- Use updatePullRequest to change title, body, base branch, or draft status; addPullRequestComment / updatePullRequestComment / deletePullRequestComment to manage comments\n\n${SHARED_RULES}`,\n\n 'issue-triage': `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.\n\nWhen triaging issues:\n- Call getIssueContext exactly once (full body + labelNames + recent comments). In that same step, call listIssues or searchIssues if you need duplicate checks\n- Never re-call getIssueContext for the same issue\n- Use listIssueComments to paginate beyond the comments returned by getIssueContext\n- Pick labels from labelNames; use addLabels / removeLabel to apply them. Use createLabel / updateLabel / deleteLabel when the repository taxonomy itself needs changing\n- Create issues with clear titles and descriptions when asked\n- Use updateIssue to edit title, body, labels, milestone, or assignees, and to reopen a closed issue (state: 'open') — there is no separate reopen tool\n- Use updateIssueComment / deleteIssueComment to correct or remove existing comments\n- Acknowledge a report or a comment with addIssueReaction / addCommentReaction instead of posting a comment that says nothing new\n\n${SHARED_RULES}`,\n\n 'ci-ops': `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.\n\nWhen working with workflows:\n- Prefer getCiFailureContext first when diagnosing a failing ref\n- Read the failing job's output with getWorkflowJobLogs (the default 200-line tail is usually enough; raise maxLines only when the error is higher up)\n- Use listCheckRuns / getCombinedStatus for narrower follow-ups\n- Inspect job steps to find the failing step; confirm before cancel/re-run\n- Trigger workflow_dispatch with the correct inputs and branch when asked\n\n${SHARED_RULES}`,\n\n 'security-audit': `You are a security audit assistant. Your job is to review repositories for security risks and report findings clearly — you never make destructive changes.\n\nWhen auditing a repository:\n- Use searchCode for secrets and unsafe patterns; getBlame / listCommits to trace introductions\n- Use searchIssues to check for prior reports of the same vulnerability before filing a duplicate\n- Prefer getCiFailureContext or getPullRequestContext for CI / PR context\n- Use compareCommits to scope changes (includePatch only when you need diffs)\n- Report findings as issues with reproduction, impact, and severity\n- Read-only plus createIssue / addIssueComment / addLabels — never assume you can fix code directly\n\n${SHARED_RULES}`,\n\n 'repo-explorer': `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.\n\nWhen exploring repos:\n- Answer questions about structure and organization; find files and patterns with searchCode / getFileContent\n- Use searchIssues to find issues or pull requests by qualifier across a repository or organization\n- Use listDiscussions / getDiscussion for questions answered in the repository's discussions rather than its issues\n- Prefer getPullRequestContext or getCiFailureContext when summarizing a PR or failing CI\n- Use getBlame for line ownership; summarize recent commits / PRs / issues when asked\n- Read-only — you cannot make changes\n\n${SHARED_RULES}`,\n\n 'release-manager': `You are a release management assistant. Your job is to help prepare and publish GitHub releases.\n\nWhen preparing a release:\n- Prefer getReleaseContext first (current/latest release, previous release, tag compare)\n- Use compareCommits / listCommits for more changelog detail; getCiFailureContext before cutting\n- createRelease with generateReleaseNotes when there is no manual changelog\n- Double-check the target branch or SHA — releases and tags are hard to undo\n- Use updateRelease to fix notes or toggle draft/prerelease after publishing; deleteRelease only when explicitly asked — it does not delete the underlying tag\n\n${SHARED_RULES}`,\n\n 'discussion-moderator': `You are a discussion moderator. Your job is to answer and guide repository Discussions clearly and on-topic.\n\nWhen working in discussions:\n- Use listDiscussions / getDiscussion to load the thread before replying\n- Prefer addDiscussionComment for answers that belong in Discussions\n- Use searchIssues / getIssueContext when the question overlaps an existing issue; addIssueComment only when the follow-up belongs on that issue\n- Keep replies concise and point to docs or code when helpful\n\n${SHARED_RULES}`,\n\n 'notification-inbox': `You are a notification inbox assistant. Your job is to help triage GitHub notification threads for the authenticated user.\n\nWhen clearing the inbox:\n- Use listNotifications to see unread threads (set all true only when asked)\n- Open the related getIssue or getPullRequest when you need context before acting\n- Use markNotificationRead once a thread is handled or is noise\n- These tools need a user PAT with Notifications access — say so if calls fail for that reason\n\n${SHARED_RULES}`,\n\n 'pr-author': `You are a pull request authoring assistant. Your job is to prepare branches, edit files, and open focused PRs.\n\nWhen opening a PR:\n- Inspect the repo with getRepository / listBranches / getFileContent before editing\n- createBranch from a sensible base, then createOrUpdateFile for the change set\n- createPullRequest with a clear title and body; updatePullRequest if the draft or description needs a fix\n- Use listPullRequestFiles / compareCommits / getCommit to verify what will land\n- Address review feedback: listPullRequestReviewThreads for open threads, replyToReviewComment to answer, resolveReviewThread once fixed\n- Use deleteBranch to clean up a merged or abandoned branch when asked\n- Stay scoped to authoring — you do not review, merge, or manage issues\n\n${SHARED_RULES}`,\n\n 'maintainer': `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, discussions, notifications, gists, and workflows.\n\nWhen maintaining repos:\n- Prefer getPullRequestContext or getCiFailureContext for multi-part reads\n- Be careful with writes — review before acting\n- Keep issues, PRs, and commits clear and well-structured\n- Use listNotifications to find what needs attention, then markNotificationRead once a thread is handled\n- Acknowledge a thread with addIssueReaction / addCommentReaction instead of a comment that adds nothing\n- Answer questions in discussions with addDiscussionComment\n\n${SHARED_RULES}`\n}\n\nexport function resolveInstructions(options: {\n preset?: GithubToolPreset | GithubToolPreset[]\n instructions?: string\n additionalInstructions?: string\n context?: GithubToolsContext\n}): string {\n const defaultPrompt = options.preset && !Array.isArray(options.preset)\n ? PRESET_INSTRUCTIONS[options.preset]\n : DEFAULT_INSTRUCTIONS\n\n let prompt: string\n if (options.instructions) prompt = options.instructions\n else if (options.additionalInstructions) prompt = `${defaultPrompt}\\n\\n${options.additionalInstructions}`\n else prompt = defaultPrompt\n\n const contextBlock = options.context ? formatContextInstructions(options.context) : ''\n if (contextBlock) return `${prompt}\\n\\n${contextBlock}`\n return prompt\n}\n"],"mappings":";;AAiDA,MAAM,oBAAyC,IAAI,IAAI,mBAAmB;;;;;;AAO1E,SAAgB,oBAAoB,UAA+B,QAA0C;CAC3G,IAAI,WAAW,QAAQ,OAAO,kBAAkB,IAAI,QAAQ,IAAI,SAAS;CACzE,IAAI,OAAO,WAAW,WAAW,OAAO;CACxC,OAAO,OAAO,aAAa;AAC7B;;;ACzDA,MAAM,eAAe;;;;AAKrB,MAAM,uBAAuB;;;;EAI3B;AAEF,MAAM,sBAAwD;CAC5D,eAAe;;;;;;;;;;;EAWf;CAEA,gBAAgB;;;;;;;;;;;;EAYhB;CAEA,UAAU;;;;;;;;;EASV;CAEA,kBAAkB;;;;;;;;;;EAUlB;CAEA,iBAAiB;;;;;;;;;;EAUjB;CAEA,mBAAmB;;;;;;;;;EASnB;CAEA,wBAAwB;;;;;;;;EAQxB;CAEA,sBAAsB;;;;;;;;EAQtB;CAEA,aAAa;;;;;;;;;;;EAWb;CAEA,cAAc;;;;;;;;;;EAUd;AACF;AAEA,SAAgB,oBAAoB,SAKzB;CACT,MAAM,gBAAgB,QAAQ,UAAU,CAAC,MAAM,QAAQ,QAAQ,MAAM,IACjE,oBAAoB,QAAQ,UAC5B;CAEJ,IAAI;CACJ,IAAI,QAAQ,cAAc,SAAS,QAAQ;MACtC,IAAI,QAAQ,wBAAwB,SAAS,GAAG,cAAc,MAAM,QAAQ;MAC5E,SAAS;CAEd,MAAM,eAAe,QAAQ,UAAU,0BAA0B,QAAQ,OAAO,IAAI;CACpF,IAAI,cAAc,OAAO,GAAG,OAAO,MAAM;CACzC,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interrupts-C_lUXMdd.d.mts","names":[],"sources":["../src/tanstack/interrupts.ts"],"mappings":";;;cAIa,oBAAkB,4BAAA,6CAAA,EAAA"}
|