import { Experimental_EvaluationModel, ModelMessage, Tool } from "ai"; import { z } from "zod"; import { Octokit as Octokit$1 } from "octokit"; //#region src/core/catalog.d.ts /** * Single source of truth for every GitHub tool. * * `GITHUB_TOOL_NAMES`, `GITHUB_WRITE_TOOLS`, `TOOL_CONNECT_SCOPES`, and the * eve tool registry are all derived from this catalog. Adding a tool here (plus * its core in `GITHUB_TOOL_CORES`, its `"use step"` factory in `src/tools/` and * `allTools` in `src/index.ts`, all enforced at compile time) is the only * registration needed. */ declare const GITHUB_TOOL_CATALOG: { /** Get information about a GitHub repository including description, stars, forks, language, and default branch. */ getRepository: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** List branches in a GitHub repository. */ listBranches: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Get the content of a file from a GitHub repository. Prefer startLine/endLine or maxLines for large files. */ getFileContent: { description: string; inputSchema: 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>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** List the file and directory structure of a repository at a given ref. */ getRepositoryTree: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodOptional; path: z.ZodOptional; recursive: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */ createBranch: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; branch: z.ZodString; from: z.ZodOptional; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; /** Delete a branch from a GitHub repository permanently. Requires approval by default. */ deleteBranch: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; branch: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */ forkRepository: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; organization: z.ZodOptional; name: z.ZodOptional; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */ createRepository: { description: string; inputSchema: 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>; write: true; connectScopes: readonly ["metadata:read", "administration:read", "administration:write"]; }; /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */ createOrUpdateFile: { description: string; inputSchema: 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>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; /** List pull requests for a GitHub repository. */ listPullRequests: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; state: z.ZodDefault>>; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read"]; }; /** Get detailed information about a specific pull request. Body truncated by default (detail: summary). */ getPullRequest: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read"]; }; /** Create a new pull request in a GitHub repository. Requires approval by default. */ createPullRequest: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; title: z.ZodString; body: z.ZodOptional; head: z.ZodString; base: z.ZodString; draft: z.ZodDefault>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Merge a pull request. Requires approval by default. */ mergePullRequest: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; commitTitle: z.ZodOptional; commitMessage: z.ZodOptional; mergeMethod: z.ZodDefault>>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Update a pull request — title, body, state, base branch, or draft status. Requires approval by default. */ updatePullRequest: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; title: z.ZodOptional; body: z.ZodOptional; state: z.ZodOptional>; base: z.ZodOptional; draft: z.ZodOptional; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Add a comment to a pull request. Requires approval by default. */ addPullRequestComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Update the body of a comment on a pull request. Requires approval by default. */ updatePullRequestComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Delete a comment from a pull request permanently. Requires approval by default. */ deletePullRequestComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** List files changed in a pull request with status and stats. Patches omitted by default — set includePatch true for diffs. */ listPullRequestFiles: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; includePatch: z.ZodDefault>; filenames: z.ZodOptional>; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read"]; }; /** List reviews on a pull request (approvals, change requests, and comments). */ listPullRequestReviews: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read"]; }; /** Submit a pull request review — approve, request changes, or comment with optional inline comments on specific lines. Requires approval by default. */ createPullRequestReview: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; body: z.ZodOptional; event: z.ZodEnum<{ APPROVE: "APPROVE"; REQUEST_CHANGES: "REQUEST_CHANGES"; COMMENT: "COMMENT"; }>; comments: z.ZodOptional; side: z.ZodOptional>; }, z.core.$strip>>>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** List review threads on a pull request with comments, resolution state, and the IDs needed to reply or resolve. Unresolved only by default. */ listPullRequestReviewThreads: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; status: z.ZodDefault>>; detail: z.ZodDefault>>; perPage: z.ZodDefault>; after: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read"]; }; /** Reply to a pull request review comment in its review thread. Requires approval by default. */ replyToReviewComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; commentId: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Mark a pull request review thread as resolved. Requires approval by default. */ resolveReviewThread: { description: string; inputSchema: z.ZodObject<{ threadId: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Request reviews from users or teams on a pull request. Requires approval by default. */ requestReviewers: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; reviewers: z.ZodOptional>; teamReviewers: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"]; }; /** Fetch pull request details plus files, reviews, and optional CI checks in one call. */ getPullRequestContext: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; pullNumber: z.ZodNumber; includeFiles: z.ZodDefault>; includeReviews: z.ZodDefault>; includeChecks: z.ZodDefault>; includePatch: z.ZodDefault>; filesPerPage: z.ZodDefault>; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "pull_requests:read", "checks:read", "statuses:read"]; }; /** Fetch an issue plus available label names and recent comments in one call. */ getIssueContext: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; includeLabels: z.ZodDefault>; includeComments: z.ZodDefault>; maxComments: z.ZodDefault>; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** List issues for a GitHub repository (excludes pull requests). */ listIssues: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; state: z.ZodDefault>>; labels: z.ZodOptional; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** Get detailed information about a specific issue. Body truncated by default (detail: summary). */ getIssue: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** List comments on a GitHub issue. Bodies are truncated by default (detail: summary). Prefer getIssueContext for the first page when triaging. */ listIssueComments: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; perPage: z.ZodDefault>; page: z.ZodDefault>; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** Create a new issue in a GitHub repository. Requires approval by default. */ createIssue: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; title: z.ZodString; body: z.ZodOptional; labels: z.ZodOptional>; assignees: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Add a comment to a GitHub issue. Requires approval by default. */ addIssueComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Update the body of a comment on a GitHub issue. Requires approval by default. */ updateIssueComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Delete a comment from a GitHub issue permanently. Requires approval by default. */ deleteIssueComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Close an open GitHub issue. Requires approval by default. */ closeIssue: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; stateReason: z.ZodDefault>>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Update a GitHub issue — title, body, state, labels, milestone, or assignees. Requires approval by default. */ updateIssue: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; title: z.ZodOptional; body: z.ZodOptional; state: z.ZodOptional>; stateReason: z.ZodOptional>; labels: z.ZodOptional>; milestone: z.ZodOptional>; assignees: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** List labels available in a GitHub repository. */ listLabels: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** Add labels to an issue or pull request. Requires approval by default. */ addLabels: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; labels: z.ZodArray; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Remove a label from an issue or pull request. Requires approval by default. */ removeLabel: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; label: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Create a label in a GitHub repository. Requires approval by default. */ createLabel: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; name: z.ZodString; color: z.ZodString; description: z.ZodOptional; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Update a label in a GitHub repository — name, color, or description. Requires approval by default. */ updateLabel: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; name: z.ZodString; newName: z.ZodOptional; color: z.ZodOptional; description: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Delete a label from a GitHub repository permanently. Requires approval by default. */ deleteLabel: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; name: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Assign users to an issue or pull request. Requires approval by default. */ addAssignees: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; assignees: z.ZodArray; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** Remove assignees from an issue or pull request. Requires approval by default. */ removeAssignees: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; assignees: z.ZodArray; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** List reactions on an issue or pull request conversation, with per-emoji counts. */ listIssueReactions: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; content: z.ZodOptional>; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** React to an issue or pull request with an emoji. Requires approval by default. */ addIssueReaction: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; issueNumber: z.ZodNumber; content: z.ZodEnum<{ "+1": "+1"; [-1]: "-1"; laugh: "laugh"; confused: "confused"; heart: "heart"; hooray: "hooray"; rocket: "rocket"; eyes: "eyes"; }>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** List reactions on an issue or pull request comment, with per-emoji counts. */ listCommentReactions: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; content: z.ZodOptional>; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "issues:read"]; }; /** React to an issue or pull request comment with an emoji. Requires approval by default. */ addCommentReaction: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; commentId: z.ZodNumber; content: z.ZodEnum<{ "+1": "+1"; [-1]: "-1"; laugh: "laugh"; confused: "confused"; heart: "heart"; hooray: "hooray"; rocket: "rocket"; eyes: "eyes"; }>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "issues:read", "issues:write"]; }; /** List discussions in a GitHub repository, most recently updated first, optionally filtered by category. */ listDiscussions: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; category: z.ZodOptional; perPage: z.ZodDefault>; after: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "discussions:read"]; }; /** Get a GitHub discussion by number. Body truncated by default (detail: summary). */ getDiscussion: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; discussionNumber: z.ZodNumber; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "discussions:read"]; }; /** Add a comment to a GitHub discussion. Requires approval by default. */ addDiscussionComment: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; discussionNumber: z.ZodNumber; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "discussions:read", "discussions:write"]; }; /** List notification threads for the authenticated user. Requires a token with notifications access. */ listNotifications: { description: string; inputSchema: z.ZodObject<{ all: z.ZodDefault>; participating: z.ZodDefault>; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly []; }; /** Mark a single notification thread as read. Requires approval by default. */ markNotificationRead: { description: string; inputSchema: z.ZodObject<{ threadId: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly []; }; /** 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. */ searchCode: { description: string; inputSchema: z.ZodObject<{ query: z.ZodString; perPage: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */ searchRepositories: { description: string; inputSchema: z.ZodObject<{ query: z.ZodString; perPage: z.ZodDefault>; sort: z.ZodOptional>; order: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["metadata:read"]; }; /** Search for issues and pull requests across GitHub using search qualifiers like "repo:owner/name is:open". */ searchIssues: { description: string; inputSchema: z.ZodObject<{ query: z.ZodString; perPage: z.ZodDefault>; sort: z.ZodOptional>; order: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["metadata:read", "issues:read", "pull_requests:read"]; }; /** List commits for a GitHub repository. Filter by file path to see commits that touched a file. For line-by-line attribution at a given ref, use getBlame instead. */ listCommits: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; path: z.ZodOptional; sha: z.ZodOptional; author: z.ZodOptional; since: z.ZodOptional; until: z.ZodOptional; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Get detailed information about a specific commit, including the list of files changed. Patches omitted by default. */ getCommit: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodString; includePatch: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). Returns contiguous ranges mapping lines to the commits that last modified them. */ getBlame: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; path: z.ZodString; ref: z.ZodOptional; line: z.ZodOptional; lineStart: z.ZodOptional; lineEnd: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Compare two branches, tags, or commits — ahead/behind counts, commits in between, and differing files. Patches omitted by default. */ compareCommits: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; base: z.ZodString; head: z.ZodString; includePatch: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** List gists for the authenticated user or a specific user. */ listGists: { description: string; inputSchema: z.ZodObject<{ username: z.ZodOptional; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly []; }; /** Get a gist by ID, including file contents. */ getGist: { description: string; inputSchema: z.ZodObject<{ gistId: z.ZodString; }, z.core.$strip>; connectScopes: readonly []; }; /** List comments on a gist. */ listGistComments: { description: string; inputSchema: z.ZodObject<{ gistId: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly []; }; /** Create a new gist with one or more files. Requires approval by default. */ createGist: { description: string; inputSchema: z.ZodObject<{ description: z.ZodOptional; files: z.ZodRecord>; isPublic: z.ZodDefault>; }, z.core.$strip>; write: true; connectScopes: readonly []; }; /** Update an existing gist — edit description, update files, or remove files. Requires approval by default. */ updateGist: { description: string; inputSchema: z.ZodObject<{ gistId: z.ZodString; description: z.ZodOptional; files: z.ZodOptional>>; filesToDelete: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly []; }; /** Delete a gist permanently. Requires approval by default. */ deleteGist: { description: string; inputSchema: z.ZodObject<{ gistId: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly []; }; /** Add a comment to a gist. Requires approval by default. */ createGistComment: { description: string; inputSchema: z.ZodObject<{ gistId: z.ZodString; body: z.ZodString; }, z.core.$strip>; write: true; connectScopes: readonly []; }; /** List GitHub Actions workflows in a repository. */ listWorkflows: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read"]; }; /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */ listWorkflowRuns: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; workflowId: z.ZodOptional>; branch: z.ZodOptional; event: z.ZodOptional; status: z.ZodOptional>; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read"]; }; /** Get details of a specific workflow run including status, timing, and trigger info. */ getWorkflowRun: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; runId: z.ZodNumber; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read"]; }; /** List jobs for a workflow run, including step-level status and timing. */ listWorkflowJobs: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; runId: z.ZodNumber; filter: z.ZodDefault>>; perPage: z.ZodDefault>; page: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read"]; }; /** Get the log output of a workflow job to diagnose failures. Returns the tail (default 200 lines) with timestamps stripped. */ getWorkflowJobLogs: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; jobId: z.ZodNumber; maxLines: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read"]; }; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */ triggerWorkflow: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; workflowId: z.ZodUnion; ref: z.ZodString; inputs: z.ZodOptional>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"]; }; /** Cancel an in-progress workflow run. Requires approval by default. */ cancelWorkflowRun: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; runId: z.ZodNumber; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"]; }; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */ rerunWorkflowRun: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; runId: z.ZodNumber; onlyFailedJobs: z.ZodDefault>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "actions:write"]; }; /** List check runs (Checks API — GitHub Actions and other CI providers) for a commit, branch, or tag. */ listCheckRuns: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "checks:read", "statuses:read"]; }; /** Get the combined commit status (Statuses API — legacy CI integrations) for a commit, branch, or tag. */ getCombinedStatus: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodString; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "checks:read", "statuses:read"]; }; /** Diagnose CI failures for a ref — combined status, failing checks, and failed workflow jobs in one call. */ getCiFailureContext: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; ref: z.ZodString; maxFailedRuns: z.ZodDefault>; maxFailedJobs: z.ZodDefault>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read", "actions:read", "checks:read", "statuses:read"]; }; /** List releases for a GitHub repository, newest first (includes drafts and prereleases). */ listReleases: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; perPage: z.ZodDefault>; page: z.ZodDefault>; maxPages: z.ZodOptional; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Get the latest published release for a GitHub repository (excludes drafts and prereleases). Body truncated by default. */ getLatestRelease: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Get a specific release by ID, including its assets. Body truncated by default. */ getRelease: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; releaseId: z.ZodNumber; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Fetch a release plus the previous release and tag comparison in one call. */ getReleaseContext: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; releaseId: z.ZodOptional; includePrevious: z.ZodDefault>; includeCompare: z.ZodDefault>; detail: z.ZodDefault>>; }, z.core.$strip>; connectScopes: readonly ["contents:read", "metadata:read"]; }; /** Create a new release (and its tag if needed) in a GitHub repository. Requires approval by default. */ createRelease: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; tagName: z.ZodString; target: z.ZodOptional; name: z.ZodOptional; body: z.ZodOptional; draft: z.ZodDefault>; prerelease: z.ZodDefault>; generateReleaseNotes: z.ZodDefault>; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; /** Update an existing release — tag, target, title, notes, draft, or prerelease status. Requires approval by default. */ updateRelease: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; releaseId: z.ZodNumber; tagName: z.ZodOptional; target: z.ZodOptional; name: z.ZodOptional; body: z.ZodOptional; draft: z.ZodOptional; prerelease: z.ZodOptional; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; /** Delete a release permanently. Requires approval by default. */ deleteRelease: { description: string; inputSchema: z.ZodObject<{ owner: z.ZodString; repo: z.ZodString; releaseId: z.ZodNumber; }, z.core.$strip>; write: true; connectScopes: readonly ["contents:read", "contents:write", "metadata:read"]; }; }; type GithubToolName = keyof typeof GITHUB_TOOL_CATALOG; /** Tool names whose catalog entry is marked `write: true`. */ type GithubWriteToolName = { [K in GithubToolName]: (typeof GITHUB_TOOL_CATALOG)[K] extends { write: true; } ? K : never; }[GithubToolName]; //#endregion //#region src/core/tool-names.d.ts /** * All GitHub tool names available via {@link createGithubTools}, keyed by name. * Derived from `GITHUB_TOOL_CATALOG` — the single source of truth for tools. */ declare const GITHUB_TOOL_NAMES: { [K in GithubToolName]: K; }; //#endregion //#region src/core/presets.d.ts /** * Predefined tool presets for common use cases. * Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}. * Presets can be combined by passing an array. */ declare const PRESET_TOOLS: { /** * **Code review** — review pull requests and submit feedback. * * Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`, `listPullRequestReviewThreads`, `getPullRequestContext`, * `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `compareCommits`, `getRepository`, `listBranches`, * `searchCode`, `listCheckRuns`, `getCombinedStatus`, `updatePullRequest`, `addPullRequestComment`, `updatePullRequestComment`, * `deletePullRequestComment`, `createPullRequestReview`, `replyToReviewComment`, `resolveReviewThread`, `requestReviewers`. * * Agent prompt: optimized for thorough PR review with inline feedback. */ readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "getFileContent", "listCommits", "getCommit", "getBlame", "compareCommits", "getRepository", "listBranches", "searchCode", "listCheckRuns", "getCombinedStatus", "updatePullRequest", "addPullRequestComment", "updatePullRequestComment", "deletePullRequestComment", "createPullRequestReview", "replyToReviewComment", "resolveReviewThread", "requestReviewers"]; /** * **Issue triage** — manage and organize GitHub issues. * * Tools: `listIssues`, `getIssueContext`, `listIssueComments`, `createIssue`, `addIssueComment`, `updateIssueComment`, `deleteIssueComment`, * `closeIssue`, `updateIssue`, `addLabels`, `removeLabel`, `createLabel`, `updateLabel`, `deleteLabel`, * `addAssignees`, `removeAssignees`, * `listIssueReactions`, `addIssueReaction`, `listCommentReactions`, `addCommentReaction`, `getRepository`, * `searchRepositories`, `searchCode`, `searchIssues`. * * Prefer `getIssueContext` (issue + `labelNames` + recent comments) over separate get/list calls. * Use `listIssueComments` to paginate beyond the comments returned by `getIssueContext`. * Reopen a closed issue with `updateIssue` (`state: 'open'`) — there is no separate reopen tool. * Acknowledge a report with `addIssueReaction` / `addCommentReaction` instead of a comment when no reply is needed. * Agent prompt: optimized for categorizing, labeling, and responding to issues. */ 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", "searchRepositories", "searchCode", "searchIssues"]; /** * **CI operations** — monitor and manage GitHub Actions workflows. * * Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`, * `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, * `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`. * * Diagnose a failure with `getCiFailureContext` first, then read the failing job's output with `getWorkflowJobLogs`. * Agent prompt: optimized for diagnosing CI failures and managing workflow runs. */ readonly 'ci-ops': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"]; /** * **Repository explorer** — read-only access to browse codebases. * * Tools: all read-only tools including repos, branches, PRs, issues, discussions, commits, blame, comparisons, * search, gists, workflows, checks, and releases. No write operations. * * Agent prompt: optimized for answering questions about code structure and history. */ readonly 'repo-explorer': readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listPullRequestReviewThreads", "getPullRequestContext", "listIssues", "getIssue", "getIssueContext", "listIssueComments", "listDiscussions", "getDiscussion", "listLabels", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listGists", "getGist", "listGistComments", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext"]; /** * **Security audit** — review repositories for security risks and report findings. * * Tools: read-only exploration (`getFileContent`, `getRepositoryTree`, `searchCode`, `searchIssues`, `listCommits`, `getCommit`, * `getBlame`, `compareCommits`), PR and CI visibility (`listPullRequests`, `getPullRequest`, `listPullRequestFiles`, * `getPullRequestContext`, `listCheckRuns`, `getCombinedStatus`, `getCiFailureContext`, `listWorkflows`, `listWorkflowRuns`, * `getWorkflowRun`, `listWorkflowJobs`, `getWorkflowJobLogs` — logs can leak secrets, so auditing them matters), * plus `createIssue`, `addIssueComment`, and `addLabels` to report findings. * No destructive writes. * * Agent prompt: optimized for finding and reporting security risks without making changes. */ readonly 'security-audit': readonly ["getRepository", "listBranches", "getFileContent", "getRepositoryTree", "listCommits", "getCommit", "getBlame", "compareCommits", "searchCode", "searchRepositories", "searchIssues", "listPullRequests", "getPullRequest", "listPullRequestFiles", "getPullRequestContext", "listCheckRuns", "getCombinedStatus", "getCiFailureContext", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "getWorkflowJobLogs", "listIssues", "getIssue", "getIssueContext", "createIssue", "addIssueComment", "addLabels"]; /** * **Release manager** — prepare and publish GitHub releases. * * Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`, `compareCommits`, * `listReleases`, `getLatestRelease`, `getRelease`, `getReleaseContext`, `createRelease`, `updateRelease`, `deleteRelease`, * `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`, `triggerWorkflow`, * `listPullRequests`, `getPullRequest`. * * Agent prompt: optimized for summarizing changes and cutting releases safely. */ readonly 'release-manager': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "compareCommits", "listReleases", "getLatestRelease", "getRelease", "getReleaseContext", "createRelease", "updateRelease", "deleteRelease", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "listPullRequests", "getPullRequest"]; /** * **Discussion moderator** — answer and moderate repository Discussions. * * Tools: `listDiscussions`, `getDiscussion`, `addDiscussionComment`, * `getRepository`, `searchIssues`, `getIssueContext`, `addIssueComment`. * * Prefer discussions for Q&A; link related issues with `getIssueContext` / `addIssueComment` when needed. * Agent prompt: optimized for clear, on-topic discussion replies. */ readonly 'discussion-moderator': readonly ["listDiscussions", "getDiscussion", "addDiscussionComment", "getRepository", "searchIssues", "getIssueContext", "addIssueComment"]; /** * **Notification inbox** — triage authenticated-user notification threads. * * Tools: `listNotifications`, `markNotificationRead`, `getIssue`, `getPullRequest`, `getRepository`. * * Requires a user PAT with the Notifications account permission — not available on Connect installation tokens. * Agent prompt: optimized for clearing inbox noise and following up on actionable threads. */ readonly 'notification-inbox': readonly ["listNotifications", "markNotificationRead", "getIssue", "getPullRequest", "getRepository"]; /** * **PR author** — open pull requests without the full write surface. * * Tools: `getRepository`, `listBranches`, `getFileContent`, `createBranch`, `deleteBranch`, `createOrUpdateFile`, * `createPullRequest`, `updatePullRequest`, `getPullRequest`, `listPullRequestFiles`, * `listPullRequestReviewThreads`, `replyToReviewComment`, `resolveReviewThread`, * `compareCommits`, `getCommit`. * * Respond to review feedback with `listPullRequestReviewThreads` → `replyToReviewComment` → `resolveReviewThread`. * Agent prompt: optimized for branching, editing files, and opening focused PRs. */ readonly 'pr-author': readonly ["getRepository", "listBranches", "getFileContent", "createBranch", "deleteBranch", "createOrUpdateFile", "createPullRequest", "updatePullRequest", "getPullRequest", "listPullRequestFiles", "listPullRequestReviewThreads", "replyToReviewComment", "resolveReviewThread", "compareCommits", "getCommit"]; /** * **Maintainer** — full repository maintenance with all read and write tools. * * Tools: all tools (same as omitting `preset`). * * Agent prompt: optimized for day-to-day repo maintenance with careful write operations. */ 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"]; }; type GithubToolPreset = keyof typeof PRESET_TOOLS; /** Tool names included in a single preset. */ type PresetToolName

= Extract<(typeof PRESET_TOOLS)[P][number], GithubToolName>; /** Tool names included when combining multiple presets. */ type CombinedPresetToolNames

= PresetToolName; //#endregion //#region src/core/token.d.ts /** * The tool call a token is requested for. Passed to token providers so they * can mint a token for the call's target — e.g. the GitHub App installation * that owns `owner/repo`. */ type GithubTokenCall = { toolName: GithubToolName; /** Tool input after context defaults are applied. */ input: unknown; /** Target repository owner. Undefined for tools without a repository target (search, gists, notifications). */ owner?: string; /** Target repository name. Undefined for tools without a repository target. */ repo?: string; }; /** * A token string, or an async provider. Providers receive the tool call the * token is requested for; `call` is undefined when the token is resolved * outside a tool call. */ type GithubTokenInput = string | ((call?: GithubTokenCall) => Promise); /** Resolves a {@link GithubTokenInput} to a token string for an optional tool call. */ declare function resolveGithubToken(token?: GithubTokenInput, call?: GithubTokenCall): Promise; //#endregion //#region src/core/evaluation-policy.d.ts /** Evaluation model used by `'auto'` approval and `preset: 'auto'` unless `evaluation.model` is set. */ declare const DEFAULT_EVALUATION_MODEL = "typesafe-ai/jev"; /** * Write tools `requireApproval: 'auto'` evaluates: labels, assignees, reactions, comments, * review-thread replies, reviewer requests, notification reads, and workflow re-runs. * Every other write tool keeps requiring approval. */ declare const AUTO_APPROVAL_TOOLS: readonly ["addLabels", "removeLabel", "addAssignees", "removeAssignees", "addIssueReaction", "addCommentReaction", "addIssueComment", "addPullRequestComment", "addDiscussionComment", "createGistComment", "replyToReviewComment", "resolveReviewThread", "requestReviewers", "markNotificationRead", "rerunWorkflowRun"]; type RoutablePreset = Exclude; //#endregion //#region src/core/write-tools.d.ts /** * GitHub tools that perform write operations and require approval by default. * Derived from the `write: true` entries of `GITHUB_TOOL_CATALOG`. */ declare const GITHUB_WRITE_TOOLS: { [K in GithubWriteToolName]: K; }; //#endregion //#region src/core/evaluation.d.ts /** * Tuning for `requireApproval: 'auto'` and `preset: 'auto'`. Every field is optional. */ type GithubEvaluationOptions = { /** * Evaluation model for AI SDK `experimental_evaluate`: an AI Gateway ID or a model instance. * @default 'typesafe-ai/jev' */ model?: Experimental_EvaluationModel; /** * Highest risk an `'auto'` tool call can have and still run without approval, on a 0–2 scale * (0 negligible, 1 visible but reversible, 2 hard to undo). * @default 1 */ maxRisk?: number; /** * Lowest probability that the latest user message asked for the call, for it to run without approval. * @default 0.6 */ minIntent?: number; /** * Lowest probability for `preset: 'auto'` to select a preset. When no preset reaches it, * the single most likely preset is used. * @default 0.7 */ minPresetProbability?: number; /** * Most presets `preset: 'auto'` combines in one call, keeping the most likely ones. * @default 2 */ maxPresets?: number; }; /** * Whether an `'auto'` write tool call needs human approval: `false` only when the model * rates it low-risk and asked for by the latest user message. When the evaluation call * fails, logs `EVALUATION_FAILED` and asks for approval. */ declare function needsAutoApproval(toolName: GithubWriteToolName, input: unknown, messages: readonly ModelMessage[], { model, maxRisk, minIntent }?: GithubEvaluationOptions): Promise; /** * Presets the latest user message needs, from one evaluation call with an independent * yes/no question per preset. Returns up to `maxPresets` presets at or above * `minPresetProbability`, most likely first; when none qualifies, the single most likely preset. * `repo-explorer` is only returned when no other preset qualifies. * When the evaluation call fails, logs `EVALUATION_FAILED` and returns read-only `repo-explorer`. * Never returns `maintainer`, so the full catalog is never exposed. */ declare function selectPresets(messages: readonly ModelMessage[], { model, minPresetProbability, maxPresets }?: GithubEvaluationOptions): Promise; declare function latestUserText(messages: readonly ModelMessage[]): string; //#endregion //#region src/core/approval-policy.d.ts /** * Approval for a single write tool. * * - `true` — always ask the user * - `false` — never ask * - `'auto'` — ask only when an evaluation model (Jev by default) rates the call risky * or not asked for by the latest user message. AI SDK evaluation needs `ai` 7.0.105 or later. */ type ToolApprovalMode = boolean | 'auto'; /** * Whether write operations require user approval. * * - `true` — all write tools need approval (default) * - `false` — no approval needed for any write tool * - `'auto'` — low-risk write tools ({@link AUTO_APPROVAL_TOOLS}) are evaluated per call; * every other write tool needs approval * - object — per-tool {@link ToolApprovalMode} via {@link GithubWriteToolName}; unspecified write tools default to `true` * * @example Global disable * ```ts * createGithubTools({ token, requireApproval: false }) * ``` * * @example Auto approval for low-risk writes * ```ts * createGithubTools({ token, requireApproval: 'auto' }) * ``` * * @example Granular per write tool * ```ts * createGithubTools({ * token, * requireApproval: { * mergePullRequest: true, * createOrUpdateFile: true, * addPullRequestComment: 'auto', * }, * }) * ``` */ type ApprovalConfig = ToolApprovalMode | Partial>; /** {@link ApprovalConfig} without `'auto'`, for runtimes that cannot run the evaluation model. */ type StaticApprovalConfig = boolean | Partial>; //#endregion //#region src/types.d.ts type GithubTool = Tool; type ToolOptions = { needsApproval?: GithubTool['needsApproval']; }; /** * Identity for a commit author or committer on GitHub. * * - **Author** — the person who originally wrote the code patch. * - **Committer** — the person who applied the commit to the repository. */ type CommitIdentity = { name: string; email: string; }; /** * Options for commit-creating tools (`createOrUpdateFile`, `mergePullRequest`). */ type CommitToolOptions = ToolOptions & { /** * The author of the commit — the person who wrote the code patch. * Falls back to the authenticated user when omitted. */ author?: CommitIdentity; /** * The committer of the commit — the person who applied the commit. * Falls back to the authenticated user when omitted. */ committer?: CommitIdentity; /** * Co-authors to attribute on commits. * Added as "Co-authored-by" trailers to commit messages. */ coAuthors?: CommitIdentity[]; }; /** * Per-tool overrides for customizing tool behavior without changing the underlying implementation. * * Overridable properties: `description`, `title`, `needsApproval`, `strict`, `providerOptions`, * `toModelOutput`, and input lifecycle callbacks (`onInputStart`, `onInputDelta`, `onInputAvailable`). * * `execute`, `inputSchema`, and `outputSchema` cannot be overridden. * * @example * ```ts * createGithubTools({ * overrides: { * mergePullRequest: { needsApproval: true, title: 'Merge PR' }, * listIssues: { description: 'List open bugs' }, * }, * }) * ``` */ type ToolOverrides = Partial>; //#endregion //#region src/core/context.d.ts /** * Default repository / issue / PR / ref values applied to tool inputs and * injected into agent system prompts. * * When a field is set here, matching tool schema fields become optional and * default to this value if the model omits them. */ type GithubToolsContext = { owner?: string; repo?: string; pullNumber?: number; issueNumber?: number; ref?: string; }; //#endregion //#region src/core/tool-types.d.ts /** Full tool set returned when no `preset` is specified. */ type AllGithubTools = Record; /** Base options shared by all {@link createGithubTools} overloads. */ type GithubToolsBaseOptions = { /** GitHub token string or async provider. Falls back to `process.env.GITHUB_TOKEN` when omitted. */ token?: GithubTokenInput; /** Control whether write operations require user approval. @see {@link ApprovalConfig} */ requireApproval?: ApprovalConfig; /** Tuning for `requireApproval: 'auto'` (model, thresholds). Jev with sensible thresholds by default. */ evaluation?: GithubEvaluationOptions; /** * Default owner / repo / PR / issue / ref values. * Softens matching tool input fields and fills them when the model omits them. * Also injected into agent system prompts via {@link createGithubAgent}. */ context?: GithubToolsContext; /** Per-tool overrides for description, title, needsApproval, and related AI SDK tool fields. */ overrides?: Partial>; /** Default author for commit-creating tools. Falls back to the authenticated user when omitted. */ author?: CommitIdentity; /** Default committer for commit-creating tools. Falls back to the authenticated user when omitted. */ committer?: CommitIdentity; /** Co-authors to attribute on all commits created by tools. */ coAuthors?: CommitIdentity[]; }; /** Tool set shape for a given preset option (single, combined, or all tools). */ type GithubToolsForPreset

= P extends GithubToolPreset ? Pick & GithubToolName> : P extends readonly GithubToolPreset[] ? Pick & GithubToolName> : AllGithubTools; /** Pick a subset of GitHub tools by tool name. */ type PickGithubTools = Pick; //#endregion export { GITHUB_TOOL_CATALOG as A, GithubTokenInput as C, PRESET_TOOLS as D, GithubToolPreset as E, GithubWriteToolName as M, PresetToolName as O, GithubTokenCall as S, CombinedPresetToolNames as T, needsAutoApproval as _, GithubToolsContext as a, AUTO_APPROVAL_TOOLS as b, GithubTool as c, ToolOverrides as d, ApprovalConfig as f, latestUserText as g, GithubEvaluationOptions as h, PickGithubTools as i, GithubToolName as j, GITHUB_TOOL_NAMES 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, selectPresets as v, resolveGithubToken as w, DEFAULT_EVALUATION_MODEL as x, GITHUB_WRITE_TOOLS as y }; //# sourceMappingURL=tool-types-CrC80SIL.d.mts.map