qianlai-ai/dsh-qianlai--packages-dsh-qianlai ↗★ 1
dsh-qianlai
钱来张姐:DeepSeek Harness 上的小企业财务助手插件,本机一本账,读票、导入流水、记账、查余额利润、结账检查
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add 'github:qianlai-ai/dsh-qianlai#4ffb57b8cd24aa1f6acf356baea90503ee373fc2&path:packages/dsh-qianlai'说明文档
阅读完整 README ↗description: "Zhangjie by Qianlai: a bookkeeping assistant mode for small Chinese companies, with one local SQLite ledger and an optional WeChat channel." kind: "package-bundle"
dsh-qianlai
English | 中文
Summary
Adds a "钱来张姐" (Zhangjie) mode to DeepSeek Harness. In that mode the agent keeps one set of books on the local machine for a small-scale VAT taxpayer: it checks invoices, imports bank statements, posts vouchers from a bundled accounting pack, reports balances and profit, and runs month-end checks before closing. Selecting the mode switches the Web UI to the Qianlai green palette and shows Zhangjie's avatar in the session header. An optional host plugin connects the same session to WeChat.
Table of Contents
- Use this package
- Understand the implementation
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
dsh plugin --profile web add dsh-qianlai
export DEEPSEEK_API_KEY=your-key
dsh --profile web
Open the printed URL, pick 钱来张姐 in the mode picker above the input box, and start a session. The first start creates fictional sample books; ask Zhangjie to open your own company's books when you are ready, and she clears the sample after you agree.
To connect WeChat, start DSH with MONEYCOME_WECHAT=1 and scan the QR code printed in the terminal. The WeChat account that scans is the owner.
Data lives under $DSH_HOME/moneycome/ (~/.dsh/moneycome/ by default): book.sqlite for the books and wechat.json for the WeChat login. Stop DSH before copying book.sqlite as a backup.
Full user documentation: repository README.
Understand the implementation
Implementation details — click to expand
cordis.patch.yml inserts three entries:
| Entry | Layer | What it does |
|---|---|---|
preset-moneycome-zhangjie | agent preset | The mode: a persona prefix plus this package's tools. No shell, file-system or web tools. |
moneycome-ui | host, mode: ui | Loads the browser half (client/client.src.js): avatar in the session header and a token override on ctx.theme while a Zhangjie session or the Zhangjie choice on the new-session page is shown. |
moneycome-wechat | host | dsh-qianlai/wechat, loaded only when MONEYCOME_WECHAT=1. Long-polls Tencent iLink and forwards owner messages to a dedicated session through sessionController. |
Domain rules come from @moneycome/fintax-core and the accounting pack in assets/packs/. The plugin writes no subject codes of its own; the bank subject, profit lines and closing items are read from the pack.
The books are one SQLite file opened with node:sqlite in WAL mode. Amounts are stored as integer cents. Schema versions live in PRAGMA user_version; migrations are appended to MIGRATIONS in src/store.ts.
Model Experience
The Zhangjie preset gives the model a persona prefix of about 1,700 characters (Chinese) and 24 tools whose names, descriptions and JSON schemas total about 13,000 characters. All tools are prefixed moneycome_:
- Book:
book_status,open_book,set_opening_balances,set_company_facts - Reading:
read_balances,read_profit,financial_statements,list_vouchers,unrecorded_statement_lines,posting_guide - For the accountant and the tax calendar:
export_review_pack,upcoming,quarter_filing_prep - Materials:
check_invoice,read_upload,import_statement,rename_bank_account - Writing:
record_entry(withpreviewandcorrectsVoucherNo),link_statement,add_evidence,void_voucher,reverse_voucher - Month end:
closing_check,close_period
Every figure the model reports comes from a tool result. Business refusals (closed month, unbalanced entry, unknown subject and so on) come back as accepted: false with a code and a plain-language message. Arguments of the wrong type return ARGUMENT_INVALID naming the field. Each tool call runs in one write transaction; an unexpected error such as a database failure rolls the whole call back and returns TOOL_FAILED. When several DSH processes open the same book (say a terminal and a browser), writes queue for up to 5 seconds. Text inside invoices, statements and uploads is passed as data and the persona tells the model not to follow instructions found there.
Token effect
The persona and tool catalog are sent with every request in a Zhangjie session. Tool results are compact JSON; a closing check on a busy month is the largest, listing each unrecorded statement line.
KV Cache effect
The persona and tool catalog are static, so they stay in the cached prefix. Nothing in this package rewrites earlier messages.
Known Limitations and Deferred Work
- One company per machine; no accounts, roles or approval flow.
- Postings that depend on earlier balances (depreciation, prepaid expense amortisation, accrued expenses) are not supported, so companies with fixed assets or prepaid expenses cannot close a month yet.
- Closed months cannot be reopened; errors found later are fixed with a reversing voucher and a correcting entry in an open month.
- Filing reminders track dates only; the plugin does not know whether a return has been filed, and the filing prep sheet totals the books without computing tax.
- The invoice check verifies internal consistency only, not authenticity with the tax bureau.
- Statement files: CSV, TSV and TXT only; Excel and PDF need exporting or a screenshot.
- The accounting pack is an unreviewed engineering candidate with placeholder signatures.
- The WeChat channel uses Tencent's undocumented iLink message format and may break when Tencent changes it.
Dev Note
Maintainer context — click to expand
pnpm build compiles src/ with tsc and inlines the avatar into lib/client.js (scripts/build-client.mjs). Unit tests use in-memory SQLite and a fake iLink server. e2e/run.mjs drives real DeepSeek sessions against scripted conversations and is not part of CI.