🎁 福利专区全网大模型免费应用 + 新用户福利 + 注册活动入口,低成本玩转 AI

费用管家 niliemi/dsh-billing

DeepSeek Harness
niliemi31 天前有提交已提供中文文档扫描:含敏感能力

实时显示会话与全局花费,超额自动拦截请求

30/100
综合分
0
GitHub 星标
—
npm 周下载
—/5
用户评分

数据截至 2026/10/1 · 周下载取自 npm 全网(含 CI / 镜像),非本站安装数;综合分由星标、活跃度与兼容性检查合成。

自动兼容检查有告警:未发布到 npm registry,仅可从源码安装。
安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add niliemi/dsh-billing
该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)

状态速览

判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态
信任档位:待复验
是什么
dsh 原生插件 · model
装得上吗
曾在 dsh 0.2.0-rc.2 下真实安装成功,但当前 dsh 已更新至 0.2.1-rc.5,本站尚未在新版下复验
L4 · 真实安装等级说明 →
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
更新放缓:最近一次提交在 31 天前
档位由哪些信号合成

本站实装验证(真实安装 L4 覆盖全站;L5 为运行时冒烟或实机截图,覆盖范围小于 L4) · 验证所用 dsh 版本 · 静态安装检查 · 风险分级 · 仓库维护状态。 下方各区块是它的证据明细。

验证判据与等级说明 →
社区实装还没有人打卡 · 装过的第一个就是你
安装兼容性检查⚠ 装前注意

未发布到 npm registry,仅可从源码安装

展开查看检查明细 ↓

以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。

✗npm 包yoka-dsh-billing(未发布到 npm,仅可源码安装)
✓Node 引擎要求 >=20 · 基线 Node 22.19 满足
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明

验证方式:npm registry 存在性 + package.json 静态校验 · 最后检查 2026/10/8 09:42:14

安全扫描自动 · 静态分析源码
v2.7.0
🔵 扫描:含敏感能力尚无人工评估
展开查看扫描说明与证据 ↓

静态扫描发现插件具备触达本地系统的能力:执行外部命令、读写/删除本地文件、读取剪贴板或密钥类环境变量(至少其一)。这是能力清单,不是危险判定——具体能力项与证据见下方,安装前请自行判断是否需要。

读写/删除本地文件
查看扫描证据(共 6 处,展示前 6 条)
  • 读取本地文件
    lib/index.js:44
    const parsed = JSON.parse(readFileSync(new URL("./pricing.json", import.meta.url), "utf8"));
  • 读取本地文件
    lib/index.js:59
    const parsed = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
  • 读取本地文件
    lib/index.js:389
    const disk = JSON.parse(readFileSync(storeFile, "utf8"));
  • 写入本地文件
    lib/index.js:421
    mkdirSync(dirname(storeFile), { recursive: true });
  • 写入本地文件
    lib/index.js:423
    writeFileSync(tmp, `${JSON.stringify(state, null, 2)}\n`, "utf8");
  • 写入本地文件
    lib/index.js:424
    renameSync(tmp, storeFile);
扫描于 2026/11/1(0 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库

静态扫描只反映源码中出现的调用,不构成安全背书;人工评估与自动扫描相互独立、互不覆盖。

给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个

功能亮点

  • 实时显示会话与全局花费
  • 超额自动拦截请求

DSH 插件:使用官方模型价格表计算 token 价格,在编辑器上下文计量器旁显示运行成本,并在支出超过你设定的上限时阻止该轮对话。

README

由 DeepSeek 最新模型翻译生成
yoka-dsh-billing · DSH 计费插件 在 DSH Desktop 里按 token 计费:聊天输入框下方、token 环左边常驻显示本会话与全局两条费用,左侧边栏底部显示 DeepSeek 账号余额;每条费用右边有一个 ↺ 可重置计费起点(本次归零、历史只进累计),达到上限时宿主在该轮开始前阻断 LLM 请求。 ● ¥0.0834 / ¥50.00 ↺ ● ¥12.3600 / ¥1000.00 ↺ 本会话本次计费 / 上限 全局本次计费 / 你设的全局上限 - 左侧边栏底部(设置按钮旁):余额 ¥1007.20(充值 + 赠金,只作参考)。 - 点角标打开面板;点 ↺ 重置计费起点;超额时弹确认框。
展开完整文档(README 剩余 1 节)
yoka-dsh-billing · DSH 计费插件

在 DSH Desktop 里按 token 计费:聊天输入框下方、token 环左边常驻显示本会话与全局两条费用,左侧边栏底部显示 DeepSeek 账号余额;每条费用右边有一个 ↺ 可重置计费起点(本次归零、历史只进累计),达到上限时宿主在该轮开始前阻断 LLM 请求。

● ¥0.0834 / ¥50.00 ↺ ● ¥12.3600 / ¥1000.00 ↺
本会话本次计费 / 上限 全局本次计费 / 你设的全局上限

- 左侧边栏底部(设置按钮旁):余额 ¥1007.20(充值 + 赠金,只作参考)。
- 点角标打开面板;点 ↺ 重置计费起点;超额时弹确认框。
- 圆点分三档:**绿 &refresh=1 | All state needed by the badge/panel; when session is included, the session's usage and limit are attached; refresh=1 forces a balance refresh |
| POST | /config | Write the exchange rate, guard, global cap ({limit}, 0 = not set), model unit-price overrides ({price:{key,value}} / {price:{key,reset:true}}), a session's own limit ({sessionId, sessionLimitFor}, passing 0 clears that session's limit); when the limit is clamped by the balance, the response carries limitClamped: true. 0.2.1's {sessionLimit} (shared default limit) is deprecated and ignored |
| POST | /override | {mode:"once"|"session"|"off"|"reset", sessionId?} allow through / clear allow-through |
| POST | /reset | {scope:"session"|"global", sessionId?} reset billing start point (default soft reset = baseline moved forward: this-session zeroed, history only goes into cumulative, not a single token lost; scope:"global" only moves the global start point, and each session's own start point is unaffected, and vice versa); {hard:true} is the old clear history (cumulative is zeroed too, unrecoverable) |
| GET | /pricing?q= | Price list search (exact matches take priority) |
| GET | /diag | Diagnostics: whether clientModules has pulled the browser half into the startup graph, plus live balance, self-set global cap and per-session limit table, this-session/cumulative amounts, and each session's baseline |

Guard: only accepts requests that are same-origin / carry a dsh-auth- cookie / come from a loopback address, and responds with cache-control: no-store.

Permissions, dependencies, and failure boundaries

Declarations for DSH STORE automated review (engines and dsh.compatibility in package.json are the machine-readable version; this is a description of the same thing):

| Capability | Where it is used | Boundary |
| File system (files) | The host half reads/writes the plugin's own ledger ~/.dsh/billing/ledger.json (config storeFile can point elsewhere) | Does not read the workspace, does not read other plugins' data; disk writes are atomic replacements of "temp file + rename" |
| Network (network) | The browser half uses same-origin fetch to call this plugin's own host route /plugin-billing/… | The host half makes no network requests; does not access any third-party domain |
| Subprocess (commands) | Zero subprocesses at runtime; only the development scripts under tests/ (self-test, HMR/HTTP probes, publishing) use the shell and git | These scripts are not in files and are not published with the package |
| Credentials (credentials) | Zero credentials at runtime; the balance goes through the host's deepseekAccount service, and the plugin never touches the account token | tests/submit-remote.mjs reads the local ~/.dsh/github-token.txt, for the author's publishing use only |
| 原生模块 / 生命周期脚本 / 运行时依赖 | 都没有:纯 ESM,peerDependencies 只有 react(宿主已提供) | 装包不执行任何 install / build 脚本 |

- 外部服务:唯一可选的对外依赖是宿主服务 deepseekAccount(读账号余额)。其余全部本地:计费靠内置价目表 lib/pricing.json 与账本里的 token 记录。
- 兼容性:Node >=20(实测 Node 24.14.0 —— DSH Desktop 0.2.0-rc.2 自带的 Electron 44 运行时,也是两份自测所用的 Node);DSH >=0.2.0-rc.1;逐版本记录里 0.2.0-rc.2 = compatible,依据是本插件在该版本上长期实跑(宿主路由、双角标、余额、重置都在用);浏览器半边声明 platform: web,profile web。一次性 profile 的安装 / 启动 / 卸载尚未自动化验证,因此不声明 dshOperations(保持 unknown)。
- 失败边界(都不影响会话本身):账本读不到或 JSON 损坏 → 从空账本开始,不抛错;写盘失败 → 记一条 billing: 账本写入失败 warn,进程内继续算;余额服务不可用(未登录 / 接口失败 / 服务缺失)→ 余额显示 — 且不夹取上限,计费与阻断照旧;价目表缺失或模型未知 → 用保守估算价 [1, 4, 0.1, 0];路由对非本机 / 非同源请求返回拒绝,只影响该请求。
- DSH STORE 自动审查的现状:按商城自己的扫描规则复扫本仓库,运行文件里只剩两条信号——lib/index.js 的 files(账本写 JSON)与 lib/client.js 的 network(浏览器半边调自己的宿主路由)。开发脚本已放在 tests/,而商城把测试目录排除在「运行能力证据」之外,所以 commands / credentials 两条不再计入。剩下这两条是这类插件的本性,条目因此仍可能停在人工复核(商城的说明也写明:高能力项目可能保持 user-reviewed,声明本身不保证自动批准)。

安装

宿主半边跑在 DSH 进程里;浏览器半边是手写的 window.__ModuleLoader__ 包装(lib/client.js,无需构建),由 dsh-client-modules 以 combo URL 提供——注意不是 /plugins/yoka-dsh-billing/client.js(该形状返回 404),真实 URL 形如 /plugins/??yoka-dsh-billing/client.js&rev=,由启动图注入,页面上会自行加载。

安装 = 让桌面 profile 能解析到本包,并在 dsh.profile.bundles 里登记。已执行的命令:

在 DSH 会话内用 plugin_manager 工具,等价于 dsh plugin --profile desktop add link: target: link:C:\Users\walex lin\Desktop\dsh workflow\插件\dsh-billing

它会把 "yoka-dsh-billing": "link:…/dsh-billing" 写进 ~/.dsh/profiles/desktop/package.json 的 dependencies,并把 yoka-dsh-billing 追加进 dsh.profile.bundles,随后热应用(application: applied)。插件自带的 cordis.patch.yml:

- insert:
- id: yoka-dsh-billing
name: 'yoka-dsh-billing'
config: { rate: 7.2, limit: 0, guard: true }

开发

node tests/build-pricing.mjs "/dist/providers/data" # 重新生成 lib/pricing.json
node tests/self-test.mjs # 宿主:折叠 / 计价 / 余额 / 自设上限与夹取 / 守卫 / 路由 / 持久化 / 旧账本迁移 / 重置计费起点(全局与单会话互不影响)(153 项)
node tests/self-test-client.mjs # 浏览器:模块外壳 / 槽位 / 双角标与 ↺、侧栏余额、面板文案与「单会话上限」独立段(每行两排:本次 / 累计)/ 两个 ↺ 互不牵连(107 项)
node tests/probe-hmr.mjs # 核对「运行中的宿主」是否已发布本地这版 client.js(无需刷新/重启)

已知边界

- 订阅制账号并不按 token 单价扣费,这里的金额是等效价值参考,不是账单。
- 余额来自宿主 deepseekAccount 服务(可选依赖:拿不到就只影响余额显示与「上限夹取」,不影响计费、自设上限与单会话上限)。
- 面板里的模型键是 provider/model;直接改单价只影响该键的用量。
- 角标挂在 conversation.composer.dock 槽位,只在会话输入态(composer)渲染;欢迎页不显示。侧栏余额挂在 sidebar.footer.action,与设置按钮同一行,收起态(56px)只留一个圆点。
- 浏览器半边的改动由模块图 HMR 自动跟上:dsh-client-hmr 每 500ms stat 一次各条目的 client.js,元数据一变就 rebuilt(id) 并经 /plugins/events 广播,页面会把该插件重挂载(不用刷新页面,但被重载插件的 React 状态会丢,所以打开着的面板会自己关掉)。node tests/probe-hmr.mjs 可核对当前发行的 revision。宿主半边(lib/index.js)不热重载源码,改完需要重启 DSH 才会生效——已安装的那份实例跑的是安装时的代码。
- 面板与确认框的底色是完全不透明的:官方「菜单面」色(--dsw-specific-menu,浅 #f8f9faf0 / 深 #303136f0,94% 不透明)叠在 --dsw-alias-bg-layer-1(纯色层)上,外加 rgba(0,0,0,.34) 遮罩;面板经 react-dom 的 createPortal 挂到 document.body,避免侧栏祖先的 transform 困住 fixed 定位。
预览分享卡片长什么样 ↓niliemi/dsh-billing
分享 · DeepSeek Harness Hub
niliemi/dsh-billing

实时显示会话与全局花费,超额自动拦截请求

回到顶部