Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:farchanjo/language-plugin-dsh
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Pin the language of the chat and of the artifacts in DSH — terminal and web.
Two independent axes, both enforced from a system-prompt section:
| Axis | Values | Meaning |
|---|---|---|
chat |
inherit (default), auto, off, a BCP-47 tag |
the prose the agent replies with |
artifacts |
en-US (default), inherit, off, a BCP-47 tag |
everything written into a file or to a forge |
decide |
auto (default), stopwords, jev, off |
how the guards judge a language |
chat defaults to inherit: the reply follows the language the user writes.
auto is an accepted alias for it. artifacts is pinned to en-US by
default, so identifiers, comments, documentation, commit messages and PR bodies
are always English whatever the reply language is. /lang opens a numbered
picker, and a pick typed straight into the composer is swallowed (nothing is
sent to the model).
Every tagged version ships a packed tarball on the Releases page:
dsh plugin --profile <profile> add \
https://github.com/farchanjo/language-plugin-dsh/releases/download/v<version>/language-plugin-dsh-<version>.tgz
Verify the asset against the .sha256 published beside it before installing.
Remove with dsh plugin --profile <profile> remove language-plugin-dsh.
A git clone works too, for development. The release contract — bump, tag, assets, checks — lives in AGENTS.md.
/lang # open the picker (also: /lang status)
/lang chat pt-BR # force the prose language by tag
/lang chat inherit # follow the user (default; `auto` is an alias)
/lang chat off # no chat rule
/lang artifacts en-US # keep artifacts in English (default)
/lang artifacts inherit # follow the chat axis instead
/lang artifacts off # no artifact rule
/lang strict on # correct an ignored chat language
/lang decide auto # how the guards judge (auto, stopwords, jev, off)
/lang reset # back to inherit / en-US / off
The picker lists 79 languages by number (the first ten are the most common, the rest follow alphabetically). Labels are the English names from Intl.DisplayNames; the status line carries the tag. Keys:
| Key | Action |
|---|---|
1-79 |
set the chat language |
0 |
follow the user (inherit) |
o |
chat off |
s |
toggle strict |
q |
close the picker |
The picker closes on any other message, which then goes through normally. It
expires after 120 s. A language outside the list is set by tag
(/lang chat eo). Language tags are canonicalized (pt-br becomes pt-BR)
and validated with Intl.getCanonicalLocales; anything that is not a tag is
rejected.
State lives in ~/.config/language-plugin-dsh/config.json (0700 directory,
0600 file, atomic write). The file is the runtime truth; the row config in
cordis.patch.yml only seeds a fresh install.
The guards need to know which language a text is in.
| Mode | Behaviour |
|---|---|
auto |
offline for the six languages the local detector knows, the decision model for anything else |
stopwords |
always offline |
jev |
always the model, with the offline detector as fallback |
off |
never judge; the guards stay inert |
The model is TypeSafe System One, asked as a noul plus a choice with
confidence. A sure answer decides; an unsure one falls back to the offline
detector; a failure of any kind falls back too. Nothing ever blocks a turn on a
network problem. Answers are cached by content hash, and prose sent upstream is
capped at 4000 characters.
The key comes from TYPESAFE_AI_FABRICIO_KEY (or TYPESAFE_API_KEY) in the
environment, then from the credential store.
The chat rule carries the verbatim list — code, commands, paths, identifiers, error strings, tool output — so a forced prose language never translates a payload. The artifact rule names every artifact kind and exempts quoted user text, untouched existing files, and localization resources that follow their own locale.
An explicit request for another language in one message wins for that turn only.
| Layer | Surface | Effect |
|---|---|---|
| Reminder | system-prompt/assemble |
the policy is restated in the runtime-context snapshot, which sits at the tail of the request and replaces itself every step |
| Write guard | tools/pre-execute |
before write/edit runs, the comments and documentation are checked; a wrong language denies the call with a retry instruction, so nothing bad lands on disk |
| Summarizer | own compaction engine |
subclasses the stock engine, so every inherited step stays and only the directive gains the artifact language |
| Title | llm/stream (purpose: 'session-title') |
the title follows the chat language |
The summarizer is mounted from inside the plugin, not from a row, and only when
nothing else claims compaction. A preset or a backend-mode jev is therefore
detected instead of crashing the boot; the checkpoint just keeps the host
language. The stock row is disabled so it cannot race ours into the service.
Everything inherited — range selection, replay prefix, envelope, usage
accounting — is untouched, and jev-compaction keeps pruning before the summary.
The write guard judges only human prose: documentation bodies and comment lines. Identifiers, strings, and data files are ignored, and so are localization resources. A file with fewer than eight words of prose is left alone. Every agent gets its own budget: at most two denials and two corrections per turn.
strict if that matters.decide: jev (or auto) to be judgeable at all; with the offline detector
alone, ja-JP produces no blocks.jev sends the judged prose to TypeSafe, costs tokens per uncached call, and
can add up to 2.5 s before a write.@deepseek-ai/dsh-compaction-basic, declared as a
dependency so dsh plugin add installs it. A host upgrade can move that
class; bump the pin with it.compaction. The plugin checks first, so a
preset or a backend-mode jev simply wins: nothing crashes, only the summary
language is lost. Switch jev-compaction to its ./backend entry and our
engine stands down on the next boot.pnpm install
pnpm test # node --test
pnpm lint # biome check (format + lint)
pnpm lint:fix # apply the safe fixes
ESM, no build step, no runtime dependency. Biome owns formatting (single quotes, 120 columns) and the recommended lint set.
MIT.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: chat。