ViteHub is still experimental. Expect bugs and breaking changes.

Repository host

Expose provider-hosted repository, Change Request, issue, comment, check, and status data.

repositoryHost() gives an Agent a provider-neutral Repository Host Capability. Use it when the Agent needs GitHub, GitLab, Bitbucket, or another repository host through a configured client boundary.

Installation

Import the Capability factory from @vite-hub/agent/capabilities and add it to defineAgent({ capabilities }). Provide a client directly or configure a repository-host primitive.

What it adds

The Capability adds repository_host_read in read mode. In write mode it also adds repository_host_write for comments and reactions through the configured Repository Host client.

Configuration

server/agents/reviewer.ts
import { defineAgent } from '@vite-hub/agent'
import { repositoryHost } from '@vite-hub/agent/capabilities'

export default defineAgent({
  driver: { model },
  capabilities: [
    repositoryHost({
      client: githubRepositoryHostClient,
      mode: 'read',
      provider: 'github',
    }),
  ],
})

Runtime behavior

repository_host_read accepts normalized operations for repositories, Change Requests, Change Request files, issues, comments, checks, and statuses. Operations that target a single Change Request, issue, comment, check, or status require target.id.

repository_host_write requires write mode and a client with write(). Comment writes require a body; all writes require a target id.

Requirements

When client is omitted, ViteHub requires a configured repository-host primitive. The client must expose read(), and write mode also requires write() before the write tool can succeed.

Driver support

Agent DriverSupport
Model-backedReceives repository_host_read, plus repository_host_write in write mode.
Harness-backedDoes not receive model-facing Repository Host tools by default.
Custom-run-backedCan use the configured client directly through runtime context if the runner owns that behavior.

Options

OptionTypeDefaultDescription
clientRepositoryHostClient | functionprimitiveProvider client with read() and optional write().
mode"read" | "write""read"Adds repository_host_write when set to "write".
policyAgentToolPolicyDecision | function"require-approval"Policy for repository_host_write.
provider"github" | "gitlab" | "bitbucket" | stringclient providerProvider metadata for inspection.

Inspect and verify

Inspect the Agent tool list in DevTools. Read one repository or Change Request through repository_host_read, then verify write mode requires approval before posting comments or reactions.

Reference

Copyright © 2026