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

@lansenger/openclaw-channel-lansenger

v1.1.32

Published

蓝信机器人插件 - 让 AI 助手接入蓝信,无需服务器 | Lanxin channel plugin for OpenClaw

Readme

Lansenger (蓝信) 通道插件 for OpenClaw

通过 WebSocket 长连接连接 Lansenger 机器人。

功能特性

  • WebSocket 长连接实现实时消息传递
  • 多账号支持
  • 不同机器人的路由管理
  • 基于会话的隔离

OpenClaw 版本兼容性说明

OpenClaw 从 2026.4.x 升级到 2026.5.x 后,channels add 等 CLI 命令的 channel 发现机制发生了变更,对插件造成了以下影响:

影响说明

| 变化 | 影响 | 说明 | | -------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------- | | channel 发现范围缩小 | channels add 命令不再自动扫描 npm 安装的插件 | 通过 openclaw plugins install 安装的插件无法被 channels add 命令发现,会报错 Unknown channel: Lansenger | | 需手动准备插件路径 | 插件需要放在 extensions/ 目录才能被 CLI 命令识别 | 将 npm 安装的插件文件复制到 extensions/openclaw-lansenger/ 目录即可 | | Plugin SDK 变化 | OpenClaw plugin SDK not found, using fallback 为正常提示 | 不影响功能,插件使用内置 fallback 机制正常运行 |

受影响的命令

  • openclaw channels add --channel Lansenger需先将插件放入 extensions 目录
  • openclaw channels update — 同上
  • openclaw plugins install — 正常,但安装后需手动复制到 extensions

当前解决方案

# 1. 安装插件
openclaw plugins install @lansenger/openclaw-channel-lansenger

# 2. 复制到 extensions 目录(解决 CLI 命令无法发现插件的问题)
cp -r ~/.openclaw/npm/node_modules/@lansenger/openclaw-channel-lansenger/* \
     ~/.openclaw/extensions/openclaw-lansenger/

# 3. 重启网关使配置加载
openclaw gateway restart

# 4. 现在可以正常使用 channels add 命令
openclaw channels add --channel Lansenger --token "AppID:AppSecret:APIGateway"

此问题是 OpenClaw 上游 bug,非插件本身问题。相关 Issue 模板已提供在插件日志目录中。

安装

通过 OpenClaw CLI 安装(推荐)

# 安装 Lansenger 通道插件
openclaw plugins install @lansenger/openclaw-channel-lansenger

使用

添加 AppId 命令

您可以使用命令行添加 Lansenger 机器人账号:

openclaw channels add --channel Lansenger --token "{AppID}:{AppSecret}:{APIGateway}"

参数说明

  • --channel Lansenger:指定通道名称为 Lansenger
  • --token:包含以下信息的令牌(使用 : 分隔字段)
    • {AppID}:蓝信机器人的 AppID
    • {AppSecret}:蓝信机器人的 AppSecret
    • {APIGateway}:(可选) 蓝信 API 网关地址,支持 https/http 协议

使用示例

# 基本格式
openclaw channels add --channel Lansenger --token "123123-123123:ABHCDEFE"

# 指定 API 网关地址
openclaw channels add --channel Lansenger --token "123123-123123:ABHCDEFE:https://gateway.cn"

此命令将:

  1. 解析令牌并提取 AppID、AppSecret、API 网关地址
  2. 在配置文件中自动添加或更新账号信息
  3. 自动启用 Lansenger 通道

注意:使用此命令后,无需手动修改 openclaw.json 配置文件,系统会自动处理所有配置。

通过 OpenClaw Dashboard 修改配置

您也可以通过 OpenClaw 的 Web 管理界面(Dashboard)来管理蓝信插件配置:

# 启动 OpenClaw 网关
openclaw gateway start

# 打开 Dashboard(默认地址)
openclaw dashboard
# 或在浏览器中访问: http://localhost:18789

在 Dashboard 中配置蓝信插件

  1. 登录 Dashboard 后,点击左侧菜单的 Channels
  2. 在通道列表中找到 Lansenger,点击进入
  3. 选择要修改的账号,或点击 Add Account 添加新账号
  4. 在配置表单中修改各项设置(如 appId、appSecret、群聊设置等)
  5. 点击 Save 保存配置

支持在 Dashboard 中修改的配置项

  • App ID 和 App Secret
  • API 网关地址
  • 群聊响应策略(ownerOnly/atMe/all)
  • 是否响应 @全体成员消息
  • 上下文消息条数
  • 高危操作审批设置

命令无法使用时的手动配置

重要提示:如果执行 openclaw channels add --channel Lansenger 命令时出现 Unknown channel: Lansenger 错误,这是因为当前 OpenClaw 版本的 bug(npm 安装的插件无法被 channels add 命令发现)。此时需要手动配置 OpenClaw。

临时解决方案

将插件源码手动复制到 extensions 目录:

cp -r ~/.openclaw/npm/node_modules/@lansenger/openclaw-channel-lansenger/* \
     ~/.openclaw/extensions/openclaw-lansenger/

再执行:

openclaw channels add --channel Lansenger --token "123123-123123:ABHCDEFE:https://gateway.cn"

如执行命令时出现 Unknown channel: Lansenger 错误,需要手动编辑配置文件

手动编辑配置文件

如果您需要手动配置,请按照以下格式编辑 ~/.openclaw/openclaw.json 文件:

1. 添加插件配置

plugins 部分添加:

{
  "plugins": {
    "enabled": true,
    "allow": [
      "openclaw-channel-lansenger"
    ],
    "entries": {
      "openclaw-channel-lansenger": {
        "enabled": true
      }
    },
    "bundledDiscovery": "compat"
  }
}

2. 添加通道配置

channels 部分添加:

{
  "channels": {
    "Lansenger": {
      "enabled": true,
      "accounts": {
        "default": {
          "enabled": true,
          "appId": "your-app-id-here",
          "appSecret": "your-app-secret-here",
          "apiGatewayUrl": "https://your-api-gateway.com",
          "approval": {
            "enabled": true,
            "highRiskTools": "write,delete,trash,rm"
          }
        }
      }
    }
  }
}

如需Agent隔离功能,需在bindings中添加配置:


"bindings": [
     {
       "type": "route",
       "agentId": "coder",
       "match": { "channel": "Lansenger", "accountId": "bot_15294464" }
     },
     {
       "type": "route",
       "agentId": "friend",
       "match": { "channel": "Lansenger", "accountId": "bot_11100160" }
     }
   ]

3. 配置参数说明

| 参数 | 说明 | 示例值 | | ------------------------ | ---------------- | ------------------------------ | | appId | 蓝信机器人的 AppID | 123456-789012 | | appSecret | 蓝信机器人的 AppSecret | ABCDEF123456789 | | apiGatewayUrl | 蓝信 API 网关地址 | https://apigw.lx.qianxin.com | | approval.enabled | 是否开启高危操作审批 | truefalse | | approval.highRiskTools | 高危操作工具列表(逗号分隔) | write,delete,trash,rm |

4. 环境变量配置(推荐)

插件支持通过环境变量配置凭证,优先级高于配置文件:

| 环境变量 | 说明 | 示例值 | | ---------------------- | ---------------- | ----------------- | | LANSENGER_APP_ID | 蓝信机器人的 AppID | 123456-789012 | | LANSENGER_APP_SECRET | 蓝信机器人的 AppSecret | ABCDEF123456789 |

使用示例

# 设置环境变量
export LANSENGER_APP_ID="123456-789012"
export LANSENGER_APP_SECRET="ABCDEF123456789"

# 启动 OpenClaw
openclaw gateway start

注意:环境变量配置仅适用于单账号场景。如需多账号管理,请使用配置文件方式。

5. 重启 OpenClaw

配置完成后,重启 OpenClaw 使配置生效:

openclaw gateway restart

Agent 隔离功能

Lansenger 插件支持每个 appId 与单独的 agent 绑定,实现独立的通信和会话管理:

实现效果

  • 不同的蓝信机器人(appId)可以绑定到不同的 OpenClaw agent
  • 每个 agent 拥有独立的会话上下文和工作区
  • 消息会自动路由到对应绑定的 agent
  • 支持多机器人同时运行,互不干扰

配置方式

  1. 添加多个账号:
    openclaw channels add --channel Lansenger --token "{AppID}:{AppSecret}:{APIGateway}"
  2. openclaw.json 的绑定配置中设置 agentId:
    "bindings": [
      {
        "type": "route",
        "agentId": "coder",
        "match": { "channel": "Lansenger", "accountId": "bot_xxx" }
      }
    ]

系统会自动在配置文件中生成绑定关系:

"bindings": [
     {
       "type": "route",
       "agentId": "coder",
       "match": { "channel": "Lansenger", "accountId": "bot_15294464" }
     },
     {
       "type": "route",
       "agentId": "friend",
       "match": { "channel": "Lansenger", "accountId": "bot_11100160" }
     }
   ]

使用示例

  • 机器人 A (appId: your-app-id-1) 绑定到 agent: friend
  • 机器人 B (appId: your-app-id-2) 绑定到 agent: coder
  • 两个机器人可以同时运行,拥有独立的会话和上下文

配置文件完整示例

以下是一个完整的 OpenClaw 配置文件示例,包含 Lansenger 插件的配置:

{
  "plugins": {
    "enabled": true,
    "allow": [
      "memory-core",
      "openclaw-channel-lansenger"
    ],
    "load": {
      "paths": [
        "~/.openclaw/extensions"
      ]
    },
    "entries": {
      "openclaw-channel-lansenger": {
        "enabled": true
      }
    },
    "bundledDiscovery": "compat"
  },
  "channels": {
    "telegram": {
      "enabled": true
    },
    "Lansenger": {
      "enabled": true,
      "accounts": {
        "default": {
          "enabled": true,
          "appId": "2285568-8700160",
          "appSecret": "FD42BF3227A03AA22AC621829AD2711C",
          "apiGatewayUrl": "https://apigw.lx.qianxin.com",
          "approval": {
            "enabled": true,
            "highRiskTools": "write,delete,trash,rm"
          }
        },
        "bot_8700160": {
          "enabled": true,
          "appId": "2285568-8700160",
          "appSecret": "FD42BF3227A03AA22AC621829AD2711C",
          "apiGatewayUrl": "https://apigw.lx.qianxin.com",
          "agentId": "coder",
          "approval": {
            "enabled": true,
            "highRiskTools": "write,delete,trash,rm"
          }
        }
      }
    }
  },
  "bindings": [
    {
      "type": "route",
      "agentId": "coder",
      "match": { "channel": "Lansenger", "accountId": "bot_8700160" }
    }
  ]
}

故障排除

会话隔离

如果您遇到会话隔离问题,请确保:

  1. 您已在 OpenClaw 配置中正确配置了绑定
  2. 每个机器人在配置中使用不同的 accountId
  3. 每个 agent 有自己的工作区

消息路由

如果消息没有路由到正确的 agent:

  1. 检查您的绑定配置
  2. 确保绑定中的 accountId 与通道配置中的 accountId 匹配
  3. 更改配置后重启 OpenClaw

channels add 命令报错 "Unknown channel: Lansenger"

问题描述:执行 openclaw channels add --channel Lansenger 命令时出现错误。

原因:这是 OpenClaw 当前版本的已知 bug。通过 openclaw plugins install 从 npm 安装的插件无法被 channels add 命令发现。

解决方案

  1. 临时方案(推荐):将插件手动复制到 extensions 目录
    cp -r ~/.openclaw/npm/node_modules/@lansenger/openclaw-channel-lansenger/* \
         ~/.openclaw/extensions/openclaw-lansenger/
    openclaw gateway restart
  2. 手动配置:参考上方的"手动编辑配置文件"章节,直接编辑 openclaw.json
  3. 长期方案:向 OpenClaw 官方提交 Issue,等待 bug 修复。

速率限制问题

如果在安装过程中遇到 Rate limit exceeded 错误:

  1. 在短暂延迟后尝试重新安装插件
  2. 如果需要,重复安装过程几次
  3. 速率限制通常是临时的,应该在几分钟内解决

日志

日志可在 OpenClaw 日志目录中找到。查找带有 [Lansenger] 前缀的日志。