Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
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
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on:
pull_request:
push:
branches:
- main
- codex/workspace
- claude/workspace
- huma/workspace

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.25.0
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm verify
61 changes: 58 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
# AgentRouter

AgentRouter is a GitHub App router for explicit agent mentions across personal and organization repositories.
AgentRouter is a GitHub App router for explicit agent mentions across personal and organization repositories. It lets one installed app listen across selected repos and queue work only when someone deliberately calls an agent.

It listens for GitHub comments and reviews, validates that the sender is allowed to dispatch work, and creates jobs for:

- `@codex`
- `@claude`
- `@huma`

The first version is intentionally conservative: it stores jobs locally, exposes a small runner API, and only dispatches when an exact mention is present.
The first version is intentionally conservative: it stores jobs locally, exposes a small runner API, and only dispatches when an exact mention is present. No ambient code review, no surprise bot activity, no repo-by-repo workflow file required.

## Commands
## Quick Start

```bash
pnpm install
pnpm verify
cp .env.example .env
```

Set the required values in `.env`, then start the router:

```bash
pnpm dev
```

In another terminal, run a local worker lane:

```bash
pnpm runner -- --agent codex
```

Expand Down Expand Up @@ -43,6 +54,16 @@ pnpm setup:url HuntDynamics org
4. GitHub will redirect back to `/setup/callback`. AgentRouter exchanges the temporary manifest code and writes generated credentials to `.state/github-app.env` with file mode `0600`.
5. Copy those values into your runtime `.env`, restart the server, then install the app on the repos/accounts it should watch.

## Commands

```bash
pnpm dev # start the webhook server
pnpm runner -- --agent codex # claim queued Codex jobs
pnpm setup:url fschrhunt user # generate a GitHub App manifest URL
pnpm test # run tests
pnpm verify # typecheck and test
```

## Configuration

Copy `.env.example` to `.env` and set:
Expand All @@ -55,10 +76,44 @@ Copy `.env.example` to `.env` and set:

`GITHUB_PRIVATE_KEY_B64` should be the GitHub App private key PEM encoded as base64.

Use `agent-router.config.json` to restrict which repositories can dispatch jobs. Start from:

```bash
cp agent-router.config.example.json agent-router.config.json
```

## Safety Rules

- No agent runs unless a comment or review contains `@codex`, `@claude`, or `@huma`.
- Bot users are ignored.
- Senders must have `write`, `maintain`, or `admin` repository permission.
- Repositories can be allowlisted in `agent-router.config.json`.
- The runner claims jobs over an authenticated local API.

## Webhook Events

AgentRouter currently understands:

- issue comments
- issue bodies
- pull request review comments
- pull request review bodies

When a valid mention is accepted, AgentRouter stores a queued job. Runners claim jobs per lane and report completion back to the local API.

## Development

```bash
pnpm install
pnpm verify
```

Runtime state is intentionally local and ignored by git:

- `.env`
- `.state/`
- SQLite files

## License

MIT
63 changes: 0 additions & 63 deletions docs/superpowers/plans/2026-04-28-agent-router-mvp.md

This file was deleted.

Loading