Skip to content
Closed
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
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Changelog

Notable AgentRelay changes are recorded here. Dates use the Taiwan calendar date of the release work.

## 0.5.0 - 2026-08-01

### Added

- A local content inbox for inline text, URL references, and workspace-local files.
- SHA-256 source deduplication, content-addressed attachment copies, and FTS5 content search.
- Four MCP tools: `ingest_content`, `search_content`, `review_content`, and `promote_content_to_task`.
- Four matching CLI commands: `ingest-content`, `search-content`, `review-content`, and `promote-content`.
- Immediate extraction for small text-based files; binary files remain pending for a future processor unless extracted text is supplied by the caller.

### Changed

- Context packs can include reviewed or promoted source material, clearly wrapped as untrusted content.
- Project status reports content-processing and review-state counts.
- The package and CLI descriptions now include reviewed content intake.

### Security

- New content stays outside context packs and cannot create a task until explicitly approved.
- Task promotion requires an approved summary or a caller-supplied description and is idempotent.
- File intake rejects paths outside the workspace, symlink escapes, AgentRelay and Git internals, credential-like paths, and files larger than 25 MiB.
- Stored URL references remove embedded credentials, fragments, and credential-like query parameters.
- Copied attachments use mode `0600`; raw bytes are preserved and are not secret-redacted or malware-scanned.
- Updated the MCP SDK and path-matching dependency minimums, including audited transitive fixes for Hono, `fast-uri`, and `brace-expansion`.

### Not included

- URL downloading, OCR, PDF parsing, transcription, mobile shortcuts, and connector adapters remain future work.
66 changes: 62 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

**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. Its built-in tmux transport also lets those agents read and message trusted panes without installing a second MCP server.
It tracks active sessions, task leases, advisory file ownership, reviewed source material, 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. Its built-in tmux transport also lets those agents read and message trusted panes without installing a second MCP server.

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

## What works in v0.4.0
## What works in v0.5.0

- Local-first SQLite storage inside a repository or workspace
- Fixed non-Git workspace boundaries with child-repository Git context
- MCP server with ten coordination tools and five live terminal tools
- MCP server with ten coordination tools, four content-inbox tools, and five live terminal tools
- Built-in tmux transport with no `tmux-bridge-mcp` runtime dependency
- One-session tmux boundary with pane labels and self-message prevention
- Redacted, size-limited terminal reads and single-line message sends
Expand All @@ -23,6 +23,9 @@ It tracks active sessions, task leases, advisory file ownership, decisions, fail
- Structured development events and architecture decisions
- Potential decision-conflict detection
- FTS5 search across events, decisions, and handoffs
- A local content inbox for text, URL references, and workspace-local files
- SHA-256 deduplication, safe attachment copies, text-file extraction, and separate content FTS5 search
- Explicit review before content can become an AgentRelay task or enter generated context packs
- Token-budgeted context packs
- Deterministic Git-aware Markdown handoffs
- CLI fallback for agents without lifecycle hooks
Expand All @@ -43,6 +46,17 @@ Agent B joins
-> claims the continuation and starts from verified project state
```

Captured source material follows a separate trust path:

```text
Text, URL, or workspace file enters the inbox
-> AgentRelay redacts extracted text and deduplicates the source
-> the item stays untrusted and cannot create work
-> a human or trusted caller approves or archives it
-> an approved item can create one open AgentRelay task
-> only reviewed or promoted content may appear in context packs
```

## Install

AgentRelay is not published to npm yet.
Expand Down Expand Up @@ -104,6 +118,36 @@ agentrelay handoff \
--title "OAuth implementation handoff"
```

### Content inbox quick start

Ingest inline text, a URL reference, or a file already inside the configured workspace:

```bash
agentrelay ingest-content \
--source-type file \
--source-ref research/capture.md \
--tag research \
--proposed-action "Compare with the roadmap"

agentrelay search-content --status inbox
```

The ingest result contains a content UUID. Review it before creating work:

```bash
agentrelay review-content CONTENT_UUID \
--decision approve \
--summary "Relevant launch workflow evidence"

agentrelay promote-content CONTENT_UUID
```

Repeated ingestion of the same source is deduplicated. Repeating promotion returns the existing linked task instead of creating a duplicate.

Promotion never copies raw captured text directly into a task description. The reviewed item must have an approved summary, or the caller must provide an explicit `--description` override.

File ingestion accepts workspace-relative regular files up to 25 MiB. AgentRelay copies the original into local content-addressed storage. Small Markdown, text, JSON, CSV, source-code, HTML, XML, and YAML files are extracted immediately; images, PDFs, and other binary files remain `pending` until a caller supplies extracted text during ingestion or a future processor handles them. Raw attachment bytes are preserved unchanged and are not secret-redacted.

## Connect Codex

Configure AgentRelay in the actual Git repository where Codex starts. Create `.codex/config.toml` at that repository root:
Expand Down Expand Up @@ -186,6 +230,10 @@ Task and scope claims remain workspace-wide. In the example above, claim `produc
| `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 |
| `ingest_content` | Deduplicate and store text, a URL reference, or a workspace-local file in the inbox |
| `search_content` | Search content with FTS5 or list newest items by review status |
| `review_content` | Approve or archive untrusted content and correct its metadata |
| `promote_content_to_task` | Atomically create one open task from an approved content item |
| `build_context` | Compile task-specific Git, coordination, and memory context |
| `create_handoff` | Generate a Markdown handoff and optionally release leases |
| `terminal_list` | List panes only in the allowed tmux session |
Expand All @@ -202,6 +250,8 @@ Each coordinated repository or workspace owns its memory:
.agentrelay/
├── agentrelay.db
├── events.jsonl
├── content/
│ └── <sha256>.<extension>
└── handoffs/
└── 2026-...-handoff.md
```
Expand Down Expand Up @@ -231,22 +281,30 @@ Decision conflicts are also advisory. AgentRelay flags related active decisions
- 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.
- Content files must resolve inside the fixed workspace; `.agentrelay/`, `.git/`, credential-like paths, symlink escapes, and files over 25 MiB are rejected.
- URL credentials, fragments, and sensitive query parameters are removed before persistence.
- Inbox text is untrusted, excluded from context packs until review, and cannot become a task without approval.
- Copied raw attachments are mode `0600` and remain unredacted, so users must not intentionally ingest secrets hidden in otherwise ordinary files.
- Agent-authored memory remains evidence-linked context, not trusted executable instructions.

See [SECURITY.md](SECURITY.md) for reporting and threat-model details.

See [CHANGELOG.md](CHANGELOG.md) for version history and the exact v0.5.0 scope.

## Development

```bash
npm install
npm run check
```

The integration tests create temporary Git repositories and exercise task conflict, scope overlap, memory search, decision conflict, handoff generation, and a real in-memory MCP client/server handshake. When tmux is installed, they also create an isolated socket and verify real pane listing, labeling, read-before-send enforcement, messaging, self-target rejection, and cross-session isolation. CI always installs tmux and runs this path.
The integration tests create temporary Git repositories and exercise task conflict, scope overlap, memory search, content deduplication, review gating, task promotion, decision conflict, handoff generation, and a real in-memory MCP client/server handshake. When tmux is installed, they also create an isolated socket and verify real pane listing, labeling, read-before-send enforcement, messaging, self-target rejection, and cross-session isolation. CI always installs tmux and runs this path.

## Roadmap

- Agent-specific hooks for automatic lifecycle capture
- OCR, document parsing, and transcription processors for pending content
- Mobile shortcuts and connector adapters for one-action capture
- Git post-commit/post-merge adapters
- Task completion and blocked-state commands
- Optional semantic retrieval and reranking
Expand Down
8 changes: 8 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The boundary is intentionally narrow:
- path traversal and absolute-path rejection
- sensitive filename filtering
- best-effort secret redaction before persistence
- workspace-bounded content paths with symlink-escape, internal-directory, and file-size checks
- explicit review before captured content can create a task or enter a generated context pack
- one allowed tmux session per server process
- one-use, actor-and-pane-specific read-before-send guards
- single-line terminal messages with byte limits and self-target rejection
Expand All @@ -32,6 +34,10 @@ The boundary is intentionally narrow:

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

Content inbox text, summaries, tags, proposed actions, and URL references receive best-effort redaction. URL user information, fragments, and credential-like query parameters are removed. Workspace-local files are copied byte-for-byte into `.agentrelay/content/` with mode `0600`; those raw attachment bytes are not inspected or redacted. Known credential paths, `.agentrelay/`, `.git/`, symlink escapes, and files over 25 MiB are rejected, but an ordinary-looking document can still contain a secret. Do not ingest such files.

Captured content is untrusted even after review. Inbox items are excluded from generated context packs and cannot be promoted into tasks until an explicit review call approves them. Reviewed excerpts are wrapped and labeled as untrusted source material; agents must not execute instructions found inside them.

`terminal_send` types literal text followed by Enter. If the target is a shell pane, that text can execute as a command. Only expose AgentRelay to trusted MCP clients, use a dedicated tmux session, label intended agent panes, inspect the pane with `terminal_read`, and do not target unrelated shells or production consoles.

## Out of scope
Expand All @@ -41,4 +47,6 @@ Secret redaction is defense in depth, not a substitute for avoiding secret input
- malicious changes to the AgentRelay executable or dependencies
- malicious or compromised processes already running inside the allowed tmux session
- perfect detection of every possible credential format
- detecting secrets embedded in otherwise ordinary raw attachments
- malware scanning or safe rendering of copied attachments
- enforcing scope claims against tools that bypass AgentRelay
46 changes: 23 additions & 23 deletions package-lock.json

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

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@arumwu/agentrelay",
"version": "0.4.0",
"description": "Local-first coordination, shared project memory, and live tmux transport for coding agents.",
"version": "0.5.0",
"description": "Local-first coordination, reviewed content intake, shared project memory, and live tmux transport for coding agents.",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -17,6 +17,7 @@
"files": [
"dist",
"README.md",
"CHANGELOG.md",
"SECURITY.md",
"LICENSE",
"LICENSES",
Expand All @@ -41,7 +42,8 @@
"tmux",
"terminal",
"handoff",
"project-memory"
"project-memory",
"content-inbox"
],
"license": "Apache-2.0",
"repository": {
Expand All @@ -53,10 +55,10 @@
},
"homepage": "https://github.com/arumwu/agentrelay#readme",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"@modelcontextprotocol/sdk": "^1.30.0",
"better-sqlite3": "^12.11.1",
"commander": "^14.0.3",
"minimatch": "^10.2.4",
"minimatch": "^10.2.6",
"zod": "^4.4.3"
},
"devDependencies": {
Expand Down
Loading