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-sparrow/dsh-codebuddy-credits

v0.2.2-rc.5

Published

Company CodeBuddy credits as a DeepSeek Harness LLM provider — official API key, models only, no agent harness

Readme

dsh-codebuddy-credits

简体中文 | English | GitHub

把公司发的 CodeBuddy 额度接成 DeepSeek Harness(DSH)的 LLM provider—— 企业发放的 WorkBuddy/CodeBuddy 积分,在 DSH 里直接用。只用 API Key: CodeBuddy 提供积分对应的模型推理,工具、权限与上下文都由 DSH 负责。

插件在 DSH 模型选择器里加一个 CodeBuddy Credits provider。

为什么做这个

公司发的 CodeBuddy 积分只能在 CodeBuddy 生态里花。如果你习惯用 DSH 当 agent 宿主,这个插件把积分花在你想要的地方——用 API Key,不借用浏览器登录态、 不装 CodeBuddy CLI。

环境要求

  • DSH >=0.2.2-rc.3 <0.2.3(0.2.2 线;构建与验证基于 0.2.2-rc.5;更新的版本线、尤其是预发布版本不在承诺范围内)
  • Node.js >= 24.9.0

安装

打开 插件 → 添加插件,输入 @dsh-sparrow/dsh-codebuddy-credits 并启用。也可以走 根 README 里的共享市场索引流程;安装后重启 DSH。

请通过 DSH 插件管理器安装,不要直接 npm 安装:包必须注册进 DSH 的 web profile,而不只是下载到某个 node_modules。

获取 API Key

  1. 登录 CodeBuddy 平台:https://copilot.tencent.com/profile/(企业控制台: API 管理 → 访问密钥;国际版 https://www.codebuddy.ai/profile/keys)。
  2. 创建密钥。企业密钥按账号签发,模型可用范围跟随账号权限。

配置(界面内完成)

打开 设置 → 模型,在 CodeBuddy Credits 行上直接粘贴 Key 并保存:

  • 保存 Key 时,插件用这把 Key 加载可用的模型(按该 Key 的账号权限返回, 例如企业管理员配置的那批)并启用 provider。清单只存进程内、按需 刷新,不写入设置文件;
  • 配置成功后,卡片同时列出这把 Key 可用的模型(只读:模型名 + x0.00 · 1M 只读事实),并提供「获取可用模型」按钮——管理员调整清单后可手动刷新; 刷新只作用于本 provider;
  • 之后官方模型选择器里即可选择这些模型(按 provider 分组)。本插件不改 模型选择器;积分系数与上下文长度在设置卡片与会话头部面板里查看;
  • 本插件接管模型行标签的渲染,才能在本 provider 的模型行显示只读的系数 / 上下文信息。该标签槽同一时刻只有一个贡献者,所以插件同时镜像官方给 DeepSeek Flash 的 1017 版本标,并让其他 provider 的标签保持官方样式; 官方再次改动选择器时,标签可能先退化为纯模型名,等插件更新。
  • 未配置 Key 时,插件不发起任何网络请求,模型选择器也不出现本 provider;
  • 移除 Key 后 provider 随即停用。

Key 只存入 DSH 凭据库,不进 settings.yaml。环境变量 CODEBUDDY_CREDITS_API_KEY 在启动时同样生效;旧拼写 CODEBUDDY_API_KEY 仍可识别并自动迁移。界面保存是推荐方式。

积分可见性

配置 Key 后,插件在对话界面里展示 CodeBuddy 用量:

  • 会话头部入口(会话列右上角、Session log 按钮左侧,对话页与新会话 首页均显示):展开面板显示账号/企业、当期额度(已用 / 额度 / 剩余、进度条、 重置日期),以及当前选中 CodeBuddy 模型的积分系数、上下文长度、描述与 可用功能;对话区变窄时这个入口会自动收成只有图标、没有文字的版本;
  • 会话积分:显示在输入框下方的统计行里,含本会话累计积分与调用 次数,点开显示调用次数与按模型聚合的每次调用明细;
  • 每轮积分:单轮消耗的积分(在该轮操作行末尾),点开显示调用次数 与按模型聚合的每次调用明细;
  • Max 模式:额度面板里的开关会把本 provider 的所有推理模型强制锁到 max 档位,开启期间覆盖逐模型档位偏好;不影响其它 provider 的模型, 关闭后恢复原来的逐模型选择。

会话与单轮统计取自会话自身的历史记录,重启 DSH 后不清零,重新打开 旧会话也仍准确;额度面板始终读服务端最新数字。

截图

会话页额度入口与面板

设置 → 模型页的 CodeBuddy Credits 配置卡

如实说明

  • Key 是官方签发、认证方式是官方 IAM 文档明示的,但对话接口本身没有公开的稳定性 承诺——本插件是第三方适配器,不是官方产品。
  • 通过 Key 发起的请求会进入账号用量记录(企业用量控制台连提示词文本都可见)。
  • 上游可能拒绝本插件的请求(报「未授权渠道」)。「自适应 API 拦截」默认开启,会尝试 自动恢复;全部尝试失败时请求报错,需升级插件才能恢复。
  • 该机制有代价:每次最多额外发 3 个请求,均会记入账号请求日志;恢复后的第一次回复 会稍慢;该状态只在本次运行内有效,重启后可能再次尝试。
  • 最坏情况下恢复会轻微改变模型行为(回答风格或工具使用习惯可能不同);本机会话历史、 用户消息与代码块不受影响。可在设置卡关掉「自适应 API 拦截」,改为直接报错。

License

MIT

更新日志

CHANGELOG.zh-CN.md