dshbase

插件目录 / Developer / dsh-mineru-parse-plugin

dsh-mineru-parse-plugin

已验证 · 实测可装 83079Vermont

✓ 持续维护

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
JavaScript语言
2026-08-15最近推送
跨平台平台

功能简介

自包含DSH插件,注册全局模型工具parse_docs:解析本地PDF/DOCX/PPTX/XLSX/TIFF等

✅
我们的评价
可用 — 实测通过,早期项目

自包含DSH插件,注册全局模型工具parse_docs:解析本地PDF/DOCX/PPTX/XLSX/TIFF等 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

mineru-parse-dsh-tool

English | 锟斤拷锟斤拷锟斤拷锟斤拷

A self-contained DeepSeek Harness (DSH) plugin that registers a global model tool parse_docs: parse local PDF / DOCX / PPTX / XLSX / TIFF and image batches into Markdown with local MinerU.


Features

  • Self-contained 锟斤拷 bundles its own wrapper script assets/scripts/parse.ps1; no skill package dependency
  • Zero runtime dependencies 锟斤拷 Node builtins only
  • Global scope 锟斤拷 mounted at the profile/host layer, available to every session
  • Batched + cached 锟斤拷 multiple files in one MinerU call; fresh <stem>.md outputs are reused
  • Sandbox-aware (Windows) 锟斤拷 fail-fast with a one-shot escalation hint when MinerU cannot run

parse_docs handles: pdf / docx / pptx / xlsx / tif / tiff / jpg / jpeg / png / bmp.

Plain text (txt / md / json / csv / code) should be read with the built-in read tool, and single images with read_image 锟斤拷 parse_docs returns a hint pointing to the right tool.


Requirements

  • DSH with a profile (tested on the web profile)

  • Windows + PowerShell (the wrapper script is .ps1)

  • Node.js >= 18

  • MinerU installed 锟斤拷 the parser engine is not bundled. parse.ps1 locates it in this order:

    1. Env var MINERU_BAT (recommended)
    2. mineru.config.json 锟斤拷 in <plugin>\assets\scripts\ or ~\.config\mineru\ (fields mineruBat / venvPython)
    3. D:\MinerU\mineru.bat (if present)
    4. mineru on PATH

    If none is found, parse_docs returns MINERU_UNAVAILABLE.


Installation

For DSH users

# from npm 
dsh plugin --profile web add mineru-parse-dsh-tool

# or from GitHub
dsh plugin --profile web add github:83079Vermont/dsh-mineru-parse-plugin

Then mount it in ~/.dsh/profiles/web/cordis.patch.yml and restart dsh web:

# - insert:
#     - id: mineru-parse-tool
#       name: 'mineru-parse-dsh-tool'

Local development

# copy the package into the plugins dir, then add it as a file: dependency
Copy-Item -Recurse <repo> $HOME\.dsh\plugins\mineru-parse-tool
dsh plugin --profile web add file:$HOME/.dsh/plugins/mineru-parse-tool

Usage

Model-invocable tool. Parameters:

Param Type Description
paths string[] required 锟斤拷 absolute file paths (multiple allowed, merged into one call)
backend auto | hybrid-engine | pipeline | vlm-engine defaultauto: <10 pages 锟斤拷 pipeline, else hybrid-engine
force boolean ignore cache and re-parse
method auto | txt | ocr parsing method (pipeline / hybrid-engine only)
lang string OCR language, defaultch (pipeline only)
effort medium | high hybrid-engine effort;high enables chart analysis (slower)
keep_images boolean keep the extractedimages/ directory
no_formula boolean disable formula recognition (enabled by default)
out_dir string output root; default<workspace>/.mineru-output
timeout_ms number default600000
sandbox_permissions workspace-write | danger-full-access only withjustification; widens this one call
justification string one-sentence reason, required withsandbox_permissions

Example:

parse_docs({
  paths: ["C:\\docs\\report.pdf", "C:\\docs\\fig1.png"],
  backend: "auto",
});

How It Works

  1. Locate the script 锟斤拷 DSH_MINERU_PARSE_SCRIPT env override, else the bundled assets/scripts/parse.ps1 (resolved relative to this module)
  2. Invoke 锟斤拷 call parse.ps1 through ctx.shell (PowerShell), passing all options through
  3. Parse markers 锟斤拷 interpret RESULT / CACHED / MINERU_UNAVAILABLE / MINERU_ERROR / NO_SUPPORTED_FILES / NO_MD / WARNING_EMPTY
  4. Read output 锟斤拷 load the Markdown via ctx.fs and return it (>2000 lines 锟斤拷 head excerpt + markdownPath, use read for the rest)
  5. Output location 锟斤拷 default <workspace>/.mineru-output (sandbox-writable, cache-friendly); pass out_dir explicitly when the source directory is read-only

Sandbox & Escalation (Windows)

DSH's Windows sandbox blocks MinerU's PDF rendering in every confined mode (read-only, workspace-write): multiprocessing named pipes are denied (WinError 5), and MinerU's mkdtemp (mode 0o700) temp dirs get unusable ACLs. Parsing therefore requires an unconfined (danger-full-access) run.

parse_docs behavior:

  • PDF-family inputs (pdf/docx/pptx/xlsx) under confinement fail fast with an escalation hint 锟斤拷 no doomed parse attempt
  • The model retries with sandbox_permissions + justification 锟斤拷 the user approves 锟斤拷 only that call runs unconfined (fail-closed; mirror of the pwsh tool)
  • Image-only inputs are attempted even when confined (no PDF rendering involved)
  • A fresh cached .md next to the source or under out_dir can be read directly with read 锟斤拷 no escalation needed

Configuration

Env var Purpose
DSH_MINERU_PARSE_SCRIPT absolute path to an alternativeparse.ps1; overrides the bundled script
MINERU_BAT consumed byparse.ps1; absolute path to the MinerU executable

Development

node tests/smoke.mjs   # unit smoke test, no MinerU required

After restart, parse_docs should appear in the session's tool list; a real PDF/DOCX call returns Markdown, a README.md call returns the "use read" hint.


Uninstall

dsh plugin --profile web remove mineru-parse-dsh-tool

Remove the mineru-parse-tool insert entry from cordis.patch.yml, then restart dsh web.


License

MIT 锟斤拷 free to use, modify, and redistribute.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-mineru-parse-plugin」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:83079Vermont/dsh-mineru-parse-plugin

Headless(CLI)profile:

dsh plugin --profile headless add github:83079Vermont/dsh-mineru-parse-plugin

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

扩展 agent 的编码能力面——给它一个新工具、工作流或集成,让它接手以前做不了的开发任务。

适合谁

想让 dsh 在真实代码库上像队友一样干活的开发者——能改、能跑、能验证,而不只是回答问题。

二次开发建议

工具/命令面就是缝:暴露更多 SDK 能力、加更聪明的上下文接线,或收紧改代码与验证之间的循环。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7797 个插件 →