@github-tools/sdk 1.18.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -26
- package/dist/approval-policy--kByBqhT.mjs +17 -0
- package/dist/approval-policy--kByBqhT.mjs.map +1 -0
- package/dist/connect/eve.d.mts +2 -2
- package/dist/connect/eve.d.mts.map +1 -1
- package/dist/connect/eve.mjs +1 -1
- package/dist/connect.d.mts +15 -24
- package/dist/connect.d.mts.map +1 -1
- package/dist/connect.mjs +2 -2
- package/dist/{cores-BeLZwcde.mjs → cores-FLzAv2tu.mjs} +23 -2
- package/dist/cores-FLzAv2tu.mjs.map +1 -0
- package/dist/evaluation-BtoHbxuQ.mjs +311 -0
- package/dist/evaluation-BtoHbxuQ.mjs.map +1 -0
- package/dist/{eve-runtime-DnhM9Vog.mjs → eve-runtime-C-0doyHq.mjs} +14 -8
- package/dist/eve-runtime-C-0doyHq.mjs.map +1 -0
- package/dist/{eve-runtime-DNQrQZ36.d.mts → eve-runtime-CflZNuXD.d.mts} +6 -6
- package/dist/eve-runtime-CflZNuXD.d.mts.map +1 -0
- package/dist/eve-runtime.d.mts +5 -5
- package/dist/eve-runtime.mjs +4 -4
- package/dist/eve.d.mts +53 -4
- package/dist/eve.d.mts.map +1 -1
- package/dist/eve.mjs +52 -3
- package/dist/eve.mjs.map +1 -1
- package/dist/{index-DkZvveZP.d.mts → index-C3wlz660.d.mts} +91 -347
- package/dist/index-C3wlz660.d.mts.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -3
- package/dist/{src-Bx5p1Unc.mjs → src-DyiAVHKl.mjs} +338 -15
- package/dist/src-DyiAVHKl.mjs.map +1 -0
- package/dist/tanstack.d.mts +1213 -55
- package/dist/tanstack.d.mts.map +1 -1
- package/dist/tanstack.mjs +26 -13
- package/dist/tanstack.mjs.map +1 -1
- package/dist/{token-BOLrrbTS.mjs → token-DIwB-wtp.mjs} +37 -117
- package/dist/token-DIwB-wtp.mjs.map +1 -0
- package/dist/{tool-types-CrC80SIL.d.mts → tool-types-OFyE3z0C.d.mts} +283 -54
- package/dist/tool-types-OFyE3z0C.d.mts.map +1 -0
- package/dist/{types-BmwOpI5-.d.mts → types-CJqhvQwi.d.mts} +3 -3
- package/dist/{types-BmwOpI5-.d.mts.map → types-CJqhvQwi.d.mts.map} +1 -1
- package/dist/{types-CPAsEMzx.d.mts → types-ITYfXMtY.d.mts} +2 -2
- package/dist/{types-CPAsEMzx.d.mts.map → types-ITYfXMtY.d.mts.map} +1 -1
- package/dist/workflow.d.mts +34 -40
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +17 -46
- package/dist/workflow.mjs.map +1 -1
- package/dist/{write-tools-BaoTUCg7.mjs → write-tools-DnGZw-RD.mjs} +941 -112
- package/dist/write-tools-DnGZw-RD.mjs.map +1 -0
- package/package.json +10 -12
- package/dist/cores-BeLZwcde.mjs.map +0 -1
- package/dist/evaluation-f-2QwBid.mjs +0 -210
- package/dist/evaluation-f-2QwBid.mjs.map +0 -1
- package/dist/eve-runtime-DNQrQZ36.d.mts.map +0 -1
- package/dist/eve-runtime-DnhM9Vog.mjs.map +0 -1
- package/dist/index-DkZvveZP.d.mts.map +0 -1
- package/dist/instructions-BuypoY0x.mjs +0 -148
- package/dist/instructions-BuypoY0x.mjs.map +0 -1
- package/dist/src-Bx5p1Unc.mjs.map +0 -1
- package/dist/token-BOLrrbTS.mjs.map +0 -1
- package/dist/tool-types-CrC80SIL.d.mts.map +0 -1
- package/dist/write-tools-BaoTUCg7.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-DIwB-wtp.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 '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;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,U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S,SAAS,OAAO,KAAA;EAC/E,OAAO,OAAO,OAAO,QAAQ,WAAW,OAAO,MAAM,KAAA;CACvD,QACM;EACJ;CACF;AACF;;;;;;;;;AAUA,SAAS,sBAAsB,gBAA6D;CAC1F,MAAM,cAAc,gBAAgB,eAAe,QAAQ,IAAI;CAC/D,IAAI,aAAa;EACf,MAAM,MAAM,gBAAgB,WAAW;EACvC,IAAI,QAAQ,KAAA,KAAa,MAAM,OAAQ,KAAK,IAAI,GAC9C,MAAM,kBAAkB,mBAAmB,EAAE,4BAAW,IAAI,KAAK,MAAM,GAAI,EAAA,CAAE,YAAY,EAAE,CAAC;CAEhG;CACA,IAAI,CAAC,eAAe,CAAC,gBAAgB,OAAO,KAAA;CAC5C,OAAO;EACL,GAAG,cAAc,EAAE,YAAY,IAAI,CAAC;EACpC,GAAG;CACL;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Experimental_EvaluationModel, ModelMessage, Tool } from "ai";
|
|
1
|
+
import { Experimental_EvaluationModel, JSONValue, ModelMessage, Tool } from "ai";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { Octokit as Octokit$1 } from "octokit";
|
|
4
4
|
//#region src/core/catalog.d.ts
|
|
@@ -91,7 +91,7 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
91
91
|
name: z.ZodOptional<z.ZodString>;
|
|
92
92
|
}, z.core.$strip>;
|
|
93
93
|
write: true;
|
|
94
|
-
connectScopes: readonly ["contents:read", "metadata:read"];
|
|
94
|
+
connectScopes: readonly ["contents:read", "metadata:read", "administration:read", "administration:write"];
|
|
95
95
|
};
|
|
96
96
|
/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
97
97
|
createRepository: {
|
|
@@ -123,6 +123,40 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
123
123
|
write: true;
|
|
124
124
|
connectScopes: readonly ["contents:read", "contents:write", "metadata:read"];
|
|
125
125
|
};
|
|
126
|
+
/** List the required checks, required reviews and other rules that protect a branch. */
|
|
127
|
+
getBranchRules: {
|
|
128
|
+
description: string;
|
|
129
|
+
inputSchema: z.ZodObject<{
|
|
130
|
+
owner: z.ZodString;
|
|
131
|
+
repo: z.ZodString;
|
|
132
|
+
branch: z.ZodString;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
connectScopes: readonly ["contents:read", "metadata:read"];
|
|
135
|
+
};
|
|
136
|
+
/** Edit files in one commit on a new or existing branch, and optionally open a pull request. Requires approval by default. */
|
|
137
|
+
editFiles: {
|
|
138
|
+
description: string;
|
|
139
|
+
inputSchema: z.ZodObject<{
|
|
140
|
+
owner: z.ZodString;
|
|
141
|
+
repo: z.ZodString;
|
|
142
|
+
branch: z.ZodString;
|
|
143
|
+
baseBranch: z.ZodOptional<z.ZodString>;
|
|
144
|
+
message: z.ZodString;
|
|
145
|
+
edits: z.ZodArray<z.ZodObject<{
|
|
146
|
+
path: z.ZodString;
|
|
147
|
+
find: z.ZodOptional<z.ZodString>;
|
|
148
|
+
replace: z.ZodOptional<z.ZodString>;
|
|
149
|
+
content: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
pullRequest: z.ZodOptional<z.ZodObject<{
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
body: z.ZodOptional<z.ZodString>;
|
|
154
|
+
draft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
write: true;
|
|
158
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
159
|
+
};
|
|
126
160
|
/** List pull requests for a GitHub repository. */
|
|
127
161
|
listPullRequests: {
|
|
128
162
|
description: string;
|
|
@@ -185,6 +219,35 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
185
219
|
}>>>;
|
|
186
220
|
}, z.core.$strip>;
|
|
187
221
|
write: true;
|
|
222
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
223
|
+
};
|
|
224
|
+
/** Merge a pull request once its required checks and reviews pass. Requires approval by default. */
|
|
225
|
+
enablePullRequestAutoMerge: {
|
|
226
|
+
description: string;
|
|
227
|
+
inputSchema: z.ZodObject<{
|
|
228
|
+
owner: z.ZodString;
|
|
229
|
+
repo: z.ZodString;
|
|
230
|
+
pullNumber: z.ZodNumber;
|
|
231
|
+
mergeMethod: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
232
|
+
merge: "merge";
|
|
233
|
+
squash: "squash";
|
|
234
|
+
rebase: "rebase";
|
|
235
|
+
}>>>;
|
|
236
|
+
commitTitle: z.ZodOptional<z.ZodString>;
|
|
237
|
+
commitMessage: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>;
|
|
239
|
+
write: true;
|
|
240
|
+
connectScopes: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
241
|
+
};
|
|
242
|
+
/** Cancel a pending auto-merge. Requires approval by default. */
|
|
243
|
+
disablePullRequestAutoMerge: {
|
|
244
|
+
description: string;
|
|
245
|
+
inputSchema: z.ZodObject<{
|
|
246
|
+
owner: z.ZodString;
|
|
247
|
+
repo: z.ZodString;
|
|
248
|
+
pullNumber: z.ZodNumber;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
write: true;
|
|
188
251
|
connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
|
|
189
252
|
};
|
|
190
253
|
/** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */
|
|
@@ -288,6 +351,11 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
288
351
|
LEFT: "LEFT";
|
|
289
352
|
RIGHT: "RIGHT";
|
|
290
353
|
}>>;
|
|
354
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
355
|
+
startSide: z.ZodOptional<z.ZodEnum<{
|
|
356
|
+
LEFT: "LEFT";
|
|
357
|
+
RIGHT: "RIGHT";
|
|
358
|
+
}>>;
|
|
291
359
|
}, z.core.$strip>>>;
|
|
292
360
|
}, z.core.$strip>;
|
|
293
361
|
write: true;
|
|
@@ -360,6 +428,7 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
360
428
|
includeChecks: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
361
429
|
includePatch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
362
430
|
filesPerPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
431
|
+
includeLinkedIssues: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
363
432
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
364
433
|
summary: "summary";
|
|
365
434
|
full: "full";
|
|
@@ -1082,9 +1151,11 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1082
1151
|
inputSchema: z.ZodObject<{
|
|
1083
1152
|
owner: z.ZodString;
|
|
1084
1153
|
repo: z.ZodString;
|
|
1085
|
-
ref: z.ZodString
|
|
1154
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
1155
|
+
runId: z.ZodOptional<z.ZodNumber>;
|
|
1086
1156
|
maxFailedRuns: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1087
1157
|
maxFailedJobs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1158
|
+
logLines: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1088
1159
|
}, z.core.$strip>;
|
|
1089
1160
|
connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "checks:read", "statuses:read"];
|
|
1090
1161
|
};
|
|
@@ -1123,7 +1194,8 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1123
1194
|
inputSchema: z.ZodObject<{
|
|
1124
1195
|
owner: z.ZodString;
|
|
1125
1196
|
repo: z.ZodString;
|
|
1126
|
-
releaseId: z.ZodNumber
|
|
1197
|
+
releaseId: z.ZodOptional<z.ZodNumber>;
|
|
1198
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
1127
1199
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1128
1200
|
summary: "summary";
|
|
1129
1201
|
full: "full";
|
|
@@ -1138,6 +1210,8 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1138
1210
|
owner: z.ZodString;
|
|
1139
1211
|
repo: z.ZodString;
|
|
1140
1212
|
releaseId: z.ZodOptional<z.ZodNumber>;
|
|
1213
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
1214
|
+
previousTag: z.ZodOptional<z.ZodString>;
|
|
1141
1215
|
includePrevious: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1142
1216
|
includeCompare: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1143
1217
|
detail: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
@@ -1192,6 +1266,74 @@ declare const GITHUB_TOOL_CATALOG: {
|
|
|
1192
1266
|
write: true;
|
|
1193
1267
|
connectScopes: readonly ["contents:read", "contents:write", "metadata:read"];
|
|
1194
1268
|
};
|
|
1269
|
+
/** List code scanning alerts for a repository. */
|
|
1270
|
+
listCodeScanningAlerts: {
|
|
1271
|
+
description: string;
|
|
1272
|
+
inputSchema: z.ZodObject<{
|
|
1273
|
+
owner: z.ZodString;
|
|
1274
|
+
repo: z.ZodString;
|
|
1275
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1276
|
+
open: "open";
|
|
1277
|
+
dismissed: "dismissed";
|
|
1278
|
+
fixed: "fixed";
|
|
1279
|
+
}>>>;
|
|
1280
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1281
|
+
error: "error";
|
|
1282
|
+
critical: "critical";
|
|
1283
|
+
high: "high";
|
|
1284
|
+
medium: "medium";
|
|
1285
|
+
low: "low";
|
|
1286
|
+
warning: "warning";
|
|
1287
|
+
note: "note";
|
|
1288
|
+
}>>;
|
|
1289
|
+
ref: z.ZodOptional<z.ZodString>;
|
|
1290
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1291
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1292
|
+
maxPages: z.ZodOptional<z.ZodNumber>;
|
|
1293
|
+
}, z.core.$strip>;
|
|
1294
|
+
connectScopes: readonly ["contents:read", "metadata:read", "security_events:read"];
|
|
1295
|
+
};
|
|
1296
|
+
/** List Dependabot alerts for vulnerable dependencies. */
|
|
1297
|
+
listDependabotAlerts: {
|
|
1298
|
+
description: string;
|
|
1299
|
+
inputSchema: z.ZodObject<{
|
|
1300
|
+
owner: z.ZodString;
|
|
1301
|
+
repo: z.ZodString;
|
|
1302
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1303
|
+
open: "open";
|
|
1304
|
+
dismissed: "dismissed";
|
|
1305
|
+
fixed: "fixed";
|
|
1306
|
+
auto_dismissed: "auto_dismissed";
|
|
1307
|
+
}>>>;
|
|
1308
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
1309
|
+
critical: "critical";
|
|
1310
|
+
high: "high";
|
|
1311
|
+
medium: "medium";
|
|
1312
|
+
low: "low";
|
|
1313
|
+
}>>;
|
|
1314
|
+
ecosystem: z.ZodOptional<z.ZodString>;
|
|
1315
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1316
|
+
after: z.ZodOptional<z.ZodString>;
|
|
1317
|
+
}, z.core.$strip>;
|
|
1318
|
+
connectScopes: readonly ["contents:read", "metadata:read", "vulnerability_alerts:read"];
|
|
1319
|
+
};
|
|
1320
|
+
/** List secret scanning alerts, without the secrets. */
|
|
1321
|
+
listSecretScanningAlerts: {
|
|
1322
|
+
description: string;
|
|
1323
|
+
inputSchema: z.ZodObject<{
|
|
1324
|
+
owner: z.ZodString;
|
|
1325
|
+
repo: z.ZodString;
|
|
1326
|
+
state: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1327
|
+
open: "open";
|
|
1328
|
+
resolved: "resolved";
|
|
1329
|
+
}>>>;
|
|
1330
|
+
secretType: z.ZodOptional<z.ZodString>;
|
|
1331
|
+
perPage: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1332
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1333
|
+
maxPages: z.ZodOptional<z.ZodNumber>;
|
|
1334
|
+
}, z.core.$strip>;
|
|
1335
|
+
connectScopes: readonly ["contents:read", "metadata:read", "secret_scanning_alerts:read"];
|
|
1336
|
+
};
|
|
1195
1337
|
};
|
|
1196
1338
|
type GithubToolName = keyof typeof GITHUB_TOOL_CATALOG;
|
|
1197
1339
|
/** Tool names whose catalog entry is marked `write: true`. */
|
|
@@ -1212,26 +1354,29 @@ declare const GITHUB_TOOL_NAMES: { [K in GithubToolName]: K; };
|
|
|
1212
1354
|
* Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}.
|
|
1213
1355
|
* Presets can be combined by passing an array.
|
|
1214
1356
|
*/
|
|
1357
|
+
/** Read tools every task preset, and every `selection: 'tools'` result, includes, so a task never stalls on context. */
|
|
1358
|
+
declare const CORE_READ_TOOLS: readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits"];
|
|
1215
1359
|
declare const PRESET_TOOLS: {
|
|
1216
1360
|
/**
|
|
1217
1361
|
* **Code review** — review pull requests and submit feedback.
|
|
1218
1362
|
*
|
|
1219
|
-
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
|
|
1220
|
-
* `
|
|
1221
|
-
* `searchCode`, `
|
|
1222
|
-
* `
|
|
1363
|
+
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
|
|
1364
|
+
* `listPullRequestReviewThreads`, `getPullRequestContext`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`,
|
|
1365
|
+
* `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`, `listCheckRuns`, `getCombinedStatus`,
|
|
1366
|
+
* `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, `deletePullRequestComment`,
|
|
1367
|
+
* `createPullRequestReview`, `replyToReviewComment`, `resolveReviewThread`, `requestReviewers`.
|
|
1223
1368
|
*
|
|
1224
1369
|
* Agent prompt: optimized for thorough PR review with inline feedback.
|
|
1225
1370
|
*/
|
|
1226
|
-
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "
|
|
1371
|
+
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "getCommit", "getBlame", "compareCommits", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "listCheckRuns", "getCombinedStatus", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers"];
|
|
1227
1372
|
/**
|
|
1228
1373
|
* **Issue triage** — manage and organize GitHub issues.
|
|
1229
1374
|
*
|
|
1230
|
-
* Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`,
|
|
1231
|
-
* `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`,
|
|
1232
|
-
* `addAssignees`, `removeAssignees`,
|
|
1233
|
-
* `
|
|
1234
|
-
* `
|
|
1375
|
+
* Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`,
|
|
1376
|
+
* `deleteIssueComment`, `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`,
|
|
1377
|
+
* `addAssignees`, `removeAssignees`, `listIssueReactions`, `addIssueReaction`, `listCommentReactions`, `addCommentReaction`,
|
|
1378
|
+
* `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `searchRepositories`, `searchIssues`,
|
|
1379
|
+
* `getPullRequest`.
|
|
1235
1380
|
*
|
|
1236
1381
|
* Prefer `getIssueContext` (issue + `labelNames` + recent comments) over separate get/list calls.
|
|
1237
1382
|
* Use `listIssueComments` to paginate beyond the comments returned by `getIssueContext`.
|
|
@@ -1239,18 +1384,18 @@ declare const PRESET_TOOLS: {
|
|
|
1239
1384
|
* Acknowledge a report with `addIssueReaction` / `addCommentReaction` instead of a comment when no reply is needed.
|
|
1240
1385
|
* Agent prompt: optimized for categorizing, labeling, and responding to issues.
|
|
1241
1386
|
*/
|
|
1242
|
-
readonly 'issue-triage': readonly ["listIssues", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "getRepository", "
|
|
1387
|
+
readonly 'issue-triage': readonly ["listIssues", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "searchRepositories", "searchIssues", "getPullRequest"];
|
|
1243
1388
|
/**
|
|
1244
1389
|
* **CI operations** — monitor and manage GitHub Actions workflows.
|
|
1245
1390
|
*
|
|
1246
|
-
* Tools: `getRepository`, `
|
|
1247
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`,
|
|
1248
|
-
* `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
|
|
1391
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`, `getCommit`,
|
|
1392
|
+
* `getPullRequest`, `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`,
|
|
1393
|
+
* `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
|
|
1249
1394
|
*
|
|
1250
1395
|
* Diagnose a failure with `getCiFailureContext` first, then read the failing job's output with `getWorkflowJobLogs`.
|
|
1251
1396
|
* Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
|
|
1252
1397
|
*/
|
|
1253
|
-
readonly 'ci-ops': readonly ["getRepository", "
|
|
1398
|
+
readonly 'ci-ops': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "getCommit", "getPullRequest", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
|
|
1254
1399
|
/**
|
|
1255
1400
|
* **Repository explorer** — read-only access to browse codebases.
|
|
1256
1401
|
*
|
|
@@ -1267,54 +1412,56 @@ declare const PRESET_TOOLS: {
|
|
|
1267
1412
|
* `getBlame`, `compareCommits`), PR and CI visibility (`listPullRequests`, `getPullRequest`, `listPullRequestFiles`,
|
|
1268
1413
|
* `getPullRequestContext`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `listWorkflows`, `listWorkflowRuns`,
|
|
1269
1414
|
* `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs` — logs can leak secrets, so auditing them matters),
|
|
1415
|
+
* the repository's alerts (`listCodeScanningAlerts`, `listDependabotAlerts`, `listSecretScanningAlerts`),
|
|
1270
1416
|
* plus `createIssue`, `addIssueComment`, and `addLabels` to report findings.
|
|
1271
1417
|
* No destructive writes.
|
|
1272
1418
|
*
|
|
1273
1419
|
* Agent prompt: optimized for finding and reporting security risks without making changes.
|
|
1274
1420
|
*/
|
|
1275
|
-
readonly 'security-audit': readonly ["getRepository", "
|
|
1421
|
+
readonly 'security-audit': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getCommit", "getBlame", "compareCommits", "searchRepositories", "searchIssues", "listPullRequests", "getPullRequest", "listPullRequestFiles", "getPullRequestContext", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listIssues", "getIssue", "getIssueContext", "createIssue", "addIssueComment", "addLabels", "listCodeScanningAlerts", "listDependabotAlerts", "listSecretScanningAlerts"];
|
|
1276
1422
|
/**
|
|
1277
1423
|
* **Release manager** — prepare and publish GitHub releases.
|
|
1278
1424
|
*
|
|
1279
|
-
* Tools: `getRepository`, `
|
|
1280
|
-
* `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`,
|
|
1281
|
-
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`,
|
|
1282
|
-
* `listPullRequests`, `getPullRequest`.
|
|
1425
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getCommit`,
|
|
1426
|
+
* `compareCommits`, `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`,
|
|
1427
|
+
* `deleteRelease`, `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`,
|
|
1428
|
+
* `getCombinedStatus`, `getCiFailureContext`, `listPullRequests`, `getPullRequest`.
|
|
1283
1429
|
*
|
|
1284
1430
|
* Agent prompt: optimized for summarizing changes and cutting releases safely.
|
|
1285
1431
|
*/
|
|
1286
|
-
readonly 'release-manager': readonly ["getRepository", "
|
|
1432
|
+
readonly 'release-manager': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getCommit", "compareCommits", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "getCombinedStatus", "getCiFailureContext", "listPullRequests", "getPullRequest"];
|
|
1287
1433
|
/**
|
|
1288
1434
|
* **Discussion moderator** — answer and moderate repository Discussions.
|
|
1289
1435
|
*
|
|
1290
|
-
* Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`,
|
|
1291
|
-
* `
|
|
1436
|
+
* Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`, `getRepository`, `getFileContent`, `getRepositoryTree`,
|
|
1437
|
+
* `searchCode`, `listCommits`, `searchIssues`, `getIssueContext`, `addIssueComment`.
|
|
1292
1438
|
*
|
|
1293
1439
|
* Prefer discussions for Q&A; link related issues with `getIssueContext` / `addIssueComment` when needed.
|
|
1294
1440
|
* Agent prompt: optimized for clear, on-topic discussion replies.
|
|
1295
1441
|
*/
|
|
1296
|
-
readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "searchIssues", "getIssueContext", "addIssueComment"];
|
|
1442
|
+
readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "searchIssues", "getIssueContext", "addIssueComment"];
|
|
1297
1443
|
/**
|
|
1298
1444
|
* **Notification inbox** — triage authenticated-user notification threads.
|
|
1299
1445
|
*
|
|
1300
|
-
* Tools: `listNotifications`, `markNotificationRead`, `
|
|
1446
|
+
* Tools: `listNotifications`, `markNotificationRead`, `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`,
|
|
1447
|
+
* `listCommits`, `getIssue`, `getIssueContext`, `getPullRequest`, `getDiscussion`.
|
|
1301
1448
|
*
|
|
1302
1449
|
* Requires a user PAT with the Notifications account permission — not available on Connect installation tokens.
|
|
1303
1450
|
* Agent prompt: optimized for clearing inbox noise and following up on actionable threads.
|
|
1304
1451
|
*/
|
|
1305
|
-
readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getIssue", "getPullRequest", "
|
|
1452
|
+
readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "getIssue", "getIssueContext", "getPullRequest", "getDiscussion"];
|
|
1306
1453
|
/**
|
|
1307
1454
|
* **PR author** — open pull requests without the full write surface.
|
|
1308
1455
|
*
|
|
1309
|
-
* Tools: `getRepository`, `
|
|
1310
|
-
* `createPullRequest`, `updatePullRequest`, `
|
|
1311
|
-
* `listPullRequestReviewThreads`, `replyToReviewComment`, `resolveReviewThread`,
|
|
1312
|
-
* `
|
|
1456
|
+
* Tools: `getRepository`, `getFileContent`, `getRepositoryTree`, `searchCode`, `listCommits`, `listBranches`, `getBranchRules`, `createBranch`,
|
|
1457
|
+
* `deleteBranch`, `createOrUpdateFile`, `editFiles`, `createPullRequest`, `updatePullRequest`, `listPullRequests`, `getPullRequest`,
|
|
1458
|
+
* `listPullRequestFiles`, `listPullRequestReviewThreads`, `replyToReviewComment`, `resolveReviewThread`, `compareCommits`,
|
|
1459
|
+
* `getCommit`.
|
|
1313
1460
|
*
|
|
1314
1461
|
* Respond to review feedback with `listPullRequestReviewThreads` → `replyToReviewComment` → `resolveReviewThread`.
|
|
1315
1462
|
* Agent prompt: optimized for branching, editing files, and opening focused PRs.
|
|
1316
1463
|
*/
|
|
1317
|
-
readonly 'pr-author': readonly ["getRepository", "listBranches", "
|
|
1464
|
+
readonly 'pr-author': readonly ["getRepository", "getFileContent", "getRepositoryTree", "searchCode", "listCommits", "listBranches", "getBranchRules", "createBranch", "deleteBranch", "createOrUpdateFile", "editFiles", "createPullRequest", "updatePullRequest", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviewThreads", "replyToReviewComment", "resolveReviewThread", "compareCommits", "getCommit"];
|
|
1318
1465
|
/**
|
|
1319
1466
|
* **Maintainer** — full repository maintenance with all read and write tools.
|
|
1320
1467
|
*
|
|
@@ -1322,7 +1469,7 @@ declare const PRESET_TOOLS: {
|
|
|
1322
1469
|
*
|
|
1323
1470
|
* Agent prompt: optimized for day-to-day repo maintenance with careful write operations.
|
|
1324
1471
|
*/
|
|
1325
|
-
readonly maintainer: readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "createBranch", "deleteBranch", "forkRepository", "createRepository", "createOrUpdateFile", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "createPullRequest", "mergePullRequest", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "listLabels", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "listDiscussions", "getDiscussion", "addDiscussionComment", "listNotifications", "markNotificationRead", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listGists", "getGist", "listGistComments", "createGist", "updateGist", "deleteGist", "createGistComment", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease"];
|
|
1472
|
+
readonly maintainer: readonly ["getRepository", "listBranches", "getBranchRules", "getFileContent", "getRepositoryTree", "createBranch", "deleteBranch", "forkRepository", "createRepository", "createOrUpdateFile", "editFiles", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "createPullRequest", "mergePullRequest", "enablePullRequestAutoMerge", "disablePullRequestAutoMerge", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "createIssue", "addIssueComment", "updateIssueComment", "deleteIssueComment", "closeIssue", "updateIssue", "listLabels", "addLabels", "removeLabel", "createLabel", "updateLabel", "deleteLabel", "addAssignees", "removeAssignees", "listIssueReactions", "addIssueReaction", "listCommentReactions", "addCommentReaction", "listDiscussions", "getDiscussion", "addDiscussionComment", "listNotifications", "markNotificationRead", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listGists", "getGist", "listGistComments", "createGist", "updateGist", "deleteGist", "createGistComment", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listCodeScanningAlerts", "listDependabotAlerts", "listSecretScanningAlerts"];
|
|
1326
1473
|
};
|
|
1327
1474
|
type GithubToolPreset = keyof typeof PRESET_TOOLS;
|
|
1328
1475
|
/** Tool names included in a single preset. */
|
|
@@ -1355,14 +1502,18 @@ type GithubTokenInput = string | ((call?: GithubTokenCall) => Promise<string>);
|
|
|
1355
1502
|
declare function resolveGithubToken(token?: GithubTokenInput, call?: GithubTokenCall): Promise<string>;
|
|
1356
1503
|
//#endregion
|
|
1357
1504
|
//#region src/core/evaluation-policy.d.ts
|
|
1358
|
-
/**
|
|
1359
|
-
|
|
1505
|
+
/**
|
|
1506
|
+
* Decision model used by `'auto'` approval and `preset: 'auto'` unless `evaluation.model` is set.
|
|
1507
|
+
* Pinned to a Jev release so the default thresholds keep matching the model they were set for;
|
|
1508
|
+
* `'typesafe-ai/jev'` follows the latest release instead.
|
|
1509
|
+
*/
|
|
1510
|
+
declare const DEFAULT_EVALUATION_MODEL = "typesafe-ai/jev-1.14.0";
|
|
1360
1511
|
/**
|
|
1361
1512
|
* Write tools `requireApproval: 'auto'` evaluates: labels, assignees, reactions, comments,
|
|
1362
|
-
* review-thread replies, reviewer requests, notification reads
|
|
1513
|
+
* review-thread replies, reviewer requests, and notification reads.
|
|
1363
1514
|
* Every other write tool keeps requiring approval.
|
|
1364
1515
|
*/
|
|
1365
|
-
declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead"
|
|
1516
|
+
declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead"];
|
|
1366
1517
|
type RoutablePreset = Exclude<GithubToolPreset, 'maintainer'>;
|
|
1367
1518
|
//#endregion
|
|
1368
1519
|
//#region src/core/write-tools.d.ts
|
|
@@ -1378,10 +1529,15 @@ declare const GITHUB_WRITE_TOOLS: { [K in GithubWriteToolName]: K; };
|
|
|
1378
1529
|
*/
|
|
1379
1530
|
type GithubEvaluationOptions = {
|
|
1380
1531
|
/**
|
|
1381
|
-
*
|
|
1382
|
-
* @default 'typesafe-ai/jev'
|
|
1532
|
+
* Decision model for AI SDK `experimental_decide`: an AI Gateway ID or a model instance.
|
|
1533
|
+
* @default 'typesafe-ai/jev-1.14.0'
|
|
1383
1534
|
*/
|
|
1384
1535
|
model?: Experimental_EvaluationModel;
|
|
1536
|
+
/**
|
|
1537
|
+
* Provider options passed to every decision call, for example AI Gateway settings such as
|
|
1538
|
+
* `{ gateway: { zeroDataRetention: true } }`.
|
|
1539
|
+
*/
|
|
1540
|
+
providerOptions?: Record<string, Record<string, JSONValue>>;
|
|
1385
1541
|
/**
|
|
1386
1542
|
* Highest risk an `'auto'` tool call can have and still run without approval, on a 0–2 scale
|
|
1387
1543
|
* (0 negligible, 1 visible but reversible, 2 hard to undo).
|
|
@@ -1395,7 +1551,7 @@ type GithubEvaluationOptions = {
|
|
|
1395
1551
|
minIntent?: number;
|
|
1396
1552
|
/**
|
|
1397
1553
|
* Lowest probability for `preset: 'auto'` to select a preset. When no preset reaches it,
|
|
1398
|
-
*
|
|
1554
|
+
* read-only `repo-explorer` is used.
|
|
1399
1555
|
* @default 0.7
|
|
1400
1556
|
*/
|
|
1401
1557
|
minPresetProbability?: number;
|
|
@@ -1404,22 +1560,95 @@ type GithubEvaluationOptions = {
|
|
|
1404
1560
|
* @default 2
|
|
1405
1561
|
*/
|
|
1406
1562
|
maxPresets?: number;
|
|
1563
|
+
/**
|
|
1564
|
+
* What `preset: 'auto'` picks. `'tools'` asks the decision model about each tool and lists only
|
|
1565
|
+
* the likely ones plus the core read tools (`CORE_READ_TOOLS`), so the model sees far fewer tool
|
|
1566
|
+
* definitions. The rest stays reachable: eve defers it, and `createGithubAgent` adds a
|
|
1567
|
+
* `callGithubTool` tool. `'presets'` lists the tools of up to `maxPresets` presets and, on
|
|
1568
|
+
* `createGithubAgent`, uses their system prompts.
|
|
1569
|
+
* @default 'tools'
|
|
1570
|
+
*/
|
|
1571
|
+
selection?: 'presets' | 'tools';
|
|
1572
|
+
/**
|
|
1573
|
+
* How long a `preset: 'auto'` decision lasts. `'session'` decides once, on the conversation's
|
|
1574
|
+
* first request, so the listed tools, and the provider's cached prompt prefix they start, stay
|
|
1575
|
+
* the same for the rest of the conversation; later needs go through deferred tools (eve) or
|
|
1576
|
+
* `callGithubTool` (`createGithubAgent`, which doesn't support it with `selection: 'presets'`).
|
|
1577
|
+
* `'turn'` decides again for each new request, which changes the tool list and makes the
|
|
1578
|
+
* provider write the whole conversation to its prompt cache again.
|
|
1579
|
+
* @default 'session', except `'turn'` for presets on `createGithubAgent`
|
|
1580
|
+
*/
|
|
1581
|
+
scope?: 'turn' | 'session';
|
|
1582
|
+
/**
|
|
1583
|
+
* Keeps `createGithubAgent`'s `preset: 'auto'` decisions across processes, such as serverless
|
|
1584
|
+
* instances, under keys derived from the request and the routing settings (decision model,
|
|
1585
|
+
* thresholds and caps), so agents configured differently don't share decisions. Without it, a decision
|
|
1586
|
+
* lives in this process's memory, and another process decides again: that costs a decision
|
|
1587
|
+
* call, and a different pick changes the tool list and invalidates the provider's prompt cache.
|
|
1588
|
+
* The eve extension keeps decisions in the session and ignores this option.
|
|
1589
|
+
*/
|
|
1590
|
+
store?: {
|
|
1591
|
+
get: (key: string) => Promise<readonly string[] | undefined>;
|
|
1592
|
+
set: (key: string, value: readonly string[]) => Promise<void>;
|
|
1593
|
+
};
|
|
1594
|
+
/**
|
|
1595
|
+
* Lowest probability for `selection: 'tools'` to list a tool beyond the core read tools.
|
|
1596
|
+
* @default 0.5
|
|
1597
|
+
*/
|
|
1598
|
+
minToolProbability?: number;
|
|
1599
|
+
/**
|
|
1600
|
+
* Most tools `selection: 'tools'` lists beyond the core read tools, keeping the most likely ones.
|
|
1601
|
+
* @default 8
|
|
1602
|
+
*/
|
|
1603
|
+
maxTools?: number;
|
|
1604
|
+
};
|
|
1605
|
+
/** Whether a person should approve a GitHub write, and why, as a short sentence for the approval request. */
|
|
1606
|
+
type AutoApprovalDecision = {
|
|
1607
|
+
ask: boolean;
|
|
1608
|
+
reason: string;
|
|
1407
1609
|
};
|
|
1408
1610
|
/**
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1411
|
-
*
|
|
1611
|
+
* Asks the decision model how risky a GitHub write is and whether the user asked for it, and
|
|
1612
|
+
* explains the outcome: `ask` is true when a person should approve the call. A failed or refused
|
|
1613
|
+
* decision asks, since it gives no evidence that the call is safe.
|
|
1412
1614
|
*/
|
|
1413
|
-
declare function
|
|
1615
|
+
declare function autoApprovalDecision(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], { model, maxRisk, minIntent, providerOptions }?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<AutoApprovalDecision>;
|
|
1616
|
+
/** Whether a GitHub write needs a person's approval; see {@link autoApprovalDecision}. */
|
|
1617
|
+
declare function needsAutoApproval(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<boolean>;
|
|
1414
1618
|
/**
|
|
1415
1619
|
* Presets the latest user message needs, from one evaluation call with an independent
|
|
1416
1620
|
* yes/no question per preset. Returns up to `maxPresets` presets at or above
|
|
1417
|
-
* `minPresetProbability`, most likely first
|
|
1418
|
-
* `repo-explorer` is only
|
|
1419
|
-
*
|
|
1420
|
-
|
|
1621
|
+
* `minPresetProbability`, most likely first, and read-only `repo-explorer` when none qualifies.
|
|
1622
|
+
* `repo-explorer` is only combined with no other preset. Rejects when the evaluation call fails;
|
|
1623
|
+
* {@link selectPresets} falls back instead. Never returns `maintainer`, so the full catalog is never exposed.
|
|
1624
|
+
*/
|
|
1625
|
+
declare function evaluatePresets(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<RoutablePreset[]>;
|
|
1626
|
+
/**
|
|
1627
|
+
* Tools the latest user message needs, from one decision call with a yes/no question per tool:
|
|
1628
|
+
* the core read tools, plus up to `maxTools` others at or above `minToolProbability`, most likely
|
|
1629
|
+
* first. Rejects when the decision call fails; {@link selectTools} falls back instead.
|
|
1630
|
+
*/
|
|
1631
|
+
declare function evaluateTools(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<GithubToolName[]>;
|
|
1632
|
+
/**
|
|
1633
|
+
* Logs `EVALUATION_FAILED` for a failed {@link evaluatePresets} call and returns the read-only
|
|
1634
|
+
* `repo-explorer` fallback. Rethrows when `abortSignal` is aborted.
|
|
1635
|
+
*/
|
|
1636
|
+
declare function fallbackPresets(error: unknown, { model }?: GithubEvaluationOptions, abortSignal?: AbortSignal): RoutablePreset[];
|
|
1637
|
+
/**
|
|
1638
|
+
* Logs `EVALUATION_FAILED` for a failed {@link evaluateTools} call and returns the read-only
|
|
1639
|
+
* `repo-explorer` tools. Rethrows when `abortSignal` is aborted.
|
|
1640
|
+
*/
|
|
1641
|
+
declare function fallbackTools(error: unknown, { model }?: GithubEvaluationOptions, abortSignal?: AbortSignal): GithubToolName[];
|
|
1642
|
+
/**
|
|
1643
|
+
* {@link evaluateTools}, falling back to the read-only `repo-explorer` tools (and logging
|
|
1644
|
+
* `EVALUATION_FAILED`) when the decision call fails.
|
|
1645
|
+
*/
|
|
1646
|
+
declare function selectTools(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<GithubToolName[]>;
|
|
1647
|
+
/**
|
|
1648
|
+
* {@link evaluatePresets}, falling back to read-only `repo-explorer` (and logging
|
|
1649
|
+
* `EVALUATION_FAILED`) when the evaluation call fails.
|
|
1421
1650
|
*/
|
|
1422
|
-
declare function selectPresets(messages: readonly ModelMessage[],
|
|
1651
|
+
declare function selectPresets(messages: readonly ModelMessage[], options?: GithubEvaluationOptions, abortSignal?: AbortSignal): Promise<RoutablePreset[]>;
|
|
1423
1652
|
declare function latestUserText(messages: readonly ModelMessage[]): string;
|
|
1424
1653
|
//#endregion
|
|
1425
1654
|
//#region src/core/approval-policy.d.ts
|
|
@@ -1569,5 +1798,5 @@ type GithubToolsForPreset<P extends GithubToolPreset | readonly GithubToolPreset
|
|
|
1569
1798
|
/** Pick a subset of GitHub tools by tool name. */
|
|
1570
1799
|
type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
|
|
1571
1800
|
//#endregion
|
|
1572
|
-
export {
|
|
1573
|
-
//# sourceMappingURL=tool-types-
|
|
1801
|
+
export { GithubTokenCall as A, GithubToolName as B, needsAutoApproval as C, AUTO_APPROVAL_TOOLS as D, GITHUB_WRITE_TOOLS as E, GithubToolPreset as F, PRESET_TOOLS as I, PresetToolName as L, resolveGithubToken as M, CORE_READ_TOOLS as N, DEFAULT_EVALUATION_MODEL as O, CombinedPresetToolNames as P, GITHUB_TOOL_NAMES as R, latestUserText as S, selectTools as T, GithubWriteToolName as V, autoApprovalDecision as _, GithubToolsContext as a, fallbackPresets as b, GithubTool as c, ToolOverrides as d, ApprovalConfig as f, GithubEvaluationOptions as g, AutoApprovalDecision as h, PickGithubTools as i, GithubTokenInput as j, RoutablePreset as k, Octokit$1 as l, ToolApprovalMode as m, GithubToolsBaseOptions as n, CommitIdentity as o, StaticApprovalConfig as p, GithubToolsForPreset as r, CommitToolOptions as s, AllGithubTools as t, ToolOptions as u, evaluatePresets as v, selectPresets as w, fallbackTools as x, evaluateTools as y, GITHUB_TOOL_CATALOG as z };
|
|
1802
|
+
//# sourceMappingURL=tool-types-OFyE3z0C.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-types-OFyE3z0C.d.mts","names":[],"sources":["../src/core/catalog.ts","../src/core/tool-names.ts","../src/core/presets.ts","../src/core/token.ts","../src/core/evaluation-policy.ts","../src/core/write-tools.ts","../src/core/evaluation.ts","../src/core/approval-policy.ts","../src/types.ts","../src/core/context.ts","../src/core/tool-types.ts"],"mappings":";;;;;;;;;;;;;cAuEa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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W,cACpB,mBAAmB,gBACnB,UAAS,yBACT,cAAc,cACb,QAAQ;;;;;iBAkDK,gBAAgB,kBAAkB,UAAoC,yBAA8B,cAAc,cAAc;;;;;iBAShI,cAAc,kBAAkB,UAAoC,yBAA8B,cAAc,cAAc;;;;;iBASxH,YACpB,mBAAmB,gBACnB,UAAS,yBACT,cAAc,cACb,QAAQ;;;;;iBAQW,cACpB,mBAAmB,gBACnB,UAAS,yBACT,cAAc,cACb,QAAQ;iBAIK,eAAe,mBAAmB;;;;;;;;;;;KCpStC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCA,iBAAiB,mBAAmB,QAAQ,OAAO,qBAAqB;;KAGxE,iCAAiC,QAAQ,OAAO;;;KCzChD,aAAa;KAEb;EAAgB,gBAAgB;;;;;;;;KAQhC;EACV;EACA;;;;;KAMU,oBAAoB;;;;;EAK9B,SAAS;;;;;EAKT,YAAY;;;;;EAKZ,YAAY;;;;;;;;;;;;;;;;;;;;KAqBF,gBAAgB,QAC1B,KACE;;;;;;;;;;KCpDQ;EACV;EACA;EACA;EACA;EACA;;;;;KCNU,iBAAiB,OAAO,gBAAgB;;KAGxC;;EAEV,QAAQ;;EAER,kBAAkB;;EAElB,aAAa;;;;;;EAMb,UAAU;;EAEV,YAAY,QAAQ,OAAO,gBAAgB;;EAE3C,SAAS;;EAET,YAAY;;EAEZ,YAAY;;;KAIF,qBAAqB,UAAU,4BAA4B,kCACrE,UAAU,mBACN,KAAK,gBAAgB,eAAe,KAAK,kBACzC,mBAAmB,qBACjB,KAAK,gBAAgB,wBAAwB,KAAK,kBAClD;;KAGI,gBAAgB,UAAU,kBAAkB,KAAK,gBAAgB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as EveGithubToolsOptions } from "./types-
|
|
1
|
+
import { A as GithubTokenCall, B as GithubToolName, F as GithubToolPreset, n as GithubToolsBaseOptions } from "./tool-types-OFyE3z0C.mjs";
|
|
2
|
+
import { r as EveGithubToolsOptions } from "./types-ITYfXMtY.mjs";
|
|
3
3
|
import { ConnectOptions, ConnectTokenParams } from "@vercel/connect";
|
|
4
4
|
//#region src/connect/connector.d.ts
|
|
5
5
|
/**
|
|
@@ -60,4 +60,4 @@ type ConnectGithubTokenOptions = {
|
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
62
62
|
export { GithubConnectParamsInput as a, resolveGithubConnector as c, GithubConnectParams as i, ConnectGithubTokenOptions as n, GithubConnectParamsResolver as o, ConnectGithubToolsOptions as r, GithubConnectorInput as s, ConnectGithubEveToolsOptions as t };
|
|
63
|
-
//# sourceMappingURL=types-
|
|
63
|
+
//# sourceMappingURL=types-CJqhvQwi.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CJqhvQwi.d.mts","names":[],"sources":["../src/connect/connector.ts","../src/connect/types.ts"],"mappings":";;;;;;;;;;;KAOY,gDAAgD;;iBAGtC,uBAAuB,WAAW,uBAAuB;;;;;;;;;;KCInE,sBAAsB,KAAK;;;;;;;;EAQrC,UAAU;;EAEV;;;;;;;;KASU,+BACV,OAAO,oBACJ,sBAAsB,QAAQ;;KAGvB,2BAA2B,sBAAsB;KAEjD,4BAA4B;EACtC,SAAS,mBAAmB;EAC5B,UAAU;;KAGA,+BAA+B,KAAK;EAC9C,UAAU;;KAGA;EACV,SAAS,mBAAmB;;EAE5B,mBAAmB;;EAEnB,mBAAmB;EACnB,SAAS;EACT,iBAAiB"}
|