New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

dsh-plugin-doc-reader

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsh-plugin-doc-reader

DeepSeek Harness host plugin: a read_document tool for text, PDF, DOCX and XLSX files over the harness filesystem backend (ctx.fs).

latest
Source
npmnpm
Version
0.1.3
Version published
Weekly downloads
32
10.34%
Maintainers
1
Weekly downloads
 
Created
Source

dsh-plugin-doc-reader

中文说明

A DeepSeek Harness host plugin: the model-facing read_document tool. It reads document files that the plain read tool cannot handle — PDF, DOCX and XLSX — plus UTF-8 text files, all through the harness filesystem backend (ctx.fs), so it inherits the session workspace resolution, the sandbox policy and the fs-observation policy exactly like the built-in tools.

How it works

One tool, four formats, dispatched by file extension (or an explicit format argument):

FormatExtensionsExtractor
textanything else (.md .txt .csv .json .py …)UTF-8 decode, binary rejected (NUL sniff), BOM stripped
pdf.pdfpdf-parse (extracts the text layer only; see limitations)
docx.docxmammoth.extractRawText
xlsx.xlsx .xlsmxlsx → per-sheet TSV rows

Extracted text is windowed with the same semantics as the built-in read tool: 1-based line numbers, offset/limit paging, line-length and byte caps, and the OpenCode-style <path>/<type>/<content> envelope.

Config

KeyDefaultMeaning
readLimit2000Default and maximum lines returned by one call.
maxFileBytes67108864Byte cap for one document read.
sheetRowLimit200Rows kept per worksheet (longer sheets get a ... (N more rows) footer).

Installation

dsh plugin --profile web add dsh-plugin-doc-reader
# restart dsh web

Build & test

npm install --legacy-peer-deps   # pdf-parse / mammoth / xlsx
node --test                      # pure-parse + mock-ctx contract tests

Model Experience

System prompt

One guidance section (tool:read-document) points the model at read_document for PDF/DOCX/XLSX and notes offset/limit paging.

Tool schema

read_document(file_path, format?, offset?, limit?) with a structured { path, format, offset, lines, totalLines } output schema and the line-numbered envelope rendering.

Known Limitations

  • No image recognition (OCR) — this plugin extracts text only; it cannot read text out of images. Scanned/image-only PDFs (page photos with no text layer) come back empty, and standalone pictures (PNG/JPG screenshots) are refused as binary. OCR / 识图 is explicitly deferred (decision 2026-08: out of scope for now; if added later it would be an opt-in extractor, not a default, given its cost and formula-rendering quality).
  • Text mode is UTF-8 only — other encodings decode as garbage; binary content is refused rather than echoed.
  • Legacy .doc is not parsed — only OOXML .docx.
  • Large documents are windowed — the model reads one window per call; very long files need several paged calls.
  • Formula-heavy PDFs lose mathematical structure (plain text only; no LaTeX reconstruction).

Keywords

deepseek

FAQs

Package last updated on 12 Sep 2026

Related posts