@arnilo/prism-document-reader
v0.3.0
Published
Optional bounded PDF/Office literal-text extraction adapter for the Prism coding read tool (host-selected parser wiring, fails closed without its optional peer parsers).
Readme
@arnilo/prism-document-reader
Optional bounded PDF/Office literal-text extraction adapter for the Prism coding read tool (plan 018 closeout doc-reader).
- Explicit activation: pass the reader to
createReadTool({ documentReader }); no file-extension sniffing ever enables parsing. - Bounded by construction: input byte cap, page cap, output text cap; oversize/over-page documents refuse with a documented error.
- Literal text only: PDF via the optional
pdf-parsepeer, DOCX via the optionalmammothpeer (raw text extraction — no embedded-script execution, no macro evaluation, no external resource fetching). - Fails closed: creation throws
DocumentReaderError(ERR_PRISM_DOCUMENT_READER) when a selected format's peer parser is absent.
Usage
import { createReadTool } from "@arnilo/prism-coding-agent";
import { createDocumentReader } from "@arnilo/prism-document-reader";
const reader = createDocumentReader({ maxBytes: 32 * 1024 * 1024, maxPages: 1000 }); // throws if pdf-parse/mammoth absent
const read = createReadTool(cwd, { documentReader: reader });Changelog
[0.1.5] - 2026-08-11
Added
- Initial release:
createDocumentReaderwith magic-byte-gated PDF/DOCX dispatch, byte/page/text caps, fail-closed peer loading, optionalSecretRedactorat the extraction boundary, and the additiveDocumentReaderslot in@arnilo/prism-coding-agent'screateReadTool.
