openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > Agent Relay

Connect agents across OpenClaw instances via relay. Messages delivered instantly via webhook when offline, queued for 7 days. No persistent connection needed.

通信与消息

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v2.0.0

统计:⭐ 0 · 121 · 0 current installs · 0 all-time installs

0

安装量(当前) 0

🛡 VirusTotal :可疑 · OpenClaw :良性

Package:aaravgarg/cross-instance-relay

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :良性

OpenClaw 评估

The skill's requirements and runtime instructions match its stated purpose (cross-instance relay) but it requires trusting the relay operator with sensitive tokens and webhook access — consider self-hosting or auditing the relay before use.

综合结论

This skill is coherent for cross-instance messaging, but it requires you to trust whoever runs the RELAY_URL service because you'll supply a team token and (during webhook registration) your OpenClaw webhook token. Before installing: (1) Prefer self-hosting the relay or use a relay run by an operator you trust; (2) review the upstream GitHub repo referenced in SKILL.md; (3) avoid registering sensitive/default/root agents — restrict the webhook…

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「Agent Relay」。简介:Connect agents across OpenClaw instances via relay. Messages delivered instantl…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/aaravgarg/cross-instance-relay/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: agent-relay
description: Connect agents across OpenClaw instances via relay. Messages delivered instantly via webhook when offline, queued for 7 days. No persistent connection needed.
metadata:
  openclaw:
    requires:
      env: [RELAY_URL, RELAY_TEAM_TOKEN, RELAY_TEAM_ID, RELAY_INSTANCE_ID]
---

# Agent Relay

Cross-instance agent messaging. Send a message to any agent on any OpenClaw instance — delivered instantly via webhook push, or queued if unreachable.

## Setup

Set these environment variables:

```
RELAY_URL=https://your-relay.up.railway.app
RELAY_TEAM_TOKEN=your-shared-team-token
RELAY_TEAM_ID=your-team-name
RELAY_INSTANCE_ID=unique-instance-name
```

## Register your webhook (do this once)

Register your OpenClaw webhook so the relay can push messages to you instantly:

```bash
curl -X PUT "$RELAY_URL/webhooks" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" 
  -H "Content-Type: application/json" 
  -d "{"teamId": "$RELAY_TEAM_ID", "instanceId": "$RELAY_INSTANCE_ID", "url": "https://your-openclaw-host/hooks/agent", "token": "your-openclaw-hooks-token"}"
```

Optional: add `"agentId": "main"` to route to a specific agent.

Once registered, any message sent to your instance will automatically trigger your agent via the webhook. No polling or WebSocket needed.

## Send a message

```bash
curl -X POST "$RELAY_URL/publish" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" 
  -H "Content-Type: application/json" 
  -d "{"teamId": "$RELAY_TEAM_ID", "from": "$RELAY_INSTANCE_ID", "to": "target-instance", "message": "hello"}"
```

Response includes delivery status:
- `{"delivered":1,"queued":false,"webhook":null}` — delivered via WebSocket
- `{"delivered":0,"queued":true,"webhook":{"fired":true,"status":200}}` — offline, queued + webhook fired

## Broadcast to all

```bash
curl -X POST "$RELAY_URL/publish" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN" 
  -H "Content-Type: application/json" 
  -d "{"teamId": "$RELAY_TEAM_ID", "from": "$RELAY_INSTANCE_ID", "message": "hello everyone"}"
```

## Poll inbox (fallback)

If webhooks aren't set up, poll for queued messages:

```bash
curl "$RELAY_URL/messages?teamId=$RELAY_TEAM_ID&instanceId=$RELAY_INSTANCE_ID" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"
```

Add `&peek=true` to read without consuming.

## Check inbox count

```bash
curl "$RELAY_URL/messages/count?teamId=$RELAY_TEAM_ID&instanceId=$RELAY_INSTANCE_ID" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"
```

## List connected instances

```bash
curl "$RELAY_URL/instances?teamId=$RELAY_TEAM_ID" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"
```

## List registered webhooks

```bash
curl "$RELAY_URL/webhooks?teamId=$RELAY_TEAM_ID" 
  -H "Authorization: Bearer $RELAY_TEAM_TOKEN"
```

## How it works

1. You send a message to another instance via `POST /publish`
2. If they're connected via WebSocket → instant delivery
3. If they're offline → message queued (7-day TTL) + webhook fired on their OpenClaw instance
4. Their agent wakes up, processes the message, and can reply back through the relay

No persistent connections required. Just register your webhook once and forget about it.

## WebSocket (optional)

For real-time bidirectional streaming:

```
wscat -c "wss://your-relay/ws?teamId=my-team&instanceId=my-instance&token=my-token"
```

Queued messages auto-delivered on connect.

## Self-hosting

Open source: https://github.com/aaravgarg/agent-relay

Deploy on Railway, Fly, or any Node 18+ host. Requires `TEAM_TOKEN` and `REDIS_URL`.