npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

talrtc-openclaw-plugin

v1.1.3

Published

OpenClaw 插件,通过 WebSocket 连接 TalRTC 实时通信服务,为 OpenClaw 提供 RTC 流接入能力。

Readme

TalRTC Openclaw Channel

OpenClaw 插件,通过 WebSocket 连接 TalRTC 实时通信服务,为 OpenClaw 提供 RTC 流接入能力。

配置步骤

# 1. 安装插件
openclaw plugins install talrtc-openclaw-plugin

# 2. 添加 TalRTC channel
openclaw channels add --channel talrtc

# 3. 创建 TalRTC 专用 agent
openclaw agents add talrtc-agent --workspace ~/.openclaw/workspace-talrtc

# 4. 绑定 agent 到 channel(路由配置核心)
openclaw agents bind --agent talrtc-agent --bind talrtc

# 5. 启用 agent 间通信
openclaw config set tools.agentToAgent.enabled true --strict-json
openclaw config set tools.sessions.visibility all
openclaw config set channels.talrtc.appId <rtc_appid>
openclaw config set channels.talrtc.secret <rtc_secret>

功能特性

  • WebSocket 连接: 通过 WebSocket 与 TalRTC 服务建立双向通信
  • 多账号支持: 支持配置多个 TalRTC 账号
  • 多媒体消息: 支持文本、图片、音频消息的收发
  • 群组与私聊: 同时支持群组消息和私聊消息处理
  • 会话管理: 自动管理会话状态和消息记录
  • 安全策略: 支持 DM 安全策略和配对机制

TalRTC 提示词示例

以下是能触发 talrtc_tools 工具的提示词示例。

加入房间

  • 帮我加入 TalRTC 房间 <rid>,我的 uid 是 <uid>
  • 以用户 <uid> 身份加入房间 <rid>
  • join talrtc room <rid> as uid <uid>
  • 加入 TalRTC 房间 <rid>,uid 用 <uid>
  • 加入 TalRTC 房间 <rid>(uid 自动生成)
  • join talrtc room <rid>

订阅流

  • 订阅房间 <rid> 中用户 <uid> 的视频流
  • 帮我订阅 uid <uid> 在房间 <rid> 的音视频流
  • subscribe to video from uid <uid> in room <rid>
  • 只订阅房间 <rid><uid> 的音频
  • 订阅房间 <rid><uid> 的视频流,持续 5 分钟
  • subscribe to uid <uid> in room <rid> for 3 minutes

取消订阅

  • 取消订阅房间 <rid> 中用户 <uid> 的流
  • 停止接收 uid <uid> 在房间 <rid> 的流
  • unsubscribe from uid <uid> in room <rid>

发送文本消息

  • 在房间 <rid> 中以用户 <uid> 的身份发送消息"你好"
  • 帮我发一条消息到房间 <rid>,内容是"Hello",uid 用 <uid>
  • send text "Hello" to room <rid> as uid <uid>
  • 读取最近 60 秒的缓存并发送消息到房间 <rid>

发送消息(透传通道)

  • 在房间 <rid> 中给用户 <uid> 透传消息"你好"
  • 帮我通过 message 通道发送 {"type":"command","data":"stop"} 到房间 <rid> 的用户 <uid>
  • send message "status update" to user <uid> in room <rid>
  • 向房间 <rid> 中的用户 <uid> 推送消息,内容是"processing done"

send_message 是一个消息透传通道,通过 Reply(contentType=message)将内容直接推送给指定用户(uid),不经过文本聊天通道。

向指定会话发送消息(send_to_session)

  • 向会话 agent:talrtc-agent:talrtc:direct:740523-message 发送消息"你好"
  • 帮我给 sessionKey 为 <session_key> 的会话发一条消息"处理完成"
  • send message "hello" to session <session_key>
  • 向指定会话推送文本"状态更新"

send_to_session 向指定 sessionKey 的会话发送纯文本消息,由 AI agent 处理。允许自定义 sessionKey,适用于精确控制会话路由。仅支持纯文本,不处理媒体。

发送音频

  • 发送指定音频到房间 <rid>,音频文件地址是 <url>,uid 是 <uid>
  • send audio file to room <rid> as uid <uid>, audio file <url>

截图(take_snapshot)

  • 对房间 <rid> 中用户 <targetUid> 的视频流截图
  • 截取 uid <targetUid> 在房间 <rid> 的视频画面
  • take a snapshot of uid <targetUid> in room <rid>
  • 对房间 <rid> 中的 <targetUid> 截图,超时 10 秒

离开房间

  • 离开当前 TalRTC 房间
  • 断开 TalRTC 连接
  • leave talrtc room
  • 退出 TalRTC

组合操作示例

  • 帮我加入 TalRTC 房间 <rid>(uid: <uid>),然后订阅 uid <uid> 的视频流
  • 先查询 TalRTC 状态,如果已连接就发送消息"测试"到房间 <rid>
  • 订阅完成后发送一条文字消息,内容是"我来了"
  • 加入房间后对 uid <targetUid> 截图

Gateway Method

插件同时注册了 Gateway Method,可通过 openclaw gateway call 直接调用,无需经过 LLM 工具链。

调用格式

openclaw gateway call <method> --params '<JSON>'

可用方法

| 方法 | 必填参数 | 说明 | |------|----------|------| | talrtc.join | rid | 加入房间(uid 可选,不提供则自动生成) | | talrtc.sub | rid, uid | 订阅流(可选: kind, duration) | | talrtc.unsub | rid, uid | 取消订阅(可选: kind) | | talrtc.leave | rid | 离开房间 | | talrtc.send_text | rid, message | 发送文本消息 | | talrtc.send_message | rid, uid, message | 发送透传消息 | | talrtc.send_audio | rid, url | 发送音频(可选: uid) | | talrtc.take_snapshot | rid, targetUid | 视频截图(可选: timeout) | | talrtc.send_to_session | message, sessionKey | 向指定会话发送消息 | | talrtc.status | — | 查询状态 |

调用示例

# 加入房间(指定 uid)
openclaw gateway call talrtc.join --params '{"rid":"123456","uid":"237284"}'

# 加入房间(uid 自动生成)
openclaw gateway call talrtc.join --params '{"rid":"123456"}'

# 订阅视频流
openclaw gateway call talrtc.sub --params '{"rid":"123456","uid":"237284","kind":"video"}'

# 视频截图
openclaw gateway call talrtc.take_snapshot --params '{"rid":"123456","targetUid":"237284"}'

# 发送文本消息
openclaw gateway call talrtc.send_text --params '{"rid":"123456","message":"hello"}'

# 发送透传消息
openclaw gateway call talrtc.send_message --params '{"rid":"123456","uid":"237284","message":"ping"}'

# 向指定会话发送消息
openclaw gateway call talrtc.send_to_session --params '{"message":"hello","sessionKey":"agent:talrtc-agent:talrtc:direct:740523-message"}'

# 发送音频
openclaw gateway call talrtc.send_audio --params '{"rid":"123456","url":"https://example.com/audio.mp3"}'

# 取消订阅
openclaw gateway call talrtc.unsub --params '{"rid":"123456","uid":"237284"}'

# 离开房间
openclaw gateway call talrtc.leave --params '{"rid":"123456"}'

# 查询状态
openclaw gateway call talrtc.status

TalRTC 内容识别 Session

Session Key

  • 文本消息(含 ASR 解析音频后的文本):agent:<agent_name>:talrtc:direct:<uid>-message

  • 其他类型(音视频流):agent:<agent_name>:talrtc:direct:<uid>

  • <agent_name> 在配置agent的时候定义

  • contentType === "text" 时,sessionKey 会自动拼接 -message 后缀,用于区分文本聊天(包括 ASR 语音转文字)与音视频流的会话

获取视频流摘要示例

  • 使用 sessions_history 获取 agent:<agent_name>:talrtc:direct:<uid> 最新的10条消息摘要

获取文本消息摘要示例

  • 使用 sessions_history 获取 agent:<agent_name>:talrtc:direct:<uid>-message 最新的10条消息摘要

配置说明

channels:
  talrtc:
    token: "your-token-here"
    allowFrom:
      - "user-id-1"
      - "user-id-2"
    dmPolicy: "pairing"

配置项

| 字段 | 说明 | 必填 | |------|------|------| | asrConfig / ttsConfig | ASR/TTS 的 JSON 配置字符串,连接后首帧 Config(0x03) 发往桥接;协议上均为可选,未配置时插件侧可用 "{}" | 否 | | allowFrom | 允许发消息的用户 ID 列表 | 否 | | dmPolicy | 私聊策略,可选 pairingallowlist | 否 |

多账号配置

channels:
  talrtc:
    accounts:
      account-1:
        token: "token-1"
        dmPolicy: "pairing"
      account-2:
        token: "token-2"
        allowFrom:
          - "user-a"
        dmPolicy: "allowlist"

安装

npm install talrtc

依赖

  • openclaw: ^2026.3.28
  • ws: ^8.20.0

开发

# 构建
npm run build

# 开发模式(监听文件变化)
npm run dev