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

dsh-codebuddy-code

v0.2.0

Published

CodeBuddy LLM provider bundle for the DeepSeek Harness web GUI: registers the `codebuddy` provider route, its Models-page card, and its model picker entries, authenticating against the machine's CodeBuddy desktop-app login

Readme

dsh-codebuddy-code

CodeBuddy LLM 提供商 bundle,为 DeepSeek Harness Web GUI 的 LLM 能力接入腾讯 CodeBuddy。它不是独立的聊天面板——而是把 CodeBuddy 作为模型提供商注册进 dsh 的 ctx.llm seam:web 模型设置里出现 CodeBuddy 提供商卡片,聊天框的模型选择器里可直接选到 CodeBuddy 的模型并用它对话。

它做什么

安装并重启后:

  • Settings → Models 出现一个 CodeBuddy 卡片(由 registerConfigurableProviders 提供),带设置表单、无凭据小圆点(因为 token 来自本机登录而非产品 API key)。
  • 聊天框模型选择器 列出 CodeBuddy 的模型,默认目录与 CodeBuddy CLI 的 cli agent 一致(glm-5.xkimi-k3-1/kimi-k2.xminimax-m3/minimax-m2.7hy3deepseek-v4-pro/deepseek-v4-flashdeepseek-v3-2-volc 等,可在 llm-codebuddy: 设置段的 models 里改),选中即可用 CodeBuddy 云接口对话。

Token 来源(每次请求按序解析):

  1. 环境变量覆盖:CODEBUDDY_AUTH_TOKENCODEBUDDY_API_KEY
  2. CodeBuddy 桌面端登录文件:%LOCALAPPDATA%\CodeBuddyExtension\Data\Public\auth\Tencent-Cloud.coding-copilot.info,带过期检查——请先用 CodeBuddy 桌面端(或 /login)完成登录。
  3. 仅当 CodeBuddy 未登录时,回退到 WorkBuddy 桌面端登录文件 %LOCALAPPDATA%\CodeBuddyExtension\Data\Public\auth\workbuddy-desktop.info(两者写入相同结构,均可通过设置覆盖路径)。

都不存在/过期时,请求以 LlmError: MISSING_CREDENTIAL 失败(不是插件加载失败),错误信息会列出每个候选被拒绝的原因。

请求走 POST https://copilot.tencent.com/v2/chat/completions,SSE 流式。地址可在配置里改。

目录结构

dsh-codebuddy-code/
├── package.json       # 声明 dsh.bundle + 对 in-closure 运行时包的依赖
├── cordis.patch.yml   # bundle 层:插入 llm-codebuddy 行
└── src/
    ├── index.js       # 插件入口:注册 provider、settings 段、session 解析
    ├── adapter.js     # fetch + SSE 适配器
    ├── serialize.js   # harness 消息 → CodeBuddy wire 请求
    ├── translate.js   # wire chunk → harness StreamChunk
    ├── sse.js         # SSE 解码
    └── types.js       # wire 格式说明

本包是 packages/llm/llm-codebuddy(workspace TypeScript,rc.5)的自包含 JS 移植,面向已安装的 dsh。若你从源码 checkout 跑 dsh,用 workspace 包即可;这里的内嵌版本与已安装 dsh 完全兼容,不需要发布或构建 workspace 包。

安装

需要一个已初始化的 web profile。从 npm 安装(已发布):

dsh plugin --profile web add dsh-codebuddy-code

然后重启 dsh web 并打开 GUI。

dsh plugin --profile web remove dsh-codebuddy-code 同时移除依赖与 bundle 层。

开发者:打包为 tgz(可选)

普通用户无需这一步——直接 dsh plugin --profile web add dsh-codebuddy-code 从 npm 安装即可。仅当你在本地开发、需要手动打包时:

cd plugins/dsh-codebuddy-code
npm pack
# 生成 dsh-codebuddy-code-0.1.0.tgz

该包所有依赖(@deepseek-ai/dsh-llm@deepseek-ai/dsh-settings@deepseek-ai/dsh-timeout@deepseek-ai/dsh-invariants@deepseek-ai/cordis@deepseek-ai/schemasteryeventsource-parser)都已在已安装 dsh 的 profile 依赖闭包 / module fallback 里,bundle 以 peer 直接依赖的形式解析到同一实例,无需额外 pnpm install

配置

Settings → CodeBuddy 同名的 llm-codebuddy: settings 段($DSH_HOME/settings.yaml,改动即时生效、无需重启):

llm-codebuddy:
  endpoint: https://copilot.tencent.com/v2/chat/completions   # 可选
  tokenPath: C:\Users\you\AppData\Local\CodeBuddyExtension\Data\Public\auth\Tencent-Cloud.coding-copilot.info  # 可选
  workbuddyTokenPath: C:\Users\you\AppData\Local\CodeBuddyExtension\Data\Public\auth\workbuddy-desktop.info  # 可选,CodeBuddy 未登录时回退
  thinking: enabled                  # enabled | disabled(默认 disabled)
  reasoningEffort: off               # off | high | max(默认 off)
  maxTokens: 4096                    # 默认 4096
  defaultContextWindow: 1000000      # 默认 1000000
  models:
    - id: hy3
      name: CodeBuddy-Hy3
    - id: glm-5.2
      name: CodeBuddy-GLM-5.2
    - id: glm-5.1
      name: CodeBuddy-GLM-5.1
    - id: glm-5.0
      name: CodeBuddy-GLM-5.0
    - id: glm-5.0-turbo
      name: CodeBuddy-GLM-5.0-Turbo
    - id: glm-5v-turbo
      name: CodeBuddy-GLM-5V-Turbo
    - id: glm-4.7
      name: CodeBuddy-GLM-4.7
    - id: minimax-m3
      name: CodeBuddy-MiniMax-M3
    - id: minimax-m2.7
      name: CodeBuddy-MiniMax-M2.7
    - id: kimi-k3-1
      name: CodeBuddy-Kimi-K3
    - id: kimi-k2.7
      name: CodeBuddy-Kimi-K2.7
    - id: kimi-k2.6
      name: CodeBuddy-Kimi-K2.6
    - id: kimi-k2.5
      name: CodeBuddy-Kimi-K2.5
    - id: deepseek-v4-pro
      name: CodeBuddy-V4-Pro
    - id: deepseek-v4-flash
      name: CodeBuddy-V4-Flash
    - id: deepseek-v3-2-volc
      name: CodeBuddy-V3.2-Volc
  streamIdleTimeoutMs: 300000        # 默认 300000
  retryPolicy: {}                    # 可选

验证可用

  1. 先确认 CodeBuddy 桌面端已登录(%LOCALAPPDATA%\CodeBuddyExtension\Data\Public\auth\Tencent-Cloud.coding-copilot.info 存在且有 auth.accessToken);未登录时插件会回退到 WorkBuddy 登录文件。
  2. 重启 dsh web,打开 Settings → Models,应看到 CodeBuddy 卡片。
  3. 回到聊天框,点模型选择器,选 CodeBuddy 下某个模型,发一条消息。

已知限制

  • 网关只会在一次工具调用的第一个 SSE delta 里携带 function.name,后续 delta 的 name 是空字符串 ""。适配器的 translate 只在 name 非空时覆盖已记录的调用名(否则空值会把正确名称冲掉,产生 unknown tool "",且第二轮把 name: "" 发回时网关返回 HTTP 400 model_param_invalid — "the request parameters were rejected by the model provider")。不要改回「只要 name !== undefined 就覆盖」。
  • 网关安全策略会拦截广告 deepseek-harness 客户端的 user-agent(HTTP 400 code 11128request illegal / "blocked by security policy")。适配器用中性的 user-agent: codebuddy-dsh 发送请求——不要改回 dsh 的归属 attributionHeaders(),否则 CodeBuddy 网关会拒绝所有请求。
  • 纯文本路由:不支持图片输入,适配器会以 UNSUPPORTED_CONTENT 拒绝并说明。
  • reasoning_effort: 'off' 是合法 harness 值,但被网关以 HTTP 400 拒绝,故适配器把 off 映射为 thinking: { type: 'disabled' },从不发送该字段。
  • stop 语义差异遵循 OpenAI 兼容;stream_options 不发(网关在 finish chunk 上已附 usage)。
  • 推理内容只在带工具调用的轮次被回放为 reasoning_content(与 DeepSeek 思维模式一致)。

结构与来源

源码是 packages/llm/llm-codebuddy 的 JS 移植(该 workspace 包仍是源码 checkout 下的首选实现)。二者共享同一契约:provider route codebuddy、settings namespace llm-codebuddy、同一套 request/serialize/translate 逻辑。