@github-tools/sdk 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -8
- package/dist/eve.d.mts +167 -0
- package/dist/eve.d.mts.map +1 -0
- package/dist/eve.mjs +522 -0
- package/dist/eve.mjs.map +1 -0
- package/dist/index-BRUYe5q0.d.mts +220 -0
- package/dist/index-BRUYe5q0.d.mts.map +1 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +3 -2
- package/dist/src-BgnkKMD7.mjs +812 -0
- package/dist/src-BgnkKMD7.mjs.map +1 -0
- package/dist/tool-types-CuirBEc8.d.mts +244 -0
- package/dist/tool-types-CuirBEc8.d.mts.map +1 -0
- package/dist/workflow.d.mts +51 -728
- package/dist/workflow.d.mts.map +1 -1
- package/dist/workflow.mjs +14 -74
- package/dist/workflow.mjs.map +1 -1
- package/dist/write-tools-vzlewWo5.mjs +1823 -0
- package/dist/write-tools-vzlewWo5.mjs.map +1 -0
- package/package.json +25 -6
- package/dist/index-ikP-LT-3.d.mts +0 -1634
- package/dist/index-ikP-LT-3.d.mts.map +0 -1
- package/dist/src--pAdGYqY.mjs +0 -1961
- package/dist/src--pAdGYqY.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-BgnkKMD7.mjs","names":[],"sources":["../src/tools/repository.ts","../src/tools/pull-requests.ts","../src/tools/issues.ts","../src/tools/search.ts","../src/tools/commits.ts","../src/tools/gists.ts","../src/tools/workflows.ts","../src/core/approval.ts","../src/agents.ts","../src/index.ts"],"sourcesContent":["import { tool } from 'ai'\nimport {\n getRepositoryInputSchema,\n getRepositoryDescription,\n getRepositoryCore,\n listBranchesInputSchema,\n listBranchesDescription,\n listBranchesCore,\n getFileContentInputSchema,\n getFileContentDescription,\n getFileContentCore,\n createBranchInputSchema,\n createBranchDescription,\n createBranchCore,\n forkRepositoryInputSchema,\n forkRepositoryDescription,\n forkRepositoryCore,\n createRepositoryInputSchema,\n createRepositoryDescription,\n createRepositoryCore,\n createOrUpdateFileInputSchema,\n createOrUpdateFileDescription,\n createOrUpdateFileCore,\n composeCommitMessage,\n} from '../core/repository'\nimport { getFileContentToModelOutput } from '../core/model-output'\nimport type { CommitToolOptions, ToolOptions, GithubTool } from '../types'\n\nexport { composeCommitMessage }\n\nasync function getRepositoryStep(args: Parameters<typeof getRepositoryCore>[0]) {\n \"use step\"\n return getRepositoryCore(args)\n}\n\n/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */\nexport const getRepository = (token: string): GithubTool =>\n tool({\n description: getRepositoryDescription,\n inputSchema: getRepositoryInputSchema,\n execute: async args => getRepositoryStep({ token, ...args }),\n })\n\nasync function listBranchesStep(args: Parameters<typeof listBranchesCore>[0]) {\n \"use step\"\n return listBranchesCore(args)\n}\n\n/** List branches in a GitHub repository. */\nexport const listBranches = (token: string): GithubTool =>\n tool({\n description: listBranchesDescription,\n inputSchema: listBranchesInputSchema,\n execute: async args => listBranchesStep({ token, ...args }),\n })\n\nasync function getFileContentStep(args: Parameters<typeof getFileContentCore>[0]) {\n \"use step\"\n return getFileContentCore(args)\n}\n\n/** Get the content of a file from a GitHub repository. */\nexport const getFileContent = (token: string): GithubTool =>\n tool({\n description: getFileContentDescription,\n inputSchema: getFileContentInputSchema,\n toModelOutput: getFileContentToModelOutput,\n execute: async args => getFileContentStep({ token, ...args }),\n })\n\nasync function createBranchStep(args: Parameters<typeof createBranchCore>[0]) {\n \"use step\"\n return createBranchCore(args)\n}\n\n/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */\nexport const createBranch = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createBranchDescription,\n needsApproval,\n inputSchema: createBranchInputSchema,\n execute: async args => createBranchStep({ token, ...args }),\n })\n\nasync function forkRepositoryStep(args: Parameters<typeof forkRepositoryCore>[0]) {\n \"use step\"\n return forkRepositoryCore(args)\n}\n\n/** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */\nexport const forkRepository = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: forkRepositoryDescription,\n needsApproval,\n inputSchema: forkRepositoryInputSchema,\n execute: async args => forkRepositoryStep({ token, ...args }),\n })\n\nasync function createRepositoryStep(args: Parameters<typeof createRepositoryCore>[0]) {\n \"use step\"\n return createRepositoryCore(args)\n}\n\n/** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */\nexport const createRepository = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createRepositoryDescription,\n needsApproval,\n inputSchema: createRepositoryInputSchema,\n execute: async args => createRepositoryStep({ token, ...args }),\n })\n\nasync function createOrUpdateFileStep(args: Parameters<typeof createOrUpdateFileCore>[0]) {\n \"use step\"\n return createOrUpdateFileCore(args)\n}\n\n/** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */\nexport const createOrUpdateFile = (\n token: string,\n { needsApproval = true, author, committer, coAuthors }: CommitToolOptions = {},\n): GithubTool =>\n tool({\n description: createOrUpdateFileDescription,\n needsApproval,\n inputSchema: createOrUpdateFileInputSchema,\n execute: async args => createOrUpdateFileStep({ token, author, committer, coAuthors, ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listPullRequestsInputSchema,\n listPullRequestsDescription,\n listPullRequestsCore,\n getPullRequestInputSchema,\n getPullRequestDescription,\n getPullRequestCore,\n createPullRequestInputSchema,\n createPullRequestDescription,\n createPullRequestCore,\n mergePullRequestInputSchema,\n mergePullRequestDescription,\n mergePullRequestCore,\n addPullRequestCommentInputSchema,\n addPullRequestCommentDescription,\n addPullRequestCommentCore,\n listPullRequestFilesInputSchema,\n listPullRequestFilesDescription,\n listPullRequestFilesCore,\n listPullRequestReviewsInputSchema,\n listPullRequestReviewsDescription,\n listPullRequestReviewsCore,\n createPullRequestReviewInputSchema,\n createPullRequestReviewDescription,\n createPullRequestReviewCore,\n} from '../core/pull-requests'\nimport { listPullRequestFilesToModelOutput } from '../core/model-output'\nimport type { CommitIdentity, ToolOptions, GithubTool } from '../types'\n\nexport type MergeToolOptions = ToolOptions & {\n coAuthors?: CommitIdentity[]\n}\n\nasync function listPullRequestsStep(args: Parameters<typeof listPullRequestsCore>[0]) {\n \"use step\"\n return listPullRequestsCore(args)\n}\n\n/** List pull requests for a GitHub repository. */\nexport const listPullRequests = (token: string): GithubTool =>\n tool({\n description: listPullRequestsDescription,\n inputSchema: listPullRequestsInputSchema,\n execute: async args => listPullRequestsStep({ token, ...args }),\n })\n\nasync function getPullRequestStep(args: Parameters<typeof getPullRequestCore>[0]) {\n \"use step\"\n return getPullRequestCore(args)\n}\n\n/** Get detailed information about a specific pull request. */\nexport const getPullRequest = (token: string): GithubTool =>\n tool({\n description: getPullRequestDescription,\n inputSchema: getPullRequestInputSchema,\n execute: async args => getPullRequestStep({ token, ...args }),\n })\n\nasync function createPullRequestStep(args: Parameters<typeof createPullRequestCore>[0]) {\n \"use step\"\n return createPullRequestCore(args)\n}\n\n/** Create a new pull request in a GitHub repository. Requires approval by default. */\nexport const createPullRequest = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createPullRequestDescription,\n needsApproval,\n inputSchema: createPullRequestInputSchema,\n execute: async args => createPullRequestStep({ token, ...args }),\n })\n\nasync function mergePullRequestStep(args: Parameters<typeof mergePullRequestCore>[0]) {\n \"use step\"\n return mergePullRequestCore(args)\n}\n\n/** Merge a pull request. Requires approval by default. */\nexport const mergePullRequest = (token: string, { needsApproval = true, coAuthors }: MergeToolOptions = {}): GithubTool =>\n tool({\n description: mergePullRequestDescription,\n needsApproval,\n inputSchema: mergePullRequestInputSchema,\n execute: async args => mergePullRequestStep({ token, coAuthors, ...args }),\n })\n\nasync function addPullRequestCommentStep(args: Parameters<typeof addPullRequestCommentCore>[0]) {\n \"use step\"\n return addPullRequestCommentCore(args)\n}\n\n/** Add a comment to a pull request. Requires approval by default. */\nexport const addPullRequestComment = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addPullRequestCommentDescription,\n needsApproval,\n inputSchema: addPullRequestCommentInputSchema,\n execute: async args => addPullRequestCommentStep({ token, ...args }),\n })\n\nasync function listPullRequestFilesStep(args: Parameters<typeof listPullRequestFilesCore>[0]) {\n \"use step\"\n return listPullRequestFilesCore(args)\n}\n\n/** List files changed in a pull request, including diff status and patch content. */\nexport const listPullRequestFiles = (token: string): GithubTool =>\n tool({\n description: listPullRequestFilesDescription,\n inputSchema: listPullRequestFilesInputSchema,\n toModelOutput: listPullRequestFilesToModelOutput,\n execute: async args => listPullRequestFilesStep({ token, ...args }),\n })\n\nasync function listPullRequestReviewsStep(args: Parameters<typeof listPullRequestReviewsCore>[0]) {\n \"use step\"\n return listPullRequestReviewsCore(args)\n}\n\n/** List reviews on a pull request (approvals, change requests, and comments). */\nexport const listPullRequestReviews = (token: string): GithubTool =>\n tool({\n description: listPullRequestReviewsDescription,\n inputSchema: listPullRequestReviewsInputSchema,\n execute: async args => listPullRequestReviewsStep({ token, ...args }),\n })\n\nasync function createPullRequestReviewStep(args: Parameters<typeof createPullRequestReviewCore>[0]) {\n \"use step\"\n return createPullRequestReviewCore(args)\n}\n\n/** Submit a pull request review with optional inline comments. Requires approval by default. */\nexport const createPullRequestReview = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createPullRequestReviewDescription,\n needsApproval,\n inputSchema: createPullRequestReviewInputSchema,\n execute: async args => createPullRequestReviewStep({ token, ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listIssuesInputSchema,\n listIssuesDescription,\n listIssuesCore,\n getIssueInputSchema,\n getIssueDescription,\n getIssueCore,\n createIssueInputSchema,\n createIssueDescription,\n createIssueCore,\n addIssueCommentInputSchema,\n addIssueCommentDescription,\n addIssueCommentCore,\n closeIssueInputSchema,\n closeIssueDescription,\n closeIssueCore,\n listLabelsInputSchema,\n listLabelsDescription,\n listLabelsCore,\n addLabelsInputSchema,\n addLabelsDescription,\n addLabelsCore,\n removeLabelInputSchema,\n removeLabelDescription,\n removeLabelCore,\n} from '../core/issues'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listIssuesStep(args: Parameters<typeof listIssuesCore>[0]) {\n \"use step\"\n return listIssuesCore(args)\n}\n\n/** List issues for a GitHub repository (excludes pull requests). */\nexport const listIssues = (token: string): GithubTool =>\n tool({\n description: listIssuesDescription,\n inputSchema: listIssuesInputSchema,\n execute: async args => listIssuesStep({ token, ...args }),\n })\n\nasync function getIssueStep(args: Parameters<typeof getIssueCore>[0]) {\n \"use step\"\n return getIssueCore(args)\n}\n\n/** Get detailed information about a specific issue. */\nexport const getIssue = (token: string): GithubTool =>\n tool({\n description: getIssueDescription,\n inputSchema: getIssueInputSchema,\n execute: async args => getIssueStep({ token, ...args }),\n })\n\nasync function createIssueStep(args: Parameters<typeof createIssueCore>[0]) {\n \"use step\"\n return createIssueCore(args)\n}\n\n/** Create a new issue in a GitHub repository. Requires approval by default. */\nexport const createIssue = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createIssueDescription,\n needsApproval,\n inputSchema: createIssueInputSchema,\n execute: async args => createIssueStep({ token, ...args }),\n })\n\nasync function addIssueCommentStep(args: Parameters<typeof addIssueCommentCore>[0]) {\n \"use step\"\n return addIssueCommentCore(args)\n}\n\n/** Add a comment to a GitHub issue. Requires approval by default. */\nexport const addIssueComment = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addIssueCommentDescription,\n needsApproval,\n inputSchema: addIssueCommentInputSchema,\n execute: async args => addIssueCommentStep({ token, ...args }),\n })\n\nasync function closeIssueStep(args: Parameters<typeof closeIssueCore>[0]) {\n \"use step\"\n return closeIssueCore(args)\n}\n\n/** Close an open GitHub issue. Requires approval by default. */\nexport const closeIssue = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: closeIssueDescription,\n needsApproval,\n inputSchema: closeIssueInputSchema,\n execute: async args => closeIssueStep({ token, ...args }),\n })\n\nasync function listLabelsStep(args: Parameters<typeof listLabelsCore>[0]) {\n \"use step\"\n return listLabelsCore(args)\n}\n\n/** List labels available in a GitHub repository. */\nexport const listLabels = (token: string): GithubTool =>\n tool({\n description: listLabelsDescription,\n inputSchema: listLabelsInputSchema,\n execute: async args => listLabelsStep({ token, ...args }),\n })\n\nasync function addLabelsStep(args: Parameters<typeof addLabelsCore>[0]) {\n \"use step\"\n return addLabelsCore(args)\n}\n\n/** Add labels to an issue or pull request. Requires approval by default. */\nexport const addLabels = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: addLabelsDescription,\n needsApproval,\n inputSchema: addLabelsInputSchema,\n execute: async args => addLabelsStep({ token, ...args }),\n })\n\nasync function removeLabelStep(args: Parameters<typeof removeLabelCore>[0]) {\n \"use step\"\n return removeLabelCore(args)\n}\n\n/** Remove a label from an issue or pull request. Requires approval by default. */\nexport const removeLabel = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: removeLabelDescription,\n needsApproval,\n inputSchema: removeLabelInputSchema,\n execute: async args => removeLabelStep({ token, ...args }),\n })\n","import { tool } from 'ai'\nimport type { GithubTool } from '../types'\nimport {\n searchCodeInputSchema,\n searchCodeDescription,\n searchCodeCore,\n searchRepositoriesInputSchema,\n searchRepositoriesDescription,\n searchRepositoriesCore,\n} from '../core/search'\n\nasync function searchCodeStep(args: Parameters<typeof searchCodeCore>[0]) {\n \"use step\"\n return searchCodeCore(args)\n}\n\n/** Search for code in GitHub repositories. Use qualifiers like \"repo:owner/name\" to scope the search. */\nexport const searchCode = (token: string): GithubTool =>\n tool({\n description: searchCodeDescription,\n inputSchema: searchCodeInputSchema,\n execute: async args => searchCodeStep({ token, ...args }),\n })\n\nasync function searchRepositoriesStep(args: Parameters<typeof searchRepositoriesCore>[0]) {\n \"use step\"\n return searchRepositoriesCore(args)\n}\n\n/** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */\nexport const searchRepositories = (token: string): GithubTool =>\n tool({\n description: searchRepositoriesDescription,\n inputSchema: searchRepositoriesInputSchema,\n execute: async args => searchRepositoriesStep({ token, ...args }),\n })\n","import { tool } from 'ai'\nimport type { GithubTool } from '../types'\nimport {\n listCommitsInputSchema,\n listCommitsDescription,\n listCommitsCore,\n getCommitInputSchema,\n getCommitDescription,\n getCommitCore,\n getBlameInputSchema,\n getBlameDescription,\n getBlameCore,\n} from '../core/commits'\nimport { getCommitToModelOutput } from '../core/model-output'\n\nasync function listCommitsStep(args: Parameters<typeof listCommitsCore>[0]) {\n \"use step\"\n return listCommitsCore(args)\n}\n\n/** List commits for a GitHub repository. Filter by file path to see commits that touched a file. */\nexport const listCommits = (token: string): GithubTool =>\n tool({\n description: listCommitsDescription,\n inputSchema: listCommitsInputSchema,\n execute: async args => listCommitsStep({ token, ...args }),\n })\n\nasync function getCommitStep(args: Parameters<typeof getCommitCore>[0]) {\n \"use step\"\n return getCommitCore(args)\n}\n\n/** Get detailed information about a specific commit, including files changed with additions and deletions. */\nexport const getCommit = (token: string): GithubTool =>\n tool({\n description: getCommitDescription,\n inputSchema: getCommitInputSchema,\n toModelOutput: getCommitToModelOutput,\n execute: async args => getCommitStep({ token, ...args }),\n })\n\nasync function getBlameStep(args: Parameters<typeof getBlameCore>[0]) {\n \"use step\"\n return getBlameCore(args)\n}\n\n/** Line-level git blame for a file at a commit-like ref (branch, tag, or SHA). */\nexport const getBlame = (token: string): GithubTool =>\n tool({\n description: getBlameDescription,\n inputSchema: getBlameInputSchema,\n execute: async args => getBlameStep({ token, ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listGistsInputSchema,\n listGistsDescription,\n listGistsCore,\n getGistInputSchema,\n getGistDescription,\n getGistCore,\n listGistCommentsInputSchema,\n listGistCommentsDescription,\n listGistCommentsCore,\n createGistInputSchema,\n createGistDescription,\n createGistCore,\n updateGistInputSchema,\n updateGistDescription,\n updateGistCore,\n deleteGistInputSchema,\n deleteGistDescription,\n deleteGistCore,\n createGistCommentInputSchema,\n createGistCommentDescription,\n createGistCommentCore,\n} from '../core/gists'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listGistsStep(args: Parameters<typeof listGistsCore>[0]) {\n \"use step\"\n return listGistsCore(args)\n}\n\n/** List gists for the authenticated user or a specific user. */\nexport const listGists = (token: string): GithubTool =>\n tool({\n description: listGistsDescription,\n inputSchema: listGistsInputSchema,\n execute: async args => listGistsStep({ token, ...args }),\n })\n\nasync function getGistStep(args: Parameters<typeof getGistCore>[0]) {\n \"use step\"\n return getGistCore(args)\n}\n\n/** Get a gist by ID, including file contents. */\nexport const getGist = (token: string): GithubTool =>\n tool({\n description: getGistDescription,\n inputSchema: getGistInputSchema,\n execute: async args => getGistStep({ token, ...args }),\n })\n\nasync function listGistCommentsStep(args: Parameters<typeof listGistCommentsCore>[0]) {\n \"use step\"\n return listGistCommentsCore(args)\n}\n\n/** List comments on a gist. */\nexport const listGistComments = (token: string): GithubTool =>\n tool({\n description: listGistCommentsDescription,\n inputSchema: listGistCommentsInputSchema,\n execute: async args => listGistCommentsStep({ token, ...args }),\n })\n\nasync function createGistStep(args: Parameters<typeof createGistCore>[0]) {\n \"use step\"\n return createGistCore(args)\n}\n\n/** Create a new gist with one or more files. Requires approval by default. */\nexport const createGist = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createGistDescription,\n needsApproval,\n inputSchema: createGistInputSchema,\n execute: async args => createGistStep({ token, ...args }),\n })\n\nasync function updateGistStep(args: Parameters<typeof updateGistCore>[0]) {\n \"use step\"\n return updateGistCore(args)\n}\n\n/** Update an existing gist. Requires approval by default. */\nexport const updateGist = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: updateGistDescription,\n needsApproval,\n inputSchema: updateGistInputSchema,\n execute: async args => updateGistStep({ token, ...args }),\n })\n\nasync function deleteGistStep(args: Parameters<typeof deleteGistCore>[0]) {\n \"use step\"\n return deleteGistCore(args)\n}\n\n/** Delete a gist permanently. Requires approval by default. */\nexport const deleteGist = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: deleteGistDescription,\n needsApproval,\n inputSchema: deleteGistInputSchema,\n execute: async args => deleteGistStep({ token, ...args }),\n })\n\nasync function createGistCommentStep(args: Parameters<typeof createGistCommentCore>[0]) {\n \"use step\"\n return createGistCommentCore(args)\n}\n\n/** Add a comment to a gist. Requires approval by default. */\nexport const createGistComment = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: createGistCommentDescription,\n needsApproval,\n inputSchema: createGistCommentInputSchema,\n execute: async args => createGistCommentStep({ token, ...args }),\n })\n","import { tool } from 'ai'\nimport {\n listWorkflowsInputSchema,\n listWorkflowsDescription,\n listWorkflowsCore,\n listWorkflowRunsInputSchema,\n listWorkflowRunsDescription,\n listWorkflowRunsCore,\n getWorkflowRunInputSchema,\n getWorkflowRunDescription,\n getWorkflowRunCore,\n listWorkflowJobsInputSchema,\n listWorkflowJobsDescription,\n listWorkflowJobsCore,\n triggerWorkflowInputSchema,\n triggerWorkflowDescription,\n triggerWorkflowCore,\n cancelWorkflowRunInputSchema,\n cancelWorkflowRunDescription,\n cancelWorkflowRunCore,\n rerunWorkflowRunInputSchema,\n rerunWorkflowRunDescription,\n rerunWorkflowRunCore,\n} from '../core/workflows'\nimport type { ToolOptions, GithubTool } from '../types'\n\nasync function listWorkflowsStep(args: Parameters<typeof listWorkflowsCore>[0]) {\n \"use step\"\n return listWorkflowsCore(args)\n}\n\n/** List GitHub Actions workflows in a repository. */\nexport const listWorkflows = (token: string): GithubTool =>\n tool({\n description: listWorkflowsDescription,\n inputSchema: listWorkflowsInputSchema,\n execute: async args => listWorkflowsStep({ token, ...args }),\n })\n\nasync function listWorkflowRunsStep(args: Parameters<typeof listWorkflowRunsCore>[0]) {\n \"use step\"\n return listWorkflowRunsCore(args)\n}\n\n/** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */\nexport const listWorkflowRuns = (token: string): GithubTool =>\n tool({\n description: listWorkflowRunsDescription,\n inputSchema: listWorkflowRunsInputSchema,\n execute: async args => listWorkflowRunsStep({ token, ...args }),\n })\n\nasync function getWorkflowRunStep(args: Parameters<typeof getWorkflowRunCore>[0]) {\n \"use step\"\n return getWorkflowRunCore(args)\n}\n\n/** Get details of a specific workflow run including status, timing, and trigger info. */\nexport const getWorkflowRun = (token: string): GithubTool =>\n tool({\n description: getWorkflowRunDescription,\n inputSchema: getWorkflowRunInputSchema,\n execute: async args => getWorkflowRunStep({ token, ...args }),\n })\n\nasync function listWorkflowJobsStep(args: Parameters<typeof listWorkflowJobsCore>[0]) {\n \"use step\"\n return listWorkflowJobsCore(args)\n}\n\n/** List jobs for a workflow run, including step-level status and timing. */\nexport const listWorkflowJobs = (token: string): GithubTool =>\n tool({\n description: listWorkflowJobsDescription,\n inputSchema: listWorkflowJobsInputSchema,\n execute: async args => listWorkflowJobsStep({ token, ...args }),\n })\n\nasync function triggerWorkflowStep(args: Parameters<typeof triggerWorkflowCore>[0]) {\n \"use step\"\n return triggerWorkflowCore(args)\n}\n\n/** Trigger a workflow via workflow_dispatch event. Requires approval by default. */\nexport const triggerWorkflow = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: triggerWorkflowDescription,\n needsApproval,\n inputSchema: triggerWorkflowInputSchema,\n execute: async args => triggerWorkflowStep({ token, ...args }),\n })\n\nasync function cancelWorkflowRunStep(args: Parameters<typeof cancelWorkflowRunCore>[0]) {\n \"use step\"\n return cancelWorkflowRunCore(args)\n}\n\n/** Cancel an in-progress workflow run. Requires approval by default. */\nexport const cancelWorkflowRun = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: cancelWorkflowRunDescription,\n needsApproval,\n inputSchema: cancelWorkflowRunInputSchema,\n execute: async args => cancelWorkflowRunStep({ token, ...args }),\n })\n\nasync function rerunWorkflowRunStep(args: Parameters<typeof rerunWorkflowRunCore>[0]) {\n \"use step\"\n return rerunWorkflowRunCore(args)\n}\n\n/** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */\nexport const rerunWorkflowRun = (token: string, { needsApproval = true }: ToolOptions = {}): GithubTool =>\n tool({\n description: rerunWorkflowRunDescription,\n needsApproval,\n inputSchema: rerunWorkflowRunInputSchema,\n execute: async args => rerunWorkflowRunStep({ token, ...args }),\n })\n","import type { GithubWriteToolName } from './write-tools'\n\n/**\n * Whether write operations require user approval.\n *\n * - `true` — all write tools need approval (default)\n * - `false` — no approval needed for any write tool\n * - object — per-tool override via {@link GithubWriteToolName}; unspecified write tools default to `true`\n *\n * @example Global disable\n * ```ts\n * createGithubTools({ token, requireApproval: false })\n * ```\n *\n * @example Granular per write tool\n * ```ts\n * createGithubTools({\n * token,\n * requireApproval: {\n * mergePullRequest: true,\n * createOrUpdateFile: true,\n * addPullRequestComment: false,\n * },\n * })\n * ```\n */\nexport type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>\n\n/**\n * Resolve whether a write tool requires approval for the AI SDK.\n *\n * @param toolName - The write tool to check.\n * @param config - Global or per-tool approval config.\n * @returns `true` when approval is required; defaults to `true` for unspecified write tools in object mode.\n */\nexport function resolveAiSdkApproval(toolName: GithubWriteToolName, config: ApprovalConfig): boolean {\n if (typeof config === 'boolean') return config\n return config[toolName] ?? true\n}\n","import { ToolLoopAgent } from 'ai'\nimport type { ToolLoopAgentSettings, ToolSet } from 'ai'\nimport { createGithubTools } from './index'\nimport type { AllGithubTools, GithubToolsBaseOptions } from './core/tool-types'\nimport type { CombinedPresetToolNames, GithubToolPreset, PresetToolName } from './core/presets'\nimport type { GithubToolName } from './core/tool-names'\n\nconst SHARED_RULES = `When a tool execution is denied by the user, do not retry it. Briefly acknowledge the decision and move on.`\n\nconst DEFAULT_INSTRUCTIONS = `You are a helpful GitHub assistant. You can read and explore repositories, issues, pull requests, commits, code, gists, and workflows. You can also create issues, pull requests, comments, gists, trigger workflows, and update files when asked.\n\n${SHARED_RULES}`\n\nconst PRESET_INSTRUCTIONS: Record<GithubToolPreset, string> = {\n 'code-review': `You are a code review assistant. Your job is to review pull requests thoroughly and provide constructive feedback.\n\nWhen reviewing a PR:\n- Read the PR description and changed files carefully\n- To trace why a specific line exists or who last touched it, use getBlame on the file path and ref (branch or merge commit), then follow up with getCommit if you need the full patch\n- Check for bugs, logic errors, and edge cases\n- Suggest improvements when you spot issues\n- Be constructive — explain why something is a problem and how to fix it\n- Use listPullRequestFiles to see exactly which files changed before diving into details\n- Use createPullRequestReview to submit a formal review with inline comments on specific lines\n- Post your review as PR comments when asked\n\n${SHARED_RULES}`,\n\n 'issue-triage': `You are an issue triage assistant. Your job is to help manage and organize GitHub issues.\n\nWhen triaging issues:\n- Read issue descriptions carefully to understand the problem\n- Identify duplicates when possible\n- Help categorize and prioritize issues\n- Respond to users with clear, helpful information\n- Use listLabels to see available labels, then addLabels and removeLabel to categorize issues\n- Create new issues when asked, with clear titles and descriptions\n\n${SHARED_RULES}`,\n\n 'ci-ops': `You are a CI/CD operations assistant. Your job is to help monitor and manage GitHub Actions workflows.\n\nWhen working with workflows:\n- Check workflow run status and report failures clearly\n- Inspect job steps to identify exactly where a run failed\n- Re-run failed workflows when asked\n- Trigger workflow dispatches with the correct inputs and branch\n- Be careful with cancel and re-run operations — confirm the target run\n- Summarize run history and trends when asked\n\n${SHARED_RULES}`,\n\n 'repo-explorer': `You are a repository explorer. Your job is to help users understand codebases and find information across GitHub repositories.\n\nWhen exploring repos:\n- Answer questions about code structure and organization\n- Use getBlame when the user asks about history or ownership of specific lines in a file\n- Summarize recent activity (commits, PRs, issues)\n- Find specific files, functions, or patterns in code\n- Explain how different parts of the codebase work together\n- You have read-only access — you cannot make changes\n\n${SHARED_RULES}`,\n\n 'maintainer': `You are a repository maintainer assistant. You have full access to manage repositories, issues, pull requests, gists, and workflows.\n\nWhen maintaining repos:\n- Be careful with write operations — review before acting\n- Create well-structured issues and PRs with clear descriptions\n- Use merge strategies appropriate for the repository\n- Keep commit messages clean and descriptive\n- When closing issues, provide a clear reason\n\n${SHARED_RULES}`\n}\n\nexport function resolveInstructions(options: {\n preset?: GithubToolPreset | GithubToolPreset[]\n instructions?: string\n additionalInstructions?: string\n}): string {\n const defaultPrompt = options.preset && !Array.isArray(options.preset)\n ? PRESET_INSTRUCTIONS[options.preset]\n : DEFAULT_INSTRUCTIONS\n\n if (options.instructions) return options.instructions\n if (options.additionalInstructions) return `${defaultPrompt}\\n\\n${options.additionalInstructions}`\n return defaultPrompt\n}\n\ntype AgentOptions = Omit<ToolLoopAgentSettings<ToolSet>, 'model' | 'tools' | 'instructions'>\n\nexport type CreateGithubAgentOptions = AgentOptions & GithubToolsBaseOptions & {\n model: ToolLoopAgentSettings<ToolSet>['model']\n /**\n * Restrict tools and system prompt to a predefined preset.\n *\n * Selects a subset of tools and, when a single preset is passed,\n * sets a matching system prompt. Combine presets with an array to merge tool sets.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n /**\n * Fully replace the default system prompt.\n * When set, `preset` system prompts and `additionalInstructions` are ignored.\n */\n instructions?: string\n /**\n * Append text to the preset-specific (or default) system prompt.\n * Ignored when `instructions` is set.\n */\n additionalInstructions?: string\n}\n\nexport function createGithubAgent(options: CreateGithubAgentOptions & { preset?: undefined }): ToolLoopAgent<never, AllGithubTools>\nexport function createGithubAgent<P extends GithubToolPreset>(\n options: CreateGithubAgentOptions & { preset: P },\n): ToolLoopAgent<never, Pick<AllGithubTools, PresetToolName<P>>>\nexport function createGithubAgent<P extends readonly GithubToolPreset[]>(\n options: CreateGithubAgentOptions & { preset: P },\n): ToolLoopAgent<never, Pick<AllGithubTools, CombinedPresetToolNames<P>>>\n\n/**\n * Create a pre-configured GitHub agent powered by the AI SDK's `ToolLoopAgent`.\n *\n * Returns a `ToolLoopAgent` instance with `.generate()` and `.stream()` methods.\n *\n * @example\n * ```ts\n * import { createGithubAgent } from '@github-tools/sdk'\n *\n * const agent = createGithubAgent({\n * model: 'anthropic/claude-sonnet-4.6',\n * token: process.env.GITHUB_TOKEN!,\n * preset: 'code-review',\n * })\n *\n * const result = await agent.generate({ prompt: 'Review PR #42 on vercel/ai' })\n * ```\n */\nexport function createGithubAgent({\n token,\n preset,\n requireApproval,\n instructions,\n additionalInstructions,\n author,\n committer,\n coAuthors,\n ...agentOptions\n}: CreateGithubAgentOptions): ToolLoopAgent<never, AllGithubTools | Pick<AllGithubTools, GithubToolName>> {\n const tools = createGithubTools({ token, requireApproval, preset, author, committer, coAuthors })\n\n return new ToolLoopAgent({\n ...agentOptions,\n tools,\n instructions: resolveInstructions({ preset, instructions, additionalInstructions }),\n } as ToolLoopAgentSettings<never, typeof tools>) as ToolLoopAgent<never, typeof tools>\n}\n","import type { ToolSet } from 'ai'\nimport { getRepository, listBranches, getFileContent, createBranch, forkRepository, createRepository, createOrUpdateFile } from './tools/repository'\nimport { listPullRequests, getPullRequest, createPullRequest, mergePullRequest, addPullRequestComment, listPullRequestFiles, listPullRequestReviews, createPullRequestReview } from './tools/pull-requests'\nimport { listIssues, getIssue, createIssue, addIssueComment, closeIssue, listLabels, addLabels, removeLabel } from './tools/issues'\nimport { searchCode, searchRepositories } from './tools/search'\nimport { listCommits, getCommit, getBlame } from './tools/commits'\nimport { listGists, getGist, listGistComments, createGist, updateGist, deleteGist, createGistComment } from './tools/gists'\nimport { listWorkflows, listWorkflowRuns, getWorkflowRun, listWorkflowJobs, triggerWorkflow, cancelWorkflowRun, rerunWorkflowRun } from './tools/workflows'\nimport { resolveAiSdkApproval } from './core/approval'\nimport { resolvePresetTools, type CombinedPresetToolNames, type GithubToolPreset, type PresetToolName } from './core/presets'\nimport { type GithubToolName } from './core/tool-names'\nimport { type AllGithubTools, type GithubToolsBaseOptions } from './core/tool-types'\nimport { resolveGithubToken } from './core/token'\nimport type { GithubWriteToolName } from './core/write-tools'\n\nexport type { GithubWriteToolName } from './core/write-tools'\nexport type { ApprovalConfig } from './core/approval'\nexport type { GithubToolPreset, PresetToolName, CombinedPresetToolNames } from './core/presets'\nexport type { GithubToolName } from './core/tool-names'\nexport type { AllGithubTools, GithubToolsForPreset, PickGithubTools } from './core/tool-types'\nexport { PRESET_TOOLS } from './core/presets'\nexport { GITHUB_TOOL_NAMES } from './core/tool-names'\nexport { GITHUB_WRITE_TOOLS } from './core/write-tools'\n\nexport type GithubToolsOptions = GithubToolsBaseOptions & {\n /**\n * Restrict the returned tools to a predefined preset.\n * Omit to get all tools.\n *\n * @see {@link GithubToolPreset} for available presets and included tools.\n *\n * @example\n * ```ts\n * // Only code-review tools\n * createGithubTools({ token, preset: 'code-review' })\n *\n * // Combine presets\n * createGithubTools({ token, preset: ['code-review', 'issue-triage'] })\n * ```\n */\n preset?: GithubToolPreset | GithubToolPreset[]\n}\n\nexport function createGithubTools(options?: GithubToolsBaseOptions & { preset?: undefined }): AllGithubTools\nexport function createGithubTools<P extends GithubToolPreset>(\n options: GithubToolsBaseOptions & { preset: P },\n): Pick<AllGithubTools, PresetToolName<P>>\nexport function createGithubTools<P extends readonly GithubToolPreset[]>(\n options: GithubToolsBaseOptions & { preset: P },\n): Pick<AllGithubTools, CombinedPresetToolNames<P>>\nexport function createGithubTools(options?: GithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>\n/**\n * Create a set of GitHub tools for the Vercel AI SDK.\n *\n * Write operations require user approval by default.\n * Control this globally or per-tool via `requireApproval`.\n * Use `preset` to get only the tools you need.\n *\n * @example\n * ```ts\n * // All tools (default)\n * createGithubTools({ token })\n *\n * // Code-review agent — only PR & commit tools\n * createGithubTools({ token, preset: 'code-review' })\n *\n * // Combine presets\n * createGithubTools({ token, preset: ['code-review', 'issue-triage'] })\n *\n * // Granular approval\n * createGithubTools({\n * token,\n * preset: 'maintainer',\n * requireApproval: {\n * mergePullRequest: true,\n * createOrUpdateFile: true,\n * addPullRequestComment: false,\n * }\n * })\n * ```\n */\nexport function createGithubTools({\n token,\n requireApproval = true,\n preset,\n overrides,\n author,\n committer,\n coAuthors,\n}: GithubToolsOptions = {}): AllGithubTools | Pick<AllGithubTools, GithubToolName> {\n const resolvedToken = resolveGithubToken(token)\n const approval = (name: GithubWriteToolName) => ({ needsApproval: resolveAiSdkApproval(name, requireApproval) })\n const allowed = preset ? resolvePresetTools(preset) : null\n\n const allTools = {\n getRepository: getRepository(resolvedToken),\n listBranches: listBranches(resolvedToken),\n getFileContent: getFileContent(resolvedToken),\n listPullRequests: listPullRequests(resolvedToken),\n getPullRequest: getPullRequest(resolvedToken),\n listIssues: listIssues(resolvedToken),\n getIssue: getIssue(resolvedToken),\n searchCode: searchCode(resolvedToken),\n searchRepositories: searchRepositories(resolvedToken),\n listCommits: listCommits(resolvedToken),\n getCommit: getCommit(resolvedToken),\n getBlame: getBlame(resolvedToken),\n createBranch: createBranch(resolvedToken, approval('createBranch')),\n forkRepository: forkRepository(resolvedToken, approval('forkRepository')),\n createRepository: createRepository(resolvedToken, approval('createRepository')),\n createOrUpdateFile: createOrUpdateFile(resolvedToken, { ...approval('createOrUpdateFile'), author, committer, coAuthors }),\n createPullRequest: createPullRequest(resolvedToken, approval('createPullRequest')),\n mergePullRequest: mergePullRequest(resolvedToken, { ...approval('mergePullRequest'), coAuthors }),\n addPullRequestComment: addPullRequestComment(resolvedToken, approval('addPullRequestComment')),\n listPullRequestFiles: listPullRequestFiles(resolvedToken),\n listPullRequestReviews: listPullRequestReviews(resolvedToken),\n createPullRequestReview: createPullRequestReview(resolvedToken, approval('createPullRequestReview')),\n createIssue: createIssue(resolvedToken, approval('createIssue')),\n addIssueComment: addIssueComment(resolvedToken, approval('addIssueComment')),\n closeIssue: closeIssue(resolvedToken, approval('closeIssue')),\n listLabels: listLabels(resolvedToken),\n addLabels: addLabels(resolvedToken, approval('addLabels')),\n removeLabel: removeLabel(resolvedToken, approval('removeLabel')),\n listGists: listGists(resolvedToken),\n getGist: getGist(resolvedToken),\n listGistComments: listGistComments(resolvedToken),\n createGist: createGist(resolvedToken, approval('createGist')),\n updateGist: updateGist(resolvedToken, approval('updateGist')),\n deleteGist: deleteGist(resolvedToken, approval('deleteGist')),\n createGistComment: createGistComment(resolvedToken, approval('createGistComment')),\n listWorkflows: listWorkflows(resolvedToken),\n listWorkflowRuns: listWorkflowRuns(resolvedToken),\n getWorkflowRun: getWorkflowRun(resolvedToken),\n listWorkflowJobs: listWorkflowJobs(resolvedToken),\n triggerWorkflow: triggerWorkflow(resolvedToken, approval('triggerWorkflow')),\n cancelWorkflowRun: cancelWorkflowRun(resolvedToken, approval('cancelWorkflowRun')),\n rerunWorkflowRun: rerunWorkflowRun(resolvedToken, approval('rerunWorkflowRun')),\n } satisfies AllGithubTools\n\n if (overrides) {\n for (const [name, toolOverrides] of Object.entries(overrides)) {\n if (name in allTools && toolOverrides) {\n const key = name as keyof typeof allTools\n Object.assign(allTools, { [key]: { ...allTools[key], ...toolOverrides } })\n }\n }\n }\n\n if (!allowed) return allTools\n\n return Object.fromEntries(\n Object.entries(allTools).filter(([name]) => allowed.has(name as GithubToolName))\n ) as Pick<typeof allTools, GithubToolName>\n}\n\nexport type GithubTools = AllGithubTools & ToolSet\n\n// Re-export individual tool factories for cherry-picking\nexport { createOctokit } from './client'\nexport { getRepository, listBranches, getFileContent, createBranch, forkRepository, createRepository, createOrUpdateFile } from './tools/repository'\nexport { listPullRequests, getPullRequest, createPullRequest, mergePullRequest, addPullRequestComment, listPullRequestFiles, listPullRequestReviews, createPullRequestReview } from './tools/pull-requests'\nexport { listIssues, getIssue, createIssue, addIssueComment, closeIssue, listLabels, addLabels, removeLabel } from './tools/issues'\nexport { searchCode, searchRepositories } from './tools/search'\nexport { listCommits, getCommit, getBlame } from './tools/commits'\nexport { listGists, getGist, listGistComments, createGist, updateGist, deleteGist, createGistComment } from './tools/gists'\nexport { listWorkflows, listWorkflowRuns, getWorkflowRun, listWorkflowJobs, triggerWorkflow, cancelWorkflowRun, rerunWorkflowRun } from './tools/workflows'\nexport type { CommitIdentity, CommitToolOptions, GithubTool, Octokit, ToolOptions, ToolOverrides } from './types'\nexport { createGithubAgent } from './agents'\nexport type { CreateGithubAgentOptions } from './agents'\n"],"mappings":";;;AA8BA,eAAe,kBAAkB,MAA+C;AAC9E;AACA,QAAO,kBAAkB,KAAK;;;AAIhC,MAAa,iBAAiB,UAC5B,KAAK;CACH,aAAa;CACb,aAAa;CACb,SAAS,OAAM,SAAQ,kBAAkB;EAAE;EAAO,GAAG;EAAM,CAAC;CAC7D,CAAC;AAEJ,eAAe,iBAAiB,MAA8C;AAC5E;AACA,QAAO,iBAAiB,KAAK;;;AAI/B,MAAa,gBAAgB,UAC3B,KAAK;CACH,aAAa;CACb,aAAa;CACb,SAAS,OAAM,SAAQ,iBAAiB;EAAE;EAAO,GAAG;EAAM,CAAC;CAC5D,CAAC;AAEJ,eAAe,mBAAmB,MAAgD;AAChF;AACA,QAAO,mBAAmB,KAAK;;;AAIjC,MAAa,kBAAkB,UAC7B,KAAK;CACH,aAAa;CACb,aAAa;CACb,eAAe;CACf,SAAS,OAAM,SAAQ,mBAAmB;EAAE;EAAO,GAAG;EAAM,CAAC;CAC9D,CAAC;AAEJ,eAAe,iBAAiB,MAA8C;AAC5E;AACA,QAAO,iBAAiB,KAAK;;;AAI/B,MAAa,gBAAgB,OAAe,EAAE,gBAAgB,SAAsB,EAAE,KACpF,KAAK;CACH,aAAa;CACb;CACA,aAAa;CACb,SAAS,OAAM,SAAQ,iBAAiB;EAAE;EAAO,GAAG;EAAM,CAAC;CAC5D,CAAC;AAEJ,eAAe,mBAAmB,MAAgD;AAChF;AACA,QAAO,mBAAmB,KAAK;;;AAIjC,MAAa,kBAAkB,OAAe,EAAE,gBAAgB,SAAsB,EAAE,KACtF,KAAK;CACH,aAAa;CACb;CACA,aAAa;CACb,SAAS,OAAM,SAAQ,mBAAmB;EAAE;EAAO,GAAG;EAAM,CAAC;CAC9D,CAAC;AAEJ,eAAe,qBAAqB,MAAkD;AACpF;AACA,QAAO,qBAAqB,KAAK;;;AAInC,MAAa,oBAAoB,O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ACrC,WAAW,UAAU,eAAe,SAAS,YAAY,CAAC;EAC1D,aAAa,YAAY,eAAe,SAAS,cAAc,CAAC;EAChE,WAAW,UAAU,cAAc;EACnC,SAAS,QAAQ,cAAc;EAC/B,kBAAkB,iBAAiB,cAAc;EACjD,YAAY,WAAW,eAAe,SAAS,aAAa,CAAC;EAC7D,YAAY,WAAW,eAAe,SAAS,aAAa,CAAC;EAC7D,YAAY,WAAW,eAAe,SAAS,aAAa,CAAC;EAC7D,mBAAmB,kBAAkB,eAAe,SAAS,oBAAoB,CAAC;EAClF,eAAe,cAAc,cAAc;EAC3C,kBAAkB,iBAAiB,cAAc;EACjD,gBAAgB,eAAe,cAAc;EAC7C,kBAAkB,iBAAiB,cAAc;EACjD,iBAAiB,gBAAgB,eAAe,SAAS,kBAAkB,CAAC;EAC5E,mBAAmB,kBAAkB,eAAe,SAAS,oBAAoB,CAAC;EAClF,kBAAkB,iBAAiB,eAAe,SAAS,mBAAmB,CAAC;EAChF;AAED,KAAI;OACG,MAAM,CAAC,MAAM,kBAAkB,OAAO,QAAQ,UAAU,CAC3D,KAAI,QAAQ,YAAY,eAAe;GACrC,MAAM,MAAM;AACZ,UAAO,OAAO,UAAU,GAAG,MAAM;IAAE,GAAG,SAAS;IAAM,GAAG;IAAe,EAAE,CAAC;;;AAKhF,KAAI,CAAC,QAAS,QAAO;AAErB,QAAO,OAAO,YACZ,OAAO,QAAQ,SAAS,CAAC,QAAQ,CAAC,UAAU,QAAQ,IAAI,KAAuB,CAAC,CACjF"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { Tool } from "ai";
|
|
2
|
+
import { Octokit as Octokit$1 } from "octokit";
|
|
3
|
+
|
|
4
|
+
//#region src/core/tool-names.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* All GitHub tool names available via {@link createGithubTools}.
|
|
7
|
+
* Each key maps to its own string literal for IDE autocomplete and hover docs.
|
|
8
|
+
*/
|
|
9
|
+
declare const GITHUB_TOOL_NAMES: {
|
|
10
|
+
/** Get information about a GitHub repository including description, stars, forks, language, and default branch. */readonly getRepository: "getRepository"; /** List branches in a GitHub repository. */
|
|
11
|
+
readonly listBranches: "listBranches"; /** Get the content of a file from a GitHub repository. */
|
|
12
|
+
readonly getFileContent: "getFileContent"; /** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */
|
|
13
|
+
readonly createBranch: "createBranch"; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
14
|
+
readonly forkRepository: "forkRepository"; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
15
|
+
readonly createRepository: "createRepository"; /** Create or update a file in a GitHub repository. Provide the SHA when updating an existing file. Requires approval by default. */
|
|
16
|
+
readonly createOrUpdateFile: "createOrUpdateFile"; /** List pull requests for a GitHub repository. */
|
|
17
|
+
readonly listPullRequests: "listPullRequests"; /** Get detailed information about a specific pull request. */
|
|
18
|
+
readonly getPullRequest: "getPullRequest"; /** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
19
|
+
readonly createPullRequest: "createPullRequest"; /** Merge a pull request. Requires approval by default. */
|
|
20
|
+
readonly mergePullRequest: "mergePullRequest"; /** Add a comment to a pull request. Requires approval by default. */
|
|
21
|
+
readonly addPullRequestComment: "addPullRequestComment"; /** List files changed in a pull request, including diff status and patch content. */
|
|
22
|
+
readonly listPullRequestFiles: "listPullRequestFiles"; /** List reviews on a pull request (approvals, change requests, and comments). */
|
|
23
|
+
readonly listPullRequestReviews: "listPullRequestReviews"; /** Submit a pull request review — approve, request changes, or comment with optional inline comments on specific lines. Requires approval by default. */
|
|
24
|
+
readonly createPullRequestReview: "createPullRequestReview"; /** List issues for a GitHub repository (excludes pull requests). */
|
|
25
|
+
readonly listIssues: "listIssues"; /** Get detailed information about a specific issue. */
|
|
26
|
+
readonly getIssue: "getIssue"; /** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
27
|
+
readonly createIssue: "createIssue"; /** Add a comment to a GitHub issue. Requires approval by default. */
|
|
28
|
+
readonly addIssueComment: "addIssueComment"; /** Close an open GitHub issue. Requires approval by default. */
|
|
29
|
+
readonly closeIssue: "closeIssue"; /** List labels available in a GitHub repository. */
|
|
30
|
+
readonly listLabels: "listLabels"; /** Add labels to an issue or pull request. Requires approval by default. */
|
|
31
|
+
readonly addLabels: "addLabels"; /** Remove a label from an issue or pull request. Requires approval by default. */
|
|
32
|
+
readonly removeLabel: "removeLabel"; /** Search for code in GitHub repositories. Use qualifiers like "repo:owner/name" to scope the search. */
|
|
33
|
+
readonly searchCode: "searchCode"; /** Search for GitHub repositories by keyword, topic, language, or other qualifiers. */
|
|
34
|
+
readonly searchRepositories: "searchRepositories"; /** 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. */
|
|
35
|
+
readonly listCommits: "listCommits"; /** Get detailed information about a specific commit, including the list of files changed with additions and deletions. */
|
|
36
|
+
readonly getCommit: "getCommit"; /** 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. */
|
|
37
|
+
readonly getBlame: "getBlame"; /** List gists for the authenticated user or a specific user. */
|
|
38
|
+
readonly listGists: "listGists"; /** Get a gist by ID, including file contents. */
|
|
39
|
+
readonly getGist: "getGist"; /** List comments on a gist. */
|
|
40
|
+
readonly listGistComments: "listGistComments"; /** Create a new gist with one or more files. Requires approval by default. */
|
|
41
|
+
readonly createGist: "createGist"; /** Update an existing gist — edit description, update files, or remove files. Requires approval by default. */
|
|
42
|
+
readonly updateGist: "updateGist"; /** Delete a gist permanently. Requires approval by default. */
|
|
43
|
+
readonly deleteGist: "deleteGist"; /** Add a comment to a gist. Requires approval by default. */
|
|
44
|
+
readonly createGistComment: "createGistComment"; /** List GitHub Actions workflows in a repository. */
|
|
45
|
+
readonly listWorkflows: "listWorkflows"; /** List workflow runs for a repository, optionally filtered by workflow, branch, status, or event. */
|
|
46
|
+
readonly listWorkflowRuns: "listWorkflowRuns"; /** Get details of a specific workflow run including status, timing, and trigger info. */
|
|
47
|
+
readonly getWorkflowRun: "getWorkflowRun"; /** List jobs for a workflow run, including step-level status and timing. */
|
|
48
|
+
readonly listWorkflowJobs: "listWorkflowJobs"; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
49
|
+
readonly triggerWorkflow: "triggerWorkflow"; /** Cancel an in-progress workflow run. Requires approval by default. */
|
|
50
|
+
readonly cancelWorkflowRun: "cancelWorkflowRun"; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
51
|
+
readonly rerunWorkflowRun: "rerunWorkflowRun";
|
|
52
|
+
};
|
|
53
|
+
type GithubToolName = typeof GITHUB_TOOL_NAMES[keyof typeof GITHUB_TOOL_NAMES];
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/core/presets.d.ts
|
|
56
|
+
/**
|
|
57
|
+
* Predefined tool presets for common use cases.
|
|
58
|
+
* Pass to {@link createGithubTools}, {@link createGithubAgent}, or {@link createDurableGithubAgent}.
|
|
59
|
+
* Presets can be combined by passing an array.
|
|
60
|
+
*/
|
|
61
|
+
declare const PRESET_TOOLS: {
|
|
62
|
+
/**
|
|
63
|
+
* **Code review** — review pull requests and submit feedback.
|
|
64
|
+
*
|
|
65
|
+
* Tools: `getPullRequest`, `listPullRequests`, `listPullRequestFiles`, `listPullRequestReviews`,
|
|
66
|
+
* `getFileContent`, `listCommits`, `getCommit`, `getBlame`, `getRepository`, `listBranches`,
|
|
67
|
+
* `searchCode`, `addPullRequestComment`, `createPullRequestReview`.
|
|
68
|
+
*
|
|
69
|
+
* Agent prompt: optimized for thorough PR review with inline feedback.
|
|
70
|
+
*/
|
|
71
|
+
readonly 'code-review': readonly ["getPullRequest", "listPullRequests", "listPullRequestFiles", "listPullRequestReviews", "getFileContent", "listCommits", "getCommit", "getBlame", "getRepository", "listBranches", "searchCode", "addPullRequestComment", "createPullRequestReview"];
|
|
72
|
+
/**
|
|
73
|
+
* **Issue triage** — manage and organize GitHub issues.
|
|
74
|
+
*
|
|
75
|
+
* Tools: `listIssues`, `getIssue`, `createIssue`, `addIssueComment`, `closeIssue`,
|
|
76
|
+
* `listLabels`, `addLabels`, `removeLabel`, `getRepository`, `searchRepositories`, `searchCode`.
|
|
77
|
+
*
|
|
78
|
+
* Agent prompt: optimized for categorizing, labeling, and responding to issues.
|
|
79
|
+
*/
|
|
80
|
+
readonly 'issue-triage': readonly ["listIssues", "getIssue", "createIssue", "addIssueComment", "closeIssue", "listLabels", "addLabels", "removeLabel", "getRepository", "searchRepositories", "searchCode"];
|
|
81
|
+
/**
|
|
82
|
+
* **CI operations** — monitor and manage GitHub Actions workflows.
|
|
83
|
+
*
|
|
84
|
+
* Tools: `getRepository`, `listBranches`, `listCommits`, `getCommit`,
|
|
85
|
+
* `listWorkflows`, `listWorkflowRuns`, `getWorkflowRun`, `listWorkflowJobs`,
|
|
86
|
+
* `triggerWorkflow`, `cancelWorkflowRun`, `rerunWorkflowRun`.
|
|
87
|
+
*
|
|
88
|
+
* Agent prompt: optimized for diagnosing CI failures and managing workflow runs.
|
|
89
|
+
*/
|
|
90
|
+
readonly 'ci-ops': readonly ["getRepository", "listBranches", "listCommits", "getCommit", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
|
|
91
|
+
/**
|
|
92
|
+
* **Repository explorer** — read-only access to browse codebases.
|
|
93
|
+
*
|
|
94
|
+
* Tools: all read-only tools including repos, branches, PRs, issues, commits, blame,
|
|
95
|
+
* search, gists, and workflows. No write operations.
|
|
96
|
+
*
|
|
97
|
+
* Agent prompt: optimized for answering questions about code structure and history.
|
|
98
|
+
*/
|
|
99
|
+
readonly 'repo-explorer': readonly ["getRepository", "listBranches", "getFileContent", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "listIssues", "getIssue", "listLabels", "listCommits", "getCommit", "getBlame", "searchCode", "searchRepositories", "listGists", "getGist", "listGistComments", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs"];
|
|
100
|
+
/**
|
|
101
|
+
* **Maintainer** — full repository maintenance with all read and write tools.
|
|
102
|
+
*
|
|
103
|
+
* Tools: all 42 tools (same as omitting `preset`).
|
|
104
|
+
*
|
|
105
|
+
* Agent prompt: optimized for day-to-day repo maintenance with careful write operations.
|
|
106
|
+
*/
|
|
107
|
+
readonly maintainer: readonly ["getRepository", "listBranches", "getFileContent", "createBranch", "forkRepository", "createRepository", "createOrUpdateFile", "listPullRequests", "getPullRequest", "listPullRequestFiles", "listPullRequestReviews", "createPullRequest", "mergePullRequest", "addPullRequestComment", "createPullRequestReview", "listIssues", "getIssue", "createIssue", "addIssueComment", "closeIssue", "listLabels", "addLabels", "removeLabel", "listCommits", "getCommit", "getBlame", "searchCode", "searchRepositories", "listGists", "getGist", "listGistComments", "createGist", "updateGist", "deleteGist", "createGistComment", "listWorkflows", "listWorkflowRuns", "getWorkflowRun", "listWorkflowJobs", "triggerWorkflow", "cancelWorkflowRun", "rerunWorkflowRun"];
|
|
108
|
+
};
|
|
109
|
+
type GithubToolPreset = keyof typeof PRESET_TOOLS;
|
|
110
|
+
/** Tool names included in a single preset. */
|
|
111
|
+
type PresetToolName<P extends GithubToolPreset> = Extract<(typeof PRESET_TOOLS)[P][number], GithubToolName>;
|
|
112
|
+
/** Tool names included when combining multiple presets. */
|
|
113
|
+
type CombinedPresetToolNames<P extends readonly GithubToolPreset[]> = PresetToolName<P[number]>;
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/core/write-tools.d.ts
|
|
116
|
+
/**
|
|
117
|
+
* Write tools that mutate GitHub state. All require user approval by default
|
|
118
|
+
* unless overridden via {@link ApprovalConfig}.
|
|
119
|
+
*/
|
|
120
|
+
declare const GITHUB_WRITE_TOOLS: {
|
|
121
|
+
/** Create a new branch in a GitHub repository from an existing branch or commit SHA. Requires approval by default. */readonly createBranch: "createBranch"; /** Fork a GitHub repository to the authenticated user account or a specified organization. Requires approval by default. */
|
|
122
|
+
readonly forkRepository: "forkRepository"; /** Create a new GitHub repository for the authenticated user or a specified organization. Requires approval by default. */
|
|
123
|
+
readonly createRepository: "createRepository"; /** Create or update a file in a GitHub repository. Requires approval by default. */
|
|
124
|
+
readonly createOrUpdateFile: "createOrUpdateFile"; /** Create a new pull request in a GitHub repository. Requires approval by default. */
|
|
125
|
+
readonly createPullRequest: "createPullRequest"; /** Merge a pull request. Requires approval by default. */
|
|
126
|
+
readonly mergePullRequest: "mergePullRequest"; /** Add a comment to a pull request. Requires approval by default. */
|
|
127
|
+
readonly addPullRequestComment: "addPullRequestComment"; /** Submit a pull request review with optional inline comments. Requires approval by default. */
|
|
128
|
+
readonly createPullRequestReview: "createPullRequestReview"; /** Create a new issue in a GitHub repository. Requires approval by default. */
|
|
129
|
+
readonly createIssue: "createIssue"; /** Add a comment to a GitHub issue. Requires approval by default. */
|
|
130
|
+
readonly addIssueComment: "addIssueComment"; /** Close an open GitHub issue. Requires approval by default. */
|
|
131
|
+
readonly closeIssue: "closeIssue"; /** Add labels to an issue or pull request. Requires approval by default. */
|
|
132
|
+
readonly addLabels: "addLabels"; /** Remove a label from an issue or pull request. Requires approval by default. */
|
|
133
|
+
readonly removeLabel: "removeLabel"; /** Create a new gist with one or more files. Requires approval by default. */
|
|
134
|
+
readonly createGist: "createGist"; /** Update an existing gist. Requires approval by default. */
|
|
135
|
+
readonly updateGist: "updateGist"; /** Delete a gist permanently. Requires approval by default. */
|
|
136
|
+
readonly deleteGist: "deleteGist"; /** Add a comment to a gist. Requires approval by default. */
|
|
137
|
+
readonly createGistComment: "createGistComment"; /** Trigger a workflow via workflow_dispatch event. Requires approval by default. */
|
|
138
|
+
readonly triggerWorkflow: "triggerWorkflow"; /** Cancel an in-progress workflow run. Requires approval by default. */
|
|
139
|
+
readonly cancelWorkflowRun: "cancelWorkflowRun"; /** Re-run a workflow run, optionally only the failed jobs. Requires approval by default. */
|
|
140
|
+
readonly rerunWorkflowRun: "rerunWorkflowRun";
|
|
141
|
+
};
|
|
142
|
+
type GithubWriteToolName = typeof GITHUB_WRITE_TOOLS[keyof typeof GITHUB_WRITE_TOOLS];
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/types.d.ts
|
|
145
|
+
type GithubTool = Tool<any, any>;
|
|
146
|
+
type ToolOptions = {
|
|
147
|
+
needsApproval?: boolean;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Identity for a commit author or committer on GitHub.
|
|
151
|
+
*
|
|
152
|
+
* - **Author** — the person who originally wrote the code patch.
|
|
153
|
+
* - **Committer** — the person who applied the commit to the repository.
|
|
154
|
+
*/
|
|
155
|
+
type CommitIdentity = {
|
|
156
|
+
name: string;
|
|
157
|
+
email: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Options for commit-creating tools (`createOrUpdateFile`, `mergePullRequest`).
|
|
161
|
+
*/
|
|
162
|
+
type CommitToolOptions = ToolOptions & {
|
|
163
|
+
/**
|
|
164
|
+
* The author of the commit — the person who wrote the code patch.
|
|
165
|
+
* Falls back to the authenticated user when omitted.
|
|
166
|
+
*/
|
|
167
|
+
author?: CommitIdentity;
|
|
168
|
+
/**
|
|
169
|
+
* The committer of the commit — the person who applied the commit.
|
|
170
|
+
* Falls back to the authenticated user when omitted.
|
|
171
|
+
*/
|
|
172
|
+
committer?: CommitIdentity;
|
|
173
|
+
/**
|
|
174
|
+
* Co-authors to attribute on commits.
|
|
175
|
+
* Added as "Co-authored-by" trailers to commit messages.
|
|
176
|
+
*/
|
|
177
|
+
coAuthors?: CommitIdentity[];
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Per-tool overrides for customizing tool behavior without changing the underlying implementation.
|
|
181
|
+
*
|
|
182
|
+
* Overridable properties: `description`, `title`, `needsApproval`, `strict`, `providerOptions`,
|
|
183
|
+
* `toModelOutput`, and input lifecycle callbacks (`onInputStart`, `onInputDelta`, `onInputAvailable`).
|
|
184
|
+
*
|
|
185
|
+
* `execute`, `inputSchema`, and `outputSchema` cannot be overridden.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* createGithubTools({
|
|
190
|
+
* overrides: {
|
|
191
|
+
* mergePullRequest: { needsApproval: true, title: 'Merge PR' },
|
|
192
|
+
* listIssues: { description: 'List open bugs' },
|
|
193
|
+
* },
|
|
194
|
+
* })
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
type ToolOverrides = Partial<Pick<Tool, 'description' | 'needsApproval' | 'onInputAvailable' | 'onInputDelta' | 'onInputStart' | 'providerOptions' | 'strict' | 'title' | 'toModelOutput'>>;
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/core/approval.d.ts
|
|
200
|
+
/**
|
|
201
|
+
* Whether write operations require user approval.
|
|
202
|
+
*
|
|
203
|
+
* - `true` — all write tools need approval (default)
|
|
204
|
+
* - `false` — no approval needed for any write tool
|
|
205
|
+
* - object — per-tool override via {@link GithubWriteToolName}; unspecified write tools default to `true`
|
|
206
|
+
*
|
|
207
|
+
* @example Global disable
|
|
208
|
+
* ```ts
|
|
209
|
+
* createGithubTools({ token, requireApproval: false })
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* @example Granular per write tool
|
|
213
|
+
* ```ts
|
|
214
|
+
* createGithubTools({
|
|
215
|
+
* token,
|
|
216
|
+
* requireApproval: {
|
|
217
|
+
* mergePullRequest: true,
|
|
218
|
+
* createOrUpdateFile: true,
|
|
219
|
+
* addPullRequestComment: false,
|
|
220
|
+
* },
|
|
221
|
+
* })
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
type ApprovalConfig = boolean | Partial<Record<GithubWriteToolName, boolean>>;
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/core/tool-types.d.ts
|
|
227
|
+
/** Full tool set returned when no `preset` is specified. */
|
|
228
|
+
type AllGithubTools = Record<GithubToolName, GithubTool>;
|
|
229
|
+
/** Base options shared by all {@link createGithubTools} overloads. */
|
|
230
|
+
type GithubToolsBaseOptions = {
|
|
231
|
+
/** GitHub personal access token. Falls back to `process.env.GITHUB_TOKEN` when omitted. */token?: string; /** Control whether write operations require user approval. @see {@link ApprovalConfig} */
|
|
232
|
+
requireApproval?: ApprovalConfig; /** Per-tool overrides for description, title, needsApproval, and related AI SDK tool fields. */
|
|
233
|
+
overrides?: Partial<Record<GithubToolName, ToolOverrides>>; /** Default author for commit-creating tools. Falls back to the authenticated user when omitted. */
|
|
234
|
+
author?: CommitIdentity; /** Default committer for commit-creating tools. Falls back to the authenticated user when omitted. */
|
|
235
|
+
committer?: CommitIdentity; /** Co-authors to attribute on all commits created by tools. */
|
|
236
|
+
coAuthors?: CommitIdentity[];
|
|
237
|
+
};
|
|
238
|
+
/** Tool set shape for a given preset option (single, combined, or all tools). */
|
|
239
|
+
type GithubToolsForPreset<P extends GithubToolPreset | readonly GithubToolPreset[] | undefined> = P extends GithubToolPreset ? Pick<AllGithubTools, PresetToolName<P> & GithubToolName> : P extends readonly GithubToolPreset[] ? Pick<AllGithubTools, CombinedPresetToolNames<P> & GithubToolName> : AllGithubTools;
|
|
240
|
+
/** Pick a subset of GitHub tools by tool name. */
|
|
241
|
+
type PickGithubTools<T extends GithubToolName> = Pick<AllGithubTools, T>;
|
|
242
|
+
//#endregion
|
|
243
|
+
export { PresetToolName as _, ApprovalConfig as a, GithubTool as c, ToolOverrides as d, GITHUB_WRITE_TOOLS as f, PRESET_TOOLS as g, GithubToolPreset as h, PickGithubTools as i, Octokit$1 as l, CombinedPresetToolNames as m, GithubToolsBaseOptions as n, CommitIdentity as o, GithubWriteToolName as p, GithubToolsForPreset as r, CommitToolOptions as s, AllGithubTools as t, ToolOptions as u, GITHUB_TOOL_NAMES as v, GithubToolName as y };
|
|
244
|
+
//# sourceMappingURL=tool-types-CuirBEc8.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-types-CuirBEc8.d.mts","names":[],"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