dsh-paper-reader: Reading Local Papers in DeepSeek Harness

Preface

When doing research or writing surveys in DeepSeek Harness (DSH), the assistant typically can only see the snippets you paste, or relies on scattered files in the workspace; local PDF papers usually require switching to an external reader and manually copying abstracts or sections back into the conversation. The community plugin dsh-paper-reader (maintainer: siluwr, category: client) brings “paper library + sidebar reading + assistant tools” into the Harness: it only processes local PDF / Markdown / plain text files, and performs no online fetching. PDF text extraction is implemented in pure Node, with no reliance on third-party PDF libraries and no network requests.

The following describes what it is, what it can do, how to install it, and the typical usage of the panel along with paper_read / paper_list / paper_scan.

What Is This

dsh-paper-reader is a DSH bundle plugin (with a Host-side component registering tools and a local HTTP server, and a Client-side component providing the sidebar panel). Parsed results are cached in $DSH_HOME/paper-reader/, preserved across sessions and workspaces; the assistant reads the same batch of papers as the panel, chapter by chapter, via tools.

The design trade-offs are clearly documented in the README: this plugin does not fetch online content such as arXiv; that requires a provider implementing ctx.web.fetch and network access, which is beyond the scope of this plugin.

  • Plugin directory: https://www.skillhub.cn/plugins/siluwr/dsh-paper-reader
  • Source code: https://github.com/siluwr/dsh-paper-reader
  • License: MIT (version 1.0.0 in package.json)

Core Features

Paper Library and Cache

Capability Description
Persistence The index and structured body text are written to $DSH_HOME/paper-reader/; the entire library can be moved to another directory via the environment variable DSH_PAPER_READER_DIR
Management Supports favorites, removal, and filtering; source files are read-only and will not be modified or deleted

Main files in the library: library.json (index), papers/<key>.json (structured body text), papers/<key>.md (readable export, also usable with Harness’s read tool).

After installation, a “Paper Reading” icon appears at the bottom of the left sidebar (plugin display name: 论文阅读). The panel provides:

  • Title, authors, metadata, abstract
  • Clickable table of contents, sectioned rendering of the body text
  • Font size adjustment, in-paper search (with hit highlighting and previous/next navigation)

Import methods: paste a file path to add a single file; “Browse…” browses directories within the panel; “Scan folder” batch-imports a directory.

“Send to assistant” works via the clipboard: one-click copy of prompts such as “Summarize the full text / Translate the abstract / Explain the selected paragraph” (accompanied by the paper key). After pasting into the conversation, the assistant uses paper_read to read the same paper. The plugin cannot write into other plugins’ input boxes; this is an established DSH requirement for DOM isolation.

Assistant Tools

Tool Purpose
paper_read Returns body text by chapter or character budget
paper_list Browse the paper library
paper_scan Batch-import a directory

The Host side also registers loopback-only, plugin-prefixed HTTP routes on the local machine for the panel to call (e.g., GET /paper-reader/api/{status,library,paper,browse,markdown,search}, POST /paper-reader/api/{ingest,scan,favorite,remove}). The routes themselves carry no authentication; the plugin only responds to requests where the Host is a loopback address, and only accepts endpoints documented in the documentation.

PDF Extraction Implementation (Brief)

lib/pdf.js is a pure-Node PDF text extractor (object streams, ToUnicode, two-column reading order, etc.), with no third-party PDF dependencies. lib/document.js converts PDF / Markdown / text into structured documents with chapters, abstracts, and title/author heuristics. Local benchmark results provided by the maintainer in the README (environment: RTX 4070 SUPER / i5-14600KF): an 8-page IEEE two-column paper yields about 43,222 characters and 14 sections in 208 ms; a 30-page Elsevier paper yields about 89,647 characters and 30 sections in 13 s (including skipping large image streams).

Installation and Activation

The plugin is installed as a bundle. In a Harness session, have the Agent execute the command, or install it from the Plugins page pointing to the same directory, using the command in the README (replace the placeholder with the absolute path of that plugin directory):

plugin_manager install_bundle <absolute path to this directory>

After installation:

  1. A “Paper Reading” entry should appear in the left sidebar.
  2. Check the enabled status and toggles under Settings → Plugins.

Typical Usage

1. Build a paper library in the panel

  1. Open the sidebar “Paper Reading”.
  2. Paste the absolute path of a local PDF / Markdown / text file, or import via “Browse…” or “Scan folder”.
  3. Read the table of contents and body text in the panel, using in-paper search to locate paragraphs as needed.
  4. When the assistant needs to get involved, use “Send to assistant” to copy a prompt with the paper key, then paste it into the conversation.

2. Let the assistant read the same paper by chapter

Describe the task in the conversation (summarize, translate the abstract, explain a certain paragraph, etc.); when the key in the prompt matches one in the library, the assistant can call paper_read to fetch text in segments, paper_list to view existing entries, and paper_scan to batch-import a directory (same service layer as the panel’s “Scan folder”).

3. Development and regression testing (optional)

The README provides Node ESM test scripts (Node ≥ 22 required; the dev environment uses DSH’s bundled Node 24), e.g.:

node test/layout.test.mjs
node test/host-offline.test.mjs
node test/pipeline.test.mjs <a.pdf>
node test/live-http.test.mjs [a.pdf ...]

Offline tests can point DSH_PAPER_READER_DIR to a temporary directory to avoid modifying the real paper library.

Use Cases and Caveats

Suitable for: when you already have local PDF / Markdown / paper text, and want to build a unified library within Harness, read carefully in the sidebar, and have the assistant read the same index chapter by chapter, instead of repeatedly copying full texts manually.

Known limitations (from the README):

  • PDFs with a text layer usually have their titles, abstracts, and chapters extracted well; scanned documents, some embedded fonts, or complex formulas may result in little or messy text, and the panel and tool outputs will indicate this.
  • Two-column layouts are re-ordered via x-clustering; in extreme layouts the reading order may not be ideal.
  • The paper library resides under $DSH_HOME (outside the workspace sandbox); the plugin reads and writes directly with node:fs and guarantees atomic writes itself.

Security and permissions: the plugin runs with the permissions of the current DSH process, reads the local paths you specify, and writes to $DSH_HOME/paper-reader/ (or DSH_PAPER_READER_DIR). Before installing, please read the GitHub repository source code and the MIT license to confirm that the paths and data storage locations comply with your environment policy. The plugin directory on SkillHub is a community ecosystem site, with no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-paper-reader binds local paper reading, library management, and the assistant-side paper_read / paper_list / paper_scan together on a single set of caches and structured documents, and explicitly does not perform online fetching. If you mainly digest local literature within Harness, you can get the bundle installation method from the plugin directory or the repository README, and then confirm in Settings that the plugin is enabled.

  • Plugin directory: https://www.skillhub.cn/plugins/siluwr/dsh-paper-reader
  • GitHub: https://github.com/siluwr/dsh-paper-reader
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye