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

@bsbofmusic/cdper-plugin-doubao

v1.1.1

Published

Doubao runtime plugin for cdper — requires cdp-bridge + Tailscale

Readme

@bsbofmusic/cdper-plugin-doubao

CDP-controlled Doubao (豆包) for AI agents — through a remote Chrome browser via cdp-bridge + Tailscale.

⚠️ FOR LEARNING PURPOSES ONLY | 仅供学习研究使用 使用本工具即表示您同意自行承担所有合规风险。


工作原理

你的 Agent
  ↓ CDP_WS (Tailscale 内网)
  ↓ 远程 Chrome(已登录豆包)
  ↓ CDP Protocol
  ↓ AI 回复内容
你的 Agent
  • 无需豆包 API Key
  • 通过 CDP 控制真实浏览器,获取与网页版完全一致的回复
  • 专家模式可输出超长深度回答(单次可达 8000+ 字)

前置要求

| 要求 | 说明 | |------|------| | cdp-bridge | CDP 桥接服务,必须已在远程机器上运行 | | Tailscale | 两台机器必须在同一 Tailscale 网络下 | | Node.js >= 18 | 运行环境 | | 豆包已登录 | ⚠️ 远程 Chrome 必须已登录豆包账号(CDP 能控制的前提是浏览器处于已登录状态) |


安装

npm install @bsbofmusic/cdper-plugin-doubao

安装后自动运行环境预检(npm run postinstall),看到 ✅ 环境就绪 即可使用。


配置

第一步:获取 CDP WebSocket 地址

在运行 cdp-bridge 的远程机器上,启动浏览器后获取 WS 地址,例如:

ws://<Tailscale_IP>:<端口>/devtools/browser?token=<你的token>

详细步骤参考 cdp-bridge 文档

第二步:配置连接信息

支持两种方式,优先级:CDP_WS 环境变量 > tools/cdp-auth.json

export CDP_WS="ws://<Tailscale_IP>:<端口>/devtools/browser?token=<你的token>"

或在当前项目写入 tools/cdp-auth.json

{ "ws_url": "ws://<Tailscale_IP>:<端口>/devtools/browser?token=<你的token>" }

永久生效(Linux/macOS):

echo 'export CDP_WS="ws://<Tailscale_IP>:<端口>/devtools/browser?token=<你的token>"' >> ~/.bashrc
source ~/.bashrc

快速开始

预检环境

cdp-doubao check

输出示例:

🔍 cdp-doubao 环境检测

✅ Node.js >= 18            v22.2.1
✅ CDP_WS 环境变量已设置      ws://<Tailscale_IP>:<端口>/devtools/...
✅ CDP Bridge 网络可达        200 OK
✅ CDP Browser 运行中         running
✅ 系统平台兼容               linux x64

✅ 环境就绪!

查询豆包

# 仅支持专家模式(推荐,内容最丰富)
cdp-doubao query "分析一下新能源汽车市场"

# 日志控制
cdp-doubao query "分析一下新能源汽车市场" --quiet
cdp-doubao query "分析一下新能源汽车市场" --debug

会话多轮(实验性)

# 建立会话上下文
cdp-doubao query "我想了解投资理财" --session finance

# 复用同一会话,自动携带上下文
cdp-doubao query "有哪些具体产品" --session finance
cdp-doubao query "风险如何" --session finance

会话管理

# 列出所有豆包活跃会话
cdp-doubao session

当前 CLI 仅支持查看活跃会话;过期会话会自动清理。


环境变量

| 变量 | 必填 | 默认值 | 说明 | |------|------|--------|------| | CDP_WS | ✅ | — | CDP WebSocket 地址 | | LOG_LEVEL | ❌ | info | 日志级别:error warn info debug | | QUIET | ❌ | 0 | 设为 1 仅保留错误输出 | | DEBUG | ❌ | 0 | 设为 1 打开调试日志 |


Agent 集成

OpenClaw

安装后在 ~/.openclaw/openclaw.json 添加:

{
  "skills": {
    "entries": {
      "cdp-doubao": {
        "env": {
          "CDP_WS": "ws://<Tailscale_IP>:<端口>/devtools/browser?token=<你的token>"
        }
      }
    }
  }
}

重启 gateway 后,Agent 自动识别触发词:CDP 豆包CDP doubao和豆包说 等。

其他 MCP Agent

通过 CLI 调用或直接 import:

const { queryDoubao } = require('@bsbofmusic/cdp-doubao/src/doubao');
const result = await queryDoubao('你的问题', { mode: 'expert' });
console.log(result.content);

故障排除

cdp-doubao check 显示 CDP_WS 未设置

export CDP_WS="ws://<Tailscale_IP>:<端口>/devtools/browser?token=<token>"

Connection refused / ECONNREFUSED

  1. 确认 cdp-bridge 服务正在运行
  2. 确认 Tailscale 已连接且两台机器可以互通
  3. 检查防火墙是否放行了对应端口

页面变成手机模式

通常是 CDP session 残留 viewport 导致,重启 cdp-bridge 的浏览器实例:

curl -X POST "http://<CDP_IP>:<PORT>/control/start?token=<TOKEN>&mode=advanced&profile=Default"

豆包只重复问题不生成内容

检查操作顺序:新建对话 → 切换模式 → 输入问题。顺序错了模式会被刷新重置,导致只重复输入内容。

专家模式找不到

等待时间不足或页面布局变化会导致菜单消失。优先检查登录态、页面稳定性与风控提示;命中验证码/校验时必须转人工接管。


风控命中处理(硬规则)

  • 命中验证码、滑块、人机校验、登录异常、访问过频、平台安全限制提示时,立即停止自动化。
  • 禁止普通重试、禁止并发硬冲、禁止切换平台扩散尝试。
  • 必须转人工接管;恢复前提是人工完成验证并确认风险解除。
  • 返回结果需包含 需要人工接管、平台名、风控信号、建议动作。

模式说明

当前产品口径固定为:仅支持专家模式

| 模式 | 说明 | 推荐场景 | |------|------|---------| | expert | 研究级(默认) | 深度内容、技术报告 |


已知限制

  • ⚠️ 远程 Chrome 必须已登录豆包(未登录时 CDP 能连接但无法操作对话界面)
  • Windows 暂不支持
  • 需要稳定的 Tailscale 网络连接

链接


免责声明

⚠️ 使用本工具即表示您同意自行承担所有合规风险及后果。

  1. 平台使用限制:本工具通过 CDP 控制豆包网页界面,可能违反字节跳动服务条款。
  2. 账号风险:使用本工具可能导致豆包账号被限制或封禁,风险完全由使用者承担。
  3. 测试后处理:使用完毕后请关闭 cdp-bridge 的浏览器实例并清除登录状态,防止未授权访问。
  4. 仅供学习:本工具仅用于技术研究和个人学习,不得用于商业目的或任何批量自动化行为。

作者不对任何使用后果负责,包括但不限于账号封禁、服务限制、数据泄露。

许可证

MIT License