import { a as GithubTokenInput, d as GithubToolPreset, h as GithubToolName, t as AllGithubTools } from "./tool-types-BsfalcyC.mjs"; import { a as GithubConnectorInput, i as GithubConnectParams, n as ConnectGithubTokenOptions, o as resolveGithubConnector, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-ve9shBaf.mjs"; import "./eve-runtime-BnWUzXdV.mjs"; import { ConnectTokenSubject } from "@vercel/connect"; //#region src/connect/scopes.d.ts /** * Vercel Connect scope strings mapped to each {@link GithubToolPreset}. * * Scopes mirror GitHub App permissions (`contents`, `pull_requests`, `issues`, * `discussions`, `actions`, `checks`, `statuses`, `administration`, `metadata`) * and must cover every read/write family a preset's tools touch, not just its * primary domain. Release tools fall under the `contents` permission on GitHub * Apps, and reaction tools under `issues`, so neither needs a scope of its own. * * Gist tools in `repo-explorer` and `maintainer` are intentionally left * unscoped: the Gists API only accepts GitHub App *user* access tokens, never * installation tokens, and Connect mints `subject: { type: 'app' }` * installation tokens by default. Gist calls made with an app-subject token * 403 regardless of requested scopes — use a `{ type: 'user' }` subject or a * fine-grained PAT with the "Gists" account permission for those tools instead. * * Notification tools in `maintainer` and `notification-inbox` are unscoped for * the same reason: `notifications` is an account-level GitHub App permission * that only applies to user access tokens, so `listNotifications` / * `markNotificationRead` need a PAT with the "Notifications" account permission. */ export declare const PRESET_CONNECT_SCOPES: { readonly 'repo-explorer': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "discussions:read", "actions:read", "checks:read", "statuses:read"]; readonly 'code-review': readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write", "checks:read", "statuses:read"]; readonly 'issue-triage': readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; readonly 'ci-ops': readonly ["contents:read", "metadata:read", "actions:read", "actions:write", "checks:read", "statuses:read"]; readonly 'security-audit': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "issues:write", "actions:read", "checks:read", "statuses:read"]; readonly 'release-manager': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "actions:read", "actions:write"]; readonly 'discussion-moderator': readonly ["contents:read", "metadata:read", "issues:read", "issues:write", "discussions:read", "discussions:write"]; readonly 'notification-inbox': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read"]; readonly 'pr-author': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write"]; readonly maintainer: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write", "issues:read", "issues:write", "discussions:read", "discussions:write", "actions:read", "actions:write", "checks:read", "statuses:read", "administration:read", "administration:write"]; }; /** * Per-tool Connect scopes, derived from `GITHUB_TOOL_CATALOG`. Empty arrays are * intentional for gist and notification tools (installation tokens cannot * satisfy those APIs). */ export declare const TOOL_CONNECT_SCOPES: Record<"getPullRequest" | "listPullRequests" | "listPullRequestFiles" | "listPullRequestReviews" | "listPullRequestReviewThreads" | "getPullRequestContext" | "getFileContent" | "listCommits" | "getCommit" | "getBlame" | "compareCommits" | "getRepository" | "listBranches" | "searchCode" | "listCheckRuns" | "getCombinedStatus" | "updatePullRequest" | "addPullRequestComment" | "updatePullRequestComment" | "deletePullRequestComment" | "createPullRequestReview" | "replyToReviewComment" | "resolveReviewThread" | "requestReviewers" | "listIssues" | "getIssueContext" | "listIssueComments" | "createIssue" | "addIssueComment" | "updateIssueComment" | "deleteIssueComment" | "closeIssue" | "updateIssue" | "addLabels" | "removeLabel" | "createLabel" | "updateLabel" | "deleteLabel" | "addAssignees" | "removeAssignees" | "listIssueReactions" | "addIssueReaction" | "listCommentReactions" | "addCommentReaction" | "searchRepositories" | "searchIssues" | "listWorkflows" | "listWorkflowRuns" | "getWorkflowRun" | "listWorkflowJobs" | "getWorkflowJobLogs" | "getCiFailureContext" | "triggerWorkflow" | "cancelWorkflowRun" | "rerunWorkflowRun" | "getRepositoryTree" | "getIssue" | "listDiscussions" | "getDiscussion" | "listLabels" | "listGists" | "getGist" | "listGistComments" | "listReleases" | "getLatestRelease" | "getRelease" | "getReleaseContext" | "createRelease" | "updateRelease" | "deleteRelease" | "addDiscussionComment" | "listNotifications" | "markNotificationRead" | "createBranch" | "deleteBranch" | "createOrUpdateFile" | "createPullRequest" | "forkRepository" | "createRepository" | "mergePullRequest" | "createGist" | "updateGist" | "deleteGist" | "createGistComment", readonly string[]>; /** * Returns Vercel Connect scopes for a preset or combined presets. * Without a preset, returns the union of all preset scopes (full tool set). */ export declare function connectGithubScopesForPreset(preset?: GithubToolPreset | GithubToolPreset[]): string[]; /** * Returns Connect scopes covering exactly the given tools. * Always includes `metadata:read`. Gist and notification tools contribute nothing. */ export declare function connectGithubScopesForTools(names: readonly GithubToolName[]): string[]; type ConnectScopeSelection = { preset?: GithubToolPreset | GithubToolPreset[]; include?: readonly GithubToolName[]; exclude?: readonly GithubToolName[]; }; /** * Resolves Connect scopes for the effective tool set. * * - No `include` / `exclude`: same as {@link connectGithubScopesForPreset} * (omitted preset → full union, including `administration:write`). * - With `include` and/or `exclude`: scopes are derived from the resolved tools * so a hand-picked `include` list does not mint the full admin surface. */ export declare function connectGithubScopesForSelection(selection?: ConnectScopeSelection): string[]; //#endregion //#region src/connect/token.d.ts /** * Returns a lazy GitHub token provider backed by a Vercel Connect connector. * Scopes are derived from `preset`, or from the resolved `include`/`exclude` * tool set when those are set, unless overridden in `params.scopes`. * * `connector` may be a static name or a resolver function — e.g. to pick a * different connector per environment (production vs. preview) or tenant. * It's re-resolved on every call, alongside the token itself. */ export declare function connectGithubToken(connector: GithubConnectorInput, options?: ConnectGithubTokenOptions): GithubTokenInput; //#endregion //#region src/connect/tools.d.ts /** * Create GitHub tools backed by a Vercel Connect connector. * Scopes are derived from `preset` unless overridden in `connect.scopes`. * * `connector` may be a static name or a resolver function — e.g. to pick a * different connector per environment (production vs. preview) or tenant. */ export declare function connectGithubTools(connector: GithubConnectorInput, options?: ConnectGithubToolsOptions): AllGithubTools | Pick; //#endregion export { type ConnectGithubEveToolsOptions, type ConnectGithubTokenOptions, type ConnectGithubToolsOptions, type ConnectScopeSelection, type ConnectTokenSubject, type GithubConnectParams, type GithubConnectorInput, resolveGithubConnector }; //# sourceMappingURL=connect.d.mts.map