Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ci-logs-review-threads-delete-branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@github-tools/sdk": minor
"@github-tools/eve-extension": minor
---

Add five tools (84 total): `getWorkflowJobLogs` reads a workflow job's log output, returning the last `maxLines` lines (default 200, max 2000) with per-line timestamps stripped to keep token usage low. `listPullRequestReviewThreads` lists PR review threads via GraphQL with resolution state and the IDs needed to reply or resolve — unresolved threads only and truncated comment bodies by default (`status: 'all'`, `detail: 'full'` to override). `replyToReviewComment` and `resolveReviewThread` answer and close review threads, and `deleteBranch` deletes a branch — all three are write tools requiring approval by default. Presets updated: `ci-ops`, `security-audit`, and `repo-explorer` gain job logs; `code-review` and `pr-author` gain the review-thread tools; `pr-author` also gains `deleteBranch`.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Overview

`@github-tools/sdk` wraps GitHub's REST API as 79 AI SDK-compatible tools for agents and `generateText`/`streamText` calls — with presets, approval control, and integrations for eve, Vercel Workflow, and Chat SDK. Docs: [github-tools.com](https://github-tools.com).
`@github-tools/sdk` wraps GitHub's REST API as 84 AI SDK-compatible tools for agents and `generateText`/`streamText` calls — with presets, approval control, and integrations for eve, Vercel Workflow, and Chat SDK. Docs: [github-tools.com](https://github-tools.com).

## Commands

Expand Down
5 changes: 5 additions & 0 deletions apps/chat/shared/utils/tools/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const GITHUB_TOOL_META: Record<GithubToolName, GithubToolMeta> = {
getFileContent: { title: 'Get File Content', label: 'File read', labelActive: 'Reading file', icon: 'i-lucide-file-code' },
getRepositoryTree: { title: 'Get Repository Tree', label: 'Tree fetched', labelActive: 'Fetching repository tree', icon: 'i-lucide-folder-tree' },
createBranch: { title: 'Create Branch', label: 'Branch created', labelActive: 'Creating branch', icon: 'i-lucide-git-branch-plus' },
deleteBranch: { title: 'Delete Branch', label: 'Branch deleted', labelActive: 'Deleting branch', icon: 'i-lucide-git-branch-minus' },
forkRepository: { title: 'Fork Repository', label: 'Repository forked', labelActive: 'Forking repository', icon: 'i-lucide-git-fork' },
createRepository: { title: 'Create Repository', label: 'Repository created', labelActive: 'Creating repository', icon: 'i-lucide-plus' },
createOrUpdateFile: { title: 'Create / Update File', label: 'File updated', labelActive: 'Updating file', icon: 'i-lucide-file-pen' },
Expand All @@ -30,6 +31,9 @@ export const GITHUB_TOOL_META: Record<GithubToolName, GithubToolMeta> = {
listPullRequestFiles: { title: 'List PR Files', label: 'Files listed', labelActive: 'Listing PR files', icon: 'i-lucide-file-diff' },
listPullRequestReviews: { title: 'List PR Reviews', label: 'Reviews listed', labelActive: 'Listing PR reviews', icon: 'i-lucide-message-circle' },
createPullRequestReview: { title: 'Submit PR Review', label: 'Review submitted', labelActive: 'Submitting PR review', icon: 'i-lucide-shield-check' },
listPullRequestReviewThreads: { title: 'List Review Threads', label: 'Review threads listed', labelActive: 'Listing review threads', icon: 'i-lucide-messages-square' },
replyToReviewComment: { title: 'Reply to Review Comment', label: 'Reply posted', labelActive: 'Replying to review comment', icon: 'i-lucide-reply' },
resolveReviewThread: { title: 'Resolve Review Thread', label: 'Thread resolved', labelActive: 'Resolving review thread', icon: 'i-lucide-check-check' },
requestReviewers: { title: 'Request Reviewers', label: 'Reviewers requested', labelActive: 'Requesting reviewers', icon: 'i-lucide-user-plus' },
getPullRequestContext: { title: 'PR Context', label: 'PR context loaded', labelActive: 'Loading PR context', icon: 'i-lucide-layers' },
listIssues: { title: 'List Issues', label: 'Issues listed', labelActive: 'Listing issues', icon: 'i-lucide-circle-dot' },
Expand Down Expand Up @@ -77,6 +81,7 @@ export const GITHUB_TOOL_META: Record<GithubToolName, GithubToolMeta> = {
listWorkflowRuns: { title: 'List Workflow Runs', label: 'Runs listed', labelActive: 'Listing workflow runs', icon: 'i-lucide-play' },
getWorkflowRun: { title: 'Get Workflow Run', label: 'Run fetched', labelActive: 'Fetching workflow run', icon: 'i-lucide-play' },
listWorkflowJobs: { title: 'List Workflow Jobs', label: 'Jobs listed', labelActive: 'Listing workflow jobs', icon: 'i-lucide-list-checks' },
getWorkflowJobLogs: { title: 'Get Job Logs', label: 'Job logs fetched', labelActive: 'Fetching job logs', icon: 'i-lucide-scroll-text' },
triggerWorkflow: { title: 'Trigger Workflow', label: 'Workflow triggered', labelActive: 'Triggering workflow', icon: 'i-lucide-rocket' },
cancelWorkflowRun: { title: 'Cancel Workflow Run', label: 'Run cancelled', labelActive: 'Cancelling workflow run', icon: 'i-lucide-circle-x' },
rerunWorkflowRun: { title: 'Re-run Workflow', label: 'Workflow re-run', labelActive: 'Re-running workflow', icon: 'i-lucide-refresh-cw' },
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/1.getting-started/1.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ The direct [`@github-tools/sdk/eve`](/deprecated/eve) import is deprecated in fa

## Explore the tools

The SDK covers repositories, branches, pull requests, issues, reactions, discussions, notifications, commits, releases, checks and statuses, code search, gists, and workflows: 79 tools in total. Each tool wraps a GitHub API operation (mostly REST; line-level blame and the discussion tools use GraphQL) and is fully typed with [Zod](https://zod.dev) schemas.
The SDK covers repositories, branches, pull requests, issues, reactions, discussions, notifications, commits, releases, checks and statuses, code search, gists, and workflows: 84 tools in total. Each tool wraps a GitHub API operation (mostly REST; line-level blame and the discussion tools use GraphQL) and is fully typed with [Zod](https://zod.dev) schemas.

Browse the full list in the [Tools Catalog](/api/tools-catalog).

Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/2.frameworks/1.eve-extension.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Build a GitHub agent with the eve extension
description: Mount @github-tools/eve-extension under agent/extensions/ to add all 79 GitHub tools to an eve agent, the recommended way to wire GitHub into eve, with durable approval and Vercel Connect support.
description: Mount @github-tools/eve-extension under agent/extensions/ to add all 84 GitHub tools to an eve agent, the recommended way to wire GitHub into eve, with durable approval and Vercel Connect support.
seo:
title: Build a GitHub agent with the eve extension
description: Mount @github-tools/eve-extension under agent/extensions/, the recommended way to add GitHub tools to an eve agent.
Expand Down Expand Up @@ -28,7 +28,7 @@ links:
variant: subtle
---

[eve](https://eve.dev) is Vercel's filesystem-first agent framework: an agent is a folder with instructions, a model config, and tools. `@github-tools/eve-extension` packages all 79 GitHub tools as a mountable [eve extension](https://eve.dev/docs/extensions): a single `pnpm add` and a one-line mount under `agent/extensions/`, no CLI setup, and no direct SDK import in `agent/tools/`.
[eve](https://eve.dev) is Vercel's filesystem-first agent framework: an agent is a folder with instructions, a model config, and tools. `@github-tools/eve-extension` packages all 84 GitHub tools as a mountable [eve extension](https://eve.dev/docs/extensions): a single `pnpm add` and a one-line mount under `agent/extensions/`, no CLI setup, and no direct SDK import in `agent/tools/`.

::callout{icon="i-custom:eve"}
This is the **recommended way** to add GitHub tools to an eve agent. The legacy direct registration APIs (`createGithubTools` and per-tool factories from [`@github-tools/sdk/eve`](/deprecated/eve)) are **deprecated** in its favor. They keep working for existing `agent/tools/` setups, but new agents should mount the extension instead. Shared runtime helpers used by this extension live on `@github-tools/sdk/eve-runtime` (not deprecated).
Expand Down Expand Up @@ -175,7 +175,7 @@ export default githubExtension({

```ts [agent/extensions/github.ts]
export default githubExtension({
preset: 'maintainer', // all 79 tools
preset: 'maintainer', // all 84 tools
exclude: ['createRepository', 'deleteGist'], // minus these two
})
```
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/2.frameworks/2.ai-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Full policy options (including `overrides.needsApproval`): [Control write safety

## Trim tool context with toolpick

With all 79 tools visible on every step, tool definitions eat tokens. [toolpick](https://github.com/pontusab/toolpick) selects only the most relevant tools per step:
With all 84 tools visible on every step, tool definitions eat tokens. [toolpick](https://github.com/pontusab/toolpick) selects only the most relevant tools per step:

```ts [with-toolpick.ts]
import { createGithubTools } from '@github-tools/sdk'
Expand Down Expand Up @@ -153,7 +153,7 @@ const tools = {
}
```

See the [Tools Catalog](/api/tools-catalog) for all 79 factories.
See the [Tools Catalog](/api/tools-catalog) for all 84 factories.

## When to level up

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Build an eve manager agent that delegates GitHub work to specialist sub-agents i

::

Instead of one agent holding all 79 tools, this manager holds none. It reads the request, picks the right specialist, and calls it. Each specialist is a normal `@github-tools/eve-extension` mount scoped to a single [preset](/guide/presets), isolated in its own [declared subagent](https://eve.dev/docs/subagents) directory with its own tools, instructions, and approval policy.
Instead of one agent holding all 84 tools, this manager holds none. It reads the request, picks the right specialist, and calls it. Each specialist is a normal `@github-tools/eve-extension` mount scoped to a single [preset](/guide/presets), isolated in its own [declared subagent](https://eve.dev/docs/subagents) directory with its own tools, instructions, and approval policy.

::callout{icon="i-lucide-layers"}
**Recommended for multi-role products.** Prefer this composition over putting `maintainer` (or omitting `preset`) on a single agent when the product has several distinct jobs — review, triage, release, and so on. Each specialist stays small in context and scoped in token permissions.
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/3.examples/7.recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ See the [full eve version of this task](/examples/eve-stale-issue-triager) for a

## Reduce tool context with toolpick

With all 79 tools visible on every step, tool definitions eat tokens. [toolpick](https://github.com/pontusab/toolpick) selects only the most relevant ones per step:
With all 84 tools visible on every step, tool definitions eat tokens. [toolpick](https://github.com/pontusab/toolpick) selects only the most relevant ones per step:

```ts [with-toolpick.ts]
import { createGithubTools } from '@github-tools/sdk'
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/4.guide/1.presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ const tools = createGithubTools({
| Preset | Tools included | Use case |
|---|---|---|
| `repo-explorer` | repository metadata, branches, file content, repo tree, code and issue search, discussions, gists, workflows, checks/statuses, releases | knowledge retrieval, repo Q&A |
| `ci-ops` | workflows, runs, jobs, checks/statuses, commits, repository context | CI monitoring, build ops |
| `code-review` | pull requests, commits, compare diff, file diffs, checks/statuses, updates, review comments, reviewer requests | PR copilots, change summaries |
| `ci-ops` | workflows, runs, jobs, job logs, checks/statuses, commits, repository context | CI monitoring, build ops |
| `code-review` | pull requests, commits, compare diff, file diffs, checks/statuses, updates, review comments, review threads, reviewer requests | PR copilots, change summaries |
| `issue-triage` | issues, issue search, labels, comments, reactions, assignees, close/create/update/reopen | support triage, backlog bots |
| `security-audit` | read-only exploration, code and issue search, PR/CI visibility, checks/statuses, compare diff, plus issue creation to report findings | vulnerability scanning, risk reporting |
| `release-manager` | releases, compare diff, commits, workflow runs, pull requests, update/delete releases | changelog generation, release cutting |
| `discussion-moderator` | discussions list/get/comment, plus light issue context | forum / Q&A bots |
| `notification-inbox` | notifications list/mark-read, plus get issue/PR/repo | inbox triage (needs a Notifications PAT) |
| `pr-author` | branches, file edits, create/update pull requests, compare | open focused PRs without full maintainer |
| `pr-author` | branches (create/delete), file edits, create/update pull requests, review threads, compare | open focused PRs and address review feedback without full maintainer |
| `maintainer` | all tool families including branch creation, forking, repo creation, discussions, notifications, gists, and workflows | full operator workflows with [approval control](/guide/approval-control) |

## Pair presets with token scopes
Expand Down
3 changes: 3 additions & 0 deletions apps/docs/content/docs/4.guide/2.approval-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ const tools = createGithubTools({
| `createPullRequest` | Medium | Optional in trusted CI |
| `updatePullRequest` | Medium | Require in production repos |
| `createBranch` | Low | Usually skip |
| `deleteBranch` | High | Always require approval |
| `addPullRequestComment` | Low | Usually skip |
| `updatePullRequestComment` | Low | Usually skip |
| `deletePullRequestComment` | Medium | Require in production repos |
| `createPullRequestReview` | Medium | Require in production repos |
| `replyToReviewComment` | Low | Usually skip |
| `resolveReviewThread` | Low | Usually skip |
| `requestReviewers` | Low | Usually skip |
| `addIssueComment` | Low | Usually skip |
| `updateIssueComment` | Low | Usually skip |
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/content/docs/4.guide/6.working-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Call independent follow-up reads **in the same step** when you already know the
| `maxPages` | List tools fetch one page by default | Set `maxPages` to combine sequential pages in one call |
| Text-match fragments | `searchCode` truncates each snippet to ~300 chars | None — fetch the file with `getFileContent` for full context |
| `listDiscussions` | Returns 20 discussions per call, cursor-paginated | Raise `perPage`, or pass the returned `endCursor` as `after` |
| `getWorkflowJobLogs` | Returns the last 200 log lines with per-line timestamps stripped | Raise `maxLines` (up to 2000) when the error is higher up |
| `listPullRequestReviewThreads` | Returns unresolved threads only, comment bodies truncated (~500 chars), cursor-paginated | `status: 'all'` for resolved threads; `detail: 'full'` for complete bodies; pass `endCursor` as `after` |
| `listNotifications` | Returns 20 unread threads per call (max 50) | `all: true` to include read threads; raise `perPage` |

## Example: code review bootstrap
Expand Down
5 changes: 5 additions & 0 deletions apps/docs/content/docs/5.api/1.tools-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Available in all presets. These tools manage repositories, branches, and file co
| `getFileContent` | read a file at a path/ref; prefer `startLine`/`endLine` or `maxLines` for large files | No |
| `getRepositoryTree` | list the file and directory structure of a repository at a given ref | No |
| `createBranch` | create a new branch from an existing branch or commit SHA | Yes |
| `deleteBranch` | permanently delete a branch | Yes |
| `forkRepository` | fork a repository to your account or an organization | Yes |
| `createRepository` | create a new repository for the authenticated user or an organization | Yes |
| `createOrUpdateFile` | create or update a file in the repository | Yes |
Expand All @@ -68,6 +69,7 @@ Available in `code-review` and `maintainer` presets:
| `getPullRequest` | read PR details including diff stats (body truncated by default; set `detail: full` for complete text) | No |
| `listPullRequestFiles` | list files changed in a PR (patches omitted by default; set `includePatch` / `filenames` for diffs) | No |
| `listPullRequestReviews` | list reviews on a PR (approvals, change requests, comments) | No |
| `listPullRequestReviewThreads` | list review threads with comments, resolution state, and reply/resolve IDs (unresolved only by default) | No |
| `getPullRequestContext` | fetch PR details plus files, reviews, and optional CI checks in one call | No |
| `createPullRequest` | open a new pull request | Yes |
| `mergePullRequest` | merge a pull request | Yes |
Expand All @@ -76,6 +78,8 @@ Available in `code-review` and `maintainer` presets:
| `updatePullRequestComment` | edit the body of a pull request comment | Yes |
| `deletePullRequestComment` | permanently delete a pull request comment | Yes |
| `createPullRequestReview` | submit a formal review (approve, request changes, or comment) with inline comments | Yes |
| `replyToReviewComment` | reply to a review comment in its thread | Yes |
| `resolveReviewThread` | mark a review thread as resolved | Yes |
| `requestReviewers` | request reviews from users or teams on a pull request | Yes |

## Issue tools
Expand Down Expand Up @@ -163,6 +167,7 @@ Available in `repo-explorer` (read-only), `ci-ops`, and `maintainer` presets:
| `listWorkflowRuns` | list workflow runs filtered by workflow, branch, status, or event | No |
| `getWorkflowRun` | read a workflow run's status, timing, and trigger info | No |
| `listWorkflowJobs` | list jobs in a workflow run with step-level status | No |
| `getWorkflowJobLogs` | read a job's log output (last 200 lines by default, timestamps stripped; raise `maxLines` for more) | No |
| `triggerWorkflow` | trigger a workflow via workflow_dispatch event | Yes |
| `cancelWorkflowRun` | cancel an in-progress workflow run | Yes |
| `rerunWorkflowRun` | re-run a workflow run, optionally only failed jobs | Yes |
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/6.deprecated/1.eve.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Build a GitHub agent with eve (direct import)
description: Deprecated. The direct @github-tools/sdk/eve import registers all 79 tools via defineDynamic with durable human-in-the-loop approval. Prefer the eve extension for new agents.
description: Deprecated. The direct @github-tools/sdk/eve import registers all 84 tools via defineDynamic with durable human-in-the-loop approval. Prefer the eve extension for new agents.
seo:
title: Build a GitHub agent with eve (direct import, deprecated)
description: Deprecated direct-import path for eve agents. See the eve extension for the recommended approach.
Expand Down Expand Up @@ -36,7 +36,7 @@ links:
**Deprecated.** The **direct registration APIs** on this page — `createGithubTools`, the per-tool factories, and `connectGithubTools` from `@github-tools/sdk/connect/eve` — are deprecated in favor of [`@github-tools/eve-extension`](/frameworks/eve-extension). They keep working for existing `agent/tools/` agents and aren't being removed, but new agents should [mount the extension](/frameworks/eve-extension) instead. Shared runtime helpers used by the extension (`listEveToolDescriptors`, `executeGithubEveTool`, approval mappers, …) live on **`@github-tools/sdk/eve-runtime`** and are **not** deprecated.
::

[eve](https://eve.dev) is Vercel's filesystem-first agent framework: an agent is a folder with instructions, a model config, and tools. With `@github-tools/sdk/eve`, that folder becomes a **complete GitHub agent in 3 files**: all 79 tools registered from a single file, with durable human-in-the-loop approval that actually pauses the session until a person approves. This page documents the legacy direct-import path; for new agents, see the [eve extension](/frameworks/eve-extension) guide instead.
[eve](https://eve.dev) is Vercel's filesystem-first agent framework: an agent is a folder with instructions, a model config, and tools. With `@github-tools/sdk/eve`, that folder becomes a **complete GitHub agent in 3 files**: all 84 tools registered from a single file, with durable human-in-the-loop approval that actually pauses the session until a person approves. This page documents the legacy direct-import path; for new agents, see the [eve extension](/frameworks/eve-extension) guide instead.

::prompt
---
Expand Down
Loading
Loading