dsh-document

DSH PLUGIN记忆与知识

仓库 jiaoqsh/dsh-document · npm @jiaoqsh/dsh-document

记忆与知识 L5 · 运行验证通过 安全审查:低风险 可信度:金 可安装插件
安装这个插件

dsh-document 是 DeepSeek Harness 插件,为模型提供 read_document 工具,将 Word、PPT、Excel、PDF 等文档本地转换为带行号的 Markdown,支持分页浏览。

验证等级 L5 L5 · 运行验证通过
GitHub 星标 3 复刻 0 · 未关闭 issue 0
最近更新 2026-10-04 创建于 2026-08-15
README 8.8 KB 正文体量,越大说明说明书写得越细

安装

可安装插件
在 DSH 里执行,装完用 dsh plugin list 确认已挂上;标了 L4 / L5 的命令已在沙盒里真实跑通
dsh plugin --profile web add @jiaoqsh/[email protected]
兼容 DSH 版本0.2.0-rc.2 等 12 个版本版本不匹配时安装会报错
Node.js 要求>=22.19来自仓库 package.json 的 engines 字段
前置依赖@deepseek-ai/cordis@^4.0.1、@deepseek-ai/dsh-fs@>=0.1.0-rc.6 <0.3.0 等 4 个需要同时安装的同级依赖
npm 包名@jiaoqsh/dsh-document可用 npm view 查看包信息

能做什么

4 项功能
字段来自项目仓库与公开索引,中文说明由本站标注

dsh-document:DeepSeek Harness 的文档读取工具

  • 多格式文档转 Markdown
  • 本地转换,无需网络
  • PDF 页面选择与统计
  • 支持 offset/limit 分页

适用场景

文件读写办公自动化视觉识别

上游标签

deepseek-harnessdocxdsh-pluginmarkdownpdf

验证等级与安全审查

L5 · 运行验证通过
自动化流程结论,不是人工审核
验证等级L5 · 运行验证通过在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来
安全审查低风险静态分析结论,未标注不代表已通过审查
仓库健康度活跃按仓库活跃度与最近更新时间给出
可信度金综合仓库活跃度与验证结果

上面的结论来自上游最近一次自动化验证(2026-10-08): 同一套检查会在插件发新版后重跑,页面显示的是最新一次的逐项结果。

逐项检查结果

L1 · 已找到 ✓ 通过
  • L1.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L2 · 结构化 ✓ 通过
  • L2.0_DEFAULTED_FROM_L3 由 L3 推定 默认通过——L3 安装规范已通过(全库 L3 扫描策略)
L3 · 安装规范 ✓ 通过
  • L3.1_INSTALL_COMMAND_PARSED 安装命令已解析 方式:安装规范解析
  • L3.2_DSH_VERSION_DECLARED DSH 版本已声明 方式:DSH 版本声明
L4 · 安装已测 ✓ 通过
  • L4.1_INSTALL_EXECUTED_CONFINED 受限沙盒内执行安装 方式:沙盒安装执行
  • L4.2_INSTALL_SUCCESS 沙盒安装成功 方式:沙盒安装执行
  • L4.3_ARTIFACT_CONFIRMED 安装产物已确认 方式:沙盒安装执行
L5 · 运行已测 ✓ 通过
  • L5.1_INSTALL_PASSED_SANDBOXED 沙盒安装通过 方式:沙盒安装执行
  • L5.2_WEB_BOOT_READY Web 启动就绪 方式:Web 启动
  • L5.3_HTTP_SERVED HTTP 服务响应 方式:HTTP 请求
  • L5.4_PLUGIN_INVENTORY_ACTIVE 插件清单中已激活 方式:插件清单查询

风险详情

  • 审查结论 通过
  • 结论说明 vet 静态分析未发现可疑行为,判定为干净(clean)。
  • 风险计数 严重 0 / 高 0 / 中 0
  • 风险详情 未发现严重或警告级问题。

仓库档案

记忆与知识
字段来自项目仓库与公开索引,中文说明由本站标注
作者 / 维护方jiaoqsh仓库 dsh-document · 默认分支 main
分类记忆与知识knowledge
收录类型可安装插件声明了 dsh.bundle、可用 dsh plugin add 安装的条目
开发语言TypeScript仓库主语言
许可证MIT商用或二次分发前请确认条款原文
星标 / 复刻 / issue3 / 0 / 0收录时的数值,非实时
创建 / 更新2026-08-15 · 2026-10-04最后推送 2026-10-04
本站收录2026-08-27首次进入本站目录的时间

README 全文

8.8 KB
作者原文,中文版优先;只做安全转义,不改内容

dsh-document

A DeepSeek Harness plugin bundle (@jiaoqsh/dsh-document) that gives the model a read_document tool: Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, and PDF files are converted to line-numbered Markdown the model can page through with offset/limit.

Conversion runs locally: office formats through @firecrawl/anydoc (Rust core, Node bindings) and PDFs through @firecrawl/pdf-inspector (WASM build, run in a worker thread) — no API key, no network, no external binaries; both MIT. PDFs get page selection, &lt;!-- Page N --&gt; markers, and page facts: total pages, text-based / scanned / mixed, and which pages have no extractable text. Files are read through the harness ctx.fs seam, so whatever filesystem provider and sandbox policy a deployment mounts applies unchanged.

Install

Into an existing profile (web, headless, or your own), from npm:

dsh plugin --profile web add @jiaoqsh/dsh-document

The npm package ships built code, so nothing runs at install time. Releases are published from this repository's release.yml through npm trusted publishing and carry provenance attestations.

From GitHub instead

dsh plugin --profile web add github:jiaoqsh/dsh-document#

A git install fetches sources, so pnpm ≥ 10 refuses to run the package's prepare (a tsdown transpile of src/) until you allow it: the first add fails and prints the exact key to copy into the profile's pnpm-workspace.yaml ($DSH_HOME/profiles//pnpm-workspace.yaml). The key names the resolved tarball, so a bare package name does not match:

allowBuilds:
&#x27;@jiaoqsh/dsh-document@https://codeload.github.com/jiaoqsh/dsh-document/tar.gz/&#x27;: true

Re-run the add. Allowing the build means executing this package's code on your machine at install time; pin a commit so a later push cannot change what runs.

dsh plugin prints "missing peer" warnings for the @deepseek-ai/* packages: expected. The dsh installation supplies them at runtime; profiles deliberately do not install peers.

Verify, then boot:

dsh --profile web --dump-config   # shows a &quot;# == @jiaoqsh/dsh-document&quot; layer
dsh --profile web

Remove with dsh plugin --profile web remove @jiaoqsh/dsh-document.

From a source checkout of the harness

pnpm dsh web --patch /absolute/path/to/dsh-document/overlay.yml

where the overlay inserts the built entry by absolute path:

- insert:
- id: document-tools
name: &#x27;/absolute/path/to/dsh-document/lib/index.js&#x27;

Configuration

The bundle's layer inserts one row, document-tools, with schema defaults. Override it by id in your profile's cordis.patch.yml; a patch replaces the whole config, so restate every key you need:

- id: document-tools
config:
maxInputBytes: 104857600   # 100 MiB
readLimit: 2000
maxLineLength: 2000
maxOutputBytes: 51200
pdfMaxPages: 100
pdfProfile: fidelity
Key Default Meaning
maxInputBytes 52428800 (50 MiB) Inclusive byte cap on the source file. Enforced by the filesystem provider before any bytes are buffered; larger files are refused.
readLimit 2000 Default and maximum number of Markdown lines returned by one call.
maxLineLength 2000 Maximum characters per returned line; overflow is cut with … [line truncated].
maxOutputBytes 51200 (50 KiB) Maximum bytes of line text returned by one call; the window stops early and the footer says how to continue.
pdfMaxPages 100 Maximum distinct pages one pages selection may name.
pdfProfile fidelity PDF Markdown profile: fidelity keeps source structure, compact spends fewer tokens.

Every numeric value must be a positive integer and pdfProfile one of the two names; anything else fails the plugin load with a message naming the key.

The tool

read_document(file_path, offset?, limit?, pages?)

  • file_path — resolved by the filesystem backend; relative paths resolve against the calling session's workspace.
  • offset — 1-based first line of the converted Markdown (default 1).
  • limit — lines to return (default and maximum readLimit).
  • pages — PDF only: 1-based pages to convert, as numbers and ranges like &quot;1-3,7&quot; (at most pdfMaxPages). Default: every page. Naming a page beyond the last one is an error that states the page count.

Supported extensions: .pdf, .doc, .docm, .docx, .ppt, .pps, .pot, .pptx, .pptm, .ppsx, .ppsm, .xls, .xlsx, .xlsm, .xlsb, .odt, .ods, .odp, .rtf, .epub, .csv. The format comes from the extension, never from content sniffing (CSV has no signature).

Canonical value (what Code Mode receives):

{ path: string, format: &#x27;pdf&#x27; | &#x27;docx&#x27; | ..., offset: number,
lines: { number: number, text: string }[], totalLines: number, truncatedByBytes: boolean,
pdf?: { pageCount: number, kind: &#x27;text&#x27; | &#x27;scanned&#x27; | &#x27;image&#x27; | &#x27;mixed&#x27;,
pagesNeedingOcr: number[], pages?: number[], title?: string } }

Model-facing text (a PDF, pages 2 and 4 of 5):

/work/report.pdf
pdf
5 pages, text-based; showing pages 2, 4
1: &lt;!-- Page 2 --&gt;
2:
3: Revenue grew 12% year over year.

(Showing lines 1-3 of 8. Use offset=4 to continue.)

A mixed PDF adds Pages 3, 7-8 contain no extractable text (scanned or image content); their content is missing below and would need OCR. before . Non-PDF formats omit the line.

Failures are tool errors in model terms: unsupported extension (pointing at read for plain text), pages on a non-PDF, a malformed pages value, not found, not a regular file, over maxInputBytes, encrypted, damaged or incomplete, engine resource limit, a page beyond the last page, cancellation, or no extractable text (a scanned or image-only PDF says so and that OCR is needed; this tool performs no OCR).

Model Experience

System prompt section tool:read_document

What the model sees

One fixed sentence, order 100 beside the shipped tool:read guidance:

Use the read_document tool — not read or shell commands — to inspect PDF, Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, and CSV files. It returns the document converted to line-numbered Markdown; use offset and limit to continue reading long documents. For a PDF, pass pages (for example &quot;1-3,7&quot;) to read only those pages; page markers like &lt;!-- Page 4 --&gt; show where each page starts.

Token effect

Fixed: the section and the tool schema add a constant number of tokens to every request; results add up to maxOutputBytes per call.

KV Cache effect

Prefix-stable: the section text and schema never change between requests, so they do not invalidate a cached prompt prefix.

Known Limitations and Deferred Work

  • No OCR — pages without a text layer are reported (pagesNeedingOcr, the `` line) but not read; a fully scanned or image-only PDF is an error naming the cause.
  • PDF conversion runs in a fresh worker thread per call — cancellation terminates it, and the harness event loop stays free, at the cost of ~50 ms of WASM start-up per call. Office-format conversion (anydoc) runs on the libuv thread pool and cannot be cancelled once started; maxInputBytes is its bound.
  • Layout-heavy PDFs may collapse paragraphs into long lines (then cut by maxLineLength); pdfProfile: compact trades structure for tokens.
  • Engines are fixed — the DocumentConverter interface and routeConverters in src/converter.ts are the seam for a hosted or OCR-capable engine; none is wired today.
  • The pdf-inspector native binary is not used — its npm build ships no darwin-x64 binary, so the WASM build runs everywhere for one code path.

Development

pnpm install          # also builds lib/ via prepare
pnpm run typecheck
pnpm test             # real Cordis Context + real registry + real local fs; no API key
pnpm run build

Release: bump version in package.json on main, then push the matching tag (git tag v0.2.0 &amp;&amp; git push origin v0.2.0). release.yml checks the tag against the version, runs the checks, publishes to npm via trusted publishing, and creates the GitHub release with generated notes.

Fixtures under tests/fixtures/ were generated once with macOS textutil and cupsfilter (including a five-page PDF and an image-only PDF) and are committed so the suite runs anywhere. In source mode the PDF worker is spawned as .ts with --experimental-strip-types, so it stays free of TypeScript-only runtime syntax.

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
dsh-document 怎么安装?

在 DSH 里执行 `dsh plugin --profile web add @jiaoqsh/[email protected]` 即可。对应的 npm 包名是 `@jiaoqsh/dsh-document`。

dsh-document 的验证等级是什么意思?

L5 · 运行验证通过。在 dsh 沙盒中完成安装与运行冒烟——装得上、跑得起来

dsh-document 安全吗?

低风险。vet 静态分析未发现可疑行为,判定为干净(clean)。

dsh-document 支持哪些 DSH 版本?

上游记录的兼容版本包括 0.2.0-rc.2、0.1.7-rc.2、0.1.7-rc.1、0.1.7-alpha.2、0.1.6-alpha.2、0.1.6-alpha.1、0.1.5-rc.2、0.1.3-alpha.2。版本较多,只列出前 8 个。

dsh-document 需要什么运行环境?

Node.js >=22.19;需要同时安装 @deepseek-ai/cordis@^4.0.1、@deepseek-ai/dsh-fs@>=0.1.0-rc.6 <0.3.0、@deepseek-ai/dsh-system-prompt@>=0.1.0-rc.6 <0.3.0、@deepseek-ai/dsh-tools@>=0.1.0-rc.6 <0.3.0。环境不满足时安装会失败,建议先确认本机版本。

dsh-document 用的是什么许可证?

上游标注为 MIT。商用或二次分发前请到仓库确认许可证原文。

dsh-document 有哪些功能?

多格式文档转 Markdown、本地转换,无需网络、PDF 页面选择与统计、支持 offset/limit 分页。

这条记录的数据可靠吗?

本站按仓库名去重后合并整理,字段以作者仓库与 npm 元数据为准;安装命令、仓库地址与 README 保持原文,带 L4 / L5 标记的安装命令已在隔离沙盒里真实跑通。

记忆与知识
按星标排序,可作替代方案

ruflo

ruflo

L3 · 安装规范通过 7.4 万 星

OpenViking

OpenViking

面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`vik

L3 · 安装规范通过 3.9 万 星

WeKnora

WeKnora

把 WeKnora 知识库接入 dsh 的四个只读工具:列出知识库、混合检索原文片段、按顺序还原单篇文档,以及直接取用 WeKnora 自己

L4 · 沙盒安装通过 3.3 万 星

distilly

distilly

Distilly — Distill how they think into reusable Skills for any Agent o

L4 · 沙盒安装通过 2.5 万 星

EverOS

EverOS

L4 · 沙盒安装通过 1.3 万 星

MemOS

MemOS

L4 · 沙盒安装通过 1.2 万 星

插件的元信息来自作者仓库;分类、验证等级与安全结论的中文说明为中文整理,最近核验 2026-10-08。