
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
dsh-usage-meter
Advanced tools
DSH(DeepSeek Harness)模型用量仪表盘插件:按服务商/模型汇总全部会话 token 用量(assistant/message 带 usage 事件),设置页「用量」板块展示,含今日/7天/30天趋势柱状图。
DSH(DeepSeek Harness)模型用量仪表盘插件。在设置页新增「用量」板块,按服务商/模型汇总全部会话的 token 用量,支持今日 / 近 7 天 / 近 30 天三档时间范围趋势图。
package.json 声明 dsh.bundle,随 dsh plugin add 自动加入 profile 层栈sessions / fs / sessionQuery / webServer)与官方内置包 @deepseek-ai/dsh-home-paths,不 import 任何第三方包ctx.sessionQuery(live-preferred 语料),持久层内部完成 zstd 解压与回放校验,不依赖外部命令$DSH_HOME/storages/usage-meter.json,经 ctx.fs.writeText 原子写(tmp + rename)assistant/message 且带 usage 的事件(失败请求无 message,不计)data.message.source.provider / modelcacheRead ÷ (input + cacheRead)插件已发布到 npm,并声明 dsh.bundle manifest:
dsh plugin --profile web add dsh-usage-meter
dsh plugin add 会将包追加进 profile 的 dsh.profile.bundles 层栈,其 cordis.patch.yml 自动插入插件行;client 部分经 dsh.client 声明被 dsh-client-modules 扫描进 __DSH_BOOT__。
安装后重启 dsh web(或刷新页面加载 client bundle),打开 设置 → 用量 即可查看。
| 接口 | 说明 |
|---|---|
GET /dsh-usage-meter/summary?range=today|7d|30d | 汇总 + byProvider + byModel + series(今日按小时、其余按天),全部按 range 过滤 |
GET /dsh-usage-meter/sessions | 每会话对账数据 [{sessionId, watermark, requests, totalTokens, provider, model}] |
summary 返回字段:
{
"updatedAt": "2026-08-15T01:06:33.031Z",
"range": "today",
"requests": 36, "inputTokens": 19049, "outputTokens": 42036,
"cacheReadTokens": 4378368, "cacheWriteTokens": 0,
"totalTokens": 4439453, "cacheHitRate": 0.995668,
"byProvider": [{ "provider": "opencode-go", "requests": 36, /* ... */ }],
"byModel": [{ "provider": "opencode-go", "model": "deepseek-v4-flash", "requests": 36, /* ... */ }],
"series": [{ "label": "08:00", "requests": 28, "totalTokens": 3240870, "cacheReadTokens": 3199360 }]
}
ctx.sessionQuery.listSessions() 列出全量会话语料;活会话折内存 session.events 全量 + session/event 事件增量,历史会话经 ctx.sessionQuery.readSession() 读完整原始日志ctx.fs.writeText 原子写 usage-meter.json插件同时把每个带 usage 的事件写入 cc-switch 的用量数据库(~/.cc-switch/cc-switch.db),使其「用量统计」的「全部」视图可以和其他 CLI 一起看到 DSH 的 token 用量:
app_type='dsh'、data_source='dsh_session'、request_id='dsh:<会话ID>:<seq>';input_token_semantics=2(input 不含 cacheRead);费用一律写 0,只搬 tokensession_usage_dedup(该表永不清理;cc-switch 归档会删 proxy_request_logs 旧明细,不能拿明细表判重);日志行与 dedup 行同事务写入,短事务 + busy_timeout=5000 + BUSY 退避重试request_id 已记同一用量。写入前按指纹(app_type 跨 dsh→claude/codex、model、input/output/cache_read、created_at ±600s)匹配 data_source='proxy' 的行,命中即跳过且不写 ledger(以便 proxy 行日后被归档删除时下次同步能补导)。对齐 cc-switch PR #6724 review fix 写入侧node scripts/backfill-ccswitch.mjs(--dry-run 只读对账;首次写真库前自动把库备份到仓库 backups/)created_at 为秒级 epoch(与库内既有行一致),来自事件 time(毫秒)取整DSH_CC_SWITCH_SYNC=0 关闭(默认开);DSH_CC_SWITCH_DB 可覆盖目标库路径(测试用)node test/verify.mjs # 自包含合成测试:口径 / 幂等 / 日志变短 / summary 自洽 / cc-switch 同步
FAQs
DSH(DeepSeek Harness)模型用量仪表盘插件:按服务商/模型汇总全部会话 token 用量(assistant/message 带 usage 事件),设置页「用量」板块展示,含今日/7天/30天趋势柱状图。
We found that dsh-usage-meter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.