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

workbuddy-codeg-bridge

v0.1.0

Published

Bridge WorkBuddy's connector capabilities (Feishu, Tencent Docs, ...) into Codeg as an ACP agent, in real time.

Readme

workbuddy-codeg-bridge

把 WorkBuddy(本机已运行的飞书 / 腾讯文档等连接器)的 Agent 能力,实时桥接成 codeg 的一个 ACP Agent。 在 codeg 里派给这个 agent 的任务,会通过 WorkBuddy 本机 ACP 网关实时执行,绕开自动化的小时级轮询。

这是从两个开源项目借鉴后的独立新实现:

与两者不同的是:面向的不是 Codex,而是 codeg;且只用 Node 内置能力 + 官方 ACP SDK,无 Python、无自写协议重复。


架构

codeg(本机协作工作台)
   │  ACP stdio(ndjson)
   ▼
workbuddy-codeg-bridge  <-- 本仓库
   │  WorkBuddy ACP HTTP + SSE(仅 127.0.0.1)
   ▼
WorkBuddy Remote Gateway  (~/.workbuddy/sessions/*.json 发现)
   ├─ 飞书连接器
   ├─ 腾讯文档连接器
   └─ WorkBuddy 已启用的其他连接器
  • 桥只连本机回环地址的网关,扫描 ~/.workbuddy/sessions/*.json 每次动态发现端口。
  • 桥本身以 ACP Agent 身份向 codeg 提供服务:initialize / session/new / session/prompt / session/cancel。
  • session/prompt 会把文本提示词转发给 WorkBuddy,并把返回流以 agent_message_chunk 回传。

环境要求

  • Windows 11(本实现已验证 win32),Node.js ≥ 20(开发环境 v24)
  • WorkBuddy 已启动,且需要用到的连接器已登录
  • codeg(桌面版)允许注册自定义 agent

安装

cd D:\workbuddy-codeg-bridge
npm install

只读验证(先跑这个)

无需经过 codeg,直接打真实网关做只读查询:

# 检查网关是否可用
node scripts/check-gateway.mjs

# 只读会话验证(默认 deny 任何权限,不发送消息、不改文档)
node scripts/smoke.mjs
# 可用参数指定提示词:
node scripts/smoke.mjs "只读查看你当前可见的腾讯文档标题"

预期输出:✓ 网关 … → ✓ 已连接 → WorkBuddy 返回一段文本。

验证发现 WorkBuddy 不支持 auto 模型,bridge 会自动选用 availableModels 里第一个(如 fast-model);并已排除「/clear 会结束当前 turn」的坑(新会话不做 /clear)。

注册进 codeg(「添加自定义智能体」)

注:codeg 表单不接受 local 分发,只接受 npx / uvx / binary 三种分发通道(distribution_kind 是 ACP 注册表分发对象,与注册表同构)。因此本项目走 npx 通道:先把包发布到 npm,再在表单里粘贴注册信息。

第 1 步:发布到 npm

包名 workbuddy-codeg-bridge 已在官方 registry 确认可用(2026-09 检索)。

cd D:\workbuddy-codeg-bridge

# 1) 先本机跑冒烟,确认网关与桥正常
npm install
node scripts/check-gateway.mjs
node scripts/smoke.mjs

# 2) 登录并发布(发布前会用 prepublishOnly 自动做语法自检)
npm login
npm publish

# 3) 本地验证能通过 npx 拉起来(临时全局安装即可,代码转 on-demand)
npm pack            # 确认 tarball 内容:应含 bin/ 与 src/
npx workbuddy-codeg-bridge  # 应进入 ACP stdio 等待(Ctrl+C 退出)

亮点:package.json 的 bin 名与包名一致,故 codeg 侧 cmd 可省略或与包名同值。

局域网离线环境:可在内网搭 verdaccio 等私有 registry,用 ~/.npmrc 指定,codeg 机器 npm i 时即可解析。

第 2 步:粘贴注册信息

codeg 设置 → 智能体 → 「添加自定义智能体」 → 「直接粘贴其注册表信息」,粘贴:

{
  "registry_id": "workbuddy-codeg-bridge",
  "name": "workbuddy-codeg-bridge",
  "version": "0.1.0",
  "description": "把本机 WorkBuddy 的连接器能力(飞书、腾讯文档等)实时桥接到 codeg,作为一个 ACP agent 使用。默认只读。",
  "distribution_kind": "npx",
  "supports_mcp": false,
  "distribution": {
    "npx": {
      "package": "workbuddy-codeg-bridge",
      "cmd": "workbuddy-codeg-bridge",
      "args": [],
      "env": {},
      "node_required": "20.0.0"
    }
  }
}

要点:

  • distribution_kind 用 npx,codeg 据此调用 npx <package> 拉起本桥作为 ACP stdio 服务。
  • cmd = npm 包安装后的可执行命令名,缺省按包名推导。这里包名与 bin(wb-bridge.js)同名,故 cmd 即包名。
  • 不支持 MCP 转发,故 supports_mcp 一律 false。
  • 粘贴后重启 codeg(或刷新 agent 列表),即可在新对话中选到 workbuddy-codeg-bridge 这个 agent。
  • 完整参考形态见 codeg-agent.example.json。

权限模型(默认只读)

  • 默认 deny:WorkBuddy 发来的任何权限请求一律拒绝,适合查询 / 总结 / 只读。
  • 实测:访问腾讯文档连接器时需要权限时被拒绝并返回 stop_reason=cancelled,说明隔离有效。
  • 未来如需「单次允许发送飞书消息等写操作」,可给 WbRunner.PERMISSION_MODE 增加 allow_once 分支(参考原 workbuddy-acp-bridge 的 allow_once 语义——只选 allow_once,绝不 allow_always)。

已实现 / 已知限制

已实现(实测通过)

  • 动态发现 WorkBuddy 网关(每次重连)
  • 建连 + initialize + session/new + session/prompt(只读)端到端跑通,文本回流 Returned
  • 权限 deny 隔离

限制

  • session/load、session/resume 未实现(codeg 每次新会话)
  • session/cancel 目前为空操作(单轮同步执行)
  • 当前每次 session/prompt 都走全新会话(不跨桥复用历史)
  • 写操作(飞书发消息等)需要额外开启 allow_once,默认不开

声明

本项目仅用于个人学习与效率工具探索,与 WorkBuddy 官方及其团队无隶属 / 授权 / 合作关系。 所用插件如认为侵权,请通过仓库联系,我第一时间下架。