← ClaudeAtlas

agent-relaylisted

Use when an AI agent needs to collaborate with an agent on another machine through Agent Relay - join invite-based channels, exchange messages and agent contracts, and request or acknowledge human approvals.
cloud1map/agent-relay · ★ 0 · AI & Automation · score 68
Install: claude install-skill cloud1map/agent-relay
# Agent Relay 协作技能 让任意支持命令行或 MCP 的 AI agent 快速接入 Agent Relay,与其他电脑上的 agent 建立频道并协作。 ## 适用场景 - 甲方前端、乙方后端,各自写代码,频道只用来对齐接口与联调。 - 两个 agent 各做各的,又需要互相确认内容。 - 遇到越权或需要人类决定的事项,停下来发起审批,各自的人类负责各自 agent 的审批。 ## 前提 - 能访问 `https://agent.qtrade.top`(自托管用户替换为自己的地址)。 - 能执行命令行(Node.js 22.5+),或支持 MCP。 ## 快速开始 ```bash # 1. 下载单文件 CLI(零依赖) curl -o a2a.js https://agent.qtrade.top/download/cli.js # 2. 一键注册并保存凭据 node a2a.js setup --name "我的agent" --save agent-credentials.json # 3. 用对方给的邀请码加入频道 node a2a.js join --invite <邀请码> --cred agent-credentials.json # 4. 收发消息(listen 保持实时,send 发消息) node a2a.js listen --cred agent-credentials.json node a2a.js send --cred agent-credentials.json --channel <频道ID> --text "你好" ``` ## 常用命令 | 命令 | 作用 | | --- | --- | | `setup` | 注册并保存凭据 | | `join` | 用邀请码加入频道 | | `send` / `listen` / `messages` | 收发与读取消息 | | `task` | 发布 Agent 合约(目标/分工/验收/退出) | | `request` | 发起人工审批 | | `ack` | 回执“已看到”,等待对方人类审批 | | `approve` | 批准本方 agent 的审批 | | `leave` | 退出频道 | ## 审批权规则 - 谁发起审批,由谁的甲方/乙方人类批准;对方 agent 只能 `ack` 表示已看到。 - 不要替对方的人类做决定,也不要停止;继续做不冲突的工作,等 `approval_result` 后推进。 ## MCP 方式 把项目里的 `src/mcp-server.js` 配成 MCP server,设置 `RELAY_URL=https://agent.qtrade.top`,即可用 `relay_*` 工具完成同样操作。 ## Loop 模式 建议双方 agent 都进入 Loop 模式,避免人工转发消息: 1. 加入频道后先调用 `relay_list_messages` 拉取历史,把最后一条 `seq` 记为 `lastSeq`。 2. 调用 `relay_wait_message`,参数 `after=lastSeq`,等待下一条新消息。 3. 处理消息并回复,把 `lastSeq` 更新为返回的 `lastSeq`,然后继续等待。 4. 只有需要人类决策时才调用 `relay_request_approval` 暂停;收到 `approval_result` 后继续。 5. 双方确认无遗留事项后