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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules/
dist/
coverage/
.agentrelay/
.devrelay/
*.log
.DS_Store
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ npm install
npm run check
```

Keep the v0.1 safety model intact: repository paths must remain fixed at server startup, Git calls must not use a shell or user-provided argument arrays, and new persistence paths must pass through redaction and sensitive-path filtering.
Keep the safety model intact: workspace paths must remain fixed at server startup, child working directories must remain inside that boundary, Git calls must not use a shell or user-provided argument arrays, and new persistence paths must pass through redaction and sensitive-path filtering.

For behavior changes, add an integration test using a temporary Git repository. For new MCP tools, explain why the behavior cannot fit one of the existing ten tools; a small and predictable tool surface is a product constraint.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2026 DevRelay contributors
Copyright 2026 AgentRelay contributors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
102 changes: 64 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# DevRelay
# AgentRelay

**DevRelay coordinates coding agents working on the same repository.**
## One project. Multiple AI agents. Zero repeated work.

**Let AI continue where another AI stopped.**

It tracks active sessions, task leases, advisory file ownership, decisions, failed attempts, Git state, and handoffs so Codex, Claude Code, and other agents can continue each other's work without rebuilding context from scratch.

> Not another chat memory. A local coordination layer for coding agents.

## What works in v0.1
## What works in v0.3

- Local-first SQLite storage inside the repository
- Local-first SQLite storage inside a repository or workspace
- Fixed non-Git workspace boundaries with child-repository Git context
- MCP server with ten focused tools
- Agent sessions and heartbeats
- Expiring task leases
Expand Down Expand Up @@ -38,11 +41,11 @@ Agent B joins

## Install from source

DevRelay is not published to npm yet.
AgentRelay is not published to npm yet.

```bash
git clone https://github.com/arumwu/devrelay.git
cd devrelay
git clone https://github.com/arumwu/agentrelay.git
cd agentrelay
npm install
npm run build
npm link
Expand All @@ -52,82 +55,102 @@ Node.js 22.13 or newer is required.

## Quick start

Run these commands from any Git repository, or pass `--repo /absolute/path` before the subcommand.
Run these commands from a Git repository, or pin AgentRelay to a larger workspace with `--repo /absolute/path` before the subcommand.

```bash
devrelay init
devrelay join --agent codex-01 --type codex --task "Implement OAuth callback"
agentrelay --repo /workspaces/company init
agentrelay --repo /workspaces/company join \
--agent codex-01 \
--type codex \
--cwd products/api \
--task "Implement OAuth callback"
```

The `join` command returns a session UUID. Use it for claims and event records:

```bash
devrelay claim-task \
agentrelay claim-task \
--session SESSION_UUID \
--title "Implement OAuth callback" \
--description "Validate callback and exchange tokens"

devrelay claim-scope \
agentrelay claim-scope \
--session SESSION_UUID \
--pattern "src/auth/**"

devrelay event \
agentrelay event \
--session SESSION_UUID \
--type attempt \
--summary "Service account approach failed" \
--content "Normal user OAuth requires authorization-code flow"

devrelay context "Finish OAuth refresh flow" --budget 5000
agentrelay context "Finish OAuth refresh flow" --cwd products/api --budget 5000

devrelay handoff \
agentrelay handoff \
--session SESSION_UUID \
--title "OAuth implementation handoff"
```

## Connect Codex

For a source checkout, register the built CLI and pin it to the repository the agents will coordinate:
For a source checkout, register the built CLI and pin it to the repository or workspace the agents will coordinate:

```bash
codex mcp add devrelay -- \
node /absolute/path/to/devrelay/dist/cli.js \
--repo /absolute/path/to/your/repository \
codex mcp add agentrelay -- \
node /absolute/path/to/agentrelay/dist/cli.js \
--repo /absolute/path/to/your/workspace \
serve
```

Equivalent `config.toml`:

```toml
[mcp_servers.devrelay]
[mcp_servers.agentrelay]
command = "node"
args = [
"/absolute/path/to/devrelay/dist/cli.js",
"/absolute/path/to/agentrelay/dist/cli.js",
"--repo",
"/absolute/path/to/your/repository",
"/absolute/path/to/your/workspace",
"serve"
]
```

## Connect Claude Code

```bash
claude mcp add devrelay -- \
node /absolute/path/to/devrelay/dist/cli.js \
--repo /absolute/path/to/your/repository \
claude mcp add agentrelay -- \
node /absolute/path/to/agentrelay/dist/cli.js \
--repo /absolute/path/to/your/workspace \
serve
```

Then place the lifecycle rules from [`examples/AGENTS.md`](examples/AGENTS.md) in the repository's `AGENTS.md` or `CLAUDE.md`.

## Workspace mode

A workspace may contain many independent Git repositories and non-Git projects:

```text
/workspaces/company/ <- fixed AgentRelay boundary
├── .agentrelay/ <- shared workspace memory
├── products/api/.git/
├── products/web/.git/
└── research-notes/
```

The MCP server remains fixed to `/workspaces/company`. Each `agent_join` and `build_context` call may include `working_directory`, such as `products/api`. AgentRelay rejects directories outside the fixed workspace and obtains Git status from the child repository containing that working directory.

Task and scope claims remain workspace-wide. In the example above, claim `products/api/src/**`, not only `src/**`, to avoid ambiguity between child projects.

## MCP tools

| Tool | Purpose |
|---|---|
| `project_init` | Initialize or inspect project-local storage and its repository boundary |
| `agent_join` | Register an identified coding-agent session |
| `project_init` | Initialize or inspect workspace-local storage and its fixed boundary |
| `agent_join` | Register an agent session and its current workspace directory |
| `agent_status` | Read coordination state and optionally heartbeat a session |
| `claim_task` | Create or claim an expiring task lease |
| `claim_scope` | Claim repository-relative files or globs and receive overlap warnings |
| `claim_scope` | Claim workspace-relative files or globs and receive overlap warnings |
| `record_event` | Record an attempt, result, issue, discovery, test, note, or completion |
| `record_decision` | Record a structured decision and identify potential conflicts |
| `search_memory` | Search events, decisions, and handoffs with SQLite FTS5 |
Expand All @@ -136,31 +159,34 @@ Then place the lifecycle rules from [`examples/AGENTS.md`](examples/AGENTS.md) i

## Local data

Each coordinated repository owns its memory:
Each coordinated repository or workspace owns its memory:

```text
.devrelay/
├── devrelay.db
.agentrelay/
├── agentrelay.db
├── events.jsonl
└── handoffs/
└── 2026-...-handoff.md
```

`.devrelay/` is excluded from this repository's Git history by default. A team may choose to version redacted handoff exports, but the database should normally remain local.
`.agentrelay/` is excluded from this repository's Git history by default. In a non-Git workspace it remains a hidden local directory. A team may choose to version redacted handoff exports, but the database should normally remain local.

When upgrading from the former DevRelay name, the first AgentRelay startup automatically renames `.devrelay/` to `.agentrelay/` and `devrelay.db` to `agentrelay.db` when the new paths do not already exist.

## Coordination semantics

Task leases are exclusive while active. If a second agent requests the same task, DevRelay returns a conflict with the current owner and expiry.
Task leases are exclusive while active. If a second agent requests the same task, AgentRelay returns a conflict with the current owner and expiry.

Scope claims are advisory. DevRelay warns when file or glob patterns may overlap, but it does not pretend it can prevent an agent from editing files outside MCP. Agents and hooks should treat warnings as a coordination stop.
Scope claims are advisory. AgentRelay warns when file or glob patterns may overlap, but it does not pretend it can prevent an agent from editing files outside MCP. Agents and hooks should treat warnings as a coordination stop.

Decision conflicts are also advisory. DevRelay flags related active decisions based on task, title, and scope overlap; a human or agent must explicitly supersede the old decision.
Decision conflicts are also advisory. AgentRelay flags related active decisions based on task, title, and scope overlap; a human or agent must explicitly supersede the old decision.

## Security boundaries

- The repository root is resolved once when the server starts.
- MCP tools cannot select another repository path.
- DevRelay does not expose arbitrary shell or test-command execution.
- The workspace root is resolved once when the server starts.
- Agent working directories must exist inside that fixed workspace.
- MCP tools cannot escape to another workspace path.
- AgentRelay does not expose arbitrary shell or test-command execution.
- Git inspection uses fixed argument arrays without a shell.
- `.env`, private keys, and credential-like paths are filtered.
- Common API keys, tokens, passwords, cookies, and bearer headers are redacted before storage.
Expand Down
16 changes: 8 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Supported versions

DevRelay is pre-1.0 software. Security fixes are applied to the latest released version.
AgentRelay is pre-1.0 software. Security fixes are applied to the latest released version.

## Reporting a vulnerability

Expand All @@ -12,25 +12,25 @@ Include the affected version, operating system, reproduction steps, security imp

## Threat model

DevRelay assumes coding agents and repository content may produce inaccurate or adversarial text. Stored memory is treated as context, not executable instructions.
AgentRelay assumes coding agents and repository content may produce inaccurate or adversarial text. Stored memory is treated as context, not executable instructions.

The v0.1 boundary is intentionally narrow:

- one fixed Git repository per server process
- one fixed repository or workspace boundary per server process
- local SQLite and Markdown storage
- no arbitrary shell command tool
- fixed Git command argument arrays
- repository-relative scope paths only
- workspace-relative scope paths only
- path traversal and absolute-path rejection
- sensitive filename filtering
- best-effort secret redaction before persistence

Secret redaction is defense in depth, not a substitute for avoiding secret input. Users should not intentionally send credentials to DevRelay.
Secret redaction is defense in depth, not a substitute for avoiding secret input. Users should not intentionally send credentials to AgentRelay.

## Out of scope for v0.1

- hostile local users with filesystem access to `.devrelay/`
- hostile local users with filesystem access to `.agentrelay/`
- full-disk compromise
- malicious changes to the DevRelay executable or dependencies
- malicious changes to the AgentRelay executable or dependencies
- perfect detection of every possible credential format
- enforcing scope claims against tools that bypass DevRelay
- enforcing scope claims against tools that bypass AgentRelay
16 changes: 8 additions & 8 deletions examples/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# DevRelay agent protocol
# AgentRelay agent protocol

This repository uses DevRelay as shared coordination state for coding agents.
This repository or parent workspace uses AgentRelay as shared coordination state for coding agents.

## Before editing

1. Call `agent_join` with a stable agent ID, agent type, and concise task summary.
2. Call `build_context` for the intended task.
1. Call `agent_join` with a stable agent ID, agent type, concise task summary, and the current `working_directory` inside the configured workspace.
2. Call `build_context` for the intended task and current `working_directory`.
3. Call `agent_status` and inspect active agents, task leases, and scope claims.
4. Call `claim_task` before taking an existing or new task.
5. Call `claim_scope` for the files or modules you expect to modify.
6. Stop and coordinate if DevRelay reports a task conflict or relevant scope overlap.
5. Call `claim_scope` for workspace-relative files or modules you expect to modify.
6. Stop and coordinate if AgentRelay reports a task conflict or relevant scope overlap.

## During work

- Heartbeat with `agent_status` before a lease expires.
- Record important discoveries, tests, results, and blockers with `record_event`.
- Record failed attempts with `event_type: attempt`, including the reason and retry condition.
- Record durable architecture choices with `record_decision`.
- Never store secrets, credentials, raw `.env` values, or private keys in DevRelay.
- Never store secrets, credentials, raw `.env` values, or private keys in AgentRelay.

## Before ending or handing off

Expand All @@ -26,4 +26,4 @@ This repository uses DevRelay as shared coordination state for coding agents.
3. Call `create_handoff`; allow it to end the session unless work is continuing immediately.
4. Confirm the handoff includes changed files, test status, failed attempts, blockers, and the recommended next action.

DevRelay claims are coordination signals, not filesystem locks. Do not edit through an active overlapping claim without explicit coordination.
AgentRelay claims are coordination signals, not filesystem locks. Do not edit through an active overlapping claim without explicit coordination.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@arumwu/devrelay",
"version": "0.1.0",
"description": "Local-first coordination, handoffs, and shared project memory for coding agents.",
"name": "@arumwu/agentrelay",
"version": "0.3.0",
"description": "One project. Multiple AI agents. Zero repeated work.",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -12,7 +12,7 @@
}
},
"bin": {
"devrelay": "dist/cli.js"
"agentrelay": "dist/cli.js"
},
"files": [
"dist",
Expand Down Expand Up @@ -40,12 +40,12 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/arumwu/devrelay.git"
"url": "git+https://github.com/arumwu/agentrelay.git"
},
"bugs": {
"url": "https://github.com/arumwu/devrelay/issues"
"url": "https://github.com/arumwu/agentrelay/issues"
},
"homepage": "https://github.com/arumwu/devrelay#readme",
"homepage": "https://github.com/arumwu/agentrelay#readme",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"better-sqlite3": "^12.11.1",
Expand Down
Loading