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

花费预测 121212165/dsh-plugin-spend-forecast

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

dsh 插件:基于成本账本 sidecar 做支出预测——日消耗速率、月末预估、预算耗尽时间(/forecast)

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

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

安装命令 · 需先装 dsh CLI 引擎
dsh plugin --profile web add 121212165/dsh-plugin-spend-forecast
该包不可直接 npm 安装,改从 GitHub 源安装(明细见下方安装检查)

状态速览

判定依据:实装验证 · 静态安装检查 · 自动扫描 · 仓库维护状态
信任档位:需留意
是什么
dsh 原生插件 · model
装得上吗
实装验证未通过(unknown),装前请到仓库确认最近更新与 issue
安全吗
本站尚未对该插件做风险分级
暂未覆盖,不等同于无风险
还在维护吗
活跃:最近一次提交在 15 天前
档位由哪些信号合成

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

验证判据与等级说明 →
⚠︎ 实装验证未通过(unknown · 2026/10/1) ——可能是验证环境差异,装前建议到 GitHub 仓库确认最近更新与 issue。
社区实装还没有人打卡 · 装过的第一个就是你
安全扫描自动 · 静态分析源码
v2.7.0
🔵 扫描:含敏感能力尚无人工评估
展开查看扫描说明与证据 ↓

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

读写/删除本地文件
查看扫描证据(共 12 处,展示前 12 条)
  • 读取本地文件
    lib/plugin.js:22
    if (!existsSync(dataDir))
  • 读取本地文件
    lib/plugin.js:24
    for (const name of readdirSync(dataDir).filter((file) => /^ledger-\d{4}-(0[1-9]|1[0-2])\.jsonl$/.test(file)).sort()) {
  • 读取本地文件
    lib/plugin.js:25
    for (const line of readFileSync(join(dataDir, name), 'utf8').split(/ ? /)) {
  • 写入本地文件
    lib/plugin.js:75
    mkdirSync(dirname(forecastPath), { recursive: true });
  • 写入本地文件
    lib/plugin.js:77
    writeFileSync(tmp, JSON.stringify(summary, null, 2) + '\n', 'utf8');
  • 写入本地文件
    lib/plugin.js:78
    renameSync(tmp, forecastPath);
  • 读取本地文件
    src/plugin.ts:44
    if (!existsSync(dataDir)) return { records, skipped };
  • 读取本地文件
    src/plugin.ts:45
    for (const name of readdirSync(dataDir).filter((file) => /^ledger-\d{4}-(0[1-9]|1[0-2])\.jsonl$/.test(file)).sort()) {
  • 读取本地文件
    src/plugin.ts:46
    for (const line of readFileSync(join(dataDir, name), 'utf8').split(/ ? /)) {
  • 写入本地文件
    src/plugin.ts:93
    mkdirSync(dirname(forecastPath), { recursive: true });
  • 写入本地文件
    src/plugin.ts:95
    writeFileSync(tmp, JSON.stringify(summary, null, 2) + '\n', 'utf8');
  • 写入本地文件
    src/plugin.ts:96
    renameSync(tmp, forecastPath);
扫描于 2026/11/1(0 天前) · 范围 入口闭包 + 发布文件清单 · 来源 GitHub 仓库

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

依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-base@deepseek-ai/schemastery@deepseek-ai/dsh-tools
给这个插件打分还没有人投票↓
用户评分
还没有人投票,来当第一个

功能亮点

  • 日消耗速率预测
  • 月末总额预估
  • 预算耗尽天数

README

由 DeepSeek 最新模型翻译生成
dsh-plugin-spend-forecast 🧩 dsh 插件家族(22 件):总目录 dsh-plugin-family | 明星插件:ide-hub 跨 IDE 统一管理 · task-forge 跨窗口无损交接 · quota 实时用量仪表 EN · Projects spend from cost-ledger sidecars: dual-window daily burn (7d vs 30d) with a trend verdict, month-end extrapolation, the exact date a budget runs dry, and a per-model breakdown (/forecast). · 12 node --test green (9 pure + 3 wire) · ran against a real ledger on this machine and matched hand calculation · month-boundary extrapolation not exercised. DeepSeek Harness (dsh) 插件:花费预测。读 cost-ledger 的台账边车,算出双窗日均(7 天 vs 30 天)与趋势、本月月末预测、烧穿预算的具体日期、以及这些钱花在哪个模型上。
展开完整文档(README 剩余 1 节)
dsh-plugin-spend-forecast

🧩 dsh 插件家族(22 件):总目录 dsh-plugin-family | 明星插件:ide-hub 跨 IDE 统一管理 · task-forge 跨窗口无损交接 · quota 实时用量仪表

EN · Projects spend from cost-ledger sidecars: dual-window daily burn (7d vs 30d) with a trend verdict, month-end extrapolation, the exact date a budget runs dry, and a per-model breakdown (/forecast). · 12 node --test green (9 pure + 3 wire) · ran against a real ledger on this machine and matched hand calculation · month-boundary extrapolation not exercised.

DeepSeek Harness (dsh) 插件:花费预测。读 cost-ledger 的台账边车,算出双窗日均(7 天 vs 30 天)与趋势、本月月末预测、烧穿预算的具体日期、以及这些钱花在哪个模型上。

适合回答:"照这个速度我这个月要花多少?预算什么时候用完?"——cost-ledger 回答"已经花了多少",本插件回答"接下来会花多少"。

同系列:price-aware · cost-ledger · relay-quota(中转余额,与本页口径不同:那是钱包余额,这是模型花费推算)。

用法

- /forecast:双窗日均与趋势、本月已花、月末预测、烧完预算的日期、按模型分解。

日均 $3.00(2/7 个活跃天) · 本月已花 $6.00 短窗 7 天 $3.00/天 · 长窗 30 天 $2.33/天 · 趋势 在加速 ↑(短/长 129%)月末预测 $15.00(还剩 3 天)按短窗速率 4 天后烧完预算 $20.00,即 2026-10-06 按模型(近 7 天):deepseek-chat $4.00(67%) · step-5 $2.00(33%)

预测口径(诚实声明)

- 日均 = 近 windowDays 天里"有花费的日子"的均值,不是除以窗口全长。周末休息不会把预测砍半,窗口只用来平滑突发。因此输出会标出活跃天数(如 1/7)——样本少时这个数字就是不确定性本身。
- 两个窗口分开算:短窗(windowDays,默认 7)说"最近这几天什么火气",长窗(longWindowDays,默认 30)说"这个月的基线"。长窗永远不会比短窗窄(配 60 天短窗时两个窗口自动对齐,趋势即为持平)。
- 趋势 = 短窗日均 / 长窗日均:≥1.25 判"在加速"、≤0.8 判"在降温"、中间是"基本持平";任一侧没有活跃天就明说"样本不足以判断",不硬凑一个 100%。留出 0.8–1.25 的死区是因为日均本来就抖,把抖动说成趋势等于骗人。
- 烧完预算给的是日期:按 floor((预算 − 本月已花) / 短窗日均) 天推出具体那一天(即 YYYY-MM-DD),只报"还有 N 天"还得用户自己去翻日历。
- 按模型分解只看短窗(前 5 个模型,其余折成"其他 N 个"),因为"上个月谁在花钱"对今天没有行动意义。
- 月末预测 = 本月已花 + 短窗日均 × 本月剩余天数(按 UTC 日历)。
- 币种取自台账记录,不跨币种混算(继承 cost-ledger 的口径)。
- 前提是台账里 costMicros 非零——必须在 cost-ledger 配好价目,否则全月为 0,预测也就是 0。

配置

| 字段 | 默认 | 说明 |
| enabled | true | |
| dataDir | ~/.dsh/cost-ledger | cost-ledger 台账目录(ledger-YYYY-MM.jsonl),本插件只读 |
| budgetMajor | 20 | 月度预算(货币整数单位,如 $20);0/负数视为未设预算 |
| windowDays | 7 | 短窗:日均速率与模型分解的回看窗口 |
| longWindowDays | 30 | 长窗:趋势基线的回看窗口 |

安装

三步,实测于 @deepseek-ai/dsh@0.1.7-alpha.1(需 pnpm 在 PATH 上):

① 装进 profile:dsh plugin 把参数原样转发给 pnpm,git 包会自动跑 prepare 构建 lib/
dsh plugin --profile web add github:121212165/dsh-plugin-spend-forecast

② 把本仓库根目录 cordis.patch.yml 的内容并进 $DSH_HOME/profiles/web/cordis.patch.yml。
该文件默认是 [],所以要么整份替换,要么把 insert 条目并进同一个数组;不要直接追加——追加会形成两个 YAML 文档,启动即报 failed to parse overlay ... end of the stream or a document separator is expected(本机实测踩过)。

③ 重启 dsh。配置层与 client 半都要重启才生效(客户端按 boot 时算出的内容 rev 下发,硬刷新浏览器没用)。
自检挂载:dsh --profile web --dump-config | grep dsh-plugin-spend-forecast,应看到该条目。

验证状态

- 12 个 node --test 全绿:test/forecast.test.ts 9 个纯函数(双窗日均只算活跃天、趋势死区上下界、模型分组与份额、月末外推、预算钳 0 与烧完日期、空台账)+ test/ledger.test.ts 3 个装配层(readLedger 只认月份文件并计数坏行、坏配置启动点名 spend-forecast、/forecast 端到端读真临时台账并核对每一行输出)。
- 本机 live:读真实 cost-ledger 边车跑通,数字与手算一致。
- 未验证:跨月切换时的月末外推(只在本月内实测)。
预览分享卡片长什么样 ↓121212165/dsh-plugin-spend-forecast
分享 · DeepSeek Harness Hub
121212165/dsh-plugin-spend-forecast

dsh 插件:基于成本账本 sidecar 做支出预测——日消耗速率、月末预估、预算耗尽时间(/forecast)

回到顶部