@github-tools/sdk 1.20.0 → 1.22.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 +50 -17
- package/dist/{approval-policy--kByBqhT.mjs → approval-policy-C2rcAY77.mjs} +3 -4
- package/dist/{approval-policy--kByBqhT.mjs.map → approval-policy-C2rcAY77.mjs.map} +1 -1
- package/dist/connect/eve.d.mts +2 -4
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +3 -4
- package/dist/connect/eve.mjs.map +1 -1
- package/dist/connect.d.mts +5 -11
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +3 -4
- package/dist/{cores-FLzAv2tu.mjs → cores-CMUr_SEv.mjs} +21 -4
- package/dist/cores-CMUr_SEv.mjs.map +1 -0
- package/dist/{tool-types-OFyE3z0C.d.mts → dry-run-BAbes7Mv.d.mts} +168 -40
- package/dist/dry-run-BAbes7Mv.d.mts.map +1 -0
- package/dist/{evaluation-BtoHbxuQ.mjs → evaluation-DskA4Lzk.mjs} +4 -6
- package/dist/{evaluation-BtoHbxuQ.mjs.map → evaluation-DskA4Lzk.mjs.map} +1 -1
- package/dist/eve-runtime-Bmdw1C-K.d.mts +127 -0
- package/dist/eve-runtime-Bmdw1C-K.d.mts.map +1 -0
- package/dist/{eve-runtime-C-0doyHq.mjs → eve-runtime-DM9yjOsG.mjs} +193 -22
- package/dist/eve-runtime-DM9yjOsG.mjs.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -4
- package/dist/eve.d.mts +103 -63
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +104 -63
- package/dist/eve.mjs.map +1 -1
- package/dist/{index-C3wlz660.d.mts → index-DgCZi9Ns.d.mts} +52 -56
- package/dist/index-DgCZi9Ns.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/{interrupts-BSDPwdJ2.d.mts → interrupts-MwQ_v_PF.d.mts} +1 -3
- package/dist/interrupts-MwQ_v_PF.d.mts.map +1 -0
- package/dist/rolldown-runtime-D8jQpDG7.mjs +12 -0
- package/dist/{src-DyiAVHKl.mjs → src-Djn_FFj1.mjs} +183 -55
- package/dist/src-Djn_FFj1.mjs.map +1 -0
- package/dist/tanstack/interrupts.d.mts +1 -1
- package/dist/tanstack/interrupts.mjs +1 -2
- package/dist/tanstack.d.mts +534 -208
- package/dist/tanstack.d.mts.map +1 -1
- package/dist/tanstack.mjs +37 -21
- package/dist/tanstack.mjs.map +1 -1
- package/dist/{token-DIwB-wtp.mjs → token-HpJhSRkl.mjs} +7 -10
- package/dist/token-HpJhSRkl.mjs.map +1 -0
- package/dist/{types-CJqhvQwi.d.mts → types-8KtcPTao.d.mts} +3 -7
- package/dist/types-8KtcPTao.d.mts.map +1 -0
- package/dist/{types-ITYfXMtY.d.mts → types-C-BIKmas.d.mts} +14 -4
- package/dist/types-C-BIKmas.d.mts.map +1 -0
- package/dist/workflow.d.mts +9 -4
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +7 -6
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-DnGZw-RD.mjs → write-tools-BR29EOoM.mjs} +483 -113
- package/dist/write-tools-BR29EOoM.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cores-FLzAv2tu.mjs.map +0 -1
- package/dist/eve-runtime-C-0doyHq.mjs.map +0 -1
- package/dist/eve-runtime-CflZNuXD.d.mts +0 -85
- package/dist/eve-runtime-CflZNuXD.d.mts.map +0 -1
- package/dist/index-C3wlz660.d.mts.map +0 -1
- package/dist/interrupts-BSDPwdJ2.d.mts.map +0 -1
- package/dist/src-DyiAVHKl.mjs.map +0 -1
- package/dist/token-DIwB-wtp.mjs.map +0 -1
- package/dist/tool-types-OFyE3z0C.d.mts.map +0 -1
- package/dist/types-CJqhvQwi.d.mts.map +0 -1
- package/dist/types-ITYfXMtY.d.mts.map +0 -1
- package/dist/write-tools-DnGZw-RD.mjs.map +0 -1
package/dist/tanstack.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack.d.mts","names":[],"sources":["../src/core/detail.ts","../src/core/bundles.ts","../src/core/checks.ts","../src/core/pagination.ts","../src/core/commits.ts","../src/core/discussions.ts","../src/core/gists.ts","../src/core/issues.ts","../src/core/notifications.ts","../src/core/pull-requests.ts","../src/core/reactions.ts","../src/core/releases.ts","../src/core/security.ts","../src/core/repository.ts","../src/core/search.ts","../src/core/workflows.ts","../src/core/cores.ts","../src/tanstack/tools.ts","../src/tanstack/evaluation.ts","../src/tanstack/agent.ts","../src/tanstack/approval.ts","../src/tanstack/factories.ts"],"mappings":";;;;;;;KAeY;;;;cCIC,kCAAgC,EAAA;;;;;;;;;;;;;;GAW3C,EAAA,KAAA;cAEW;iBA6BS,4BACpB,OACA,OACA,MACA,YACA,cACA,gBACA,eACA,cACA,cACA,qBACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsCY,4BAA0B,EAAA;;;;;;;;;;;GAarC,EAAA,KAAA;cAEW;iBAES,sBACpB,OACA,OACA,MACA,aACA,eACA,iBACA,aACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;cA2BY,8BAA4B,EAAA;;;;;;;;;;;;GASvC,EAAA,KAAA;cAEW;iBAKS,wBACpB,OACA,OACA,MACA,WACA,KACA,aACA,iBACA,gBACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS;IACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwCY,gCAA8B,EAAA;;;;;;;;GAQzC,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;;;;;;;;;;;;;;;;;;;gBAAA"}
|
|
1
|
+
{"version":3,"file":"tanstack.d.mts","names":["_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","_$__pagination0.PagedList","repository","repository.getRepositoryCore","repository.listBranchesCore","repository.getFileContentCore","repository.getRepositoryTreeCore","repository.createBranchCore","repository.deleteBranchCore","repository.forkRepositoryCore","repository.createRepositoryCore","repository.createOrUpdateFileCore","repository.editFilesCore","repository.getBranchRulesCore","repository.getCollaboratorPermissionCore","pullRequests","pullRequests.listPullRequestsCore","pullRequests.getPullRequestCore","pullRequests.createPullRequestCore","pullRequests.mergePullRequestCore","pullRequests.enablePullRequestAutoMergeCore","pullRequests.disablePullRequestAutoMergeCore","pullRequests.updatePullRequestCore","pullRequests.updatePullRequestBranchCore","pullRequests.addPullRequestCommentCore","pullRequests.updatePullRequestCommentCore","pullRequests.deletePullRequestCommentCore","pullRequests.listPullRequestFilesCore","pullRequests.listPullRequestReviewsCore","pullRequests.createPullRequestReviewCore","pullRequests.listPullRequestReviewThreadsCore","pullRequests.replyToReviewCommentCore","pullRequests.resolveReviewThreadCore","pullRequests.requestReviewersCore","bundles","bundles.getPullRequestContextCore","bundles.getIssueContextCore","issues","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","issues.listMilestonesCore","issues.listSubIssuesCore","issues.addSubIssueCore","reactions","reactions.listIssueReactionsCore","reactions.addIssueReactionCore","reactions.listCommentReactionsCore","reactions.addCommentReactionCore","discussions","discussions.listDiscussionsCore","discussions.getDiscussionCore","discussions.addDiscussionCommentCore","notifications","notifications.listNotificationsCore","notifications.markNotificationReadCore","search","search.searchCodeCore","search.searchRepositoriesCore","search.searchIssuesCore","commits","commits.listCommitsCore","commits.getCommitCore","commits.getBlameCore","commits.compareCommitsCore","gists","gists.listGistsCore","gists.getGistCore","gists.listGistCommentsCore","gists.createGistCore","gists.updateGistCore","gists.deleteGistCore","gists.createGistCommentCore","workflows","workflows.listWorkflowsCore","workflows.listWorkflowRunsCore","workflows.getWorkflowRunCore","workflows.listWorkflowJobsCore","workflows.getWorkflowJobLogsCore","workflows.triggerWorkflowCore","workflows.cancelWorkflowRunCore","workflows.rerunWorkflowRunCore","checks","checks.listCheckRunsCore","checks.getCombinedStatusCore","checks.createCommitStatusCore","bundles.getCiFailureContextCore","releases","releases.listReleasesCore","releases.getLatestReleaseCore","releases.getReleaseCore","bundles.getReleaseContextCore","releases.createReleaseCore","releases.updateReleaseCore","releases.deleteReleaseCore","security","security.listCodeScanningAlertsCore","security.listDependabotAlertsCore","security.listSecretScanningAlertsCore","_$__0.GithubTokenInput","_$__tools0.TanstackToolOptions","_$___core_pagination0.PagingFields","_$__0.GithubDryRunResult"],"sources":["../src/core/detail.ts","../src/core/bundles.ts","../src/core/checks.ts","../src/core/pagination.ts","../src/core/commits.ts","../src/core/discussions.ts","../src/core/gists.ts","../src/core/issues.ts","../src/core/notifications.ts","../src/core/pull-requests.ts","../src/core/reactions.ts","../src/core/releases.ts","../src/core/security.ts","../src/core/repository.ts","../src/core/search.ts","../src/core/workflows.ts","../src/core/cores.ts","../src/tanstack/tools.ts","../src/tanstack/evaluation.ts","../src/tanstack/agent.ts","../src/tanstack/approval.ts","../src/tanstack/factories.ts"],"mappings":";;;;;KAeY;;;;cCIC,kCAAgC,EAAA;;;;;;;;;;;;;;GAW3C,EAAA,KAAA;cAEW;iBA6BS,4BACpB,OACA,OACA,MACA,YACA,cACA,gBACA,eACA,cACA,cACA,qBACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;E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,UAAAC,wBAAA,4BAAA,yBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAAC;;;qBAGtB,uBAAoB,OAApBF,kBAAoB,UAAAC,wBAAA,4BAAA,yBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAGpB,2BAAwB,OAAxBD,kBAAwB,UAAAC,wBAAA,4BAAA,yBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAAC"}
|
package/dist/tanstack.mjs
CHANGED
|
@@ -1,40 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
1
|
+
import { $a as stripRateLimit, C as withGithubGuardrails, E as isGithubWriteToolName, T as GITHUB_TOOL_CATALOG, Za as githubToolsErrors, c as AUTO_APPROVAL_TOOLS, d as PRESET_PURPOSES, f as RISK_QUESTION, g as GITHUB_TOOL_NAMES, h as requiresApproval, i as dryRunWrite, l as DEFAULT_EVALUATION_MODEL, m as rankPresets, n as resolveInstructions, o as mergeContextArgs, p as conversationState, s as softenContextSchema, t as GITHUB_WRITE_TOOLS, u as INTENT_QUESTION, v as PRESET_TOOLS, w as ALL_GITHUB_TOOL_NAMES, x as githubTokenCall, y as resolvePresetTools } from "./write-tools-BR29EOoM.mjs";
|
|
2
|
+
import { t as GITHUB_TOOL_CORES } from "./cores-CMUr_SEv.mjs";
|
|
3
|
+
import { t as resolveApprovalMode } from "./approval-policy-C2rcAY77.mjs";
|
|
4
4
|
import { githubToolApproval } from "./tanstack/interrupts.mjs";
|
|
5
5
|
import { boolean, chat, convertMessagesToModelMessages, decide, score, toolDefinition } from "@tanstack/ai";
|
|
6
6
|
import { isDeepStrictEqual } from "node:util";
|
|
7
|
-
|
|
7
|
+
// src/tanstack/tools.ts
|
|
8
8
|
const autoTools = /* @__PURE__ */ new WeakMap();
|
|
9
9
|
function buildTool(name, token, options) {
|
|
10
10
|
const descriptor = GITHUB_TOOL_CATALOG[name];
|
|
11
|
-
const resolveToken =
|
|
11
|
+
const resolveToken = withGithubGuardrails(token, options.guardrails);
|
|
12
12
|
const inputSchema = options.context ? softenContextSchema(descriptor.inputSchema, options.context) : descriptor.inputSchema;
|
|
13
13
|
const resolveInput = (input) => {
|
|
14
14
|
const args = inputSchema.parse(input);
|
|
15
15
|
return options.context ? mergeContextArgs(args, options.context) : args;
|
|
16
16
|
};
|
|
17
17
|
const mode = options.needsApproval ?? (isGithubWriteToolName(name) ? true : false);
|
|
18
|
+
const dryRun = options.dryRun && isGithubWriteToolName(name);
|
|
18
19
|
const core = GITHUB_TOOL_CORES[name];
|
|
19
20
|
const built = toolDefinition({
|
|
20
21
|
name,
|
|
21
22
|
description: options.description ?? descriptor.description,
|
|
22
23
|
inputSchema,
|
|
23
|
-
needsApproval: mode !== false
|
|
24
|
+
needsApproval: mode !== false && !dryRun
|
|
24
25
|
}).server(async (input) => {
|
|
25
26
|
const resolved = resolveInput(input);
|
|
27
|
+
if (dryRun) return dryRunWrite(name, resolved, options.guardrails, () => mode === "auto" ? void 0 : { required: mode });
|
|
26
28
|
const attribution = name === "createOrUpdateFile" || name === "editFiles" ? {
|
|
27
29
|
author: options.author,
|
|
28
30
|
committer: options.committer,
|
|
29
31
|
coAuthors: options.coAuthors
|
|
30
|
-
} : name === "mergePullRequest" || name === "enablePullRequestAutoMerge" ? {
|
|
32
|
+
} : name === "mergePullRequest" || name === "enablePullRequestAutoMerge" ? {
|
|
33
|
+
coAuthors: options.coAuthors,
|
|
34
|
+
branches: options.guardrails?.branches
|
|
35
|
+
} : name === "updatePullRequestBranch" ? { guardrails: options.guardrails } : {};
|
|
31
36
|
return stripRateLimit(await core({
|
|
32
37
|
...resolved,
|
|
33
38
|
...attribution,
|
|
34
39
|
token: await resolveToken(githubTokenCall(name, resolved))
|
|
35
40
|
}));
|
|
36
41
|
});
|
|
37
|
-
if (mode === "auto") autoTools.set(built, {
|
|
42
|
+
if (mode === "auto" && !dryRun) autoTools.set(built, {
|
|
38
43
|
name,
|
|
39
44
|
resolveInput
|
|
40
45
|
});
|
|
@@ -52,11 +57,12 @@ function createGithubTools(options = {}) {
|
|
|
52
57
|
committer: options.committer,
|
|
53
58
|
coAuthors: options.coAuthors,
|
|
54
59
|
needsApproval: isGithubWriteToolName(name) ? resolveApprovalMode(name, options.requireApproval ?? true) : false,
|
|
55
|
-
...options.overrides?.[name]
|
|
60
|
+
...options.overrides?.[name],
|
|
61
|
+
guardrails: options.guardrails,
|
|
62
|
+
dryRun: options.dryRun
|
|
56
63
|
}));
|
|
57
64
|
}
|
|
58
|
-
|
|
59
|
-
//#region src/tanstack/evaluation.ts
|
|
65
|
+
// src/tanstack/evaluation.ts
|
|
60
66
|
const TANSTACK_DEFAULT_EVALUATION_MODEL = "typesafe-ai/jev";
|
|
61
67
|
async function evaluationAdapter(options) {
|
|
62
68
|
if (options.adapter) return options.adapter;
|
|
@@ -130,8 +136,7 @@ async function selectPresets(messages, options = {}, signal) {
|
|
|
130
136
|
return ["repo-explorer"];
|
|
131
137
|
}
|
|
132
138
|
}
|
|
133
|
-
|
|
134
|
-
//#region src/tanstack/approval.ts
|
|
139
|
+
// src/tanstack/approval.ts
|
|
135
140
|
/** Evaluate automatic GitHub writes before execution and request review through githubToolApproval. */
|
|
136
141
|
function createGithubApprovalMiddleware({ tools, evaluation }) {
|
|
137
142
|
const managed = new Map(tools.flatMap((tool) => {
|
|
@@ -216,10 +221,9 @@ function createGithubApprovalMiddleware({ tools, evaluation }) {
|
|
|
216
221
|
}
|
|
217
222
|
};
|
|
218
223
|
}
|
|
219
|
-
|
|
220
|
-
//#region src/tanstack/agent.ts
|
|
224
|
+
// src/tanstack/agent.ts
|
|
221
225
|
/** Create a GitHub agent with preset instructions, tools, and automatic approval middleware. */
|
|
222
|
-
function createGithubAgent({ token, preset, requireApproval, overrides, context, author, committer, coAuthors, instructions, additionalInstructions, evaluation, middleware = [], ...settings }) {
|
|
226
|
+
function createGithubAgent({ token, preset, requireApproval, overrides, context, author, committer, coAuthors, guardrails, dryRun, instructions, additionalInstructions, evaluation, middleware = [], ...settings }) {
|
|
223
227
|
async function prepare(call) {
|
|
224
228
|
const { prompt, messages: suppliedMessages, ...callSettings } = call;
|
|
225
229
|
const messages = suppliedMessages ?? [{
|
|
@@ -237,7 +241,9 @@ function createGithubAgent({ token, preset, requireApproval, overrides, context,
|
|
|
237
241
|
context,
|
|
238
242
|
author,
|
|
239
243
|
committer,
|
|
240
|
-
coAuthors
|
|
244
|
+
coAuthors,
|
|
245
|
+
guardrails,
|
|
246
|
+
dryRun
|
|
241
247
|
});
|
|
242
248
|
const completed = new Set(modelMessages.filter((message) => message.role === "tool").map((message) => message.toolCallId));
|
|
243
249
|
const pendingNames = new Set(modelMessages.flatMap((message) => message.role === "assistant" ? message.toolCalls ?? [] : []).filter((call) => !completed.has(call.id)).map((call) => call.function.name));
|
|
@@ -288,8 +294,7 @@ function createGithubAgent({ token, preset, requireApproval, overrides, context,
|
|
|
288
294
|
}
|
|
289
295
|
};
|
|
290
296
|
}
|
|
291
|
-
|
|
292
|
-
//#region src/tanstack/factories.ts
|
|
297
|
+
// src/tanstack/factories.ts
|
|
293
298
|
/** Create the TanStack `getRepository` server tool. */
|
|
294
299
|
const getRepository = toolFactory("getRepository");
|
|
295
300
|
/** Create the TanStack `listBranches` server tool. */
|
|
@@ -324,8 +329,12 @@ const enablePullRequestAutoMerge = toolFactory("enablePullRequestAutoMerge");
|
|
|
324
329
|
const disablePullRequestAutoMerge = toolFactory("disablePullRequestAutoMerge");
|
|
325
330
|
/** Create the TanStack `getBranchRules` server tool. */
|
|
326
331
|
const getBranchRules = toolFactory("getBranchRules");
|
|
332
|
+
/** Create the TanStack `getCollaboratorPermission` server tool. */
|
|
333
|
+
const getCollaboratorPermission = toolFactory("getCollaboratorPermission");
|
|
327
334
|
/** Create the TanStack `updatePullRequest` server tool. */
|
|
328
335
|
const updatePullRequest = toolFactory("updatePullRequest");
|
|
336
|
+
/** Create the TanStack `updatePullRequestBranch` server tool. */
|
|
337
|
+
const updatePullRequestBranch = toolFactory("updatePullRequestBranch");
|
|
329
338
|
/** Create the TanStack `addPullRequestComment` server tool. */
|
|
330
339
|
const addPullRequestComment = toolFactory("addPullRequestComment");
|
|
331
340
|
/** Create the TanStack `updatePullRequestComment` server tool. */
|
|
@@ -384,6 +393,12 @@ const deleteLabel = toolFactory("deleteLabel");
|
|
|
384
393
|
const addAssignees = toolFactory("addAssignees");
|
|
385
394
|
/** Create the TanStack `removeAssignees` server tool. */
|
|
386
395
|
const removeAssignees = toolFactory("removeAssignees");
|
|
396
|
+
/** Create the TanStack `listMilestones` server tool. */
|
|
397
|
+
const listMilestones = toolFactory("listMilestones");
|
|
398
|
+
/** Create the TanStack `listSubIssues` server tool. */
|
|
399
|
+
const listSubIssues = toolFactory("listSubIssues");
|
|
400
|
+
/** Create the TanStack `addSubIssue` server tool. */
|
|
401
|
+
const addSubIssue = toolFactory("addSubIssue");
|
|
387
402
|
/** Create the TanStack `listIssueReactions` server tool. */
|
|
388
403
|
const listIssueReactions = toolFactory("listIssueReactions");
|
|
389
404
|
/** Create the TanStack `addIssueReaction` server tool. */
|
|
@@ -450,6 +465,8 @@ const rerunWorkflowRun = toolFactory("rerunWorkflowRun");
|
|
|
450
465
|
const listCheckRuns = toolFactory("listCheckRuns");
|
|
451
466
|
/** Create the TanStack `getCombinedStatus` server tool. */
|
|
452
467
|
const getCombinedStatus = toolFactory("getCombinedStatus");
|
|
468
|
+
/** Create the TanStack `createCommitStatus` server tool. */
|
|
469
|
+
const createCommitStatus = toolFactory("createCommitStatus");
|
|
453
470
|
/** Create the TanStack `getCiFailureContext` server tool. */
|
|
454
471
|
const getCiFailureContext = toolFactory("getCiFailureContext");
|
|
455
472
|
/** Create the TanStack `listReleases` server tool. */
|
|
@@ -472,7 +489,6 @@ const listCodeScanningAlerts = toolFactory("listCodeScanningAlerts");
|
|
|
472
489
|
const listDependabotAlerts = toolFactory("listDependabotAlerts");
|
|
473
490
|
/** Create the TanStack `listSecretScanningAlerts` server tool. */
|
|
474
491
|
const listSecretScanningAlerts = toolFactory("listSecretScanningAlerts");
|
|
475
|
-
|
|
476
|
-
export { AUTO_APPROVAL_TOOLS, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, PRESET_TOOLS, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createGist, createGistComment, createGithubAgent, createGithubApprovalMiddleware, createGithubTools, createIssue, createLabel, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestComment, updateRelease };
|
|
492
|
+
export { AUTO_APPROVAL_TOOLS, DEFAULT_EVALUATION_MODEL, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, PRESET_TOOLS, addAssignees, addCommentReaction, addDiscussionComment, addIssueComment, addIssueReaction, addLabels, addPullRequestComment, addSubIssue, cancelWorkflowRun, closeIssue, compareCommits, createBranch, createCommitStatus, createGist, createGistComment, createGithubAgent, createGithubApprovalMiddleware, createGithubTools, createIssue, createLabel, createOrUpdateFile, createPullRequest, createPullRequestReview, createRelease, createRepository, deleteBranch, deleteGist, deleteIssueComment, deleteLabel, deletePullRequestComment, deleteRelease, disablePullRequestAutoMerge, editFiles, enablePullRequestAutoMerge, forkRepository, getBlame, getBranchRules, getCiFailureContext, getCollaboratorPermission, getCombinedStatus, getCommit, getDiscussion, getFileContent, getGist, getIssue, getIssueContext, getLatestRelease, getPullRequest, getPullRequestContext, getRelease, getReleaseContext, getRepository, getRepositoryTree, getWorkflowJobLogs, getWorkflowRun, listBranches, listCheckRuns, listCodeScanningAlerts, listCommentReactions, listCommits, listDependabotAlerts, listDiscussions, listGistComments, listGists, listIssueComments, listIssueReactions, listIssues, listLabels, listMilestones, listNotifications, listPullRequestFiles, listPullRequestReviewThreads, listPullRequestReviews, listPullRequests, listReleases, listSecretScanningAlerts, listSubIssues, listWorkflowJobs, listWorkflowRuns, listWorkflows, markNotificationRead, mergePullRequest, removeAssignees, removeLabel, replyToReviewComment, requestReviewers, rerunWorkflowRun, resolveReviewThread, searchCode, searchIssues, searchRepositories, selectPresets, triggerWorkflow, updateGist, updateIssue, updateIssueComment, updateLabel, updatePullRequest, updatePullRequestBranch, updatePullRequestComment, updateRelease };
|
|
477
493
|
|
|
478
494
|
//# sourceMappingURL=tanstack.mjs.map
|
package/dist/tanstack.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack.mjs","names":[],"sources":["../src/tanstack/tools.ts","../src/tanstack/evaluation.ts","../src/tanstack/approval.ts","../src/tanstack/agent.ts","../src/tanstack/factories.ts"],"sourcesContent":["import { toolDefinition } from '@tanstack/ai'\nimport type { ServerTool } from '@tanstack/ai'\nimport type { z } from 'zod'\nimport { GITHUB_TOOL_CATALOG, isGithubWriteToolName } from '../core/catalog'\nimport { GITHUB_TOOL_CORES } from '../core/cores'\nimport { resolveApprovalMode, type ApprovalConfig, type ToolApprovalMode } from '../core/approval-policy'\nimport { mergeContextArgs, softenContextSchema, type GithubToolsContext } from '../core/context'\nimport { resolvePresetTools, type GithubToolPreset, type PresetToolName } from '../core/presets'\nimport { createGithubTokenResolver, githubTokenCall, type GithubTokenInput } from '../core/token'\nimport type { GithubToolName } from '../core/tool-names'\nimport { ALL_GITHUB_TOOL_NAMES } from '../core/tool-names'\nimport { stripRateLimit } from '../core/rate-limit'\nimport type { CommitIdentity } from '../types'\n\ntype Catalog = typeof GITHUB_TOOL_CATALOG\n/** A TanStack server tool with the catalog's input schema and core return type. */\nexport type GithubTanstackTool<N extends GithubToolName = GithubToolName> = N extends GithubToolName\n ? Omit<ServerTool<Catalog[N]['inputSchema'], undefined, N, unknown, boolean>, 'execute'> & {\n execute: (input: z.input<Catalog[N]['inputSchema']>) => ReturnType<(typeof GITHUB_TOOL_CORES)[N]>\n }\n : never\n\n/** Supported TanStack tool customizations. */\nexport type TanstackToolOverrides = {\n description?: string\n needsApproval?: boolean\n}\n\n/** Options shared by TanStack tool factories. */\nexport type TanstackToolOptions = Omit<TanstackToolOverrides, 'needsApproval'> & {\n needsApproval?: ToolApprovalMode\n context?: GithubToolsContext\n author?: CommitIdentity\n committer?: CommitIdentity\n coAuthors?: CommitIdentity[]\n}\n\n/** Configuration for a native array of GitHub server tools. */\nexport type CreateGithubToolsOptions = Omit<TanstackToolOptions, 'description' | 'needsApproval'> & {\n token?: GithubTokenInput\n preset?: GithubToolPreset | readonly GithubToolPreset[]\n requireApproval?: ApprovalConfig\n overrides?: Partial<Record<GithubToolName, TanstackToolOverrides>>\n}\n\nexport const autoTools = new WeakMap<object, { name: GithubToolName, resolveInput: (input: unknown) => Record<string, unknown> }>()\n\nfunction buildTool<N extends GithubToolName>(name: N, token: GithubTokenInput | undefined, options: TanstackToolOptions): GithubTanstackTool<N> {\n const descriptor = GITHUB_TOOL_CATALOG[name]\n const resolveToken = createGithubTokenResolver(token)\n const inputSchema = options.context ? softenContextSchema(descriptor.inputSchema, options.context) : descriptor.inputSchema\n const resolveInput = (input: unknown): Record<string, unknown> => {\n const args = inputSchema.parse(input) as Record<string, unknown>\n return options.context ? mergeContextArgs(args, options.context) : args\n }\n const mode = options.needsApproval ?? (isGithubWriteToolName(name) ? true : false)\n const core = GITHUB_TOOL_CORES[name] as (input: Record<string, unknown> & { token: string }) => Promise<unknown>\n const built = toolDefinition({\n name,\n description: options.description ?? descriptor.description,\n inputSchema,\n needsApproval: mode !== false,\n }).server(async (input) => {\n const resolved = resolveInput(input)\n const attribution = name === 'createOrUpdateFile' || name === 'editFiles'\n ? { author: options.author, committer: options.committer, coAuthors: options.coAuthors }\n : name === 'mergePullRequest' || name === 'enablePullRequestAutoMerge' ? { coAuthors: options.coAuthors } : {}\n return stripRateLimit(await core({ ...resolved, ...attribution, token: await resolveToken(githubTokenCall(name, resolved)) }))\n })\n if (mode === 'auto') autoTools.set(built, { name, resolveInput })\n return built as unknown as GithubTanstackTool<N>\n}\n\nexport function toolFactory<N extends GithubToolName>(name: N) {\n return (token: GithubTokenInput, options: TanstackToolOptions = {}): GithubTanstackTool<N> => buildTool(name, token, options)\n}\n\n/** Create TanStack server tools, optionally restricted to one or more presets. */\nexport function createGithubTools<const P extends GithubToolPreset | readonly GithubToolPreset[] | undefined = undefined>(\n options: CreateGithubToolsOptions & { preset?: P } = {},\n): GithubTanstackTool<P extends GithubToolPreset ? PresetToolName<P> : P extends readonly GithubToolPreset[] ? PresetToolName<P[number]> : GithubToolName>[] {\n const allowed = options.preset ? resolvePresetTools(typeof options.preset === 'string' ? options.preset : [...options.preset]) : null\n const tools = ALL_GITHUB_TOOL_NAMES.filter(name => !allowed || allowed.has(name)).map(name => buildTool(name, options.token, {\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n needsApproval: isGithubWriteToolName(name) ? resolveApprovalMode(name, options.requireApproval ?? true) : false,\n ...options.overrides?.[name],\n }))\n return tools as ReturnType<typeof createGithubTools<P>>\n}\n","import { boolean, decide, score } from '@tanstack/ai'\nimport type { EvaluateAdapter, ModelMessage } from '@tanstack/ai'\nimport { GITHUB_TOOL_CATALOG } from '../core/catalog'\nimport { INTENT_QUESTION, PRESET_PURPOSES, RISK_QUESTION, conversationState, rankPresets, requiresApproval, type RoutablePreset } from '../core/evaluation-policy'\nimport { PRESET_TOOLS } from '../core/presets'\nimport { githubToolsErrors } from '../core/errors'\nimport type { GithubToolName } from '../core/tool-names'\n\n/** Jev configuration for TanStack automatic approval and preset selection. */\nexport type GithubEvaluationOptions = {\n /** Defaults to vercelGatewayDecider('typesafe-ai/jev') using Gateway authentication. */\n adapter?: EvaluateAdapter\n /** Maximum risk on the 0–2 rubric. @default 1 */\n maxRisk?: number\n /** Minimum probability that the user requested the call. @default 0.6 */\n minIntent?: number\n /** Minimum probability for a preset to qualify. @default 0.7 */\n minPresetProbability?: number\n /** Maximum number of combined presets. @default 2 */\n maxPresets?: number\n}\n\n// `@tanstack/ai-vercel-gateway` 0.3 types only the `typesafe-ai/jev` alias, not pinned releases.\nconst TANSTACK_DEFAULT_EVALUATION_MODEL = 'typesafe-ai/jev'\n\nasync function evaluationAdapter(options: GithubEvaluationOptions) {\n if (options.adapter) return options.adapter\n const { vercelGatewayDecider } = await import('@tanstack/ai-vercel-gateway')\n return vercelGatewayDecider(TANSTACK_DEFAULT_EVALUATION_MODEL)\n}\n\nexport function latestUserText(messages: readonly ModelMessage[]): string {\n return conversationState(messages, messageText).request\n}\n\nfunction messageText(message: ModelMessage): string {\n if (typeof message.content === 'string') return message.content\n return message.content?.flatMap(part => part.type === 'text' ? [part.content] : []).join('\\n') ?? ''\n}\n\nfunction evaluationFailed(error: unknown, options: GithubEvaluationOptions, fallback: string, signal?: AbortSignal) {\n signal?.throwIfAborted()\n if (error instanceof Error && error.name === 'AbortError') throw error\n const cause = error instanceof Error ? error : new Error(String(error))\n console.warn('[github-tools]', githubToolsErrors.EVALUATION_FAILED({\n model: options.adapter?.model ?? TANSTACK_DEFAULT_EVALUATION_MODEL,\n fallback,\n detail: cause.message,\n cause,\n }))\n}\n\nexport async function needsAutoApproval(name: GithubToolName, input: unknown, messages: readonly ModelMessage[], options: GithubEvaluationOptions = {}, signal?: AbortSignal): Promise<boolean> {\n signal?.throwIfAborted()\n try {\n const result = await decide({\n adapter: await evaluationAdapter(options),\n state: { ...conversationState(messages, messageText), toolCall: { tool: name, description: GITHUB_TOOL_CATALOG[name].description, input } },\n questions: {\n risk: score({ instructions: RISK_QUESTION.instructions, levels: RISK_QUESTION.criteria }),\n intent: boolean(INTENT_QUESTION),\n },\n abortSignal: signal,\n })\n signal?.throwIfAborted()\n return requiresApproval(result.risk.score, result.intent.probability, options)\n } catch (error) {\n evaluationFailed(error, options, `asking approval for ${name}`, signal)\n return true\n }\n}\n\nexport async function selectPresets(messages: readonly ModelMessage[], options: GithubEvaluationOptions = {}, signal?: AbortSignal): Promise<RoutablePreset[]> {\n signal?.throwIfAborted()\n try {\n const presets = Object.keys(PRESET_PURPOSES) as RoutablePreset[]\n const result = await decide({\n adapter: await evaluationAdapter(options),\n state: conversationState(messages, messageText),\n questions: Object.fromEntries(presets.map(preset => [preset, boolean({\n instructions: 'Does handling this GitHub request need the tools of this preset?',\n criteria: { true: JSON.stringify({ purpose: PRESET_PURPOSES[preset], tools: [...PRESET_TOOLS[preset]] }) },\n })])),\n abortSignal: signal,\n })\n signal?.throwIfAborted()\n return rankPresets(Object.fromEntries(presets.map(preset => [preset, result[preset].probability])) as Record<RoutablePreset, number>, options)\n } catch (error) {\n evaluationFailed(error, options, 'using the repo-explorer preset', signal)\n return ['repo-explorer']\n }\n}\n","import { isDeepStrictEqual } from 'node:util'\nimport type { ChatMiddleware, ChatMiddlewareContext, Tool } from '@tanstack/ai'\nimport { autoTools } from './tools'\nimport { needsAutoApproval, type GithubEvaluationOptions } from './evaluation'\nimport { githubToolApproval } from './interrupts'\n\ntype Decision = { toolCallId: string, toolName: string, input: Record<string, unknown>, approved: boolean }\ntype RunState = { decisions: Decision[] }\n\n/** Options for GitHub approval middleware. Register githubToolApproval with chat(). */\nexport type GithubApprovalMiddlewareOptions = {\n tools: readonly Tool[]\n evaluation?: GithubEvaluationOptions\n}\n\n/** Evaluate automatic GitHub writes before execution and request review through githubToolApproval. */\nexport function createGithubApprovalMiddleware({ tools, evaluation }: GithubApprovalMiddlewareOptions): ChatMiddleware<unknown, typeof githubToolApproval> {\n const managed = new Map(tools.flatMap(tool => {\n const info = autoTools.get(tool)\n return info ? [[tool.name, { tool, ...info }] as const] : []\n }))\n const runs = new WeakMap<ChatMiddlewareContext, RunState>()\n const state = (ctx: ChatMiddlewareContext) => runs.get(ctx)!\n const decisionFor = (ctx: ChatMiddlewareContext, toolCallId: string | undefined, toolName: string, input: unknown) =>\n state(ctx).decisions.find(decision => decision.toolCallId === toolCallId && decision.toolName === toolName && isDeepStrictEqual(decision.input, input))\n\n return {\n name: 'github-tools.approval',\n onConfig(ctx, config) {\n if (ctx.phase === 'init') runs.set(ctx, { decisions: [] })\n return {\n tools: config.tools?.map(tool => {\n const info = managed.get(tool.name)\n if (!info || tool !== info.tool) return tool\n return {\n ...tool,\n needsApproval: false,\n execute: async (input, execution) => {\n const resolved = info.resolveInput(input)\n if (!decisionFor(ctx, execution?.toolCallId, tool.name, resolved)?.approved) {\n throw new Error(`GitHub tool ${tool.name} has no approval for this input.`)\n }\n return tool.execute!(resolved, execution)\n },\n }\n }),\n }\n },\n onInterruptResolution(ctx, resolutions) {\n for (const resolution of resolutions.for(githubToolApproval)) {\n const payload = resolution.request.payload\n if (!payload || !managed.has(payload.toolName)) continue\n state(ctx).decisions.push({ ...payload, approved: resolution.status === 'resolved' && resolution.response.approved })\n }\n },\n async onInterruptBoundary(ctx) {\n if (ctx.phase !== 'beforeTools') return\n const completed = new Set(ctx.messages.filter(message => message.role === 'tool').map(message => message.toolCallId))\n const calls = ctx.messages.flatMap(message => message.role === 'assistant' ? message.toolCalls ?? [] : []).filter(call => !completed.has(call.id))\n const interrupts = []\n for (const call of calls) {\n const info = managed.get(call.function.name)\n if (!info) continue\n const input = info.resolveInput(JSON.parse(call.function.arguments))\n if (decisionFor(ctx, call.id, info.name, input)) continue\n const needsApproval = await needsAutoApproval(info.name, input, ctx.messages, evaluation, ctx.signal)\n if (needsApproval) {\n interrupts.push(githubToolApproval.interrupt({\n key: call.id,\n reason: 'github-tool-approval',\n message: `Approve ${info.name}?`,\n payload: { toolCallId: call.id, toolName: info.name, input },\n }))\n } else {\n state(ctx).decisions.push({ toolCallId: call.id, toolName: info.name, input, approved: true })\n }\n }\n if (interrupts.length) return { interrupts }\n },\n onBeforeToolCall(ctx, call) {\n const info = managed.get(call.toolName)\n if (!info) return\n const decision = decisionFor(ctx, call.toolCallId, call.toolName, info.resolveInput(call.args))\n if (!decision) return { type: 'skip', result: { error: 'No approval recorded for this GitHub tool call and input.' } }\n if (!decision.approved) return { type: 'skip', result: { error: 'User denied this GitHub tool call.' } }\n },\n }\n}\n","import { chat, convertMessagesToModelMessages } from '@tanstack/ai'\nimport type { AnyTextAdapter, ChatMiddleware, ChatStream } from '@tanstack/ai'\nimport { resolveInstructions } from '../core/instructions'\nimport { PRESET_TOOLS, type GithubToolPreset } from '../core/presets'\nimport { createGithubTools, type CreateGithubToolsOptions } from './tools'\nimport { selectPresets, type GithubEvaluationOptions } from './evaluation'\nimport { createGithubApprovalMiddleware } from './approval'\nimport { githubToolApproval } from './interrupts'\n\ntype NativeOptions<A extends AnyTextAdapter> = Parameters<typeof chat<A, undefined, true>>[0]\ntype ChatSettings<A extends AnyTextAdapter> = Omit<NativeOptions<A>, 'tools' | 'messages' | 'systemPrompts' | 'context' | 'middleware' | 'interrupts' | 'stream' | 'outputSchema'>\n\n/** Configure a GitHub agent backed by TanStack chat(). */\nexport type CreateGithubAgentOptions<A extends AnyTextAdapter> = ChatSettings<A> & Omit<CreateGithubToolsOptions, 'preset'> & {\n /** Explicit presets or request-based selection with Jev. */\n preset?: GithubToolPreset | readonly GithubToolPreset[] | 'auto'\n /** Replace the default instructions; repository context is still appended. */\n instructions?: string\n /** Append to default instructions, unless instructions is supplied. */\n additionalInstructions?: string\n /** Evaluator adapter and thresholds for automatic routing and approval. */\n evaluation?: GithubEvaluationOptions\n /** Additional TanStack middleware. GitHub approval runs before these hooks. */\n middleware?: ChatMiddleware[]\n}\n\n/** One agent invocation, including TanStack cancellation and continuation options. */\nexport type GithubAgentCallOptions<A extends AnyTextAdapter> = Omit<Partial<ChatSettings<A>>, 'adapter'> & (\n | { prompt: string, messages?: never }\n | { messages: NonNullable<NativeOptions<A>['messages']>, prompt?: never }\n)\n\n/** A reusable, stateless TanStack GitHub agent. */\nexport type GithubAgent<A extends AnyTextAdapter> = {\n /** Collect TanStack's text result. Throws on interrupts; use stream() for approval UIs. */\n generate: (options: GithubAgentCallOptions<A>) => Promise<string>\n /** Run the tool loop as native TanStack events, including approval interrupts. */\n stream: (options: GithubAgentCallOptions<A>) => ChatStream\n}\n\n/** Create a GitHub agent with preset instructions, tools, and automatic approval middleware. */\nexport function createGithubAgent<A extends AnyTextAdapter>({\n token, preset, requireApproval, overrides, context, author, committer, coAuthors,\n instructions, additionalInstructions, evaluation, middleware = [], ...settings\n}: CreateGithubAgentOptions<A>): GithubAgent<A> {\n async function prepare(call: GithubAgentCallOptions<A>) {\n const { prompt, messages: suppliedMessages, ...callSettings } = call\n const messages = suppliedMessages ?? [{ role: 'user' as const, content: prompt! }]\n const modelMessages = convertMessagesToModelMessages(messages)\n const continuingAuto = preset === 'auto' && Boolean((callSettings.resume ?? settings.resume)?.length)\n const selected = preset === 'auto'\n ? continuingAuto ? 'repo-explorer' : await selectPresets(modelMessages, evaluation, (callSettings.abortController ?? settings.abortController)?.signal)\n : preset\n const availableTools = createGithubTools({ token, preset: continuingAuto ? undefined : selected, requireApproval, overrides, context, author, committer, coAuthors })\n const completed = new Set(modelMessages.filter(message => message.role === 'tool').map(message => message.toolCallId))\n const pendingNames = new Set(modelMessages.flatMap(message => message.role === 'assistant' ? message.toolCalls ?? [] : [])\n .filter(call => !completed.has(call.id)).map(call => call.function.name))\n const continuationNames = new Set<string>([...PRESET_TOOLS['repo-explorer'], ...pendingNames])\n const tools = continuingAuto ? availableTools.filter(tool => continuationNames.has(tool.name)) : availableTools\n const promptPreset: GithubToolPreset | GithubToolPreset[] | undefined = typeof selected === 'string' || selected === undefined\n ? selected\n : selected.length === 1 ? selected[0] : [...selected]\n return {\n ...settings,\n ...callSettings,\n messages,\n tools,\n systemPrompts: [resolveInstructions({ preset: continuingAuto ? undefined : promptPreset, instructions, additionalInstructions, context })],\n middleware: [createGithubApprovalMiddleware({ tools, evaluation }), ...middleware],\n interrupts: [githubToolApproval],\n }\n }\n\n return {\n async generate(call) {\n const prepared = await prepare(call)\n let interrupted = false\n const observeInterrupt: ChatMiddleware = {\n name: 'github-tools.generate',\n onChunk(_ctx, chunk) {\n if (chunk.type === 'RUN_FINISHED' && chunk.outcome?.type === 'interrupt') interrupted = true\n },\n }\n const text = await chat({ ...prepared, middleware: [observeInterrupt, ...prepared.middleware], stream: false })\n if (interrupted) throw new Error('GitHub agent requires review. Use stream() to handle approval interrupts and continuation.')\n return text\n },\n async *stream(call) {\n yield* chat({ ...await prepare(call), stream: true })\n },\n }\n}\n","import { toolFactory } from './tools'\n\n/** Create the TanStack `getRepository` server tool. */\nexport const getRepository = toolFactory('getRepository')\n\n/** Create the TanStack `listBranches` server tool. */\nexport const listBranches = toolFactory('listBranches')\n\n/** Create the TanStack `getFileContent` server tool. */\nexport const getFileContent = toolFactory('getFileContent')\n\n/** Create the TanStack `getRepositoryTree` server tool. */\nexport const getRepositoryTree = toolFactory('getRepositoryTree')\n\n/** Create the TanStack `createBranch` server tool. */\nexport const createBranch = toolFactory('createBranch')\n\n/** Create the TanStack `deleteBranch` server tool. */\nexport const deleteBranch = toolFactory('deleteBranch')\n\n/** Create the TanStack `forkRepository` server tool. */\nexport const forkRepository = toolFactory('forkRepository')\n\n/** Create the TanStack `createRepository` server tool. */\nexport const createRepository = toolFactory('createRepository')\n\n/** Create the TanStack `createOrUpdateFile` server tool. */\nexport const createOrUpdateFile = toolFactory('createOrUpdateFile')\n\n/** Create the TanStack `editFiles` server tool. */\nexport const editFiles = toolFactory('editFiles')\n\n/** Create the TanStack `listPullRequests` server tool. */\nexport const listPullRequests = toolFactory('listPullRequests')\n\n/** Create the TanStack `getPullRequest` server tool. */\nexport const getPullRequest = toolFactory('getPullRequest')\n\n/** Create the TanStack `createPullRequest` server tool. */\nexport const createPullRequest = toolFactory('createPullRequest')\n\n/** Create the TanStack `mergePullRequest` server tool. */\nexport const mergePullRequest = toolFactory('mergePullRequest')\n\n/** Create the TanStack `enablePullRequestAutoMerge` server tool. */\nexport const enablePullRequestAutoMerge = toolFactory('enablePullRequestAutoMerge')\n\n/** Create the TanStack `disablePullRequestAutoMerge` server tool. */\nexport const disablePullRequestAutoMerge = toolFactory('disablePullRequestAutoMerge')\n\n/** Create the TanStack `getBranchRules` server tool. */\nexport const getBranchRules = toolFactory('getBranchRules')\n\n/** Create the TanStack `updatePullRequest` server tool. */\nexport const updatePullRequest = toolFactory('updatePullRequest')\n\n/** Create the TanStack `addPullRequestComment` server tool. */\nexport const addPullRequestComment = toolFactory('addPullRequestComment')\n\n/** Create the TanStack `updatePullRequestComment` server tool. */\nexport const updatePullRequestComment = toolFactory('updatePullRequestComment')\n\n/** Create the TanStack `deletePullRequestComment` server tool. */\nexport const deletePullRequestComment = toolFactory('deletePullRequestComment')\n\n/** Create the TanStack `listPullRequestFiles` server tool. */\nexport const listPullRequestFiles = toolFactory('listPullRequestFiles')\n\n/** Create the TanStack `listPullRequestReviews` server tool. */\nexport const listPullRequestReviews = toolFactory('listPullRequestReviews')\n\n/** Create the TanStack `createPullRequestReview` server tool. */\nexport const createPullRequestReview = toolFactory('createPullRequestReview')\n\n/** Create the TanStack `listPullRequestReviewThreads` server tool. */\nexport const listPullRequestReviewThreads = toolFactory('listPullRequestReviewThreads')\n\n/** Create the TanStack `replyToReviewComment` server tool. */\nexport const replyToReviewComment = toolFactory('replyToReviewComment')\n\n/** Create the TanStack `resolveReviewThread` server tool. */\nexport const resolveReviewThread = toolFactory('resolveReviewThread')\n\n/** Create the TanStack `requestReviewers` server tool. */\nexport const requestReviewers = toolFactory('requestReviewers')\n\n/** Create the TanStack `getPullRequestContext` server tool. */\nexport const getPullRequestContext = toolFactory('getPullRequestContext')\n\n/** Create the TanStack `getIssueContext` server tool. */\nexport const getIssueContext = toolFactory('getIssueContext')\n\n/** Create the TanStack `listIssues` server tool. */\nexport const listIssues = toolFactory('listIssues')\n\n/** Create the TanStack `getIssue` server tool. */\nexport const getIssue = toolFactory('getIssue')\n\n/** Create the TanStack `listIssueComments` server tool. */\nexport const listIssueComments = toolFactory('listIssueComments')\n\n/** Create the TanStack `createIssue` server tool. */\nexport const createIssue = toolFactory('createIssue')\n\n/** Create the TanStack `addIssueComment` server tool. */\nexport const addIssueComment = toolFactory('addIssueComment')\n\n/** Create the TanStack `updateIssueComment` server tool. */\nexport const updateIssueComment = toolFactory('updateIssueComment')\n\n/** Create the TanStack `deleteIssueComment` server tool. */\nexport const deleteIssueComment = toolFactory('deleteIssueComment')\n\n/** Create the TanStack `closeIssue` server tool. */\nexport const closeIssue = toolFactory('closeIssue')\n\n/** Create the TanStack `updateIssue` server tool. */\nexport const updateIssue = toolFactory('updateIssue')\n\n/** Create the TanStack `listLabels` server tool. */\nexport const listLabels = toolFactory('listLabels')\n\n/** Create the TanStack `addLabels` server tool. */\nexport const addLabels = toolFactory('addLabels')\n\n/** Create the TanStack `removeLabel` server tool. */\nexport const removeLabel = toolFactory('removeLabel')\n\n/** Create the TanStack `createLabel` server tool. */\nexport const createLabel = toolFactory('createLabel')\n\n/** Create the TanStack `updateLabel` server tool. */\nexport const updateLabel = toolFactory('updateLabel')\n\n/** Create the TanStack `deleteLabel` server tool. */\nexport const deleteLabel = toolFactory('deleteLabel')\n\n/** Create the TanStack `addAssignees` server tool. */\nexport const addAssignees = toolFactory('addAssignees')\n\n/** Create the TanStack `removeAssignees` server tool. */\nexport const removeAssignees = toolFactory('removeAssignees')\n\n/** Create the TanStack `listIssueReactions` server tool. */\nexport const listIssueReactions = toolFactory('listIssueReactions')\n\n/** Create the TanStack `addIssueReaction` server tool. */\nexport const addIssueReaction = toolFactory('addIssueReaction')\n\n/** Create the TanStack `listCommentReactions` server tool. */\nexport const listCommentReactions = toolFactory('listCommentReactions')\n\n/** Create the TanStack `addCommentReaction` server tool. */\nexport const addCommentReaction = toolFactory('addCommentReaction')\n\n/** Create the TanStack `listDiscussions` server tool. */\nexport const listDiscussions = toolFactory('listDiscussions')\n\n/** Create the TanStack `getDiscussion` server tool. */\nexport const getDiscussion = toolFactory('getDiscussion')\n\n/** Create the TanStack `addDiscussionComment` server tool. */\nexport const addDiscussionComment = toolFactory('addDiscussionComment')\n\n/** Create the TanStack `listNotifications` server tool. */\nexport const listNotifications = toolFactory('listNotifications')\n\n/** Create the TanStack `markNotificationRead` server tool. */\nexport const markNotificationRead = toolFactory('markNotificationRead')\n\n/** Create the TanStack `searchCode` server tool. */\nexport const searchCode = toolFactory('searchCode')\n\n/** Create the TanStack `searchRepositories` server tool. */\nexport const searchRepositories = toolFactory('searchRepositories')\n\n/** Create the TanStack `searchIssues` server tool. */\nexport const searchIssues = toolFactory('searchIssues')\n\n/** Create the TanStack `listCommits` server tool. */\nexport const listCommits = toolFactory('listCommits')\n\n/** Create the TanStack `getCommit` server tool. */\nexport const getCommit = toolFactory('getCommit')\n\n/** Create the TanStack `getBlame` server tool. */\nexport const getBlame = toolFactory('getBlame')\n\n/** Create the TanStack `compareCommits` server tool. */\nexport const compareCommits = toolFactory('compareCommits')\n\n/** Create the TanStack `listGists` server tool. */\nexport const listGists = toolFactory('listGists')\n\n/** Create the TanStack `getGist` server tool. */\nexport const getGist = toolFactory('getGist')\n\n/** Create the TanStack `listGistComments` server tool. */\nexport const listGistComments = toolFactory('listGistComments')\n\n/** Create the TanStack `createGist` server tool. */\nexport const createGist = toolFactory('createGist')\n\n/** Create the TanStack `updateGist` server tool. */\nexport const updateGist = toolFactory('updateGist')\n\n/** Create the TanStack `deleteGist` server tool. */\nexport const deleteGist = toolFactory('deleteGist')\n\n/** Create the TanStack `createGistComment` server tool. */\nexport const createGistComment = toolFactory('createGistComment')\n\n/** Create the TanStack `listWorkflows` server tool. */\nexport const listWorkflows = toolFactory('listWorkflows')\n\n/** Create the TanStack `listWorkflowRuns` server tool. */\nexport const listWorkflowRuns = toolFactory('listWorkflowRuns')\n\n/** Create the TanStack `getWorkflowRun` server tool. */\nexport const getWorkflowRun = toolFactory('getWorkflowRun')\n\n/** Create the TanStack `listWorkflowJobs` server tool. */\nexport const listWorkflowJobs = toolFactory('listWorkflowJobs')\n\n/** Create the TanStack `getWorkflowJobLogs` server tool. */\nexport const getWorkflowJobLogs = toolFactory('getWorkflowJobLogs')\n\n/** Create the TanStack `triggerWorkflow` server tool. */\nexport const triggerWorkflow = toolFactory('triggerWorkflow')\n\n/** Create the TanStack `cancelWorkflowRun` server tool. */\nexport const cancelWorkflowRun = toolFactory('cancelWorkflowRun')\n\n/** Create the TanStack `rerunWorkflowRun` server tool. */\nexport const rerunWorkflowRun = toolFactory('rerunWorkflowRun')\n\n/** Create the TanStack `listCheckRuns` server tool. */\nexport const listCheckRuns = toolFactory('listCheckRuns')\n\n/** Create the TanStack `getCombinedStatus` server tool. */\nexport const getCombinedStatus = toolFactory('getCombinedStatus')\n\n/** Create the TanStack `getCiFailureContext` server tool. */\nexport const getCiFailureContext = toolFactory('getCiFailureContext')\n\n/** Create the TanStack `listReleases` server tool. */\nexport const listReleases = toolFactory('listReleases')\n\n/** Create the TanStack `getLatestRelease` server tool. */\nexport const getLatestRelease = toolFactory('getLatestRelease')\n\n/** Create the TanStack `getRelease` server tool. */\nexport const getRelease = toolFactory('getRelease')\n\n/** Create the TanStack `getReleaseContext` server tool. */\nexport const getReleaseContext = toolFactory('getReleaseContext')\n\n/** Create the TanStack `createRelease` server tool. */\nexport const createRelease = toolFactory('createRelease')\n\n/** Create the TanStack `updateRelease` server tool. */\nexport const updateRelease = toolFactory('updateRelease')\n\n/** Create the TanStack `deleteRelease` server tool. */\nexport const deleteRelease = toolFactory('deleteRelease')\n\n/** Create the TanStack `listCodeScanningAlerts` server tool. */\nexport const listCodeScanningAlerts = toolFactory('listCodeScanningAlerts')\n\n/** Create the TanStack `listDependabotAlerts` server tool. */\nexport const listDependabotAlerts = toolFactory('listDependabotAlerts')\n\n/** Create the TanStack `listSecretScanningAlerts` server tool. */\nexport const listSecretScanningAlerts = toolFactory('listSecretScanningAlerts')\n"],"mappings":";;;;;;;AA6CA,MAAa,4BAAY,IAAI,QAAqG;AAElI,SAAS,UAAoC,MAAS,OAAqC,SAAqD;CAC9I,MAAM,aAAa,oBAAoB;CACvC,MAAM,eAAe,0BAA0B,KAAK;CACpD,MAAM,cAAc,QAAQ,UAAU,oBAAoB,WAAW,aAAa,QAAQ,OAAO,IAAI,WAAW;CAChH,MAAM,gBAAgB,UAA4C;EAChE,MAAM,OAAO,YAAY,MAAM,KAAK;EACpC,OAAO,QAAQ,UAAU,iBAAiB,MAAM,QAAQ,OAAO,IAAI;CACrE;CACA,MAAM,OAAO,QAAQ,kBAAkB,sBAAsB,IAAI,IAAI,OAAO;CAC5E,MAAM,OAAO,kBAAkB;CAC/B,MAAM,QAAQ,eAAe;EAC3B;EACA,aAAa,QAAQ,eAAe,WAAW;EAC/C;EACA,eAAe,SAAS;CAC1B,CAAC,CAAC,CAAC,OAAO,OAAO,UAAU;EACzB,MAAM,WAAW,aAAa,KAAK;EACnC,MAAM,cAAc,SAAS,wBAAwB,SAAS,cAC1D;GAAE,QAAQ,QAAQ;GAAQ,WAAW,QAAQ;GAAW,WAAW,QAAQ;EAAU,IACrF,SAAS,sBAAsB,SAAS,+BAA+B,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;EAC/G,OAAO,eAAe,MAAM,KAAK;GAAE,G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a,YAAY,YAAY;;AAGlD,MAAa,oBAAoB,YAAY,mBAAmB;;AAGhE,MAAa,gBAAgB,YAAY,eAAe;;AAGxD,MAAa,mBAAmB,YAAY,kBAAkB;;AAG9D,MAAa,iBAAiB,YAAY,gBAAgB;;AAG1D,MAAa,mBAAmB,YAAY,kBAAkB;;AAG9D,MAAa,qBAAqB,YAAY,oBAAoB;;AAGlE,MAAa,kBAAkB,YAAY,iBAAiB;;AAG5D,MAAa,oBAAoB,YAAY,mBAAmB;;AAGhE,MAAa,mBAAmB,YAAY,kBAAkB;;AAG9D,MAAa,gBAAgB,YAAY,eAAe;;AAGxD,MAAa,oBAAoB,YAAY,mBAAmB;;AAGhE,MAAa,sBAAsB,YAAY,qBAAqB;;AAGpE,MAAa,eAAe,YAAY,cAAc;;AAGtD,MAAa,mBAAmB,YAAY,kBAAkB;;AAG9D,MAAa,aAAa,YAAY,YAAY;;AAGlD,MAAa,oBAAoB,YAAY,mBAAmB;;AAGhE,MAAa,gBAAgB,YAAY,eAAe;;AAGxD,MAAa,gBAAgB,YAAY,eAAe;;AAGxD,MAAa,gBAAgB,YAAY,eAAe;;AAGxD,MAAa,yBAAyB,YAAY,wBAAwB;;AAG1E,MAAa,uBAAuB,YAAY,sBAAsB;;AAGtE,MAAa,2BAA2B,YAAY,0BAA0B"}
|
|
1
|
+
{"version":3,"file":"tanstack.mjs","names":[],"sources":["../src/tanstack/tools.ts","../src/tanstack/evaluation.ts","../src/tanstack/approval.ts","../src/tanstack/agent.ts","../src/tanstack/factories.ts"],"sourcesContent":["import { toolDefinition } from '@tanstack/ai'\nimport type { ServerTool } from '@tanstack/ai'\nimport type { z } from 'zod'\nimport { GITHUB_TOOL_CATALOG, isGithubWriteToolName } from '../core/catalog'\nimport { GITHUB_TOOL_CORES } from '../core/cores'\nimport { resolveApprovalMode, type ApprovalConfig, type ToolApprovalMode } from '../core/approval-policy'\nimport { mergeContextArgs, softenContextSchema, type GithubToolsContext } from '../core/context'\nimport { resolvePresetTools, type GithubToolPreset, type PresetToolName } from '../core/presets'\nimport { githubTokenCall, withGithubGuardrails, type GithubTokenInput } from '../core/token'\nimport type { GithubGuardrails } from '../core/guardrails'\nimport { dryRunWrite, type GithubDryRunResult } from '../core/dry-run'\nimport type { GithubToolName } from '../core/tool-names'\nimport { ALL_GITHUB_TOOL_NAMES } from '../core/tool-names'\nimport { stripRateLimit } from '../core/rate-limit'\nimport type { CommitIdentity } from '../types'\nimport type { GithubWriteToolName } from '../core/write-tools'\n\ntype Catalog = typeof GITHUB_TOOL_CATALOG\ntype CoreResult<N extends GithubToolName> = Awaited<ReturnType<(typeof GITHUB_TOOL_CORES)[N]>>\n\n/**\n * A TanStack server tool with the catalog's input schema and core return type. A write tool created\n * with `dryRun: true` returns a `GithubDryRunResult` instead, so narrow with `'dryRun' in result`.\n */\nexport type GithubTanstackTool<N extends GithubToolName = GithubToolName> = N extends GithubToolName\n ? Omit<ServerTool<Catalog[N]['inputSchema'], undefined, N, unknown, boolean>, 'execute'> & {\n execute: (input: z.input<Catalog[N]['inputSchema']>) => Promise<N extends GithubWriteToolName ? CoreResult<N> | GithubDryRunResult : CoreResult<N>>\n }\n : never\n\n/** Supported TanStack tool customizations. */\nexport type TanstackToolOverrides = {\n description?: string\n needsApproval?: boolean\n}\n\n/** Options shared by TanStack tool factories. */\nexport type TanstackToolOptions = Omit<TanstackToolOverrides, 'needsApproval'> & {\n needsApproval?: ToolApprovalMode\n context?: GithubToolsContext\n author?: CommitIdentity\n committer?: CommitIdentity\n coAuthors?: CommitIdentity[]\n /** Repositories and branches the tool may act on, checked before each call reaches GitHub. */\n guardrails?: GithubGuardrails\n /** Send no write to GitHub: a write returns a `GithubDryRunResult` instead, after the guardrails check. */\n dryRun?: boolean\n}\n\n/** Configuration for a native array of GitHub server tools. */\nexport type CreateGithubToolsOptions = Omit<TanstackToolOptions, 'description' | 'needsApproval'> & {\n token?: GithubTokenInput\n preset?: GithubToolPreset | readonly GithubToolPreset[]\n requireApproval?: ApprovalConfig\n overrides?: Partial<Record<GithubToolName, TanstackToolOverrides>>\n}\n\nexport const autoTools = new WeakMap<object, { name: GithubToolName, resolveInput: (input: unknown) => Record<string, unknown> }>()\n\nfunction buildTool<N extends GithubToolName>(name: N, token: GithubTokenInput | undefined, options: TanstackToolOptions): GithubTanstackTool<N> {\n const descriptor = GITHUB_TOOL_CATALOG[name]\n const resolveToken = withGithubGuardrails(token, options.guardrails)\n const inputSchema = options.context ? softenContextSchema(descriptor.inputSchema, options.context) : descriptor.inputSchema\n const resolveInput = (input: unknown): Record<string, unknown> => {\n const args = inputSchema.parse(input) as Record<string, unknown>\n return options.context ? mergeContextArgs(args, options.context) : args\n }\n const mode = options.needsApproval ?? (isGithubWriteToolName(name) ? true : false)\n const dryRun = options.dryRun && isGithubWriteToolName(name)\n const core = GITHUB_TOOL_CORES[name] as (input: Record<string, unknown> & { token: string }) => Promise<unknown>\n const built = toolDefinition({\n name,\n description: options.description ?? descriptor.description,\n inputSchema,\n // A dry-run write asks nobody; its result reports what approval would have decided instead. Reads still run, so they keep their approval.\n needsApproval: mode !== false && !dryRun,\n }).server(async (input) => {\n const resolved = resolveInput(input)\n if (dryRun) {\n // `'auto'` is decided by the approval middleware, which a dry-run write never reaches.\n return dryRunWrite(name, resolved, options.guardrails, () => mode === 'auto' ? undefined : { required: mode })\n }\n const attribution = name === 'createOrUpdateFile' || name === 'editFiles'\n ? { author: options.author, committer: options.committer, coAuthors: options.coAuthors }\n : name === 'mergePullRequest' || name === 'enablePullRequestAutoMerge' ? { coAuthors: options.coAuthors, branches: options.guardrails?.branches }\n : name === 'updatePullRequestBranch' ? { guardrails: options.guardrails } : {}\n return stripRateLimit(await core({ ...resolved, ...attribution, token: await resolveToken(githubTokenCall(name, resolved)) }))\n })\n if (mode === 'auto' && !dryRun) autoTools.set(built, { name, resolveInput })\n return built as unknown as GithubTanstackTool<N>\n}\n\nexport function toolFactory<N extends GithubToolName>(name: N) {\n return (token: GithubTokenInput, options: TanstackToolOptions = {}): GithubTanstackTool<N> => buildTool(name, token, options)\n}\n\n/** Create TanStack server tools, optionally restricted to one or more presets. */\nexport function createGithubTools<const P extends GithubToolPreset | readonly GithubToolPreset[] | undefined = undefined>(\n options: CreateGithubToolsOptions & { preset?: P } = {},\n): GithubTanstackTool<P extends GithubToolPreset ? PresetToolName<P> : P extends readonly GithubToolPreset[] ? PresetToolName<P[number]> : GithubToolName>[] {\n const allowed = options.preset ? resolvePresetTools(typeof options.preset === 'string' ? options.preset : [...options.preset]) : null\n const tools = ALL_GITHUB_TOOL_NAMES.filter(name => !allowed || allowed.has(name)).map(name => buildTool(name, options.token, {\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n needsApproval: isGithubWriteToolName(name) ? resolveApprovalMode(name, options.requireApproval ?? true) : false,\n ...options.overrides?.[name],\n guardrails: options.guardrails,\n dryRun: options.dryRun,\n }))\n return tools as ReturnType<typeof createGithubTools<P>>\n}\n","import { boolean, decide, score } from '@tanstack/ai'\nimport type { EvaluateAdapter, ModelMessage } from '@tanstack/ai'\nimport { GITHUB_TOOL_CATALOG } from '../core/catalog'\nimport { INTENT_QUESTION, PRESET_PURPOSES, RISK_QUESTION, conversationState, rankPresets, requiresApproval, type RoutablePreset } from '../core/evaluation-policy'\nimport { PRESET_TOOLS } from '../core/presets'\nimport { githubToolsErrors } from '../core/errors'\nimport type { GithubToolName } from '../core/tool-names'\n\n/** Jev configuration for TanStack automatic approval and preset selection. */\nexport type GithubEvaluationOptions = {\n /** Defaults to vercelGatewayDecider('typesafe-ai/jev') using Gateway authentication. */\n adapter?: EvaluateAdapter\n /** Maximum risk on the 0–2 rubric. @default 1 */\n maxRisk?: number\n /** Minimum probability that the user requested the call. @default 0.6 */\n minIntent?: number\n /** Minimum probability for a preset to qualify. @default 0.7 */\n minPresetProbability?: number\n /** Maximum number of combined presets. @default 2 */\n maxPresets?: number\n}\n\n// `@tanstack/ai-vercel-gateway` 0.3 types only the `typesafe-ai/jev` alias, not pinned releases.\nconst TANSTACK_DEFAULT_EVALUATION_MODEL = 'typesafe-ai/jev'\n\nasync function evaluationAdapter(options: GithubEvaluationOptions) {\n if (options.adapter) return options.adapter\n const { vercelGatewayDecider } = await import('@tanstack/ai-vercel-gateway')\n return vercelGatewayDecider(TANSTACK_DEFAULT_EVALUATION_MODEL)\n}\n\nexport function latestUserText(messages: readonly ModelMessage[]): string {\n return conversationState(messages, messageText).request\n}\n\nfunction messageText(message: ModelMessage): string {\n if (typeof message.content === 'string') return message.content\n return message.content?.flatMap(part => part.type === 'text' ? [part.content] : []).join('\\n') ?? ''\n}\n\nfunction evaluationFailed(error: unknown, options: GithubEvaluationOptions, fallback: string, signal?: AbortSignal) {\n signal?.throwIfAborted()\n if (error instanceof Error && error.name === 'AbortError') throw error\n const cause = error instanceof Error ? error : new Error(String(error))\n console.warn('[github-tools]', githubToolsErrors.EVALUATION_FAILED({\n model: options.adapter?.model ?? TANSTACK_DEFAULT_EVALUATION_MODEL,\n fallback,\n detail: cause.message,\n cause,\n }))\n}\n\nexport async function needsAutoApproval(name: GithubToolName, input: unknown, messages: readonly ModelMessage[], options: GithubEvaluationOptions = {}, signal?: AbortSignal): Promise<boolean> {\n signal?.throwIfAborted()\n try {\n const result = await decide({\n adapter: await evaluationAdapter(options),\n state: { ...conversationState(messages, messageText), toolCall: { tool: name, description: GITHUB_TOOL_CATALOG[name].description, input } },\n questions: {\n risk: score({ instructions: RISK_QUESTION.instructions, levels: RISK_QUESTION.criteria }),\n intent: boolean(INTENT_QUESTION),\n },\n abortSignal: signal,\n })\n signal?.throwIfAborted()\n return requiresApproval(result.risk.score, result.intent.probability, options)\n } catch (error) {\n evaluationFailed(error, options, `asking approval for ${name}`, signal)\n return true\n }\n}\n\nexport async function selectPresets(messages: readonly ModelMessage[], options: GithubEvaluationOptions = {}, signal?: AbortSignal): Promise<RoutablePreset[]> {\n signal?.throwIfAborted()\n try {\n const presets = Object.keys(PRESET_PURPOSES) as RoutablePreset[]\n const result = await decide({\n adapter: await evaluationAdapter(options),\n state: conversationState(messages, messageText),\n questions: Object.fromEntries(presets.map(preset => [preset, boolean({\n instructions: 'Does handling this GitHub request need the tools of this preset?',\n criteria: { true: JSON.stringify({ purpose: PRESET_PURPOSES[preset], tools: [...PRESET_TOOLS[preset]] }) },\n })])),\n abortSignal: signal,\n })\n signal?.throwIfAborted()\n return rankPresets(Object.fromEntries(presets.map(preset => [preset, result[preset].probability])) as Record<RoutablePreset, number>, options)\n } catch (error) {\n evaluationFailed(error, options, 'using the repo-explorer preset', signal)\n return ['repo-explorer']\n }\n}\n","import { isDeepStrictEqual } from 'node:util'\nimport type { ChatMiddleware, ChatMiddlewareContext, Tool } from '@tanstack/ai'\nimport { autoTools } from './tools'\nimport { needsAutoApproval, type GithubEvaluationOptions } from './evaluation'\nimport { githubToolApproval } from './interrupts'\n\ntype Decision = { toolCallId: string, toolName: string, input: Record<string, unknown>, approved: boolean }\ntype RunState = { decisions: Decision[] }\n\n/** Options for GitHub approval middleware. Register githubToolApproval with chat(). */\nexport type GithubApprovalMiddlewareOptions = {\n tools: readonly Tool[]\n evaluation?: GithubEvaluationOptions\n}\n\n/** Evaluate automatic GitHub writes before execution and request review through githubToolApproval. */\nexport function createGithubApprovalMiddleware({ tools, evaluation }: GithubApprovalMiddlewareOptions): ChatMiddleware<unknown, typeof githubToolApproval> {\n const managed = new Map(tools.flatMap(tool => {\n const info = autoTools.get(tool)\n return info ? [[tool.name, { tool, ...info }] as const] : []\n }))\n const runs = new WeakMap<ChatMiddlewareContext, RunState>()\n const state = (ctx: ChatMiddlewareContext) => runs.get(ctx)!\n const decisionFor = (ctx: ChatMiddlewareContext, toolCallId: string | undefined, toolName: string, input: unknown) =>\n state(ctx).decisions.find(decision => decision.toolCallId === toolCallId && decision.toolName === toolName && isDeepStrictEqual(decision.input, input))\n\n return {\n name: 'github-tools.approval',\n onConfig(ctx, config) {\n if (ctx.phase === 'init') runs.set(ctx, { decisions: [] })\n return {\n tools: config.tools?.map(tool => {\n const info = managed.get(tool.name)\n if (!info || tool !== info.tool) return tool\n return {\n ...tool,\n needsApproval: false,\n execute: async (input, execution) => {\n const resolved = info.resolveInput(input)\n if (!decisionFor(ctx, execution?.toolCallId, tool.name, resolved)?.approved) {\n throw new Error(`GitHub tool ${tool.name} has no approval for this input.`)\n }\n return tool.execute!(resolved, execution)\n },\n }\n }),\n }\n },\n onInterruptResolution(ctx, resolutions) {\n for (const resolution of resolutions.for(githubToolApproval)) {\n const payload = resolution.request.payload\n if (!payload || !managed.has(payload.toolName)) continue\n state(ctx).decisions.push({ ...payload, approved: resolution.status === 'resolved' && resolution.response.approved })\n }\n },\n async onInterruptBoundary(ctx) {\n if (ctx.phase !== 'beforeTools') return\n const completed = new Set(ctx.messages.filter(message => message.role === 'tool').map(message => message.toolCallId))\n const calls = ctx.messages.flatMap(message => message.role === 'assistant' ? message.toolCalls ?? [] : []).filter(call => !completed.has(call.id))\n const interrupts = []\n for (const call of calls) {\n const info = managed.get(call.function.name)\n if (!info) continue\n const input = info.resolveInput(JSON.parse(call.function.arguments))\n if (decisionFor(ctx, call.id, info.name, input)) continue\n const needsApproval = await needsAutoApproval(info.name, input, ctx.messages, evaluation, ctx.signal)\n if (needsApproval) {\n interrupts.push(githubToolApproval.interrupt({\n key: call.id,\n reason: 'github-tool-approval',\n message: `Approve ${info.name}?`,\n payload: { toolCallId: call.id, toolName: info.name, input },\n }))\n } else {\n state(ctx).decisions.push({ toolCallId: call.id, toolName: info.name, input, approved: true })\n }\n }\n if (interrupts.length) return { interrupts }\n },\n onBeforeToolCall(ctx, call) {\n const info = managed.get(call.toolName)\n if (!info) return\n const decision = decisionFor(ctx, call.toolCallId, call.toolName, info.resolveInput(call.args))\n if (!decision) return { type: 'skip', result: { error: 'No approval recorded for this GitHub tool call and input.' } }\n if (!decision.approved) return { type: 'skip', result: { error: 'User denied this GitHub tool call.' } }\n },\n }\n}\n","import { chat, convertMessagesToModelMessages } from '@tanstack/ai'\nimport type { AnyTextAdapter, ChatMiddleware, ChatStream } from '@tanstack/ai'\nimport { resolveInstructions } from '../core/instructions'\nimport { PRESET_TOOLS, type GithubToolPreset } from '../core/presets'\nimport { createGithubTools, type CreateGithubToolsOptions } from './tools'\nimport { selectPresets, type GithubEvaluationOptions } from './evaluation'\nimport { createGithubApprovalMiddleware } from './approval'\nimport { githubToolApproval } from './interrupts'\n\ntype NativeOptions<A extends AnyTextAdapter> = Parameters<typeof chat<A, undefined, true>>[0]\ntype ChatSettings<A extends AnyTextAdapter> = Omit<NativeOptions<A>, 'tools' | 'messages' | 'systemPrompts' | 'context' | 'middleware' | 'interrupts' | 'stream' | 'outputSchema'>\n\n/** Configure a GitHub agent backed by TanStack chat(). */\nexport type CreateGithubAgentOptions<A extends AnyTextAdapter> = ChatSettings<A> & Omit<CreateGithubToolsOptions, 'preset'> & {\n /** Explicit presets or request-based selection with Jev. */\n preset?: GithubToolPreset | readonly GithubToolPreset[] | 'auto'\n /** Replace the default instructions; repository context is still appended. */\n instructions?: string\n /** Append to default instructions, unless instructions is supplied. */\n additionalInstructions?: string\n /** Evaluator adapter and thresholds for automatic routing and approval. */\n evaluation?: GithubEvaluationOptions\n /** Additional TanStack middleware. GitHub approval runs before these hooks. */\n middleware?: ChatMiddleware[]\n}\n\n/** One agent invocation, including TanStack cancellation and continuation options. */\nexport type GithubAgentCallOptions<A extends AnyTextAdapter> = Omit<Partial<ChatSettings<A>>, 'adapter'> & (\n | { prompt: string, messages?: never }\n | { messages: NonNullable<NativeOptions<A>['messages']>, prompt?: never }\n)\n\n/** A reusable, stateless TanStack GitHub agent. */\nexport type GithubAgent<A extends AnyTextAdapter> = {\n /** Collect TanStack's text result. Throws on interrupts; use stream() for approval UIs. */\n generate: (options: GithubAgentCallOptions<A>) => Promise<string>\n /** Run the tool loop as native TanStack events, including approval interrupts. */\n stream: (options: GithubAgentCallOptions<A>) => ChatStream\n}\n\n/** Create a GitHub agent with preset instructions, tools, and automatic approval middleware. */\nexport function createGithubAgent<A extends AnyTextAdapter>({\n token, preset, requireApproval, overrides, context, author, committer, coAuthors, guardrails, dryRun,\n instructions, additionalInstructions, evaluation, middleware = [], ...settings\n}: CreateGithubAgentOptions<A>): GithubAgent<A> {\n async function prepare(call: GithubAgentCallOptions<A>) {\n const { prompt, messages: suppliedMessages, ...callSettings } = call\n const messages = suppliedMessages ?? [{ role: 'user' as const, content: prompt! }]\n const modelMessages = convertMessagesToModelMessages(messages)\n const continuingAuto = preset === 'auto' && Boolean((callSettings.resume ?? settings.resume)?.length)\n const selected = preset === 'auto'\n ? continuingAuto ? 'repo-explorer' : await selectPresets(modelMessages, evaluation, (callSettings.abortController ?? settings.abortController)?.signal)\n : preset\n const availableTools = createGithubTools({ token, preset: continuingAuto ? undefined : selected, requireApproval, overrides, context, author, committer, coAuthors, guardrails, dryRun })\n const completed = new Set(modelMessages.filter(message => message.role === 'tool').map(message => message.toolCallId))\n const pendingNames = new Set(modelMessages.flatMap(message => message.role === 'assistant' ? message.toolCalls ?? [] : [])\n .filter(call => !completed.has(call.id)).map(call => call.function.name))\n const continuationNames = new Set<string>([...PRESET_TOOLS['repo-explorer'], ...pendingNames])\n const tools = continuingAuto ? availableTools.filter(tool => continuationNames.has(tool.name)) : availableTools\n const promptPreset: GithubToolPreset | GithubToolPreset[] | undefined = typeof selected === 'string' || selected === undefined\n ? selected\n : selected.length === 1 ? selected[0] : [...selected]\n return {\n ...settings,\n ...callSettings,\n messages,\n tools,\n systemPrompts: [resolveInstructions({ preset: continuingAuto ? undefined : promptPreset, instructions, additionalInstructions, context })],\n middleware: [createGithubApprovalMiddleware({ tools, evaluation }), ...middleware],\n interrupts: [githubToolApproval],\n }\n }\n\n return {\n async generate(call) {\n const prepared = await prepare(call)\n let interrupted = false\n const observeInterrupt: ChatMiddleware = {\n name: 'github-tools.generate',\n onChunk(_ctx, chunk) {\n if (chunk.type === 'RUN_FINISHED' && chunk.outcome?.type === 'interrupt') interrupted = true\n },\n }\n const text = await chat({ ...prepared, middleware: [observeInterrupt, ...prepared.middleware], stream: false })\n if (interrupted) throw new Error('GitHub agent requires review. Use stream() to handle approval interrupts and continuation.')\n return text\n },\n async *stream(call) {\n yield* chat({ ...await prepare(call), stream: true })\n },\n }\n}\n","import { toolFactory } from './tools'\n\n/** Create the TanStack `getRepository` server tool. */\nexport const getRepository = toolFactory('getRepository')\n\n/** Create the TanStack `listBranches` server tool. */\nexport const listBranches = toolFactory('listBranches')\n\n/** Create the TanStack `getFileContent` server tool. */\nexport const getFileContent = toolFactory('getFileContent')\n\n/** Create the TanStack `getRepositoryTree` server tool. */\nexport const getRepositoryTree = toolFactory('getRepositoryTree')\n\n/** Create the TanStack `createBranch` server tool. */\nexport const createBranch = toolFactory('createBranch')\n\n/** Create the TanStack `deleteBranch` server tool. */\nexport const deleteBranch = toolFactory('deleteBranch')\n\n/** Create the TanStack `forkRepository` server tool. */\nexport const forkRepository = toolFactory('forkRepository')\n\n/** Create the TanStack `createRepository` server tool. */\nexport const createRepository = toolFactory('createRepository')\n\n/** Create the TanStack `createOrUpdateFile` server tool. */\nexport const createOrUpdateFile = toolFactory('createOrUpdateFile')\n\n/** Create the TanStack `editFiles` server tool. */\nexport const editFiles = toolFactory('editFiles')\n\n/** Create the TanStack `listPullRequests` server tool. */\nexport const listPullRequests = toolFactory('listPullRequests')\n\n/** Create the TanStack `getPullRequest` server tool. */\nexport const getPullRequest = toolFactory('getPullRequest')\n\n/** Create the TanStack `createPullRequest` server tool. */\nexport const createPullRequest = toolFactory('createPullRequest')\n\n/** Create the TanStack `mergePullRequest` server tool. */\nexport const mergePullRequest = toolFactory('mergePullRequest')\n\n/** Create the TanStack `enablePullRequestAutoMerge` server tool. */\nexport const enablePullRequestAutoMerge = toolFactory('enablePullRequestAutoMerge')\n\n/** Create the TanStack `disablePullRequestAutoMerge` server tool. */\nexport const disablePullRequestAutoMerge = toolFactory('disablePullRequestAutoMerge')\n\n/** Create the TanStack `getBranchRules` server tool. */\nexport const getBranchRules = toolFactory('getBranchRules')\n\n/** Create the TanStack `getCollaboratorPermission` server tool. */\nexport const getCollaboratorPermission = toolFactory('getCollaboratorPermission')\n\n/** Create the TanStack `updatePullRequest` server tool. */\nexport const updatePullRequest = toolFactory('updatePullRequest')\n\n/** Create the TanStack `updatePullRequestBranch` server tool. */\nexport const updatePullRequestBranch = toolFactory('updatePullRequestBranch')\n\n/** Create the TanStack `addPullRequestComment` server tool. */\nexport const addPullRequestComment = toolFactory('addPullRequestComment')\n\n/** Create the TanStack `updatePullRequestComment` server tool. */\nexport const updatePullRequestComment = toolFactory('updatePullRequestComment')\n\n/** Create the TanStack `deletePullRequestComment` server tool. */\nexport const deletePullRequestComment = toolFactory('deletePullRequestComment')\n\n/** Create the TanStack `listPullRequestFiles` server tool. */\nexport const listPullRequestFiles = toolFactory('listPullRequestFiles')\n\n/** Create the TanStack `listPullRequestReviews` server tool. */\nexport const listPullRequestReviews = toolFactory('listPullRequestReviews')\n\n/** Create the TanStack `createPullRequestReview` server tool. */\nexport const createPullRequestReview = toolFactory('createPullRequestReview')\n\n/** Create the TanStack `listPullRequestReviewThreads` server tool. */\nexport const listPullRequestReviewThreads = toolFactory('listPullRequestReviewThreads')\n\n/** Create the TanStack `replyToReviewComment` server tool. */\nexport const replyToReviewComment = toolFactory('replyToReviewComment')\n\n/** Create the TanStack `resolveReviewThread` server tool. */\nexport const resolveReviewThread = toolFactory('resolveReviewThread')\n\n/** Create the TanStack `requestReviewers` server tool. */\nexport const requestReviewers = toolFactory('requestReviewers')\n\n/** Create the TanStack `getPullRequestContext` server tool. */\nexport const getPullRequestContext = toolFactory('getPullRequestContext')\n\n/** Create the TanStack `getIssueContext` server tool. */\nexport const getIssueContext = toolFactory('getIssueContext')\n\n/** Create the TanStack `listIssues` server tool. */\nexport const listIssues = toolFactory('listIssues')\n\n/** Create the TanStack `getIssue` server tool. */\nexport const getIssue = toolFactory('getIssue')\n\n/** Create the TanStack `listIssueComments` server tool. */\nexport const listIssueComments = toolFactory('listIssueComments')\n\n/** Create the TanStack `createIssue` server tool. */\nexport const createIssue = toolFactory('createIssue')\n\n/** Create the TanStack `addIssueComment` server tool. */\nexport const addIssueComment = toolFactory('addIssueComment')\n\n/** Create the TanStack `updateIssueComment` server tool. */\nexport const updateIssueComment = toolFactory('updateIssueComment')\n\n/** Create the TanStack `deleteIssueComment` server tool. */\nexport const deleteIssueComment = toolFactory('deleteIssueComment')\n\n/** Create the TanStack `closeIssue` server tool. */\nexport const closeIssue = toolFactory('closeIssue')\n\n/** Create the TanStack `updateIssue` server tool. */\nexport const updateIssue = toolFactory('updateIssue')\n\n/** Create the TanStack `listLabels` server tool. */\nexport const listLabels = toolFactory('listLabels')\n\n/** Create the TanStack `addLabels` server tool. */\nexport const addLabels = toolFactory('addLabels')\n\n/** Create the TanStack `removeLabel` server tool. */\nexport const removeLabel = toolFactory('removeLabel')\n\n/** Create the TanStack `createLabel` server tool. */\nexport const createLabel = toolFactory('createLabel')\n\n/** Create the TanStack `updateLabel` server tool. */\nexport const updateLabel = toolFactory('updateLabel')\n\n/** Create the TanStack `deleteLabel` server tool. */\nexport const deleteLabel = toolFactory('deleteLabel')\n\n/** Create the TanStack `addAssignees` server tool. */\nexport const addAssignees = toolFactory('addAssignees')\n\n/** Create the TanStack `removeAssignees` server tool. */\nexport const removeAssignees = toolFactory('removeAssignees')\n\n/** Create the TanStack `listMilestones` server tool. */\nexport const listMilestones = toolFactory('listMilestones')\n\n/** Create the TanStack `listSubIssues` server tool. */\nexport const listSubIssues = toolFactory('listSubIssues')\n\n/** Create the TanStack `addSubIssue` server tool. */\nexport const addSubIssue = toolFactory('addSubIssue')\n\n/** Create the TanStack `listIssueReactions` server tool. */\nexport const listIssueReactions = toolFactory('listIssueReactions')\n\n/** Create the TanStack `addIssueReaction` server tool. */\nexport const addIssueReaction = toolFactory('addIssueReaction')\n\n/** Create the TanStack `listCommentReactions` server tool. */\nexport const listCommentReactions = toolFactory('listCommentReactions')\n\n/** Create the TanStack `addCommentReaction` server tool. */\nexport const addCommentReaction = toolFactory('addCommentReaction')\n\n/** Create the TanStack `listDiscussions` server tool. */\nexport const listDiscussions = toolFactory('listDiscussions')\n\n/** Create the TanStack `getDiscussion` server tool. */\nexport const getDiscussion = toolFactory('getDiscussion')\n\n/** Create the TanStack `addDiscussionComment` server tool. */\nexport const addDiscussionComment = toolFactory('addDiscussionComment')\n\n/** Create the TanStack `listNotifications` server tool. */\nexport const listNotifications = toolFactory('listNotifications')\n\n/** Create the TanStack `markNotificationRead` server tool. */\nexport const markNotificationRead = toolFactory('markNotificationRead')\n\n/** Create the TanStack `searchCode` server tool. */\nexport const searchCode = toolFactory('searchCode')\n\n/** Create the TanStack `searchRepositories` server tool. */\nexport const searchRepositories = toolFactory('searchRepositories')\n\n/** Create the TanStack `searchIssues` server tool. */\nexport const searchIssues = toolFactory('searchIssues')\n\n/** Create the TanStack `listCommits` server tool. */\nexport const listCommits = toolFactory('listCommits')\n\n/** Create the TanStack `getCommit` server tool. */\nexport const getCommit = toolFactory('getCommit')\n\n/** Create the TanStack `getBlame` server tool. */\nexport const getBlame = toolFactory('getBlame')\n\n/** Create the TanStack `compareCommits` server tool. */\nexport const compareCommits = toolFactory('compareCommits')\n\n/** Create the TanStack `listGists` server tool. */\nexport const listGists = toolFactory('listGists')\n\n/** Create the TanStack `getGist` server tool. */\nexport const getGist = toolFactory('getGist')\n\n/** Create the TanStack `listGistComments` server tool. */\nexport const listGistComments = toolFactory('listGistComments')\n\n/** Create the TanStack `createGist` server tool. */\nexport const createGist = toolFactory('createGist')\n\n/** Create the TanStack `updateGist` server tool. */\nexport const updateGist = toolFactory('updateGist')\n\n/** Create the TanStack `deleteGist` server tool. */\nexport const deleteGist = toolFactory('deleteGist')\n\n/** Create the TanStack `createGistComment` server tool. */\nexport const createGistComment = toolFactory('createGistComment')\n\n/** Create the TanStack `listWorkflows` server tool. */\nexport const listWorkflows = toolFactory('listWorkflows')\n\n/** Create the TanStack `listWorkflowRuns` server tool. */\nexport const listWorkflowRuns = toolFactory('listWorkflowRuns')\n\n/** Create the TanStack `getWorkflowRun` server tool. */\nexport const getWorkflowRun = toolFactory('getWorkflowRun')\n\n/** Create the TanStack `listWorkflowJobs` server tool. */\nexport const listWorkflowJobs = toolFactory('listWorkflowJobs')\n\n/** Create the TanStack `getWorkflowJobLogs` server tool. */\nexport const getWorkflowJobLogs = toolFactory('getWorkflowJobLogs')\n\n/** Create the TanStack `triggerWorkflow` server tool. */\nexport const triggerWorkflow = toolFactory('triggerWorkflow')\n\n/** Create the TanStack `cancelWorkflowRun` server tool. */\nexport const cancelWorkflowRun = toolFactory('cancelWorkflowRun')\n\n/** Create the TanStack `rerunWorkflowRun` server tool. */\nexport const rerunWorkflowRun = toolFactory('rerunWorkflowRun')\n\n/** Create the TanStack `listCheckRuns` server tool. */\nexport const listCheckRuns = toolFactory('listCheckRuns')\n\n/** Create the TanStack `getCombinedStatus` server tool. */\nexport const getCombinedStatus = toolFactory('getCombinedStatus')\n\n/** Create the TanStack `createCommitStatus` server tool. */\nexport const createCommitStatus = toolFactory('createCommitStatus')\n\n/** Create the TanStack `getCiFailureContext` server tool. */\nexport const getCiFailureContext = toolFactory('getCiFailureContext')\n\n/** Create the TanStack `listReleases` server tool. */\nexport const listReleases = toolFactory('listReleases')\n\n/** Create the TanStack `getLatestRelease` server tool. */\nexport const getLatestRelease = toolFactory('getLatestRelease')\n\n/** Create the TanStack `getRelease` server tool. */\nexport const getRelease = toolFactory('getRelease')\n\n/** Create the TanStack `getReleaseContext` server tool. */\nexport const getReleaseContext = toolFactory('getReleaseContext')\n\n/** Create the TanStack `createRelease` server tool. */\nexport const createRelease = toolFactory('createRelease')\n\n/** Create the TanStack `updateRelease` server tool. */\nexport const updateRelease = toolFactory('updateRelease')\n\n/** Create the TanStack `deleteRelease` server tool. */\nexport const deleteRelease = toolFactory('deleteRelease')\n\n/** Create the TanStack `listCodeScanningAlerts` server tool. */\nexport const listCodeScanningAlerts = toolFactory('listCodeScanningAlerts')\n\n/** Create the TanStack `listDependabotAlerts` server tool. */\nexport const listDependabotAlerts = toolFactory('listDependabotAlerts')\n\n/** Create the TanStack `listSecretScanningAlerts` server tool. */\nexport const listSecretScanningAlerts = toolFactory('listSecretScanningAlerts')\n"],"mappings":";;;;;;;AAyDA,MAAa,4BAAY,IAAI,QAAqG;AAElI,SAAS,UAAoC,MAAS,OAAqC,SAAqD;CAC9I,MAAM,aAAa,oBAAoB;CACvC,MAAM,eAAe,qBAAqB,OAAO,QAAQ,UAAU;CACnE,MAAM,cAAc,QAAQ,UAAU,oBAAoB,WAAW,aAAa,QAAQ,OAAO,IAAI,WAAW;CAChH,MAAM,gBAAgB,UAA4C;EAChE,MAAM,OAAO,YAAY,MAAM,KAAK;EACpC,OAAO,QAAQ,UAAU,iBAAiB,MAAM,QAAQ,OAAO,IAAI;CACrE;CACA,MAAM,OAAO,QAAQ,kBAAkB,sBAAsB,IAAI,IAAI,OAAO;CAC5E,MAAM,SAAS,QAAQ,UAAU,sBAAsB,IAAI;CAC3D,MAAM,OAAO,kBAAkB;CAC/B,MAAM,QAAQ,eAAe;EAC3B;EACA,aAAa,QAAQ,eAAe,WAAW;EAC/C;EAEA,eAAe,SAAS,SAAS,CAAC;CACpC,CAAC,CAAC,CAAC,OAAO,OAAO,UAAU;EACzB,MAAM,WAAW,aAAa,KAAK;EACnC,IAAI,QAEF,OAAO,YAAY,MAAM,UAAU,QAAQ,kBAAkB,SAAS,SAAS,KAAA,IAAY,EAAE,UAAU,KAAK,CAAC;EAE/G,MAAM,cAAc,SAAS,wBAAwB,SAAS,cAC1D;GAAE,QAAQ,QAAQ;GAAQ,WAAW,QAAQ;GAAW,WAAW,QAAQ;EAAU,IACrF,SAAS,sBAAsB,SAAS,+BAA+B;GAAE,WAAW,QAAQ;GAAW,UAAU,QAAQ,YAAY;EAAS,IAC9I,SAAS,4BAA4B,EAAE,YAAY,QAAQ,WAAW,IAAI,CAAC;EAC/E,OAAO,eAAe,MAAM,KAAK;GAAE,GAAG;GAAU,GAAG;GAAa,OAAO,MAAM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-BR29EOoM.mjs";
|
|
2
2
|
import { ConnectError, ConnectorInstallationRequiredError, UserAuthorizationRequiredError, getToken } from "@vercel/connect";
|
|
3
|
-
|
|
3
|
+
// src/connect/connector.ts
|
|
4
4
|
/** Resolves a {@link GithubConnectorInput} to a connector name string. */
|
|
5
5
|
async function resolveGithubConnector(connector) {
|
|
6
6
|
return typeof connector === "function" ? await connector() : connector;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
//#region src/connect/scopes.ts
|
|
8
|
+
// src/connect/scopes.ts
|
|
10
9
|
/** Stable scope order for tool-derived unions (tests + Connect payloads). */
|
|
11
10
|
const SCOPE_ORDER = [
|
|
12
11
|
"contents:read",
|
|
@@ -22,6 +21,7 @@ const SCOPE_ORDER = [
|
|
|
22
21
|
"actions:write",
|
|
23
22
|
"checks:read",
|
|
24
23
|
"statuses:read",
|
|
24
|
+
"statuses:write",
|
|
25
25
|
"administration:read",
|
|
26
26
|
"administration:write",
|
|
27
27
|
"security_events:read",
|
|
@@ -106,8 +106,7 @@ function connectGithubScopesForSelection(selection = {}) {
|
|
|
106
106
|
if (!include && !exclude) return connectGithubScopesForPreset(preset);
|
|
107
107
|
return connectGithubScopesForTools(resolveSelectedToolNames(selection));
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
//#region src/connect/params.ts
|
|
109
|
+
// src/connect/params.ts
|
|
111
110
|
function resolveGithubConnectTokenParams(options = {}) {
|
|
112
111
|
const { preset, include, exclude, params } = options;
|
|
113
112
|
return buildConnectTokenParams(params?.scopes ?? connectGithubScopesForSelection({
|
|
@@ -129,8 +128,7 @@ function buildConnectTokenParams(scopes, params) {
|
|
|
129
128
|
...authorizationDetails && { authorizationDetails }
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
|
-
|
|
133
|
-
//#region src/connect/token.ts
|
|
131
|
+
// src/connect/token.ts
|
|
134
132
|
/**
|
|
135
133
|
* Returns a lazy GitHub token provider backed by a Vercel Connect connector.
|
|
136
134
|
* Scopes are derived from `preset`, or from the resolved `include`/`exclude`
|
|
@@ -265,7 +263,6 @@ function resolveConnectOptions(connectOptions) {
|
|
|
265
263
|
...connectOptions
|
|
266
264
|
};
|
|
267
265
|
}
|
|
268
|
-
//#endregion
|
|
269
266
|
export { connectGithubScopesForSelection as a, connectGithubScopesForPreset as i, PRESET_CONNECT_SCOPES as n, connectGithubScopesForTools as o, TOOL_CONNECT_SCOPES as r, resolveGithubConnector as s, connectGithubToken as t };
|
|
270
267
|
|
|
271
|
-
//# sourceMappingURL=token-
|
|
268
|
+
//# sourceMappingURL=token-HpJhSRkl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-HpJhSRkl.mjs","names":[],"sources":["../src/connect/connector.ts","../src/connect/scopes.ts","../src/connect/params.ts","../src/connect/token.ts"],"sourcesContent":["/**\n * A Vercel Connect connector name, or a resolver that returns one.\n *\n * Use a function to pick the connector dynamically — e.g. a different\n * connector per environment (`production` vs. `preview`) or per tenant.\n * It's resolved lazily, on every token request, alongside the token itself.\n */\nexport type GithubConnectorInput = string | (() => string | Promise<string>)\n\n/** Resolves a {@link GithubConnectorInput} to a connector name string. */\nexport async function resolveGithubConnector(connector: GithubConnectorInput): Promise<string> {\n return typeof connector === 'function' ? await connector() : connector\n}\n","import { PRESET_TOOLS, resolvePresetTools, type GithubToolPreset } from '../core/presets'\nimport { GITHUB_TOOL_CATALOG } from '../core/catalog'\nimport { ALL_GITHUB_TOOL_NAMES, type GithubToolName } from '../core/tool-names'\n\n/** Stable scope order for tool-derived unions (tests + Connect payloads). */\nconst SCOPE_ORDER = [\n 'contents:read',\n 'contents:write',\n 'metadata:read',\n 'pull_requests:read',\n 'pull_requests:write',\n 'issues:read',\n 'issues:write',\n 'discussions:read',\n 'discussions:write',\n 'actions:read',\n 'actions:write',\n 'checks:read',\n 'statuses:read',\n 'statuses:write',\n 'administration:read',\n 'administration:write',\n 'security_events:read',\n 'vulnerability_alerts:read',\n 'secret_scanning_alerts:read',\n] as const\n\n/**\n * Per-tool Connect scopes, derived from `GITHUB_TOOL_CATALOG`. Empty arrays are\n * intentional for gist and notification tools (installation tokens cannot\n * satisfy those APIs).\n */\nexport const TOOL_CONNECT_SCOPES = ALL_GITHUB_TOOL_NAMES.reduce(\n (map, name) => {\n map[name] = GITHUB_TOOL_CATALOG[name].connectScopes\n return map\n },\n {} as Record<GithubToolName, readonly string[]>,\n)\n\nfunction orderScopes(scopes: Set<string>): string[] {\n return SCOPE_ORDER.filter(scope => scopes.has(scope))\n}\n\n/**\n * Vercel Connect scope strings mapped to each {@link GithubToolPreset}, derived\n * from the preset's tools so a tool added to a preset brings its scopes along.\n *\n * Scopes mirror GitHub App permissions (`contents`, `pull_requests`, `issues`,\n * `discussions`, `actions`, `checks`, `statuses`, `administration`, `metadata`,\n * and `security_events`, `vulnerability_alerts`, `secret_scanning_alerts` for the alert tools)\n * and must cover every read/write family a preset's tools touch, not just its\n * primary domain. Release tools fall under the `contents` permission on GitHub\n * Apps, and reaction tools under `issues`, so neither needs a scope of its own.\n *\n * Gist tools in `repo-explorer` and `maintainer` are intentionally left\n * unscoped: the Gists API only accepts GitHub App *user* access tokens, never\n * installation tokens, and Connect mints `subject: { type: 'app' }`\n * installation tokens by default. Gist calls made with an app-subject token\n * 403 regardless of requested scopes — use a `{ type: 'user' }` subject or a\n * fine-grained PAT with the \"Gists\" account permission for those tools instead.\n *\n * Notification tools in `maintainer` and `notification-inbox` are unscoped for\n * the same reason: `notifications` is an account-level GitHub App permission\n * that only applies to user access tokens, so `listNotifications` /\n * `markNotificationRead` need a PAT with the \"Notifications\" account permission.\n */\nexport const PRESET_CONNECT_SCOPES = (Object.keys(PRESET_TOOLS) as GithubToolPreset[]).reduce(\n (map, preset) => {\n map[preset] = connectGithubScopesForTools(PRESET_TOOLS[preset])\n return map\n },\n {} as Record<GithubToolPreset, readonly string[]>,\n)\n\n/** Default scopes when no preset is specified: every tool's scopes. */\nconst ALL_CONNECT_SCOPES = connectGithubScopesForTools(ALL_GITHUB_TOOL_NAMES)\n\n/**\n * Returns Vercel Connect scopes for a preset or combined presets.\n * Without a preset, returns the union of all preset scopes (full tool set).\n */\nexport function connectGithubScopesForPreset(\n preset?: GithubToolPreset | GithubToolPreset[],\n): string[] {\n if (!preset) return [...ALL_CONNECT_SCOPES]\n\n const presets = Array.isArray(preset) ? preset : [preset]\n return [\n ...new Set(presets.flatMap(p => PRESET_CONNECT_SCOPES[p])),\n ]\n}\n\n/**\n * Returns Connect scopes covering exactly the given tools.\n * Always includes `metadata:read`. Gist and notification tools contribute nothing.\n */\nexport function connectGithubScopesForTools(names: readonly GithubToolName[]): string[] {\n const scopes = new Set<string>(['metadata:read'])\n for (const name of names) {\n for (const scope of TOOL_CONNECT_SCOPES[name]) {\n scopes.add(scope)\n }\n }\n return orderScopes(scopes)\n}\n\nexport type ConnectScopeSelection = {\n preset?: GithubToolPreset | GithubToolPreset[]\n include?: readonly GithubToolName[]\n exclude?: readonly GithubToolName[]\n}\n\nfunction resolveSelectedToolNames({\n preset,\n include,\n exclude,\n}: ConnectScopeSelection): GithubToolName[] {\n const presetAllowed = preset ? resolvePresetTools(preset) : null\n const includeAllowed = include ? new Set(include) : null\n const excluded = exclude ? new Set(exclude) : null\n\n const allowed = presetAllowed && includeAllowed\n ? new Set([...presetAllowed, ...includeAllowed])\n : presetAllowed ?? includeAllowed\n\n return ALL_GITHUB_TOOL_NAMES.filter(\n name => (!allowed || allowed.has(name)) && !excluded?.has(name),\n )\n}\n\n/**\n * Resolves Connect scopes for the effective tool set.\n *\n * - No `include` / `exclude`: same as {@link connectGithubScopesForPreset}\n * (omitted preset → full union, including `administration:write`).\n * - With `include` and/or `exclude`: scopes are derived from the resolved tools\n * so a hand-picked `include` list does not mint the full admin surface.\n */\nexport function connectGithubScopesForSelection(selection: ConnectScopeSelection = {}): string[] {\n const { preset, include, exclude } = selection\n if (!include && !exclude) {\n return connectGithubScopesForPreset(preset)\n }\n return connectGithubScopesForTools(resolveSelectedToolNames(selection))\n}\n","import type { ConnectTokenParams } from '@vercel/connect'\nimport { connectGithubScopesForSelection } from './scopes'\nimport type { ConnectGithubTokenOptions, GithubConnectParams } from './types'\n\nexport function resolveGithubConnectTokenParams(\n options: Omit<ConnectGithubTokenOptions, 'params'> & { params?: GithubConnectParams } = {},\n): ConnectTokenParams {\n const { preset, include, exclude, params } = options\n const scopes = params?.scopes ?? connectGithubScopesForSelection({ preset, include, exclude })\n return buildConnectTokenParams(scopes, params)\n}\n\nfunction buildConnectTokenParams(\n scopes: string[],\n params?: GithubConnectParams,\n): ConnectTokenParams {\n const { repositories, subject, ...rest } = params ?? {}\n\n const authorizationDetails = rest.authorizationDetails\n ?? (repositories?.length\n ? [{ type: 'github_app_installation' as const, repositories }]\n : undefined)\n\n return {\n subject: subject ?? { type: 'app' },\n ...rest,\n scopes,\n ...(authorizationDetails && { authorizationDetails }),\n }\n}\n","import {\n ConnectError,\n ConnectorInstallationRequiredError,\n getToken,\n UserAuthorizationRequiredError,\n type ConnectOptions,\n type ConnectTokenParams,\n} from '@vercel/connect'\nimport { githubToolsErrors } from '../core/errors'\nimport type { GithubTokenCall, GithubTokenInput } from '../core/token'\nimport { resolveGithubConnector, type GithubConnectorInput } from './connector'\nimport { resolveGithubConnectTokenParams } from './params'\nimport type { ConnectGithubTokenOptions, GithubConnectParams } from './types'\n\n/**\n * Returns a lazy GitHub token provider backed by a Vercel Connect connector.\n * Scopes are derived from `preset`, or from the resolved `include`/`exclude`\n * tool set when those are set, unless overridden in `params.scopes`.\n *\n * `connector` may be a static name or a resolver function — e.g. to pick a\n * different connector per environment (production vs. preview) or tenant.\n * It's re-resolved on every call, alongside the token itself.\n *\n * App-subject tokens are minted for the GitHub App installation that owns the\n * call's target repository, so one App installed on several accounts works\n * with no configuration; an explicit `installationId`, `authorizationDetails`\n * or `repositories` in `params` pins the installation instead. `params` may\n * also be a resolver called with the tool call on every token request.\n * Connect caches tokens per `(connector, params)`, so repeated calls on the\n * same repository reuse one token.\n */\nexport function connectGithubToken(\n connector: GithubConnectorInput,\n options: ConnectGithubTokenOptions = {},\n): GithubTokenInput {\n const { connectOptions } = options\n const tokenParamsFor = createTokenParamsResolver(options)\n\n return async (call) => {\n const tokenParams = await tokenParamsFor(call)\n try {\n return await getToken(\n await resolveGithubConnector(connector),\n tokenParams,\n resolveConnectOptions(connectOptions),\n )\n }\n catch (error) {\n throw toConnectCatalogError(error, tokenParams, call)\n }\n }\n}\n\n/**\n * Static and resolved params go through the same repository targeting and\n * scope derivation, so per-call params keep the preset/include/exclude scope\n * narrowing unless they set `scopes` explicitly.\n */\nfunction createTokenParamsResolver(\n options: ConnectGithubTokenOptions,\n): (call?: GithubTokenCall) => Promise<ConnectTokenParams> {\n const { params } = options\n return async (call) => {\n const resolved = typeof params === 'function' ? await params(call) : params\n return resolveGithubConnectTokenParams({ ...options, params: withRepositoryTarget(resolved, call) })\n }\n}\n\n/**\n * Target the installation that owns the call's repository. Only app subjects\n * are installation-scoped, and an explicit installation choice in `params`\n * always wins.\n */\nexport function withRepositoryTarget(params: GithubConnectParams | undefined, call: GithubTokenCall | undefined): GithubConnectParams | undefined {\n if (!call?.owner || !call.repo) return params\n if (params?.subject !== undefined && params.subject.type !== 'app') return params\n if (params?.installationId !== undefined || params?.authorizationDetails !== undefined || params?.repositories !== undefined) return params\n return {\n ...params,\n authorizationDetails: [{ type: 'github_app_installation', org: call.owner, repositories: [call.repo] }],\n }\n}\n\n/** Account Connect selects the installation for: the detail's `org`, else the owner of a qualified repository. */\nfunction installationTarget(tokenParams: ConnectTokenParams): string | undefined {\n for (const detail of tokenParams.authorizationDetails ?? []) {\n if (detail.type !== 'github_app_installation') continue\n if (typeof detail.org === 'string') return detail.org\n const repositories = [detail.repositories].flat()\n const qualified = repositories.find((repository): repository is string => typeof repository === 'string' && repository.includes('/'))\n if (qualified) return qualified.split('/')[0]\n }\n return undefined\n}\n\n/**\n * Map @vercel/connect failures to catalog errors so models get the actual\n * cause (process identity, missing user connection, missing installation)\n * instead of a bare \"Not authorized\" they misread as GitHub permissions.\n */\nfunction toConnectCatalogError(error: unknown, tokenParams: ConnectTokenParams, call: GithubTokenCall | undefined): unknown {\n if (error instanceof UserAuthorizationRequiredError) {\n const { subject } = tokenParams\n const subjectId = subject.type === 'user' ? subject.id : subject.type ?? 'token'\n return githubToolsErrors.CONNECT_USER_NOT_CONNECTED({ subjectId, cause: error })\n }\n if (error instanceof ConnectorInstallationRequiredError) {\n const owner = installationTarget(tokenParams) ?? call?.owner\n return githubToolsErrors.CONNECT_INSTALLATION_REQUIRED({ detail: error.message, ...(owner && { owner }), cause: error })\n }\n if (error instanceof ConnectError && error.status === 403) {\n return githubToolsErrors.CONNECT_NOT_AUTHORIZED({ detail: error.message, cause: error })\n }\n return error\n}\n\n/**\n * Best-effort JWT `exp` claim, in epoch seconds. Returns undefined for\n * malformed tokens — Connect then rejects them with its own error.\n */\nfunction oidcTokenExpiry(token: string): number | undefined {\n const payload = token.split('.')[1]\n if (!payload) return undefined\n try {\n const claims: unknown = JSON.parse(Buffer.from(payload, 'base64url').toString())\n if (claims == null || typeof claims !== 'object' || !('exp' in claims)) return undefined\n return typeof claims.exp === 'number' ? claims.exp : undefined\n }\n catch {\n return undefined\n }\n}\n\n/**\n * Prefer an explicit `vercelToken`, then `VERCEL_OIDC_TOKEN` from the environment.\n * Passing the env token into `getToken` skips `@vercel/oidc`'s project-root walk,\n * which fails inside eve/workflow snapshots that have no `.vercel` directory.\n *\n * Pinning also disables refresh, so an expired token fails loudly here instead\n * of surfacing as an opaque Connect 403 the model misreads as GitHub permissions.\n */\nfunction resolveConnectOptions(connectOptions?: ConnectOptions): ConnectOptions | undefined {\n const vercelToken = connectOptions?.vercelToken ?? process.env.VERCEL_OIDC_TOKEN\n if (vercelToken) {\n const exp = oidcTokenExpiry(vercelToken)\n if (exp !== undefined && exp * 1000 <= Date.now()) {\n throw githubToolsErrors.OIDC_TOKEN_EXPIRED({ expiredAt: new Date(exp * 1000).toISOString() })\n }\n }\n if (!vercelToken && !connectOptions) return undefined\n return {\n ...vercelToken ? { vercelToken } : {},\n ...connectOptions,\n }\n}\n\nexport type { ConnectOptions }\n"],"mappings":";;;;AAUA,eAAsB,uBAAuB,WAAkD;CAC7F,OAAO,OAAO,cAAc,aAAa,MAAM,UAAU,IAAI;AAC/D;;;ACPA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;AAOA,MAAa,sBAAsB,sBAAsB,QACtD,KAAK,SAAS;CACb,IAAI,QAAQ,oBAAoB,KAAK,CAAC;CACtC,OAAO;AACT,GACA,CAAC,CACH;AAEA,SAAS,YAAY,QAA+B;CAClD,OAAO,YAAY,QAAO,UAAS,OAAO,IAAI,KAAK,CAAC;AACtD;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAa,wBAAyB,OAAO,KAAK,YAAY,CAAC,CAAwB,QACpF,KAAK,WAAW;CACf,IAAI,UAAU,4BAA4B,aAAa,OAAO;CAC9D,OAAO;AACT,GACA,CAAC,CACH;;AAGA,MAAM,qBAAqB,4BAA4B,qBAAqB;;;;;AAM5E,SAAgB,6BACd,QACU;CACV,IAAI,CAAC,QAAQ,OAAO,CAAC,GAAG,kBAAkB;CAG1C,OAAO,CACL,GAAG,IAAI,KAFO,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM,EAAA,CAEnC,SAAQ,MAAK,sBAAsB,EAAE,CAAC,CAC3D;AACF;;;;;AAMA,SAAgB,4BAA4B,OAA4C;CACtF,MAAM,yBAAS,IAAI,IAAY,CAAC,eAAe,CAAC;CAChD,KAAK,MAAM,QAAQ,OACjB,KAAK,MAAM,SAAS,oBAAoB,OACtC,OAAO,IAAI,KAAK;CAGpB,OAAO,YAAY,MAAM;AAC3B;AAQA,SAAS,yBAAyB,EAChC,QACA,SACA,WAC0C;CAC1C,MAAM,gBAAgB,SAAS,mBAAmB,MAAM,IAAI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