Metadata-Version: 2.4
Name: revia-bridge
Version: 0.1.0
Summary: Standalone, MCP-free realtime bridge daemon for Revia — connect any coding agent to WhatsApp, Telegram, Gmail, and agent-chat over a raw WebSocket.
Author-email: Moussa Mokhtari <me@moussamokhtari.com>
Maintainer-email: Moussa Mokhtari <me@moussamokhtari.com>
License: MIT
Project-URL: Homepage, https://revia.devshub.ai
Project-URL: Repository, https://github.com/ApertaCodex/revia
Project-URL: Issues, https://github.com/ApertaCodex/revia/issues
Keywords: revia,bridge,websocket,whatsapp,telegram,gmail,coding-agent,automation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: websockets>=12
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"

# revia-bridge

[![PyPI](https://img.shields.io/pypi/v/revia-bridge.svg)](https://pypi.org/project/revia-bridge/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Standalone, **MCP-free** realtime bridge plugin for [Revia](https://revia.devshub.ai).
It runs a background daemon that connects directly to Revia's raw WebSocket
(`wss://revia.devshub.ai/api/v1/mcp/ws`), handles real-time inbound events, and
answers bidirectional agent chat by shelling out to a configurable CLI command
(e.g. `codesync ask "{message}"` or `claude -p "{message}"`).

The daemon lifecycle is managed automatically by plugin hooks: `SessionStart`
starts it, `SessionEnd`/`Stop` stop it.

> **Supersedes `revia-mcp`.** The old MCP-based client is deprecated in favor
> of this package, which has zero MCP dependencies, is installable in any
> coding agent (not just MCP-capable ones), and runs as a self-managed
> background daemon rather than a per-session MCP server process.

## Install

### From PyPI

```bash
pip install revia-bridge
revia-bridge init   # interactive one-time setup
revia-bridge run --daemon
```

### CodeSync

```bash
codesync plugin marketplace add /path/to/plugins/revia-bridge
codesync plugin install revia-bridge@revia --scope user
```

### Claude Code

```bash
claude plugin marketplace add /path/to/plugins/revia-bridge
claude plugin install revia-bridge@revia
```

> The marketplace is named `revia`; the plugin is named `revia-bridge`. The
> install spec is therefore `revia-bridge@revia`.

## Configure

Run the interactive initializer:

```bash
revia-bridge init
```

It prompts for:

| Field          | Default                              | Notes                                        |
|----------------|--------------------------------------|----------------------------------------------|
| Agent token    | *(required)*                         | `rvagent_...` from Revia → Settings → Coding Agent |
| Reply command  | `codesync ask "{message}"`           | `{message}` and `{chat_id}` are substituted  |
| Agent name     | `Revia Bridge`                       | Shown in Revia's `agents_list`               |
| WebSocket URL  | `wss://revia.devshub.ai/api/v1/mcp/ws` |                                              |

This writes `~/.codesync/revia-bridge.json` (override with
`REVIA_BRIDGE_CONFIG`). See `SKILL.md` for the full key reference.

## Manual daemon control

```bash
revia-bridge run --daemon   # start detached (PID + log under ~/.codesync)
revia-bridge status         # running? last event time?
revia-bridge stop           # SIGTERM via PID file
```

## Development

```bash
cd plugins/revia-bridge
python -m pytest -q
```

The package is a plain Python project (`pyproject.toml`) with a
`revia-bridge` console-script entry point. It has **zero MCP dependencies** —
only `websockets`.
