rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:ChrisLou-bioinfo/dsh-usage-lite
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
跨全部会话统计 DeepSeek Harness (DSH) 的 token 总使用量,在设置面板新增「用量统计」页。 无第三方依赖、无构建步骤、无网络调用——数据全部来自本地会话日志。
A zero-dependency DSH plugin that aggregates token usage across all sessions and renders it as a settings page (totals, daily trend, per-model and per-workspace breakdown).
~/.dsh/usage-lite/index.jsondsh plugin add github:ChrisLou-bioinfo/dsh-usage-lite
装好后打开 Settings → 用量统计。
适配 DSH 0.2.0-rc.2+(desktop 与 web profile 均可)。手动挂载方式:
在对应 profile 的 cordis.patch.yml 末尾加 - insert: 条目指向本包,仓库根目录的
cordis.patch.yml 即为模板。
ctx.sessionQuery(live 优先、持久化兜底),readSession(id) 读取全量事件。assistant/message 事件上 data.usage 且 data.message.source.kind === "model" 的样本
(流式 assistant/attempt 里的 usage 是过程值,忽略)。inheritedEventCount 之前的事件:fork/resume 会话继承的父会话事件不重复计数。total = input + output + cacheRead + cacheWrite;reasoning 单列(若 provider 上报)。cacheRead / (cacheRead + input);provider 不上报缓存时显示 "—"。fetch /usage-lite/stats → Host 立即返回内存中的聚合快照(毫秒级),
同时在后台做变更检测(stale-while-revalidate);仅首次安装索引为空时同步等待。listSessions() 对比持久化日志 mtime,只重读新增/变更
(live 会话每次都重读内存快照)。~/.dsh/usage-lite/index.json(10s 节流,原子写,版本化,坏文件从空开始)。totals / days(按天)/ models(按模型)/ workspaces(按工作区)/
cells(按天×模型,供前端按时间范围重切)。| 文件 | 角色 |
|---|---|
index.mjs |
Host 半:折叠会话日志里的用量样本,维护增量索引,暴露 GET /usage-lite/stats(inject webServer + sessionQuery) |
client.js |
浏览器半:Settings 面板的「用量统计」页(手工 bundle,只 require 平台种子模块 react;inject slots 服务,注册进 settings.section 槽位) |
cordis.patch.yml |
bundle 挂载模板(- insert: 条目) |
package.json |
dsh.bundle.patch + dsh.client 声明 |
react、react-dom、@deepseek-ai/cordis、
dsh-client-store、dsh-client-ui-slots、dsh-client-ui-primitives、dsh-client-ui-dockkit)。exports.inject 必须是服务名 ["slots"](不是包名);写错会导致 web boot
判定 "entry did not activate" 并拒绝启动,桌面版连续失败后会触发恢复流程重置 profile patch。dsh plugin remove dsh-usage-lite,或删掉 patch 里的 insert 行;
~/.dsh/usage-lite/ 索引可一并删除。CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。