Introduction¶
In the DeepSeek Harness (DSH) ecosystem, processing local documents often raises privacy concerns or involves complex network requests. The following section introduces a plugin maintained by ralfsqual. It adds a read_pdf tool for Agents through purely local parsing, solving the need to read local PDF text directly without going through the network.
What is dsh-pdf-reader¶
This is a DeepSeek Harness plugin whose core function is to register the read_pdf tool, which uses the pdfjs-dist library to extract PDF text page by page. The tool runs entirely locally, involves no file uploads or network requests, and strictly limits paths to the current workspace.
Core Features¶
- Local PDF text extraction
- Page-by-page parsing (using
--- page N ---separators) - No uploads, no network requests
- Paths limited to the workspace
Installation and Activation¶
Install using the official command:
dsh plugin --profile web add github:ralfsqual/dsh-pdf-reader
Or install from a local path:
dsh plugin --profile web add /path/to/dsh-pdf-reader
After installation, restart dsh web so the Agent can invoke the tool in new sessions.
Tool Parameters¶
path(string): PDF path. Supports relative paths from the current working directory or absolute paths within the workspace.maxPages(number): Maximum number of pages to extract. Defaults to500. Set to0for unlimited.maxChars(number): Maximum number of characters returned. Defaults to120000.
Typical Usage¶
After receiving an instruction, the Agent invokes the tool. Example:
Read @docs/spec.pdf and summarize the requirements.
读取 @docs/report.pdf 并总结要点。
How It Works and Security¶
The tool is registered via defineTool, and uses pdfjs-dist (version 2.6.347) for parsing. The parsing result is a structured object containing pages, extractedPages, truncated, empty, and text.
In terms of security, it strictly follows these restrictions:
- Read-only and local: It only reads files and never writes files or executes commands; parsing is completed on the host, with no network requests.
- Path isolation: path must be within the workspace path to prevent out-of-bounds access (e.g., ../ is rejected).
Environment Requirements and Known Limitations¶
Environment Requirements:
- A web Profile (or a Profile with Agent capabilities) for running DeepSeek Harness is required.
- Node.js version must be >= 22.19.
Known Limitations:
- Only text layers are extracted; scanned or image-based PDFs cannot be extracted (OCR is required).
- When used with the @ plugin, path must not start with @.
- Large files are limited by maxPages and maxChars, and output may be truncated.
References¶
- GitHub: https://github.com/ralfsqual/dsh-pdf-reader
- Ecosystem Directory: https://www.skillhub.cn/plugins/ralfsqual/dsh-pdf-reader