Tools & Capabilities
dsh-pdf
sunshine-lang/dsh-pdf · ★ 7
PDF toolbox for DeepSeek Harness: extract text, metadata, and page ranges via pdfjs-dist (local, no API key)
安装
dsh plugin --profile web add github:sunshine-lang/dsh-pdfGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
中文 | English
PDF toolbox for DeepSeek Harness: extract text, metadata, and page ranges from PDF files. Local parsing via PDF.js (pdfjs-dist) — no API key, no network.
Features
pdf_readtool: per-page text extraction with page markers.- Page selection:
"1-3,5"or"all"— read large documents in chunks. - Document metadata (title) and total page count.
- Bounded by design: byte cap on the file, page cap per parse, character cap per call — truncation is explicit and tells the model how to continue.
- Reads through the harness filesystem seam (
ctx.fs), so the deployment's permission and sandbox policy applies.
Install
From GitHub
dsh plugin --profile web add "github:sunshine-lang/dsh-pdf"
Then restart dsh --profile web. lib/ is prebuilt and committed, so no build permission is needed.
From npm
dsh plugin --profile web add dsh-pdf
From a local checkout (development)
dsh plugin --profile web add ./dsh-pdf
Official DSH runtime packages are supplied by the host as optional peers. Run npm install --ignore-scripts in this checkout for build dependencies before using a local link; local links do not install pdfjs-dist automatically.
Use
Start the Web UI and ask the model, for example:
Read the first 3 pages of
paper.pdfand summarize them.What does page 7 of
contract.pdfsay?
The model calls pdf_read with path (required) and optionally pages ("1-3,5" or "all"). Large outputs stop at a page boundary with a note; the model continues with a page range.
Configuration
Override any key through cordis.patch.yml or the profile's patch layer:
- patch:
- id: dsh-pdf
config:
maxFileBytes: 52428800
maxPages: 200
maxCharsPerCall: 20000
| Key | Default | Meaning |
|---|---|---|
maxFileBytes |
20971520 (20 MiB) |
Inclusive byte cap on the whole PDF; larger files fail with a loud error. |
maxPages |
500 |
Maximum pages parsed in one call; larger documents truncate with a notice. |
maxCharsPerCall |
12000 |
Maximum characters returned by one call; the result truncates at a page boundary. |
Invalid configuration fails the load with an actionable error.
Development
npm install # or pnpm install
npm run build # tsc → lib/
Rebuild from a DeepSeek Harness checkout (for type resolution against the workspace source) uses tsconfig.local.json instead: tsc -p tsconfig.local.json.
Tests: tests/fixtures/sample.pdf is generated by make-test-pdf.mjs (dependency-free); w3-dummy.pdf is the W3C dummy test file. Integration test: node --import tsx/esm test-integration.ts from a harness checkout.
More plugins by this author
All DeepSeek Harness plugins by this author, in one place: dsh-plugins
License
MIT.
Compatibility
Version 0.1.1 passed packed install, real CLI startup, PDF assertions and removal in disposable minimal Profiles on DSH 0.1.5-rc.2 and 0.1.6-alpha.2. Alpha.1 remains unknown. Requires Node.js >=22.19; tested on macOS arm64 with Node.js 22.23.1. See the evidence and reproduction commands for exact scope and limitations.