import { C as GithubTokenInput, E as GithubToolPreset, O as PresetToolName, T as CombinedPresetToolNames, c as GithubTool, j as GithubToolName, l as Octokit$1, n as GithubToolsBaseOptions, o as CommitIdentity, s as CommitToolOptions, t as AllGithubTools, u as ToolOptions } from "./tool-types-CrC80SIL.mjs"; import { ToolLoopAgent, ToolLoopAgentSettings, ToolSet } from "ai"; import { z } from "zod"; import { Octokit } from "octokit"; import "evlog"; //#endregion //#region src/client.d.ts declare function createOctokit(token: string): Octokit; //#endregion //#region src/core/pagination.d.ts type PagingFields = { hasMore: boolean; page: number; perPage: number; nextPage?: number; }; type PagedList = { items: T[]; } & PagingFields; declare namespace repository_d_exports { export { composeCommitMessage, createBranchCore, createBranchDescription, createBranchInputSchema, createCommitOnBranch, createOrUpdateFileCore, createOrUpdateFileDescription, createOrUpdateFileInputSchema, createRepositoryCore, createRepositoryDescription, createRepositoryInputSchema, deleteBranchCore, deleteBranchDescription, deleteBranchInputSchema, forkRepositoryCore, forkRepositoryDescription, forkRepositoryInputSchema, getFileContentCore, getFileContentDescription, getFileContentInputSchema, getRepositoryCore, getRepositoryDescription, getRepositoryInputSchema, getRepositoryTreeCore, getRepositoryTreeDescription, getRepositoryTreeInputSchema, listBranchesCore, listBranchesDescription, listBranchesInputSchema }; } declare function createCommitOnBranch(octokit: Octokit$1, input: { owner: string; repo: string; branch: string; expectedHeadOid: string; headline: string; body?: string; additions?: Array<{ path: string; contents: string; }>; deletions?: Array<{ path: string; }>; }): Promise<{ commitSha: string; commitUrl: string; }>; declare function composeCommitMessage(message: string, coAuthors?: CommitIdentity[]): string; declare const getRepositoryInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; }, z.core.$strip>; declare const getRepositoryDescription = "Get information about a GitHub repository including description, stars, forks, language, and default branch"; declare function getRepositoryCore({ token, owner, repo }: { token: string; owner: string; repo: string; }): Promise<{ name: string; fullName: string; description: string | null; url: string; defaultBranch: string; stars: number; forks: number; openIssues: number; language: string | null; private: boolean; createdAt: string; updatedAt: string; }>; declare const listBranchesInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; declare const listBranchesDescription = "List branches in a GitHub repository. When hasMore, pass nextPage — do not repeat the same call."; declare function listBranchesCore({ token, owner, repo, perPage, page }: { token: string; owner: string; repo: string; perPage: number; page?: number; }): Promise>; declare const getFileContentInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; path: z.ZodString; ref: z.ZodOptional; startLine: z.ZodOptional; endLine: z.ZodOptional; maxLines: z.ZodOptional; }, z.core.$strip>; declare const getFileContentDescription = "Get the content of a file from a GitHub repository. Prefer startLine/endLine or maxLines to read only the lines you need"; declare function getFileContentCore({ token, owner, repo, path, ref, startLine, endLine, maxLines }: { token: string; owner: string; repo: string; path: string; ref?: string; startLine?: number; endLine?: number; maxLines?: number; }): Promise<{ type: "directory"; entries: { name: string; type: "file" | "dir" | "submodule" | "symlink"; path: string; }[]; path?: undefined; sha?: undefined; size?: undefined; totalLines?: undefined; content?: undefined; startLine?: undefined; endLine?: undefined; truncated?: undefined; } | { type: "submodule" | "symlink"; path: string; entries?: undefined; sha?: undefined; size?: undefined; totalLines?: undefined; content?: undefined; startLine?: undefined; endLine?: undefined; truncated?: undefined; } | { type: "file"; path: string; sha: string; size: number; totalLines: number; content: string; entries?: undefined; startLine?: undefined; endLine?: undefined; truncated?: undefined; } | { type: "file"; path: string; sha: string; size: number; totalLines: number; startLine: number; endLine: number; truncated: boolean; content: string; entries?: undefined; }>; declare const getRepositoryTreeInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodOptional; path: z.ZodOptional; recursive: z.ZodDefault>; }, z.core.$strip>; declare const getRepositoryTreeDescription = "List the file and directory structure of a repository at a given ref. Prefer a path prefix over recursive true. If truncated, narrow path instead of recalling the full tree."; declare function getRepositoryTreeCore({ token, owner, repo, ref, path, recursive }: { token: string; owner: string; repo: string; ref?: string; path?: string; recursive: boolean; }): Promise<{ sha: string; truncated: boolean; path: string | undefined; entries: { path: string; type: string; size: number | undefined; sha: string; }[]; }>; declare const createBranchInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; branch: z.ZodString; from: z.ZodOptional; }, z.core.$strip>; declare const createBranchDescription = "Create a new branch in a GitHub repository from an existing branch or commit SHA"; /** Idempotent when the branch already exists at the target SHA. Not idempotent otherwise. */ declare function createBranchCore({ token, owner, repo, branch, from }: { token: string; owner: string; repo: string; branch: string; from?: string; }): Promise<{ ref: string; sha: string; url: string; }>; declare const deleteBranchInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; branch: z.ZodString; }, z.core.$strip>; declare const deleteBranchDescription = "Delete a branch from a GitHub repository permanently"; /** Not idempotent — deleting a branch that no longer exists fails with a 422. */ declare function deleteBranchCore({ token, owner, repo, branch }: { token: string; owner: string; repo: string; branch: string; }): Promise<{ deleted: boolean; branch: string; }>; declare const forkRepositoryInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; organization: z.ZodOptional; name: z.ZodOptional; }, z.core.$strip>; declare const forkRepositoryDescription = "Fork a GitHub repository to the authenticated user account or a specified organization"; /** Not idempotent — each call may create another fork attempt. */ declare function forkRepositoryCore({ token, owner, repo, organization, name }: { token: string; owner: string; repo: string; organization?: string; name?: string; }): Promise<{ name: string; fullName: string; url: string; cloneUrl: string; sshUrl: string; defaultBranch: string; private: boolean; parent: { fullName: string; url: string; } | null; }>; declare const createRepositoryInputSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodOptional; isPrivate: z.ZodDefault>; autoInit: z.ZodDefault>; gitignoreTemplate: z.ZodOptional; licenseTemplate: z.ZodOptional; org: z.ZodOptional; }, z.core.$strip>; declare const createRepositoryDescription = "Create a new GitHub repository for the authenticated user or a specified organization"; /** Not idempotent — each call creates a new repository. */ declare function createRepositoryCore({ token, name, description, isPrivate, autoInit, gitignoreTemplate, licenseTemplate, org }: { token: string; name: string; description?: string; isPrivate: boolean; autoInit: boolean; gitignoreTemplate?: string; licenseTemplate?: string; org?: string; }): Promise<{ name: string; fullName: string; description: string | null; url: string; cloneUrl: string; sshUrl: string; defaultBranch: string; private: boolean; createdAt: string; }>; declare const createOrUpdateFileInputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; path: z.ZodString; message: z.ZodString; content: z.ZodString; branch: z.ZodOptional; sha: z.ZodOptional; }, z.core.$strip>; declare const createOrUpdateFileDescription = "Create or update a file in a GitHub repository. Provide the SHA when updating an existing file."; /** Idempotent when updating with sha and content is unchanged. Not idempotent for new commits. */ declare function createOrUpdateFileCore({ token, owner, repo, path, message, content, branch, sha, author, committer, coAuthors }: { token: string; owner: string; repo: string; path: string; message: string; content: string; branch?: string; sha?: string; author?: CommitIdentity; committer?: CommitIdentity; coAuthors?: CommitIdentity[]; }): Promise<{ path: string; sha: string; skipped: true; message: string; commitSha?: undefined; commitUrl?: undefined; } | { path: string | undefined; sha: string | undefined; commitSha: string | undefined; commitUrl: string | undefined; skipped?: undefined; message?: undefined; }>; //#endregion //#region src/tools/repository.d.ts /** Get information about a GitHub repository including description, stars, forks, language, and default branch. */ declare const getRepository: (token: GithubTokenInput) => GithubTool; /** List branches in a GitHub repository. */ declare const listBranches: (token: GithubTokenInput) => GithubTool; /** Get the content of a file from a GitHub repository. */ declare const getFileContent: (token: GithubTokenInput) => GithubTool; /** List the file and directory structure of a repository at a given ref. */ declare const getRepositoryTree: (token: GithubTokenInput) => GithubTool; /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */ declare const createBranch: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a branch from a GitHub repository permanently. Requires approval by default. */ declare const deleteBranch: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */ declare const forkRepository: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */ declare const createRepository: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */ declare const createOrUpdateFile: (token: GithubTokenInput, { needsApproval, author, committer, coAuthors }?: CommitToolOptions) => GithubTool; //#endregion //#region src/tools/pull-requests.d.ts type MergeToolOptions = ToolOptions & { coAuthors?: CommitIdentity[]; }; /** List pull requests for a GitHub repository. */ declare const listPullRequests: (token: GithubTokenInput) => GithubTool; /** Get detailed information about a specific pull request. */ declare const getPullRequest: (token: GithubTokenInput) => GithubTool; /** Create a new pull request in a GitHub repository. Requires approval by default. */ declare const createPullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Merge a pull request. Requires approval by default. */ declare const mergePullRequest: (token: GithubTokenInput, { needsApproval, coAuthors }?: MergeToolOptions) => GithubTool; /** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */ declare const updatePullRequest: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Add a comment to a pull request. Requires approval by default. */ declare const addPullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update the body of a comment on a pull request. Requires approval by default. */ declare const updatePullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a comment from a pull request permanently. Requires approval by default. */ declare const deletePullRequestComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** List files changed in a pull request with status and stats. Patches omitted by default. */ declare const listPullRequestFiles: (token: GithubTokenInput) => GithubTool; /** List reviews on a pull request (approvals, change requests, and comments). */ declare const listPullRequestReviews: (token: GithubTokenInput) => GithubTool; /** Submit a pull request review with optional inline comments. Requires approval by default. */ declare const createPullRequestReview: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** List review threads on a pull request with comments, resolution state, and reply/resolve IDs. */ declare const listPullRequestReviewThreads: (token: GithubTokenInput) => GithubTool; /** Reply to a pull request review comment in its review thread. Requires approval by default. */ declare const replyToReviewComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Mark a pull request review thread as resolved. Requires approval by default. */ declare const resolveReviewThread: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Request reviews from users or teams on a pull request. Requires approval by default. */ declare const requestReviewers: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/issues.d.ts /** List issues for a GitHub repository (excludes pull requests). */ declare const listIssues: (token: GithubTokenInput) => GithubTool; /** Get detailed information about a specific issue. */ declare const getIssue: (token: GithubTokenInput) => GithubTool; /** List comments on a GitHub issue. Prefer getIssueContext for the first page when triaging. */ declare const listIssueComments: (token: GithubTokenInput) => GithubTool; /** Create a new issue in a GitHub repository. Requires approval by default. */ declare const createIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Add a comment to a GitHub issue. Requires approval by default. */ declare const addIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Close an open GitHub issue. Requires approval by default. */ declare const closeIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */ declare const updateIssue: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update the body of a comment on a GitHub issue. Requires approval by default. */ declare const updateIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a comment from a GitHub issue permanently. Requires approval by default. */ declare const deleteIssueComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** List labels available in a GitHub repository. */ declare const listLabels: (token: GithubTokenInput) => GithubTool; /** Add labels to an issue or pull request. Requires approval by default. */ declare const addLabels: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Remove a label from an issue or pull request. Requires approval by default. */ declare const removeLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Create a label in a GitHub repository. Requires approval by default. */ declare const createLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update a label in a GitHub repository. Requires approval by default. */ declare const updateLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a label from a GitHub repository permanently. Requires approval by default. */ declare const deleteLabel: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Assign users to an issue or pull request. Requires approval by default. */ declare const addAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Remove assignees from an issue or pull request. Requires approval by default. */ declare const removeAssignees: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/reactions.d.ts /** List reactions on an issue or pull request conversation. */ declare const listIssueReactions: (token: GithubTokenInput) => GithubTool; /** React to an issue or pull request with an emoji. Requires approval by default. */ declare const addIssueReaction: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** List reactions on an issue or pull request comment. */ declare const listCommentReactions: (token: GithubTokenInput) => GithubTool; /** React to an issue or pull request comment with an emoji. Requires approval by default. */ declare const addCommentReaction: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/discussions.d.ts /** List discussions in a repository, optionally filtered by category. */ declare const listDiscussions: (token: GithubTokenInput) => GithubTool; /** Get a discussion by number. */ declare const getDiscussion: (token: GithubTokenInput) => GithubTool; /** Add a comment to a discussion. Requires approval by default. */ declare const addDiscussionComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/notifications.d.ts /** List notification threads for the authenticated user. */ declare const listNotifications: (token: GithubTokenInput) => GithubTool; /** Mark a notification thread as read. Requires approval by default. */ declare const markNotificationRead: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/search.d.ts /** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. Results include matching text snippets when GitHub returns them. */ declare const searchCode: (token: GithubTokenInput) => GithubTool; /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */ declare const searchRepositories: (token: GithubTokenInput) => GithubTool; /** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */ declare const searchIssues: (token: GithubTokenInput) => GithubTool; //#endregion //#region src/tools/commits.d.ts /** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */ declare const listCommits: (token: GithubTokenInput) => GithubTool; /** Get detailed information about a specific commit. Patches omitted by default. */ declare const getCommit: (token: GithubTokenInput) => GithubTool; /** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */ declare const getBlame: (token: GithubTokenInput) => GithubTool; /** Compare two branches, tags, or commits. Patches omitted by default. */ declare const compareCommits: (token: GithubTokenInput) => GithubTool; //#endregion //#region src/tools/gists.d.ts /** List gists for the authenticated user or a specific user. */ declare const listGists: (token: GithubTokenInput) => GithubTool; /** Get a gist by ID, including file contents. */ declare const getGist: (token: GithubTokenInput) => GithubTool; /** List comments on a gist. */ declare const listGistComments: (token: GithubTokenInput) => GithubTool; /** Create a new gist with one or more files. Requires approval by default. */ declare const createGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update an existing gist. Requires approval by default. */ declare const updateGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a gist permanently. Requires approval by default. */ declare const deleteGist: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Add a comment to a gist. Requires approval by default. */ declare const createGistComment: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/workflows.d.ts /** List GitHub Actions workflows in a repository. */ declare const listWorkflows: (token: GithubTokenInput) => GithubTool; /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */ declare const listWorkflowRuns: (token: GithubTokenInput) => GithubTool; /** Get details of a specific workflow run including status, timing, and trigger info. */ declare const getWorkflowRun: (token: GithubTokenInput) => GithubTool; /** List jobs for a workflow run, including step-level status and timing. */ declare const listWorkflowJobs: (token: GithubTokenInput) => GithubTool; /** Get the log output of a workflow job, tail-truncated with timestamps stripped. */ declare const getWorkflowJobLogs: (token: GithubTokenInput) => GithubTool; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */ declare const triggerWorkflow: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Cancel an in-progress workflow run. Requires approval by default. */ declare const cancelWorkflowRun: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */ declare const rerunWorkflowRun: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/checks.d.ts /** List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. */ declare const listCheckRuns: (token: GithubTokenInput) => GithubTool; /** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */ declare const getCombinedStatus: (token: GithubTokenInput) => GithubTool; //#endregion //#region src/tools/releases.d.ts /** List releases for a GitHub repository, newest first (includes drafts and prereleases). */ declare const listReleases: (token: GithubTokenInput) => GithubTool; /** Get the latest published release for a GitHub repository (excludes drafts and prereleases). */ declare const getLatestRelease: (token: GithubTokenInput) => GithubTool; /** Get a specific release by ID, including its assets. */ declare const getRelease: (token: GithubTokenInput) => GithubTool; /** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */ declare const createRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */ declare const updateRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; /** Delete a release permanently. Requires approval by default. */ declare const deleteRelease: (token: GithubTokenInput, { needsApproval }?: ToolOptions) => GithubTool; //#endregion //#region src/tools/bundles.d.ts /** Fetch pull request details plus files, reviews, and optional CI checks in one call. */ declare const getPullRequestContext: (token: GithubTokenInput) => GithubTool; /** Fetch an issue plus available label names and recent comments in one call. */ declare const getIssueContext: (token: GithubTokenInput) => GithubTool; /** Fetch a release plus the previous release and tag comparison in one call. */ declare const getReleaseContext: (token: GithubTokenInput) => GithubTool; /** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs. */ declare const getCiFailureContext: (token: GithubTokenInput) => GithubTool; //#endregion //#region src/core/rate-limit.d.ts /** * GitHub REST/GraphQL rate-limit snapshot from the last request in a tool call. * Present on object-shaped execute results; stripped before the model sees the output. */ type GithubRateLimit = { remaining: number; limit: number; reset: number; resource?: string; retryAfter?: number; }; //#endregion //#region src/core/errors.d.ts /** * Structured error catalog for every failure the SDK can surface to a model * or a consumer. Each entry carries `why` (technical cause) and `fix` * (actionable remedy) so agents can recover instead of guessing — a bare * "Not authorized" reads as "the repo is private" to a model; the catalog * version names the real cause. */ declare const githubToolsErrors: import("evlog").ErrorCatalog<"github_tools", { readonly TOKEN_REQUIRED: { readonly status: 401; readonly message: "GitHub token is required. Pass it as `token` or set the GITHUB_TOKEN environment variable."; readonly why: "No token string, async token provider, or GITHUB_TOKEN environment variable was available when the tool resolved its GitHub credentials."; readonly fix: "Pass `token` (a PAT string or async provider) when creating the tools, set GITHUB_TOKEN, or configure a Vercel Connect `connector`."; readonly link: "https://github-tools.com/guide/tokens-and-auth"; }; readonly OIDC_TOKEN_EXPIRED: { readonly status: 401; readonly message: ({ expiredAt }: { expiredAt: string; }) => string; readonly why: "The SDK pins the VERCEL_OIDC_TOKEN environment token when it is set (skipping @vercel/oidc's project-root walk, which fails inside eve/workflow snapshots), so an expired env token is never refreshed automatically."; readonly fix: "Locally: run `vercel env pull` to refresh .env.local. On Vercel: deployments inject a fresh token — check nothing overrides VERCEL_OIDC_TOKEN with a stale value."; readonly link: "https://github-tools.com/guide/vercel-connect#eve-agent"; }; readonly CONNECT_NOT_AUTHORIZED: { readonly status: 403; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "Connect rejected the identity of the calling process (the Vercel OIDC token), not the GitHub permissions — the request never reached GitHub."; readonly fix: "Refresh the OIDC token (`vercel env pull` locally) and check the connector is linked to the Vercel project this code runs in."; readonly link: "https://github-tools.com/guide/vercel-connect#setup-checklist"; }; readonly CONNECT_USER_NOT_CONNECTED: { readonly status: 401; readonly message: ({ subjectId }: { subjectId: string; }) => string; readonly why: "The Connect token was requested with a user subject, but that user has not connected their GitHub account to this connector (or revoked the authorization)."; readonly fix: "Have the user connect their GitHub account (e.g. from the integrations panel), then retry."; readonly link: "https://github-tools.com/guide/vercel-connect#per-user-tokens"; }; readonly CONNECT_INSTALLATION_REQUIRED: { readonly status: 401; readonly message: ({ detail, owner }: { detail: string; owner?: string; }) => string; readonly why: "The connector exists but its GitHub App is not installed on the target org or user account, so Connect cannot mint a token for it."; readonly fix: "Install the connector's GitHub App on the org or account named in the message (from the Vercel Connect dashboard), or target a repository on an account where it is installed."; readonly link: "https://github-tools.com/guide/vercel-connect#create-a-github-connector"; }; readonly SUBJECT_CONTEXT_REQUIRED: { readonly status: 500; readonly message: "A `connect` or `connect.subject` resolver needs the tool execution context — it is only available while a tool call executes."; readonly why: "A per-call Connect resolver was invoked without an eve ToolContext and tool call, which only exist during tool execution."; readonly fix: "Keep Connect resolver calls on the tool execute path; use static `connect` params when no execution context is available."; readonly link: "https://github-tools.com/frameworks/eve-extension#per-user-tokens"; }; readonly EVALUATION_UNAVAILABLE: { readonly status: 500; readonly message: "`requireApproval: 'auto'` and `preset: 'auto'` need `experimental_evaluate` from `ai` 7.0.105 or later."; readonly why: "The installed `ai` package does not export `experimental_evaluate`, which runs the evaluation model behind the `'auto'` options."; readonly fix: "Upgrade `ai` to 7.0.105 or later, or replace `'auto'` with `true` / `false` or an explicit preset."; readonly link: "https://github-tools.com/guide/approval-control#auto-approval"; }; readonly EVALUATION_FAILED: { readonly status: 502; readonly message: ({ model, fallback, detail }: { model: string; fallback: string; detail: string; }) => string; readonly why: "The `experimental_evaluate` call behind `requireApproval: 'auto'` or `preset: 'auto'` threw — typically the model is not enabled for the AI Gateway project, the team has no credits, or the gateway is rate limiting or unavailable."; readonly fix: "Check the evaluation model is available to the project on AI Gateway and has credits, or set `evaluation.model` to one that is. The agent keeps running on the fallback until then."; readonly link: "https://github-tools.com/guide/approval-control#auto-approval"; }; readonly UNAUTHORIZED: { readonly status: 401; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "The GitHub token is invalid, expired, or revoked."; readonly fix: "Rotate the credential: regenerate the PAT or re-mint the installation token, then update the token source."; readonly link: "https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api"; }; readonly FORBIDDEN: { readonly status: 403; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "The token authenticated but lacks permission: a missing scope on this resource, SAML SSO enforcement, or an API that only accepts user access tokens (gists, notifications) called with an installation token."; readonly fix: "Grant the missing permission on the PAT or GitHub App installation; authorize the token for SAML if the org enforces it; use a user access token for gist and notification tools."; readonly link: "https://github-tools.com/guide/tokens-and-auth#map-permissions-to-presets"; }; readonly RATE_LIMITED: { readonly status: 429; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "The token used up its GitHub API rate limit for this resource."; readonly fix: "Stop calling this tool and retry after the reset timestamp in the message; batch reads or narrow the query to spend fewer requests."; readonly link: "https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"; }; readonly NOT_FOUND: { readonly status: 404; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "Either the resource does not exist, or the token cannot see it — GitHub deliberately returns 404 instead of 403 for private resources the token has no access to."; readonly fix: "Check the owner/repo/number input first. If it is correct, the token lacks access: grant the repository to the PAT or App installation, or use a Connect subject that has access."; readonly link: "https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api#404-not-found-for-an-existing-resource"; }; readonly VALIDATION_FAILED: { readonly status: 422; readonly message: ({ detail }: { detail: string; }) => string; readonly why: "The input was well-formed but GitHub refused it — a duplicate resource, an immutable state transition, or an unresolvable ref."; readonly fix: "The embedded GitHub message names the offending field or state; adjust the input and retry."; readonly link: "https://docs.github.com/en/rest/using-the-rest-api/troubleshooting-the-rest-api#validation-failed"; }; }>; declare module 'evlog' { interface RegisteredErrorCatalogs { github_tools: typeof githubToolsErrors; } } //#endregion //#region src/agents.d.ts type AgentOptions = Omit, 'model' | 'tools' | 'instructions'>; type CreateGithubAgentOptions = AgentOptions & GithubToolsBaseOptions & { model: ToolLoopAgentSettings['model']; /** * Restrict tools and system prompt to a predefined preset. * * Selects a subset of tools and, when a single preset is passed, * sets a matching system prompt. Combine presets with an array to merge tool sets. * * `'auto'` picks presets per call from the latest user message with an evaluation model * (Jev by default, see `evaluation`), then narrows `activeTools` and uses the matching * system prompt. Combines at most two presets (`evaluation.maxPresets`), and only uses * read-only `repo-explorer` when no other preset qualifies; when none clears the threshold, * uses the most likely one. Never exposes the full catalog. Needs `ai` 7.0.105 or later. * * @see {@link GithubToolPreset} for available presets and included tools. */ preset?: GithubToolPreset | GithubToolPreset[] | 'auto'; /** * Fully replace the default system prompt. * When set, `preset` system prompts and `additionalInstructions` are ignored. * `context` is still appended when provided. */ instructions?: string; /** * Append text to the preset-specific (or default) system prompt. * Ignored when `instructions` is set. */ additionalInstructions?: string; }; declare function createGithubAgent(options: CreateGithubAgentOptions & { preset?: undefined | 'auto'; }): ToolLoopAgent; declare function createGithubAgent

(options: CreateGithubAgentOptions & { preset: P; }): ToolLoopAgent>>; declare function createGithubAgent

(options: CreateGithubAgentOptions & { preset: P; }): ToolLoopAgent>>; //#endregion //#region src/index.d.ts type GithubToolsOptions = GithubToolsBaseOptions & { /** * Restrict the returned tools to a predefined preset. * Prefer a focused preset for most agents. Omit or use `maintainer` for the full catalog. * * @see {@link GithubToolPreset} for available presets and included tools. * * @example * ```ts * // Only code-review tools * createGithubTools({ token, preset: 'code-review' }) * * // Combine presets * createGithubTools({ token, preset: ['code-review', 'issue-triage'] }) * * // Full catalog * createGithubTools({ token, preset: 'maintainer' }) * ``` */ preset?: GithubToolPreset | GithubToolPreset[]; }; declare function createGithubTools(options?: GithubToolsBaseOptions & { preset?: undefined; }): AllGithubTools; declare function createGithubTools

(options: GithubToolsBaseOptions & { preset: P; }): Pick>; declare function createGithubTools

(options: GithubToolsBaseOptions & { preset: P; }): Pick>; declare function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick; type GithubTools = AllGithubTools & ToolSet; //#endregion export { addLabels as $, deleteGist as A, createOrUpdateFile as At, searchIssues as B, createRepositoryCore as Bt, listWorkflowJobs as C, mergePullRequest as Ct, triggerWorkflow as D, updatePullRequest as Dt, rerunWorkflowRun as E, resolveReviewThread as Et, compareCommits as F, getRepository as Ft, getDiscussion as G, getRepositoryTreeCore as Gt, listNotifications as H, forkRepositoryCore as Ht, getBlame as I, getRepositoryTree as It, addIssueReaction as J, PagedList as Jt, listDiscussions as K, listBranchesCore as Kt, getCommit as L, listBranches as Lt, listGistComments as M, deleteBranch as Mt, listGists as N, forkRepository as Nt, createGist as O, updatePullRequestComment as Ot, updateGist as P, getFileContent as Pt, addIssueComment as Q, listCommits as R, createBranchCore as Rt, getWorkflowRun as S, listPullRequests as St, listWorkflows as T, requestReviewers as Tt, markNotificationRead as U, getFileContentCore as Ut, searchRepositories as V, deleteBranchCore as Vt, addDiscussionComment as W, getRepositoryCore as Wt, listIssueReactions as X, __exportAll as Xt, listCommentReactions as Y, createOctokit as Yt, addAssignees as Z, updateRelease as _, deletePullRequestComment as _t, createGithubAgent as a, getIssue as at, cancelWorkflowRun as b, listPullRequestReviewThreads as bt, getCiFailureContext as c, listLabels as ct, getReleaseContext as d, updateIssue as dt, closeIssue as et, createRelease as f, updateIssueComment as ft, listReleases as g, createPullRequestReview as gt, getRelease as h, createPullRequest as ht, CreateGithubAgentOptions as i, deleteLabel as it, getGist as j, createRepository as jt, createGistComment as k, createBranch as kt, getIssueContext as l, removeAssignees as lt, getLatestRelease as m, addPullRequestComment as mt, GithubToolsOptions as n, createLabel as nt, githubToolsErrors as o, listIssueComments as ot, deleteRelease as p, updateLabel as pt, addCommentReaction as q, repository_d_exports as qt, createGithubTools as r, deleteIssueComment as rt, GithubRateLimit as s, listIssues as st, GithubTools as t, createIssue as tt, getPullRequestContext as u, removeLabel as ut, getCombinedStatus as v, getPullRequest as vt, listWorkflowRuns as w, replyToReviewComment as wt, getWorkflowJobLogs as x, listPullRequestReviews as xt, listCheckRuns as y, listPullRequestFiles as yt, searchCode as z, createOrUpdateFileCore as zt }; //# sourceMappingURL=index-DkZvveZP.d.mts.map