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

v0.1.5

Published

dsh-oauthpro — provider account pool & quota plugin for DeepSeek Harness (Codex/Claude/Cursor/Grok/Antigravity/GLM), live model catalog + balance/quota, macOS/Windows/Linux

Readme

🔑 dsh-oauthpro · Provider 账户池与额度面板

DeepSeek Harness 装上 provider 账户中枢:OAuth 账户池、原生 Key 池、实时余额/额度、三平台自动打开的授权流——macOS / Windows / Linux 一个插件全搞定。

dsh-plugin npm CI license node platform

CI 在 ubuntu / windows / macos 三平台真机跑同一套测试,全绿才发版。

⭐ 欢迎点星收藏

如果 dsh-oauthpro 帮到了你,欢迎到 GitHub 仓库 点个 Star ⭐,让更多 DSH 用户看到它。问题与建议请提 Issue。

📋 兼容性

| 插件版本 | 状态 | 对应 DSH | |---|---|---| | 0.1.5(当前) | ✅ | DSH 0.1.5 线(peer:@deepseek-ai/* 由宿主提供,不再 hoist 进 profile) |

本次升级功能变化

  • Grok / Cursor / Antigravity 空目录兜底:浏览器登录、没装官方 CLI 时仍能列出可调用模型,provider 不会从 /model 消失。
  • 依赖契约@deepseek-ai/* 改为 optional peer,避免 #45 那种装插件后 DSH 启动失败。
  • 面板品牌:composer 弹窗 / 设置页 eyebrow 与命令帮助改为 oauthpro(内部路径与凭证 ref 不变)。
  • npm description 去掉 macOS-only,与三平台 README 对齐。

✨ 截图速览

| Provider 弹窗:套餐 + 额度窗口 + 重置时间 | |---| | Provider Popup |

| Key 池:凭证状态 + 用量台账 + 上下文上限覆写 | |---| | Key Pool |

输入框底栏 chip:有额度时显示剩余百分比 + 渐变进度条(如 80% ▬▬▬),无额度的 provider 回退显示 Key 数量;点击打开上方弹窗。

🚀 核心能力

  • 原生 Key 池面板:每个 API Key provider 一个弹窗——添加/移除 Key、手动/轮询/失败转移三种策略、请求级换 Key 不改写 provider 激活配置;Key 用量(请求数、输入/输出/缓存 token)逐条入账
  • 实时余额/额度:刷新即查,不猜不伪造——
    • DeepSeek 兼容网关GET /user/balance 余额
    • OpenRouter 兼容网关GET /credits 余额
    • z.ai / 智谱 GLM Coding PlanGET /api/monitor/usage/quota/limit:5 小时 + 月度两个 credits 窗口、使用百分比、重置时间、套餐名
    • 自定义 provider 按以上三族自动探测;都不兼容则给出明确探测诊断,绝不显示假百分比
  • OAuth 账户池:Codex / Claude / Cursor / Grok / Antigravity 等订阅制 provider 的浏览器授权流(PKCE + state 校验),授权页三平台自动打开(macOS open / Windows cmd /c start / Linux xdg-open),loopback 与 manual-code 双回调
  • 实时模型目录:OAuth provider 接官方实时目录(如 Codex 的 gpt-5.6 系列),合并本地注册表,官网上新模型即刻可见;官方 CLI / 本地缓存都拿不到目录时(如只在本插件里用浏览器授权登录 Grok、机器上没装官方 CLI),自动回退 DSH 内置 pi-ai 注册表,provider 不会因为目录为空而在模型菜单里消失
  • 上下文上限覆写:官方/注册表值缺失时可自定义,只影响 DSH 实际发送的上下文
  • composer chip:额度优先、Key 数量兜底,点击弹窗、悬停见模型名
  • token 台账:按 provider/account 维度持久化请求与 token 计数,「清空全部用量」一键重置

📦 安装

dsh plugin --profile web add github:meyaomiao/dsh-oauthpro

@deepseek-ai/*@earendil-works/pi-aiDSH 宿主提供(peer),dsh plugin add 不会再把旧版 DSH 内部包 hoist 进 profile。需要 DSH 0.1.5 线。若曾经用 0.1.4 装挂过启动树,先卸插件再装这一版,或删掉 profile 里 hoist 出来的 @deepseek-ai/[email protected] 一类旧包。

重启 dsh web 后,输入框底栏出现 provider chip;硬刷新(Cmd/Ctrl+Shift+R)确保 client 为最新。

API Key 配置示例

~/.dsh/settings.yamlllm-pi-ai.providers 下:

  zai:
    apiKeyEnv: ZAI_API_KEY
    models:
      - glm-5.3-flash

Key 值放 ~/.dsh/.credentials.yaml:

refs:
  ZAI_API_KEY: <your-key>

OAuth 类 provider(Codex 等)不填 Key,在弹窗里点登录走浏览器授权即可。

🔩 工作原理

┌─ client(lib/client.js)────────────┐   ┌─ host(dist/index.mjs)─────────────┐
│ composer chip + provider 弹窗      │ ⇄ │ OAuth 账户池 / Key 池 / 刷新编排    │
│ typert RPC → remote.dockyard      │   │ 余额/额度探测(DeepSeek/OpenRouter/ │
│ slots: conversation.input.left    │   │ z.ai 三族) / token 台账 / 状态落盘  │
└───────────────────────────────────┘   └───────────────────────────────────┘
  • 凭证只经 DSH Credentials(~/.dsh/.credentials.yaml)落盘,浏览器不存 Key、不回显
  • 余额/额度探测按 baseURL 自动识别协议族;Windows 上无系统级 Keychain 时兜底存储自动降级并明确提示,主路不受影响

🧪 平台兼容

| 平台 | 状态 | 说明 | |---|---|---| | macOS | ✅ 完整 | Keychain 兜底存储 + 授权页自动打开 | | Windows | ✅ 核心全量 | 授权页自动打开(cmd /c start);CI windows-latest 真机跑全套测试 | | Linux | ✅ 核心全量 | 授权页自动打开(xdg-open) | | Cursor / Antigravity 桌面凭证扫描 | macOS 专属 | 其他平台自动跳过,回退 env 等替代源 |

🛠 开发

npm install
npm run build   # inject 门禁校验 → 平台构建 → client/host 产物
npm test        # 243 项测试(本地需 node ≥ 22.19 或 ≥ 24)
  • 产物:packages/dsh-plugin/lib/client.js(client)+ packages/dsh-plugin/dist/index.mjs(host);DSH 加载的是产物不是 src
  • npm run build 第一步即校验 dsh.client.inject 与本机 DSH 安装一致,平台包漂移在构建期拦截
  • 提交走 workflow:Issue → issue-N-slug 分支 → PR

📄 License

MIT © meyaomiao