dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:MMDAI666/dsh-token-attribution
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
中文 · English
一个 DSH 插件:实时记录当前 profile 内每一次模型调用(包括 auto-review 这类不落会话日志的调用),并以 provider 返回的真实 usage 为锚,把 token 归因到系统提示段、工具声明、工具结果、重放推理、注入上下文等内容来源。Host 端在宿主进程内静默采集与持久化;Web 端提供侧边栏 用量 / Token usage 面板。
llm/stream,覆盖主对话、子代理、auto-review、compaction、session-title 与重试 attempt,总量锚定 provider 真实 usage。web_search / web_fetch 次数并估算费用,可归因到具体对话;升级前(M2.5 之前)的调用以「未归因」余量显式呈现。D:\Projects\dsh-token-attribution)。restart-required,重启 DSH 后再查看数据。首次使用:
卸载使用插件管理器的 remove bundle;卸载不会删除账本数据。
files、shell、web、session、goals、schedule、subagents、plugins、browser、workflow),并支持任意自定义分组键。rememberLastTab。web_search / web_fetch,并默认填入 2026–2027 年国务院法定节假日表。| 文档 | 内容 |
|---|---|
| docs/configuration.md | 13 个 Config 字段、价格/分时/节假日/Web API 默认值、dataDir 迁移、需重启字段、rememberLastTab、旧 Host 保存守卫。 |
| docs/accounting.md | token 口径与 char-v1 估算、高峰/空闲计价、Web API 计数口径与限制、M2.5 之前的未归因行、隐私。 |
| docs/ui.md | 七个标签页、共享范围/刷新/导出、会话下钻、明细分页与筛选、设置行为、会话标题、命名。 |
| README.zh.md | 完整中文镜像(与本文中文部分相同)。 |
账本只写非内容元数据:数字与 token 计数、分类名、hash、sessionId、provider/model、时间戳、purpose 与推理强度、origin/preset 标签、委派深度、费用档位/版本,以及稳定的归因错误名。不落盘任何 prompt 文本、系统提示文本、工具参数、工具结果或会话标题;会话标题仅在渲染时从客户端会话 store 解析。详见 docs/accounting.md#privacy-and-what-is-stored。
node --check index.js
node --test --test-isolation=none "test/*.test.mjs"
当前单测为 288 个(2026-11-16 实测;M5 收尾期间数量可能继续变化,按近似值看待)。测试使用 node:test、合成 fixture 与临时 DSH_HOME,不会读写真实 profile。在 DSH Windows 沙箱内请使用上面的 in-process runner(--test-isolation=none):默认 runner 以管道 stdio 启动子进程,会报 spawn EPERM。
要求 Node.js 24+,DSH 引擎范围为 >=0.2.1-rc.1 <0.3.0;零运行时依赖、无构建步骤。
M1a 至 M2.10 已实现;M2.6–M2.10 已安装到 desktop profile(M2.10 历史迁移已 live 执行:3 天共 2,649 条记录)。MIT 许可证,见 LICENSE。验收证据在 evidence/。
中文 · English
A DSH plugin that records every model call in the running profile — including calls that never reach a session log, such as auto-review — and attributes the provider's real usage to system-prompt sections, tool declarations, tool results, replayed reasoning, injected context, and other content sources. The Host half collects and persists headless; the Web half adds the 用量 / Token usage sidebar panel.
llm/stream sees main chat, subagents, auto-review, compaction, session-title, and retry attempts, all anchored to measured provider usage.web_search / web_fetch counts and estimated cost, attributed per conversation, with an explicit unattributed remainder for pre-M2.5 history.D:\Projects\dsh-token-attribution on the development machine).restart-required, restart DSH before expecting data.First use:
Uninstall with the plugin manager's remove bundle action. Removal does not delete the ledger.
files, shell, web, session, goals, schedule, subagents, plugins, browser, workflow) plus arbitrary custom group keys.rememberLastTab.web_search / web_fetch, plus the default 2026–2027 Chinese statutory holiday calendar.| document | covers |
|---|---|
| docs/configuration.md | All 13 Config fields, pricing/off-peak/holiday/Web API defaults, dataDir migration, restart-required fields, rememberLastTab, older-Host save guard. |
| docs/accounting.md | Token accounting and char-v1 estimates, peak/off-peak pricing, Web API counts and their limits, unattributed pre-M2.5 rows, privacy. |
| docs/ui.md | The seven tabs, shared range/refresh/export, session drill-down, Details pagination and filters, Settings behavior, session titles, naming. |
| README.zh.md | Full Chinese mirror (same as the Chinese half of this file). |
The ledger stores only non-content metadata: numbers and token counts, category names, hashes, session ids, provider/model, timestamps, purpose and reasoning effort, origin/preset labels, delegation depth, cost tier/version, and a stable attribution-error name. No prompt text, system-prompt text, tool arguments, tool results, or session titles are written to disk; titles are resolved from the live client session store at render time. See docs/accounting.md#privacy-and-what-is-stored.
node --check index.js
node --test --test-isolation=none "test/*.test.mjs"
The suite currently reports 288 tests (observed 2026-11-16; the count is approximate while M5 settles). Tests use node:test, synthetic fixtures, and temporary DSH_HOME directories — they never read or write a real profile. In the DSH Windows sandbox use the in-process runner (--test-isolation=none) as shown; the default runner spawns child processes with piped stdio and fails with spawn EPERM.
Requires Node.js 24 or newer and the DSH >=0.2.1-rc.1 <0.3.0 engine range. No runtime dependencies and no build step.
M1a through M2.10 are implemented; M2.6–M2.10 are installed on the desktop profile (M2.10 historical migration ran live: 2,649 records across 3 days). MIT licensed — see LICENSE. Acceptance evidence is in evidence/.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。