dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
dsh 只读记账仪表盘插件:会话页「记账」Tab 展示 beancount 账本月度快照(收支总览/资产结构动态分组/支出分类/最近交易),只读,复用 ledger.py,Fava 保留做深度分析
在 dsh web 会话页的 「记账」Tab(与「梦境」并排)展示 beancount 账本的月度快照: 本月收支总览、资产结构、支出分类占比、最近交易。只读——不在插件里记账,Fava 保留做深度分析。
要求 dsh ≥ 0.1.7-rc.1(已在 0.1.7-rc.1 实测通过)。
ctx.settings.register() 已移除(2026-09-24):原 ledger settings namespace 并入插件 Config,可热改字段标 .volatile();inject 去掉 settings。create() 工厂(0.1.7 客户端校验):client.js 与 index.js 的 result / payload codec 均已补 create()。进入「记账」Tab / 点「刷新」
→ RPC /dsh-ledger/dashboard
→ LedgerEngine:
1. 解析当月账本文件 Beancount/<year>/<month>.bean(交易/分类/收支)
2. exec ledger.py balance(全部账户余额)
→ 输出统一 JSON → Tab 渲染
数据源复用现有 ledger.py(skill 自带),脚本零改动;当月交易直接从按月分文件的 .bean 解析,不调账本写入。
Assets:<类别> 自动发现(任意 beancount 结构自适应),活期 = 数字尾号卡账户(如 Assets:CMB:1234 形态)dsh-ledger/
├── index.js # host 插件:settings + connection.rpc(/dsh-ledger)
├── client.js # 浏览器 bundle:conversation.view "记账" Tab
├── lib/ledger-engine.mjs # 解析 .bean + exec ledger.py balance → 仪表盘 JSON
├── cordis.patch.yml
└── package.json
node_modules/@deepseek-ai → /usr/local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai,否则 ERR_MODULE_NOT_FOUND: Cannot find package '@deepseek-ai/schemastery' 导致整个 profile 起不来ctx.typert,inject 列表需含 "typert"(曾漏掉)"webServer"(dsh 0.1.5 起严格检查):漏了报 cannot get property "webServer" without inject,整个 profile 起不来(2026-09-10 踩过)Assets:TimeDeposit:享定存70007 等中文账户,正则需允许 \u4e00-\u9fff,否则几十万资产解析不到~/.dsh/profiles/web/package.json 的 dependencies(link)+ dsh.profile.bundles 两处# 引擎单测(真实账本)
node -e "import('./lib/ledger-engine.mjs').then(async m => { const e = new m.LedgerEngine(); console.log(JSON.stringify(await e.buildDashboard(), null, 1).slice(0, 800)); })"
# RPC 实测
curl -s -X POST "http://127.0.0.1:3080/dsh-ledger/dashboard" \
-H "Content-Type: application/json" \
-d '{"type":"client-request","rpcId":"v1","method":"dashboard","payload":{}}'
改代码后重启 web 生效:launchctl kickstart -k system/com.dsh.web