# v3.4.0 — Optional local OCR engines / 按需安装本地 OCR 引擎 **Release identity / 发布状态:** This document describes the contents of v3.4.0, not proof that the version is already published. Publication requires an immutable GitHub tag/Release, npm `latest` and successful signed-package identity verification by the protected Release workflow. / 本文说明 3.4.0 更新内容;正式发布须以受保护工作流、不可变 GitHub tag/Release 和 npm `latest` 的包体核验结果为准。 ## Overview / 主要变化 **Both local OCR engines are optional. No native OCR executable or model is installed during ordinary `dsh-vision-router` plugin installation.** Most users can continue to use the existing, authorized vision-model fallback for image transcription without installing either local engine. / 两个本地 OCR 引擎完全可选。用户正常安装 Vision Router 不会自动安装 OCR 程序或模型;多数用户无需配置,继续按既有策略回退视觉模型。 Open **DSH Settings → Vision Router → Local & device → Optional local OCR** (本地与设备 → 可选本地 OCR) to inspect and manage the two local engine choices: ### Tesseract / 系统优先,插件私有版可选 - If the machine already has usable system `tesseract` with **both** `chi_sim` and `eng` language data, **reuse it directly** and disable the redundant Install button. Never uninstall or modify the user's global Tesseract. / 系统已有可用的简体中文和英文 Tesseract 时直接复用,不重复下载、不改动系统安装。 - Otherwise an explicit **Install Tesseract** click can install a **private Tesseract.js 7.0.0/WASM** runtime and Chinese/English traineddata. It is not installed by npm during plugin installation and does not require a system-wide package manager operation. Pinned npm SHA-512 and language-data SHA-256 are checked, staged atomically, and removed only by the plugin-owned uninstall. / 未检测到完整系统版时,用户可以在设置里主动安装插件私有的 WASM 与中英文模型,或独立卸载。 - Managed recognition executes in a bounded Node subprocess with cancellation, resource limits and Electron Host compatibility. Installation and recognition can require temporary network access for the opt-in download, but later inference uses locally installed assets. / 安装时需联网,安装完成后的识别在本机进行;执行有超时、取消与资源限制。 - Native system `tesseract` is never owned by the plugin. The private WASM and system binary are distinct providers of the same `engine=tesseract` OCR compatibility path; neither is guaranteed to transcribe stylized Chinese typography perfectly. / 系统版与插件版均归入 Tesseract 兼容路径,复杂文字效果仍有局限。 ### PP-OCRv6 small / ncnn — verified offline archive only - macOS ARM64 and Windows x64 can install and uninstall a **trusted user-supplied local archive** through the Settings file picker. The existing owner-installed binary and five model assets are SHA-pinned, and native execution retains the earlier supervision/deadline gates. / 支持从用户自备的可信离线包在设置页安装和卸载,保持完整性校验和子进程边界。 - **The public PP-OCRv6 native archive remains NOT CLEARED FOR REDISTRIBUTION.** This release does **not** host, download or attach worker executables or model weights to npm or GitHub Release; a file picker is **not** an automatic public installer. / 原生包仍未通过公开分发审核,不提供官方公网一键下载,也不会把原生二进制和模型随 npm 打包。 - Damaged but verifiably plugin-owned PP installations may now be removed safely without relying on intact worker/model hashes; system/unowned paths remain protected. / 插件管理的损坏安装也可卸载,不允许清理无关用户目录。 ## Fallback, privacy and defaults / 回退、隐私与默认行为 - `vision_ocr(auto)` continues to prefer an installed, verified PP-OCRv6 native worker where supported, then available managed/system Tesseract, and then the existing model fallback if local OCR is unavailable/empty. An explicit `engine=tesseract` never invokes the cloud vision chain; explicit `engine=vision` continues to bypass local engines. / 原来的 `auto` 优先级保持,新引擎未安装时不会影响视觉模型后备。 - **Default free vision fallback may transmit the image (or crop) and request metadata to an external provider.** Installing a local OCR engine does not make the full plugin or the chat model offline. Strict local-only vision continues to prevent the plugin's cloud visual requests; user must also use a local chat model for fully local end-to-end processing. / 云端后备依旧可能传图;严格本地模式按既有策略执行。 - No automatic first-run downloads, prompt to force-install either engine, change to existing user settings, or automatic Host/profile migration. / 不强制下载、不自动迁移、不更改用户现有设置。 ## Review evidence and known limits / 审核与限制 - **#856 final head `c8d3b9278ec3259862a40926608d139be560aea7`: 14/14 GitHub Actions workflows passed, including two Node full-test versions (24.9.0/24.21.0), complete 28-job CI, exact minimum/recommended/current DSH Host and latest Alpha Host/Desktop gates, security analysis and browser Settings acceptance.** - **Real Mac and Windows x64 isolated private install → image OCR → uninstall:** Both passed without altering global packages. Both recognized a generated `HELLO 123` screenshot (confidence 87/88). The Mac Chinese sample `你好世界 123` came back as `你 好 世界 123` (confidence 94), highlighting spacing limitations rather than perfect transcription. / Mac、Windows 真实安装/识别/卸载通过,中文可能出现空格。 - Existing PP native worker tests are from earlier 3.3.0/isolated work and do not constitute approval of public native asset redistribution, nor do they prove original Issue #836 reporter-specific images were recognized exactly. / 仍不可将实验室验证误当作公开原生包放行。 ## Compatibility and upgrade / 兼容与升级 - DSH `>=0.2.1-rc.5 <0.3.0-0`; Node.js `>=24.9.0`. No support-floor change. - Before upgrading, back up DSH Profile, Settings, Sessions and attachments; run the read-only `doctor --upgrade-preflight`; keep `v3.3.0` available as rollback. No automatic migration. - Third-party Desktop builders and unreviewed installations are not certified solely by official Host CI. / 第三方打包器需另行验收。 - Verify the protected release SHA, GitHub Release asset SHA256SUMS and npm tarball identity/provenance before assuming the installed build is v3.4.0. / 以正式工作流和包体哈希为准。