npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apollo-music/dsh-file-reader

v0.3.1

Published

Session-scoped document reader bundle for DeepSeek Harness

Readme

@apollo-music/dsh-file-reader

DeepSeek Harness bundle for session-scoped, source-neutral document reading and analysis. It always exposes six reader tools: file_reader_open, file_reader_outline, file_reader_read, file_reader_search, file_reader_render, and file_reader_close. When both ctx.fileAnalysisStore and the DSH subagent/agent services are available, it also exposes file_reader_analyze and file_reader_analysis_history.

The model never receives host paths, parser paths, content hashes, or parser filenames. Handles are 256-bit random values bound to a DSH session and reader instance. Workspace files are realpath-checked and copied through a no-follow descriptor into a private 0700 session directory; staged files use 0600 permissions. Trusted plugins may instead supply a bounded private ReadableStream with provenance.

Runtime

The TypeScript bundle requires Node 24 and targets DeepSeek Harness 0.1.1-rc.2; its DSH packages are declared as exact peer dependencies and must be upgraded together. Cordis remains pinned to 4.0.1. Its bundled parser requires Python 3.11–3.13 and the exact versions in parser/requirements.lock.

The plugin launches its bundled parser directly with Python isolated mode, a minimal environment, bounded stdout/stderr, per-operation deadlines, cancellation, and process-group cleanup. The parser receives only the private staged document path and bounded operation input. No Docker socket, OCI image, registry, runner service, or external parser configuration is required.

Install the bundle into a DSH profile:

dsh plugin --profile <profile> add @apollo-music/[email protected]

Static configuration only needs to declare whether the active model route accepts image input:

- name: @apollo-music/dsh-file-reader
  config:
    imageInputSupported: true

imageInputSupported must reflect the selected model route. On a text-only route, render fails with document_capability_unavailable and text reading remains available.

Legacy .doc, .xls, and .ppt inputs are converted privately to DOCX, XLSX, and PPTX with LibreOffice, then use the same bounded read/search/render path as native OOXML files. The converted artifact is scoped to the document handle, validated before parsing, reused by later operations, and removed with the handle or session. If LibreOffice is absent, opening a legacy file returns document_capability_unavailable; native PDF, DOCX, XLSX/XLSM, and PPTX text operations remain available. Compatible Word/PowerPoint rendering also requires LibreOffice.

LibreOffice must provide soffice or libreoffice on the DSH process PATH. Roll back by disabling or restoring the previous plugin version; Cordis disposal terminates active parser processes and removes staged and converted files.

Development

npm run build --workspace @apollo-music/dsh-file-reader
npm test --workspace @apollo-music/dsh-file-reader
npm run test:parser --workspace @apollo-music/dsh-file-reader
npm run test:package --workspace @apollo-music/dsh-file-reader

Analysis history provider

The package exports FileAnalysisStoreService, HttpFileAnalysisStore, and SqliteFileAnalysisStore. Production profiles resolve separate read/write/link credentials through FileAnalysisCredentialProvider and register the HTTP-backed service as ctx.fileAnalysisStore; DSH processes never receive a PostgreSQL connection. HTTP responses are bounded, redirects fail closed, credentials stay in headers, and provider/network errors are mapped to stable path-free errors.

SqliteFileAnalysisStore is only for local development and protocol tests. It refuses production mode and is never an automatic fallback when the PostgreSQL-backed API is absent or unhealthy.

Run creation defaults to cachePolicy: "prefer-cache". The returned disposition distinguishes a new reservation, a coalesced concurrent request, an exact cache hit, and an expired lease that requires terminal reconciliation. refresh and fresh always reserve independent runs; an expired run must be completed or failed from the child terminal fact before a replacement is created.

file_reader_analyze sends the caller's analysis input unchanged to a dedicated continuable DSH child. The child receives only a newly delegated document handle and the five non-open reader operations; the original caller handle is never shared. Trusted runtime context and bounded authorized history are injected separately from the user prompt. DEFAULT is the sole built-in analysis name and must be passed exactly; all other nonblank inputs are custom instructions.

prefer-cache reuses an exact completed result, refresh creates a new persisted result while allowing compatible history and child continuation, and fresh creates a history-free, non-continuing run. The service records the run before starting the child, binds the child session as soon as it is accepted, and records a completed or failed terminal state. file_reader_analysis_history is scoped to an already authorized document handle; previous revisions and explicitly linked sources are opt-in.