DSH Plugins Marketplace

DSH Plugins

Plugins

/

Terminal & Clients

/

@dsh-external/dsh-pdf

@

@dsh-external/dsh-pdf

Manifest valid

A DeepSeek Harness (DSH) plugin that reads PDF files of any size (no 64KB limit): full Unicode text extraction (Chinese/English) via pdfjs-dist, with automatic OCR for scanned or image-heavy pages (Windows WinRT OCR zh-Hans-CN + en-US, or optional tesseract.js).

UI (client)hasBundlePatch

dsh-pdf — PDF Reader Plugin for DeepSeek Harness

中文说明

License DSH Platform

A DeepSeek Harness (DSH) plugin that lets the agent read PDF files of any size — no 64KB limit. It extracts the full Unicode text layer (Chinese, English, any script) via pdfjs-dist, and automatically OCRs scanned / image-heavy pages so even handwritten lecture notes become readable text.

usage demoOCR demo

✨ Features

  • read_pdf tool — returns PDF text page by page (pages="1-3", "2", "1,3-5", "all").
  • No 64KB cap — single-file limit defaults to 200 MB (maxFileBytes).
  • Full Unicode text layer — Chinese & English out of the box, other scripts too.
  • Automatic OCR fallback (mode: auto): pages with little text are rendered and OCR'd:
    • Windows WinRT OCR (primary, zero-install): uses the OS built-in zh-Hans-CN + en-US recognizers;
    • tesseract.js (optional): drop chi_sim.traineddata(.gz) and eng.traineddata(.gz) into <cacheDir>/tessdata/ to enable.
  • Mode control — mode=text (text layer only, fast), mode=ocr (force OCR every page), ocrEngine=windows|tesseract.
  • MIT licensed — free to use, modify and redistribute.

📦 Requirements

  • A running DeepSeek Harness instance (profile web or any Cordis-based host)
  • Node.js ≥ 20 (for the host)
  • Windows with zh-Hans-CN/en-US language packs for the Windows OCR engine (most Windows 10/11 installs include them) — or tesseract.js traineddata

🚀 Installation

# 1. clone
git clone https://github.com/henryxiao709/dsh-pdf.git
cd dsh-pdf

# 2. install dependencies (all registry-pinned, including the matching
#    @deepseek-ai/* versions — no manual linking needed)
npm install --ignore-scripts

# 3. inject into the running DSH (via dsh-super-injector, if installed)
#    tell your DSH agent:  dev_install_package <absolute path to dsh-pdf>
#    or add it to the profile's dsh.profile.bundles for startup assembly

All @deepseek-ai/* dependencies are pinned to the same versions the DSH host ships (0.1.0-rc.6), so the plugin works identically whether it is runtime-injected or assembled at boot — no junction linking required.

🧰 Usage

read_pdf file_path=... [pages="1-3"] [mode=auto|text|ocr] [ocrEngine=auto|windows|tesseract] [maxCharsPerPage=20000]

Example result:

{
  "path": ".../test.pdf",
  "totalPages": 7,
  "mode": "auto",
  "pages": [
    { "number": 1, "text": "test… [OCR] test…", "source": "mixed", "chars": 163 },
    { "number": 2, "text": "1 test)…", "source": "text", "chars": 876 }
  ],
  "engines": ["windows: ok", "tesseract: unavailable (no traineddata)"],
  "warnings": []
}

Each page reports source: text (text layer only), ocr (OCR only), or mixed (both).

⚙️ Configuration

The plugin registers a dsh-pdf settings section (host namespace + a settings-UI card): every knob below is adjustable live in the DSH settings UI (Settings → Plugins → dsh-pdf); changes apply immediately and clear the result cache. The same keys can be set in cordis.patch.yml as the composition base:

KeyDefaultDescription
maxFileBytes209715200byte cap per PDF read
readLimitPages50max pages processed per call
ocrMinChars120pages with fewer text-layer chars get OCR'd in auto mode
ocrScale2render scale for OCR (2 ≈ 144 DPI)
ocrEngineautoauto / windows / tesseract
ocrTimeoutMs60000per-page OCR timeout
maxCharsPerPage20000per-page character cap in results
cacheEntries4result cache entries
cacheDir%TEMP%/dsh-pdfscratch dir for the OCR script and temp images

Settings UI: the plugin registers a dsh-pdf settings section — all keys above are adjustable live in the DSH settings UI (Settings → Plugins → dsh-pdf); changes apply immediately and clear the result cache. The cordis.patch.yml values act as the composition base.

🏗️ How it works

read_pdf
 ├─ ctx.fs.readBytes (no 64KB cap)
 ├─ pdfjs-dist: per-page text layer extraction (full Unicode)
 └─ mode=auto: pages with < ocrMinChars chars
      ├─ render page → PNG (@napi-rs/canvas, scale 2)
      └─ OCR: Windows WinRT OCR (powershell.exe, zh-Hans-CN + en-US)
               └─ tesseract.js fallback (WASM, needs traineddata)

Known host caveats handled inside the plugin:

  • Module resolution for runtime-injected plugins — the plugin links its @deepseek-ai/* peers into its own node_modules (scripts/link-deps.mjs), pinned to the host's exact versions.
  • Multiple pdfjs instances — the plugin forces globalThis.Path2D/DOMMatrix/ImageData to its own canvas classes so page.render() never hits a mixed-instance type error.

🧹 Troubleshooting

  • OCR failed (… none of these types String, Path …) — restart DSH after updating the plugin (or dev_reload_package dsh-pdf); this was a stale-module-cache artifact during development.
  • tesseract: unavailable (no traineddata) — expected unless you provide traineddata; Windows OCR is the default engine and needs no downloads.
  • dev_install_package reports Cannot find package '@deepseek-ai/…' — run node scripts/link-deps.mjs first, then retry; if it still fails, restart the DSH host once (Node's internal module cache may hold a stale failed import).

📄 License

MIT © 2026 henryxiao709

Comments

Loading…

From the same category

dsh-TUI

by ccch1mneyyy

DSH 官方公众号收录的 TUI 补位插件:Claude Code 风,鲸鱼顶栏/实时状态/流式思考/双击 Esc 回滚/上下文进度+TPS。npm 一键装。 DSH official WeChat featured TUI plugin — Claude Code style: whale bar, live status, streaming thoughts, double-Esc rol

Terminal & ClientsManifest valid

★ 4.2k

↓ 14.5k/wk

MIT

TypeScript

Oct 7, 2026

dsh plugin --profile terminal add @deepseek-harness-tui/dsh-tui

by strukto-ai

The World's First Virtual Terminal for AI Agents

Terminal & ClientsManifest valid

★ 3.7k

↓ 393/wk

Apache-2.0

TypeScript

Oct 7, 2026

dsh plugin --profile agent add @struktoai/mirage-dsh

by bowenliang123

The best DeepSeek Harness plugin for context insight and management, with context dashboard / browser / sidebar and context command, for context statistics, composition, breakdown, evolution details,

Tools & CapabilitiesUI & ExperienceTerminal & ClientsManifest valid

★ 1.9k

↓ 39k/wk

Apache-2.0

TypeScript

Oct 7, 2026

dsh plugin --profile web add dsh-context

by huiliyi37

官方 DeepSeek Harness 的交互式终端 UI 插件:自研 ANSI 极简交互渲染、流式 Markdown/工具卡、16+ 主题、slash 命令与选择器、输入历史与本地偏好持久化、LSP 诊断、memory记忆,很丝滑的开发体验。

Terminal & ClientsManifest valid

★ 285

↓ 630/wk

Apache-2.0

TypeScript

Sep 30, 2026

dsh plugin --profile terminal add @huiliyi37/dsh-tianshu-tui

by Hilbert-beinghappy

面向 DeepSeek Harness 的 Claude Code 风格终端界面,支持 Windows、macOS 与 Linux,兼容透明终端、VS Code 主题和自定义配色。

Terminal & ClientsManifest valid

★ 197

↓ 108/wk

MIT

TypeScript

Oct 1, 2026

dsh plugin --profile web add seektty

by T-Auto

deepseek-harness Plugin Access and Implementation Standards / deepseek-harness交互生态插件规范与实施标准

Terminal & Clients

★ 81

MIT

JavaScript

Oct 3, 2026

Index only — not installable