Saltar al contenido principal
C

dsh-paper-tools

chartatheory/dsh-paper-tools

Gives a DeepSeek Harness agent read access to papers managed by dsh-paper-read. Bridges the isolated PaperReader UI with the main agent.

Instalar

dsh plugin --profile web add github:chartatheory/dsh-paper-tools

README

dsh-paper-tools

Gives a DeepSeek Harness agent read access to the papers managed by dsh-paper-read. PaperReader stays the place where you read PDFs visually; this plugin hands the same text to the normal chat session, so you can ask your main agent about a paper without switching panes.

┌────────────────┐   reads    ┌──────────────────────┐
│  PaperReader   │◄───────────│  dsh-paper-tools     │
│  (UI + store)  │  HTTP/disk │  tool: paper_text    │
└────────────────┘            └──────────┬───────────┘
                                         │ tool call
                                    ┌────▼────┐
                                    │  Agent  │
                                    └─────────┘

Why this exists

dsh-paper-read deliberately keeps its reader chat isolated: every paper runs in its own DSH session (pr-<paperId>) whose preset has no tools. That is good for focused reading, but it means the main agent cannot see any of the paper text. This plugin closes exactly that gap — read-only, on demand.

Requirements

  • DeepSeek Harness with dsh-paper-read installed and at least one paper imported (a parsed text layer is required).
  • @deepseek-ai/dsh-tools is provided by the host at runtime; it is declared as a peer dependency and does not need to be installed in the profile.

Install

# inside the desktop (or any) profile
dsh plugin --profile desktop add /home/<user>/.dsh/plugins/dsh-paper-tools

Or through the in-app plugin manager:

plugin_manager install_bundle  file:/home/<user>/.dsh/plugins/dsh-paper-tools

After enabling, paper_text shows up in the agent's tool list. No restart is needed when the plugin manager reports application: "applied".

Tool: paper_text

ParameterTypeMeaning
paperstringPaper id or a substring of its title. Omit for the most recently read paper.
pageintegerReturn only this page (1-based).
querystringSearch inside the paper; returns matching snippets with page numbers instead of the full text.
maxCharsintegerCharacter cap for the full text (default 20000).

Examples

paper_text()                                  → full text of the last opened paper
paper_text(query="attention")                 → snippets with page numbers
paper_text(paper="Performative Self-Reference", page=3)
paper_text(paper="p_12ab34", maxChars=8000)

Answers are capped: when the text is longer than maxChars, the result says so and tells you which page to continue from.

Where the text comes from

  1. HTTP API of PaperReader — /api/paperreader/papers and /api/paperreader/papers/:id/pages/:n. The base URL is taken from DSH_WEB_URL, otherwise from the host's webServer service (port).
  2. Fallback: PaperReader's own storage — library.json plus papers/<id>/pages.json under $DSH_HOME/paperreader, used when the HTTP layer is unreachable (different port, headless host).

Both paths return identical content; only the origin differs. The plugin never writes: importing, annotating and translating remain UI actions.

Limitations

  • Text only. Layout, figures, tables and formulas are not part of the parsed text. "Explain figure 2" still belongs in the reader.
  • Scans without a text layer return nothing (no OCR).
  • The text is the snapshot PaperReader produced at import time; re-import or re-parse a paper to refresh it.
  • Search is a plain substring match over the parsed pages, not the reader's ranked full-text index.

Development

pnpm installs a file: dependency as a hardlink into the profile. An in-place edit of lib/index.js therefore reaches the profile copy directly — but anything that replaces the file (git checkout, git pull, git stash, most editors' safe-write) breaks the hardlink, and the profile keeps the old content.

So after switching branches or pulling:

dsh plugin --profile desktop add /home/<user>/.dsh/plugins/dsh-paper-tools

then reload the plugin (no app restart needed for lib/ changes):

plugin_manager set_plugin target=include:paper-tools enabled=false
plugin_manager set_plugin target=include:paper-tools enabled=true

A full app restart is required only for cordis.patch.yml or package.json changes.

node --check lib/index.js      # syntax
git tag v0.1.0                # versions follow package.json

License

MIT

Plugins relacionados