← Back to Plugins
Channels

Remote Lucius Agent

daddyclint82 By daddyclint82 👁 36 views ▲ 0 votes

TypeScript OpenClaw plugin bridging Discord to local OpenClaw for remote task delegation and sub-agent spawning

GitHub

Install

npm install

#

README

# Sophos Phone Extension

HTTP bridge server for Galaxy S24 to communicate with OpenClaw.

## What This Does

Simple Express/Fastify server that:
- Serves a mobile-optimized chat UI
- Accepts messages from phone browser
- Forwards to OpenClaw Gateway (via WebSocket)
- Returns responses to phone

## Easy Start (One-Click)

### Start Everything

Double-click `start_phone_extension.bat` on your desktop:

```
1. Checks WSL2 is running
2. Starts OpenClaw Gateway
3. Starts HTTP bridge server
4. Starts Tailscale Serve
5. Opens browser to https://sophos.tail823eab.ts.net/
```

**Setup:** Copy `start_phone_extension.bat` to your Windows desktop.

### Stop Everything

Double-click `stop_phone_extension.bat` on your desktop:

```
1. Stops OpenClaw Gateway
2. Stops HTTP bridge server
3. Stops Tailscale Serve
```

**Setup:** Copy `stop_phone_extension.bat` to your Windows desktop.

### systemd Service (Auto-Start)

```bash
# Copy service file
cp sophos-phone-extension.service ~/.config/systemd/user/

# Enable and start
systemctl --user daemon-reload
systemctl --user enable sophos-phone-extension
systemctl --user start sophos-phone-extension
```

This auto-starts the HTTP bridge on WSL2 boot.

### Stop systemd Service

```bash
systemctl --user stop sophos-phone-extension
systemctl --user disable sophos-phone-extension
```

## Quick Start

```bash
# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env if needed (default port 3000)

# Build TypeScript
npm run build

# Start server
npm start

# Or dev mode (auto-reload)
npm run dev
```

## Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | Mobile chat UI |
| `/health` | GET | Server status |
| `/chat` | POST | Send message, get response |

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `PORT` | `3000` | Server port |
| `HOST` | `0.0.0.0` | Bind address |
| `OPENCLAW_URL` | - | Gateway WebSocket URL |
| `OPENCLAW_TOKEN` | - | Gateway auth token |

## Project Structure

```
remote-lucius-agent/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ server.ts           # Entry point
โ”‚   โ””โ”€โ”€ routes/
โ”‚       โ”œโ”€โ”€ health.ts       # Status endpoint
โ”‚       โ””โ”€โ”€ chat.ts         # Message handling
โ”œโ”€โ”€ .env                    # Runtime config
โ”œโ”€โ”€ .env.example            # Template
โ”œโ”€โ”€ package.json            # Dependencies
โ””โ”€โ”€ tsconfig.json         # TypeScript config
```

## Architecture

This server runs **independently** from OpenClaw:
- Own HTTP server (port 3000)
- Connects to OpenClaw Gateway via WebSocket
- Acts as client, not part of OpenClaw core

## Connection Chain

```
Galaxy S24 (Browser)
  โ†“ HTTP
Tailscale VPN
  โ†“
This Server (WSL2, port 3000)
  โ†“ WebSocket
OpenClaw Gateway (localhost:18789)
  โ†“
Sophos Agent
```

## Status

- โœ… HTTP server running
- โœ… Mobile UI styled
- โš ๏ธ WebSocket to OpenClaw not yet connected (echo mode)
- โš ๏ธ Requires manual auth/token setup

## Notes

- Server must bind to `0.0.0.0` (not localhost) for Tailscale access
- WSL2 firewall may block inbound connections
- See `../PHONE_EXTENSION_SETUP.md` for full system setup

## Dependencies

- `fastify` โ€” HTTP server
- `dotenv` โ€” Environment variables
- `typescript` โ€” Type checking
- `tsx` โ€” Dev mode (no build step)
channels

Comments

Sign in to leave a comment

Loading comments...