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-cpa

v0.1.4

Published

DSH CPA provider and runtime plugin

Readme

dsh-cpa

English | 简体中文

CLI Proxy API(CPA)的 dsh bundle 插件。注册 cpa provider,请求走 CPA 的 /v1/chat/completions,同步 /v1/models 模型列表。

快速开始

npx @deepseek-ai/dsh plugin --profile web add dsh-cpa

headless profile 同理:

npx @deepseek-ai/dsh plugin --profile headless add dsh-cpa

从源码安装

开发或本地构建时使用:

npx @deepseek-ai/dsh plugin --profile web add .

headless profile 同理:

npx @deepseek-ai/dsh plugin --profile headless add .

使用已有 CPA

在设置面板切换到“外部 CPA”,填写 URL、API key、management key 后点击 “应用”。

自动启动 CPA

默认生成 $DSH_HOME/cpa/config.yaml,启动 cli-proxy-api,并把生成的 key 注入 provider 适配器。启动前会先在 PATH 中解析可执行文件;二进制不在 PATH 时,在 CPA 设置页的内部 CPA 路径中填写绝对路径。

模型每 5 分钟从 /v1/models 同步一次。

设置面板

CPA 页面使用 dsh web-app 组件,支持内部、外部两种启动方式,保存到 $DSH_HOME/cpa/settings.json。只有内部 CPA 运行时显示停止操作。管理面板 在弹窗中打开。外部模式可配置 URL、API key、management key;内部 模式可配置 CPA 可执行文件路径。高级设置可配置端口、模型刷新间隔、 quota 缓存与并发,以及配置、设置、执行记录路径。其中端口、配置路径和 “使用统计”只对内部 CPA 生效;模型刷新间隔、quota 缓存/并发、设置路径和执行记录 路径对两种模式都生效。

使用状态

插件会解析成功与失败响应中的 x-cpa-trace-id,把脱敏后的执行记录写入 $DSH_HOME/cpa/executions.json,并给当前会话提供 cpaUsage 投影。 /dsh-cpa/execution-status?sessionId=... 返回脱敏后的账号、额度快照和 最近一次执行记录,供 composer 下方的紧凑状态行读取。浏览器无法调用 CPA 的 /v0/management/api-call,该接口仅由服务端 quota 查询使用。状态行只展示 CPA 集成特有的信息:当前使用服务商/套餐、失败/不可用状态和一个主额度窗口,不重复 dsh 已展示的 token、耗时和性能统计。服务商同时从认证文件和 API key 配置读取; 有执行记录时按 CPA trace 的账号定位当前服务商;trace 没有账号或账号不在已读取 配置中时,只按模型推断服务商。点击可展开账号、来源、Base URL/前缀、额度、 模型/用途和 CPA trace/request 标识。同一会话仍按 CPA 账号聚合请求、失败与 token,作为 cpaUsage 投影保留;无管理 API 时状态行自动隐藏。

内部 CPA 的 usage-statistics-enabled 默认开启,可在 CPA 设置面板中关闭。

CPA 摘要

只读 /dsh-cpa/summary 接口由服务端使用 management key 调用 CPA 管理 API, 浏览器只收到脱敏汇总数据,不包含 management key 或账号凭据。摘要包含版本/更新 状态、白名单过滤的运行时配置、/v0/management/api-key-usage 与认证文件计数聚合 的请求统计、脱敏账号,以及认证文件提供的模型到账号可用性。CPA 管理 API 不暴露 token 汇总,因此 token 项保持为 0。服务端做短时缓存;单个来源失败只记录错误, 不影响其他数据。

设置页提供紧凑的“CPA 摘要”区域:版本/更新、运行配置、用量总计、用量明细、账号。 composer 状态详情在有 requestId 时提供“日志”链接,打开 CPA 原始 management 日志界面。管理面板仍是完整管理入口。