插件目录 / Developer / dsh-ocr-seam-guard
dsh-ocr-seam-guard
已验证 · 实测可装 DosterBool
功能简介
Self-healing guard for dsh-ocr: auto re-applies the llm-deepseek adapter OCR seam and plugin fixes wiped by dsh upgrades
可用 — 实测通过,早期项目
Self-healing guard for dsh-ocr: auto re-applies the llm-deepseek adapter OCR seam and plugin fixes wiped by dsh upgrades 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-ocr-seam-guard
Self-healing guard for the dsh-ocr plugin on
DeepSeek Harness: automatically re-applies the
local patches that npm i -g @deepseek-ai/dsh upgrades (or a plugin re-install) wipe out.
中文说明见下方。
What it guards
The dsh-ocr plugin needs three fixes that live OUTSIDE the profile (so profile reconcile never
touches them, and a harness upgrade wipes the adapter one):
| Fix | File | Wiped by |
|---|---|---|
The ocr service seam in the official dsh-llm-deepseek adapter |
<dsh package>/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js |
npm i -g @deepseek-ai/dsh upgrade |
| UTF-8 stdout enforcement for the Python OCR subprocess | <DSH_HOME>/profiles/node_modules/@deepseek-ai/dsh-ocr/lib/index.js |
plugin re-install |
rapidocr 1.2.3 API fix (text_det→text_detector, text_rec→text_recognizer) |
<DSH_HOME>/profiles/node_modules/@deepseek-ai/dsh-ocr/tools/ocr_image.py |
plugin re-install |
How it works
On every harness boot the plugin checks the three sites. A missing fix is re-applied with anchored
string replacements — every anchor must match exactly once or the whole site is skipped (never a
partial patch) — then the patched module is import-verified in a child node process. A failed
verification rolls the file back and reports the error. If the upstream code shape is unknown
(anchors drifted), the guard does nothing but log.
When a fix is (re-)applied, the running process already holds the old module — restart dsh once
more to activate.
Install
dsh plugin --profile web add github:YOURNAME/dsh-ocr-seam-guard
# or from a local clone:
dsh plugin --profile web add file:D:/path/to/dsh-ocr-seam-guard
Restart dsh. The guard logs its status on every boot:
adapter seam: ok— everything in placeadapter seam: patched— just re-applied; restart once to activateadapter seam: skipped— upstream code drifted, human review needed
Upgrade flow
npm i -g @deepseek-ai/dsh # upgrade wipes the adapter patch
restart dsh # guard auto-patches at boot (log: "restart once")
restart dsh again # patch active
Configuration
| Env var | Default | Purpose |
|---|---|---|
DSH_OCR_ADAPTER_FILE |
auto-detect (npm global root) | override the adapter file path |
The adapter is located via npm root -g with a fallback to the platform npm global directory;
only npm-global dsh installs are supported out of the box.
License
MIT.
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-ocr-seam-guard」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:DosterBool/dsh-ocr-seam-guard Headless(CLI)profile:
dsh plugin --profile headless add github:DosterBool/dsh-ocr-seam-guard 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。