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

@tng/teambition-openclaw-connector

v0.0.5

Published

Teambition messaging channel plugin for OpenClaw — WebSocket connection with streaming support, session management, and media upload

Readme

Teambition OpenClaw Connector

Teambition 接入 OpenClaw,让 AI Agent 通过任务评论与用户实时对话。

License: MIT

特性

| | | |---|---| | 💬 实时流式对话 | 基于 WebSocket,打字机效果逐字输出 | | 🎯 会话隔离 | 基于 threadId 独立管理上下文,支持多轮对话 | | ⚡ AG-UI 协议 | 标准 RunAgentInput 格式,与 Teambition AI 服务无缝对接 | | 🔄 自动重连 | 指数退避 + 随机抖动,断线自动恢复 |


快速开始

1. 获取机器人 Token

  1. 安装 数字员工管理平台应用
  2. 创建数字员工
  3. 复制 数字员工 Token

💡 重要:此 Token 将同时用于 teambition-openclaw-connectordingtalk-teambition,只需配置一次即可。

2. 安装插件

openclaw plugins install @tng/teambition-openclaw-connector

3. 配置 Connector

编辑 ~/.openclaw/openclaw.json

{
  "channels": {
    "teambition-openclaw-connector": {
      "token": "YOUR_BOT_TOKEN"
    }
  }
}

4. 安装 Teambition Skills

安装 dingtalk-teambition,让 AI Agent 具备操作 Teambition 项目和任务的能力。

配置 Token(与 Connector 使用相同的 Token)

方式 1:环境变量

export TEAMBITION_USER_TOKEN="YOUR_BOT_TOKEN"

方式 2:写入 Claw 配置文件(~/.openclaw/openclaw.json)

{
  "skills": {
    "entries": {
      "dingtalk-teambition": {
        "enabled": true,
        "env": { "TEAMBITION_USER_TOKEN": "YOUR_BOT_TOKEN" }
      }
    }
  }
}

5. 启动并验证

重启 Gateway:

openclaw gateway restart
openclaw plugins list   # 验证插件已加载

在 Teambition 任务中 @ 机器人即可开始对话 🎉


配置项

| 配置项 | 类型 | 必填 | 默认值 | 说明 | |--------|------|:----:|--------|------| | token | string | ✅ | — | Teambition 数字员工 Token | | wsUrl | string | — | wss://ai.teambition.net/api/ai-agent/chatbot/websocket | AG-UI WebSocket 端点 |


技术架构

核心模块

| 文件 | 职责 | |------|------| | index.ts | 插件入口,注册 channel、tool、hooks | | src/channel.ts | OpenClaw channel 接口实现与消息路由 | | src/ws-client.ts | WebSocket 连接管理、重连、心跳 | | src/agui-handler.ts | 解析 RunAgentInput,调用 Agent,返回事件流 | | src/agui-session-store.ts | AG-UI 会话状态管理 | | src/agui-tool-hooks.ts | 拦截 tool call,注入 AG-UI 上下文 |

AG-UI 事件流

服务端下发 RunAgentInput,插件调用 OpenClaw Agent 后返回标准事件序列:

RUN_STARTED → TEXT_MESSAGE_START → TEXT_MESSAGE_CONTENT → TEXT_MESSAGE_END → RUN_FINISHED

入站消息示例(RunAgentInput):

{
  "threadId": "session-001",
  "runId": "run-abc",
  "messages": [{ "id": "msg-001", "role": "user", "content": "你好" }],
  "tools": []
}

WebSocket 连接

  • 认证:Bearer Token(HTTP Header)
  • 端点wss://ai.teambition.net/api/ai-agent/chatbot/websocket
  • 重连:指数退避 + 随机抖动
  • 心跳:自动 ping/pong 监控

常见问题

机器人不回复消息?

  1. 确认消息中已 @ 机器人
  2. 检查 OpenClaw 日志是否有报错
  3. 确认 Token 正确且未过期

Token 过期了怎么办?Teambition 开放平台 刷新 Token,更新配置后执行 openclaw gateway restart 即可。


贡献指南

欢迎提交 Issue 和 Pull Request!提交 PR 前请确保:

  1. npm run lint 无错误
  2. npm test 所有用例通过
  3. 新功能附带对应测试用例

相关链接

License

MIT