dsh-mineru 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/CONTRIBUTING.md +2 -2
- package/README.md +307 -74
- package/README.zh.md +310 -77
- package/RELEASE.md +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,16 @@ All notable changes to **dsh-mineru** are documented here. The format follows [K
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
-
- 无(当前为最新发布版本 0.1.
|
|
7
|
+
- 无(当前为最新发布版本 0.1.8)
|
|
8
|
+
|
|
9
|
+
## [0.1.8] - 2026-08-16
|
|
10
|
+
|
|
11
|
+
### Docs
|
|
12
|
+
|
|
13
|
+
- 重写双语 README 为详细版:新增三步快速开始、工具完整参数表、22 项配置参考、错误码速查与 FAQ(中英两版结构对称)。
|
|
14
|
+
- 新增 `CHANGELOG.md`(Keep a Changelog)与 `RELEASE.md`(发布 SOP 清单)。
|
|
15
|
+
- `CONTRIBUTING.md` 补充提交规范:commit message 描述一律使用英文。
|
|
16
|
+
- `package.json` `files` 字段加入 `CHANGELOG.md` / `RELEASE.md`。
|
|
8
17
|
|
|
9
18
|
## [0.1.7] - 2026-08-16
|
|
10
19
|
|
|
@@ -49,6 +58,7 @@ All notable changes to **dsh-mineru** are documented here. The format follows [K
|
|
|
49
58
|
- 限流感知(令牌桶 + 429 退避 + 每日限额);
|
|
50
59
|
- Artifact 落地与 Web 界面(设置卡片、工具结果卡片、HMAC 签名预览)。
|
|
51
60
|
|
|
61
|
+
[0.1.8]: https://github.com/Lee-Hilex/dsh-mineru/releases/tag/v0.1.8
|
|
52
62
|
[0.1.7]: https://github.com/Lee-Hilex/dsh-mineru/releases/tag/v0.1.7
|
|
53
63
|
[0.1.6]: https://github.com/Lee-Hilex/dsh-mineru/releases/tag/v0.1.6
|
|
54
64
|
[0.1.5]: https://github.com/Lee-Hilex/dsh-mineru/releases/tag/v0.1.5
|
package/CONTRIBUTING.md
CHANGED
|
@@ -20,9 +20,9 @@ Web profile 重启可复用 `D:\Users\Lee\Desktop\dsh\.dsh-restart\restart.ps1`
|
|
|
20
20
|
|
|
21
21
|
注意:本地路径直装(pnpm link)会使 @deepseek-ai 依赖解析脱离 profile,请用 tgz 安装。
|
|
22
22
|
|
|
23
|
-
## 提交规范
|
|
23
|
+
## 提交规范 (Commit conventions)
|
|
24
24
|
|
|
25
|
-
- 提交信息格式:`<type>:
|
|
25
|
+
- 提交信息格式:`<type>: <英文描述>[, 版本 X.Y.Z]`,`type` 取 `feat` / `fix` / `docs` / `refactor` / `chore`;**描述一律用英文**(如 `fix: drag-drop fills composer draft instead of auto-send`)。
|
|
26
26
|
- 文档变更(README / CHANGELOG / CONTRIBUTING / RELEASE)与代码变更**必须同一次提交**,不要分开发。
|
|
27
27
|
|
|
28
28
|
## 发布流程
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# dsh-mineru
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
|
-
[](https://github.com/Lee-Hilex/dsh-mineru/releases)
|
|
5
5
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
6
6
|
[](https://mineru.net/apiManage/docs)
|
|
7
7
|
|
|
@@ -9,139 +9,372 @@
|
|
|
9
9
|
|
|
10
10
|
English | [简体中文](README.zh.md)
|
|
11
11
|
|
|
12
|
+
**dsh-mineru** is a **MinerU-powered multimodal document parsing plugin** for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh): turn PDF, Word, PPT, Excel, HTML, and images into **structured Markdown**. Configure a MinerU token to use the 🎯 Precision API, or leave it blank and use the ⚡ Agent API (tokenless, IP rate-limited).
|
|
13
|
+
|
|
12
14
|
## Contents
|
|
13
15
|
|
|
14
|
-
- [
|
|
16
|
+
- [Overview](#overview) · [Quick start](#quick-start) · [Two API modes](#two-api-modes) · [Tools](#tools) · [Results & artifacts](#results--artifacts) · [Configuration](#configuration) · [Usage tips](#usage-tips) · [Web UI](#web-ui) · [Rate limits & reliability](#rate-limits--reliability) · [Error code reference](#error-code-reference) · [Security model](#security-model) · [FAQ](#faq) · [Development & publishing](#development--publishing) · [Contributing](#contributing) · [License](#license)
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
## Overview
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
### What is this?
|
|
19
21
|
|
|
20
|
-
-
|
|
21
|
-
- **Four tools, progressive exposure** — `mineru_parse`, `mineru_batch_parse` (auto-chunked batches), `mineru_task` (resume after timeout), plus the `mineru-tools` skill; only the tiny `mineru_activate` bootstrap is visible until the agent activates the toolset.
|
|
22
|
-
- **Drag-and-drop uploads that work with text-only models** — drop PDFs/Office documents/images into the chat; files land in the session workspace and their paths are filled into the composer draft (never auto-sent) — you add your own request and press send, bypassing the native image-attachment channel that text-only models reject.
|
|
23
|
-
- **Rate-limit aware** — built-in token buckets (40 submits/min, 900 queries/min), daily submit accounting, `Retry-After` backoff on HTTP 429, and actionable messages for every MinerU error code.
|
|
24
|
-
- **Artifacts & Web UI** — results are extracted under `<workspace>/.dsh-mineru/artifacts/` with HMAC-signed preview URLs, a dedicated Web Settings card (write-only token, collapsible advanced section, busy/result feedback), and custom tool-result cards.
|
|
22
|
+
dsh-mineru plugs [MinerU](https://mineru.net) (OpenDataLab's high-precision document parsing engine) into the DeepSeek Harness agent ecosystem, letting **text-only models "read" documents**: the model receives structured Markdown (tables, formulas, and images preserved) instead of binary files it cannot open.
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
Typical use cases:
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
- Read papers / contracts / reports: parse a PDF, then ask the agent to summarize or extract data;
|
|
27
|
+
- Batch-processing documents: parse dozens of files in one call, each producing Markdown;
|
|
28
|
+
- OCR for images / screenshots: scanned pages and web screenshots become searchable text;
|
|
29
|
+
- Formulas & tables: math formulas in papers and Excel tables survive with full structure.
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
### Supported file formats
|
|
32
|
+
|
|
33
|
+
| Format | Precision API (token required) | Agent API (tokenless) |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| PDF | ✅ | ✅ |
|
|
36
|
+
| Word (`.doc` / `.docx`) | ✅ | ✅ (`.docx` only) |
|
|
37
|
+
| PPT (`.ppt` / `.pptx`) | ✅ | ✅ (`.pptx` only) |
|
|
38
|
+
| Excel (`.xls` / `.xlsx`) | ✅ | ✅ (`.xlsx` only) |
|
|
39
|
+
| HTML (`.html` / `.htm`) | ✅ (forces MinerU-HTML model) | ❌ |
|
|
40
|
+
| Images (`.png` `.jpg` `.jpeg` `.jp2` `.webp` `.gif` `.bmp`) | ✅ | ✅ |
|
|
41
|
+
|
|
42
|
+
> Note: the Agent API does not support `.doc` / `.ppt` / `.xls` (legacy Office formats) or HTML — use the Precision API (token required) for those.
|
|
43
|
+
|
|
44
|
+
### Highlights
|
|
45
|
+
|
|
46
|
+
- **Dual API modes, auto-selected** — chooses Precision or Agent parsing based on whether a token is configured; can be overridden per call;
|
|
47
|
+
- **Progressive tool exposure** — only the tiny `mineru_activate` bootstrap is visible until the agent activates the full toolset, saving context;
|
|
48
|
+
- **Drag-and-drop uploads** — drop a file into the chat; its path lands in the composer draft so text-only models can process documents;
|
|
49
|
+
- **Auto-chunked batch parsing** — submit hundreds of files/URLs at once; batching respects official limits automatically;
|
|
50
|
+
- **Rate-limit aware** — built-in token buckets, daily caps, 429 backoff, and actionable messages for every error code;
|
|
51
|
+
- **Artifact-backed results** — parsed output lands in the workspace as files with signed preview links in the Web UI.
|
|
52
|
+
|
|
53
|
+
## Quick start
|
|
54
|
+
|
|
55
|
+
### Step 1: Install
|
|
56
|
+
|
|
57
|
+
Prerequisites: DeepSeek Harness `0.1.0-rc.6` (or a compatible `0.1.x`) with the `dsh` CLI available.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Web profile
|
|
31
61
|
dsh plugin --profile web add dsh-mineru
|
|
62
|
+
|
|
63
|
+
# Headless profile
|
|
32
64
|
dsh plugin --profile headless add dsh-mineru
|
|
33
65
|
```
|
|
34
66
|
|
|
35
|
-
Restart a running Web profile, then open **Settings → Plugins → MinerU
|
|
67
|
+
Restart a running Web profile, then open **Settings → Plugins → MinerU 解析**.
|
|
36
68
|
|
|
37
|
-
For a local build, install from the packed tarball (see [
|
|
69
|
+
For a local build, install from the packed tarball (see [Development & publishing](#development--publishing)):
|
|
38
70
|
|
|
71
|
+
```bash
|
|
72
|
+
dsh plugin --profile web add <path>/dsh-mineru-0.1.8.tgz
|
|
39
73
|
```
|
|
40
|
-
|
|
41
|
-
|
|
74
|
+
|
|
75
|
+
### Step 2: Configure (optional)
|
|
76
|
+
|
|
77
|
+
**No token needed to get started** — the plugin automatically falls back to the tokenless Agent API. Add a token to unlock the full feature set (Precision API, batch parsing, HTML, more formats):
|
|
78
|
+
|
|
79
|
+
- **Web UI**: Settings → Plugins → **MinerU 解析** → paste the token into the write-only field (blank keeps the existing value);
|
|
80
|
+
- **Headless / CLI**: put `MINERU_API_TOKEN: <token>` in `$DSH_HOME/.credentials.yaml`, or export the `MINERU_API_TOKEN` environment variable.
|
|
81
|
+
|
|
82
|
+
The token is resolved once per operation — **rotations take effect on the very next call without a restart**. Get a token by registering at <https://mineru.net> (API management page).
|
|
83
|
+
|
|
84
|
+
### Step 3: Use it
|
|
85
|
+
|
|
86
|
+
**Web UI** (drag-and-drop friendly):
|
|
87
|
+
|
|
88
|
+
1. **Drag** a PDF/Word/image into the chat — the file is saved to the session workspace and its path is filled into the composer draft (never auto-sent);
|
|
89
|
+
2. Add your request, e.g. "Parse this PDF to Markdown and summarize the key points";
|
|
90
|
+
3. Send. The agent activates the toolset and calls `mineru_parse`; results come back as files you can preview.
|
|
91
|
+
|
|
92
|
+
**URL parsing**: just tell the agent "parse this document: https://example.com/paper.pdf".
|
|
93
|
+
|
|
94
|
+
**Headless / CLI**: the agent calls the tools automatically when it sees a workspace path or URL; you can also type `/mineru-tools` in a conversation to load the usage skill.
|
|
42
95
|
|
|
43
96
|
## Two API modes
|
|
44
97
|
|
|
45
|
-
| | Precision API (token required) | Agent API (tokenless) |
|
|
98
|
+
| | 🎯 Precision API (token required) | ⚡ Agent API (tokenless) |
|
|
46
99
|
| --- | --- | --- |
|
|
47
100
|
| Endpoints | `/api/v4/extract/task`, `/api/v4/file-urls/batch`, `/api/v4/extract/task/batch` | `/api/v1/agent/parse/url`, `/api/v1/agent/parse/file` |
|
|
48
101
|
| Models | `pipeline` / `vlm` (default) / `MinerU-HTML` | fixed lightweight pipeline |
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
102
|
+
| Size limit | ≤ 200 MB | ≤ 10 MB |
|
|
103
|
+
| Page limit | ≤ 200 pages | ≤ 20 pages |
|
|
104
|
+
| Batch parsing | ✅ (URLs ≤ 200/batch, local uploads ≤ 50/batch, auto-chunked) | ❌ single file only |
|
|
105
|
+
| Output | Zip: `full.md` + `content_list.json` + `layout.json` + images (+ optional docx/html/latex) | Markdown only |
|
|
106
|
+
| Best for | Long docs, scans, formulas/tables, batch jobs, HTML | Quick reads, small files, temporary use |
|
|
107
|
+
|
|
108
|
+
**Mode selection** (`mode` parameter or config):
|
|
52
109
|
|
|
53
|
-
|
|
110
|
+
- `auto` (default) — Precision when a token is configured, Agent otherwise;
|
|
111
|
+
- `precision` — force Precision; errors loudly when no token is configured;
|
|
112
|
+
- `agent` — force Agent.
|
|
113
|
+
|
|
114
|
+
To see which API the current session is actually using: call `mineru_activate` once — the `api` field in its result tells you (`precision` or `agent`).
|
|
54
115
|
|
|
55
116
|
## Tools
|
|
56
117
|
|
|
57
|
-
|
|
118
|
+
By default the toolset is **progressively exposed**: only the `mineru_activate` bootstrap is registered at first. One call unlocks the other three tools, and `mineru_activate` then hides itself for that session.
|
|
119
|
+
|
|
120
|
+
### `mineru_activate` — activation bootstrap
|
|
121
|
+
|
|
122
|
+
| Item | Description |
|
|
58
123
|
| --- | --- |
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
124
|
+
| Purpose | Unlocks `mineru_parse` / `mineru_batch_parse` / `mineru_task` and loads the `mineru-tools` skill |
|
|
125
|
+
| Parameters | none |
|
|
126
|
+
| Returns | A status summary: effective API mode, token configured or not, per-API limits |
|
|
127
|
+
|
|
128
|
+
### `mineru_parse` — parse a single document
|
|
129
|
+
|
|
130
|
+
Parses a **workspace file path** or **http(s) URL** into structured Markdown.
|
|
131
|
+
|
|
132
|
+
| Parameter | Required | Description |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `source` | ✅ | Workspace file path, or full http(s) URL |
|
|
135
|
+
| `mode` | | `auto` (default) / `precision` / `agent` |
|
|
136
|
+
| `modelVersion` | | Precision model: `pipeline` / `vlm` (default, recommended) / `MinerU-HTML` (forced automatically for HTML sources) |
|
|
137
|
+
| `language` | | Document language pack, default `ch` — see [Configuration](#configuration) |
|
|
138
|
+
| `enableTable` | | Table recognition, default `true` |
|
|
139
|
+
| `enableFormula` | | Formula recognition, default `true` |
|
|
140
|
+
| `isOcr` | | Force OCR for scans, default `false` |
|
|
141
|
+
| `pageRanges` | | Precision page ranges, comma-separated: `"2,4-6"`; negative pages supported: `"2--2"` (2nd from last) |
|
|
142
|
+
| `pageRange` | | Agent page range, `from-to` or single page: `"1-10"` |
|
|
143
|
+
| `extraFormats` | | Extra export formats (Precision only): `docx` / `html` / `latex` |
|
|
144
|
+
| `dataId` | | Business data ID (optional, ≤ 128 chars) |
|
|
145
|
+
| `timeoutMs` | | Whole-operation timeout incl. polling; defaults to plugin config (10 min) |
|
|
146
|
+
| `output` | | Result directory base name; defaults to the source file name |
|
|
147
|
+
|
|
148
|
+
**Result highlights**: `ok`, the `api`/`modelVersion` used, `taskId`, duration, `runDir`, a truncated Markdown preview, and the artifact list (with signed preview links on Web).
|
|
149
|
+
|
|
150
|
+
### `mineru_batch_parse` — batch parsing (Precision only)
|
|
151
|
+
|
|
152
|
+
Parses many documents in one call; **local paths and URLs can be mixed**, submissions are auto-chunked within official limits, and per-item success/failure is reported.
|
|
153
|
+
|
|
154
|
+
| Parameter | Required | Description |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| `sources` | ✅ | Mixed list of file paths / URLs |
|
|
157
|
+
| `outputPrefix` | | Result directory base name, default `batch` |
|
|
158
|
+
| `dataIdPrefix` | | Business data ID prefix; a sequence number is appended per item (optional) |
|
|
159
|
+
| others | | Same shared options as `mineru_parse` (except `mode` — this tool is Precision-only) |
|
|
160
|
+
|
|
161
|
+
**Chunking rules**: local files ≤ 50 per batch, URLs ≤ 200 per batch, ≤ 1000 total per call; exceeding these errors with a hint to split the call.
|
|
162
|
+
|
|
163
|
+
**Result highlights**: success/failure counts, `batchId`s, per-item results (each success includes its `full.md` directory), and error messages for failures.
|
|
164
|
+
|
|
165
|
+
### `mineru_task` — task query & result collection
|
|
166
|
+
|
|
167
|
+
**A timed-out parse is never lost**: use the `taskId` + `api` returned by `mineru_parse` to query progress and collect results later — no resubmission needed.
|
|
63
168
|
|
|
64
|
-
|
|
169
|
+
| Parameter | Required | Description |
|
|
170
|
+
| --- | --- | --- |
|
|
171
|
+
| `taskId` | ✅ | The task_id returned when the task was submitted |
|
|
172
|
+
| `api` | ✅ | Which API owns the task: `precision` or `agent` |
|
|
173
|
+
| `wait` | | Poll until the task finishes, default `false` (query once) |
|
|
174
|
+
| `collect` | | Download the result into an Artifact when done, default `true` |
|
|
175
|
+
| `output` | | Result directory base name, default `task` |
|
|
176
|
+
| `timeoutMs` | | Timeout for `wait` mode |
|
|
177
|
+
|
|
178
|
+
**Typical scenario**: `mineru_parse` timed out on a large PDF → tell the agent "collect the result for taskId=xxx with mineru_task".
|
|
179
|
+
|
|
180
|
+
### `mineru-tools` skill
|
|
65
181
|
|
|
66
|
-
|
|
182
|
+
The plugin ships a skill of the same name. Type `/mineru-tools` in a conversation or ask the agent to load it via the `skill` tool: it contains the full agent-facing manual — tool list, dual-API comparison, usage notes, and official limits.
|
|
67
183
|
|
|
68
|
-
|
|
184
|
+
## Results & artifacts
|
|
69
185
|
|
|
186
|
+
All results land in **`<workspace>/.dsh-mineru/artifacts/<run>/`** (`<workspace>` is the session workspace, `<run>` a fresh directory per parse):
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
.dsh-mineru/artifacts/<run>/
|
|
190
|
+
├── full.md # Structured Markdown (both modes)
|
|
191
|
+
├── run.json # Run metadata (source, API, model, duration, …)
|
|
192
|
+
├── *_content_list.json # Structured content list (Precision only)
|
|
193
|
+
├── layout.json # Layout data (Precision only)
|
|
194
|
+
├── *_model.json # Raw model output (Precision only)
|
|
195
|
+
├── *_origin.pdf # Server-side original file (Precision only)
|
|
196
|
+
├── images/ # Embedded images (Precision only)
|
|
197
|
+
└── result.zip # Raw server result package (Precision only)
|
|
70
198
|
```
|
|
199
|
+
|
|
200
|
+
- Tool results carry a **bounded Markdown preview** (first 12 KB by default); read the full text from `full.md` with the `read` tool;
|
|
201
|
+
- **Web UI**: artifacts get HMAC-signed preview URLs (24 h lifetime by default) — click to view/download; tool-result cards open files directly;
|
|
202
|
+
- **Headless**: use the absolute paths returned by the tool.
|
|
203
|
+
|
|
204
|
+
Batch parses keep each document in its own subdirectory: `<run>/<file-name>/full.md`.
|
|
205
|
+
|
|
206
|
+
## Configuration
|
|
207
|
+
|
|
208
|
+
Configuration resolves in three layers, later wins: **schema defaults ← composition layer (the `mineru` row config in a profile patch) ← user settings (written through the Web Settings card)**.
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
# Composition-layer example (cordis.patch.yml or a profile patch)
|
|
71
212
|
- id: mineru
|
|
72
213
|
config:
|
|
73
|
-
mode: auto
|
|
74
|
-
modelVersion: vlm
|
|
75
|
-
language: ch
|
|
76
|
-
enableTable: true
|
|
77
|
-
enableFormula: true
|
|
78
|
-
isOcr: false
|
|
79
|
-
extraFormats: []
|
|
80
|
-
exposeMode: progressive # progressive:
|
|
81
|
-
timeoutMs: 600000
|
|
82
|
-
pollIntervalMs: 3000
|
|
83
|
-
inlineMarkdownBytes: 12000
|
|
84
|
-
submitRatePerMin: 40
|
|
85
|
-
pollRatePerMin: 900
|
|
86
|
-
dailySubmitLimit: 5000
|
|
87
|
-
artifactRootName: .dsh-mineru
|
|
214
|
+
mode: auto # auto | precision | agent
|
|
215
|
+
modelVersion: vlm # pipeline | vlm | MinerU-HTML
|
|
216
|
+
language: ch # document language pack
|
|
217
|
+
enableTable: true # table recognition
|
|
218
|
+
enableFormula: true # formula recognition
|
|
219
|
+
isOcr: false # force OCR
|
|
220
|
+
extraFormats: [] # docx | html | latex (Precision only)
|
|
221
|
+
exposeMode: progressive # progressive: bootstrap activation; always: register everything globally
|
|
222
|
+
timeoutMs: 600000 # whole-operation timeout (ms)
|
|
223
|
+
pollIntervalMs: 3000 # result poll interval (ms)
|
|
224
|
+
inlineMarkdownBytes: 12000 # inline preview bytes in tool results
|
|
225
|
+
submitRatePerMin: 40 # submission rate cap (per minute)
|
|
226
|
+
pollRatePerMin: 900 # query rate cap (per minute)
|
|
227
|
+
dailySubmitLimit: 5000 # daily submission cap
|
|
228
|
+
artifactRootName: .dsh-mineru # artifact root directory name
|
|
88
229
|
```
|
|
89
230
|
|
|
231
|
+
### Full option reference
|
|
232
|
+
|
|
233
|
+
| Option | Default | Description |
|
|
234
|
+
| --- | --- | --- |
|
|
235
|
+
| `mode` | `auto` | API mode: `auto` (by token presence) / `precision` / `agent` |
|
|
236
|
+
| `modelVersion` | `vlm` | Precision model: `pipeline` / `vlm` / `MinerU-HTML` (forced for HTML sources) |
|
|
237
|
+
| `language` | `ch` | Document language pack (see below) |
|
|
238
|
+
| `enableTable` | `true` | Table recognition |
|
|
239
|
+
| `enableFormula` | `true` | Formula recognition |
|
|
240
|
+
| `isOcr` | `false` | Force OCR for scans |
|
|
241
|
+
| `extraFormats` | `[]` | Extra export formats (Precision only): `docx` / `html` / `latex` |
|
|
242
|
+
| `exposeMode` | `progressive` | `progressive`: bootstrap + per-agent activation; `always`: register all tools globally |
|
|
243
|
+
| `timeoutMs` | `600000` | Whole-operation timeout incl. polling; range 10 s – 1 h |
|
|
244
|
+
| `pollIntervalMs` | `3000` | Result poll interval; range 500 – 60000 ms |
|
|
245
|
+
| `pollJitterMs` | `500` | Per-query poll jitter so requests do not line up |
|
|
246
|
+
| `maxFileBytes` | `0` | Local file byte cap; `0` = per-mode API limits (200 MB / 10 MB) |
|
|
247
|
+
| `inlineMarkdownBytes` | `12000` | Markdown preview bytes returned inline with tool results |
|
|
248
|
+
| `artifactUrlTtlSec` | `86400` | Signed preview URL lifetime (s); range 60 s – 30 days |
|
|
249
|
+
| `submitRatePerMin` | `40` | Submission rate cap (official: 50/min) |
|
|
250
|
+
| `pollRatePerMin` | `900` | Result-query rate cap (official: 1000/min) |
|
|
251
|
+
| `dailySubmitLimit` | `5000` | Daily submission cap (official: 5000/day) |
|
|
252
|
+
| `tokenCredential` | `MINERU_API_TOKEN` | DSH credential reference name (a reference, never the secret) |
|
|
253
|
+
| `apiBaseUrl` | `https://mineru.net` | MinerU API base URL |
|
|
254
|
+
| `artifactRootName` | `.dsh-mineru` | Artifact root directory name (single segment) |
|
|
255
|
+
| `userAgent` | `dsh-mineru/<version>` | Request User-Agent |
|
|
256
|
+
|
|
90
257
|
### Token (DSH Credentials)
|
|
91
258
|
|
|
92
|
-
The configuration stores only the **credential reference name** (default `MINERU_API_TOKEN`); the token value lives in the credentials layer:
|
|
259
|
+
The configuration stores only the **credential reference name** (default `MINERU_API_TOKEN`); the token value lives in the credentials layer. Any of three ways:
|
|
93
260
|
|
|
94
|
-
|
|
95
|
-
|
|
261
|
+
1. **Web Settings card**: the token field is write-only — blank keeps the existing value, 清除 removes it;
|
|
262
|
+
2. **Headless / CLI**: put `MINERU_API_TOKEN: <token>` in `$DSH_HOME/.credentials.yaml`;
|
|
263
|
+
3. **Environment variable**: export `MINERU_API_TOKEN`.
|
|
96
264
|
|
|
97
|
-
The token is resolved once per operation
|
|
265
|
+
The token is resolved once per operation — **a rotation applies to the very next call without a restart**. Logs, errors, and Settings responses **never contain the secret**.
|
|
98
266
|
|
|
99
267
|
### language values
|
|
100
268
|
|
|
101
|
-
|
|
269
|
+
| Value | Meaning | Value | Meaning |
|
|
270
|
+
| --- | --- | --- | --- |
|
|
271
|
+
| `ch` | Chinese + English (default) | `ch_server` | Chinese (server-side) |
|
|
272
|
+
| `en` | English | `japan` | Japanese |
|
|
273
|
+
| `korean` | Korean | `chinese_cht` | Traditional Chinese |
|
|
274
|
+
| `latin` | Latin script | `arabic` | Arabic |
|
|
275
|
+
| `cyrillic` | Cyrillic script | `east_slavic` | East Slavic |
|
|
276
|
+
| `devanagari` | Devanagari | `th` | Thai |
|
|
277
|
+
| `ta` | Tamil | `te` | Telugu |
|
|
278
|
+
| `ka` | Georgian | `el` | Greek |
|
|
279
|
+
|
|
280
|
+
## Usage tips
|
|
281
|
+
|
|
282
|
+
- **Drag-and-drop**: drop a file into the chat — it is saved to the session workspace and its **path is filled into the composer draft (never auto-sent)**; add your request and send. This bypasses the native image-attachment channel that text-only models reject;
|
|
283
|
+
- **URL caveat**: MinerU fetches the URL server-side — **it cannot reach blocked sites** (github.com, AWS, etc.). Download such documents locally first and pass a path;
|
|
284
|
+
- **Page ranges**: Precision uses `pageRanges` (`"2,4-6"`; `"2--2"` = 2nd from last); Agent uses `pageRange` (`"1-10"`);
|
|
285
|
+
- **Long documents**: prefer Precision + `pageRanges` in chunks; the `vlm` model handles formulas and complex layouts best;
|
|
286
|
+
- **Timeout recovery**: a timeout is not a failure — the task keeps running server-side; collect it later with `mineru_task` + `taskId`;
|
|
287
|
+
- **HTML documents**: Precision only, and the `MinerU-HTML` model is forced automatically;
|
|
288
|
+
- **HTML daily quota**: HTML submissions have a separate official cap (max 100/day).
|
|
289
|
+
|
|
290
|
+
## Web UI
|
|
291
|
+
|
|
292
|
+
- **Settings → Plugins → MinerU 解析**: write-only token, mode, model, language, table/formula/OCR switches, extra formats, plus a collapsible **Advanced** section (timeouts/polling/rate limits, API base URL, credential reference, artifact root name). Every action shows immediate feedback (busy states and result messages); saves are revision-fenced (409 conflict → reload and retry);
|
|
293
|
+
- **Test buttons**: 测试 Token submits the official one-page demo PDF to verify the key (≈ 1 page of quota); 测试 Agent API verifies the tokenless channel (IP rate-limited);
|
|
294
|
+
- **Tool cards**: results of the three parsing tools render as dedicated cards — mode badge, duration, task id, artifact chips (open / preview), bounded preview, per-item batch outcomes.
|
|
102
295
|
|
|
103
296
|
## Rate limits & reliability
|
|
104
297
|
|
|
105
|
-
|
|
106
|
-
- HTTP 429 honors `Retry-After` with automatic backoff and retry.
|
|
107
|
-
- Polling carries random jitter; on timeout the task is not lost — collect it later with `mineru_task` using the `taskId`.
|
|
108
|
-
- Error codes map to actionable messages (A0202/A0211 token problems, -60005/-60006 size/pages, -30001~-30003 Agent limits, -60018 daily quota, and more).
|
|
298
|
+
**Official MinerU limits** (the plugin enforces local equivalents and backoff; requests beyond the limits are rejected with HTTP 429):
|
|
109
299
|
|
|
110
|
-
|
|
300
|
+
| Dimension | Official limit | Plugin local default |
|
|
301
|
+
| --- | --- | --- |
|
|
302
|
+
| Submissions | 50 files/min | 40/min |
|
|
303
|
+
| Daily submissions | 5000 files/day/user (HTML: max 100/day) | 5000 (fails fast locally) |
|
|
304
|
+
| Result queries | 1000/min | 900/min |
|
|
111
305
|
|
|
112
|
-
|
|
113
|
-
|
|
306
|
+
Plugin behavior:
|
|
307
|
+
|
|
308
|
+
- Built-in **token buckets** (separate for submit/query) — local requests queue instead of hammering the API;
|
|
309
|
+
- HTTP 429 honors `Retry-After` with **automatic backoff and retry**;
|
|
310
|
+
- Polling carries random jitter (`pollJitterMs`) so requests do not line up;
|
|
311
|
+
- On whole-operation timeout (`timeoutMs`) the task is not lost — collect it later with `mineru_task` + `taskId`.
|
|
312
|
+
|
|
313
|
+
## Error code reference
|
|
314
|
+
|
|
315
|
+
| Code | Meaning | What to do |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
| `A0202` / `A0211` | Token invalid / expired | Update the MinerU token in Settings |
|
|
318
|
+
| `-60005` / `-30001` | File too large (200 MB / 10 MB) | Compress or split the file |
|
|
319
|
+
| `-60006` / `-30003` | Too many pages (200 / 20) | Split with `pageRanges` / `pageRange` |
|
|
320
|
+
| `-60018` | Daily quota exhausted | Try again tomorrow; check `dailySubmitLimit` |
|
|
321
|
+
| `429` | Too many requests | Retry later or lower concurrency |
|
|
322
|
+
| `MINERU_TOKEN_REQUIRED` | Token-required operation without a token | Configure a token or use Agent mode |
|
|
323
|
+
| `MINERU_UNSUPPORTED_TYPE` | Format unsupported by the current API | Switch format or API mode |
|
|
324
|
+
| `MINERU_BATCH_TOO_LARGE` | Batch exceeds 1000 items | Split into multiple calls |
|
|
325
|
+
|
|
326
|
+
Every error is mapped to an **actionable message** instead of a raw code.
|
|
114
327
|
|
|
115
328
|
## Security model
|
|
116
329
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
330
|
+
- **Path isolation**: input paths resolve against the session workspace; files outside it cannot be read;
|
|
331
|
+
- **ZIP unpacking guards**: rejects absolute paths, `..` traversal, encrypted entries, and ZIP64, with entry-count and byte caps, and verifies CRC32 on every extracted entry;
|
|
332
|
+
- **Artifact boundary**: written only under `<workspace>/.dsh-mineru`; preview URLs are HMAC-signed with expiry and re-validated on every read;
|
|
333
|
+
- **Web routes**: same-origin only; HTML/SVG artifacts are served as attachments with `nosniff`;
|
|
334
|
+
- **Cancellable**: all network work honors the tool-call abort signal — cancel/timeout stops uploads, polling, and downloads;
|
|
335
|
+
- **Secrets never leave the vault**: the token lives only in the credentials layer; logs/errors/Settings responses never carry it.
|
|
121
336
|
|
|
122
|
-
##
|
|
337
|
+
## FAQ
|
|
123
338
|
|
|
124
|
-
|
|
339
|
+
**Q: Can I use it without a token?**
|
|
340
|
+
Yes. It falls back to the tokenless Agent API (≤ 10 MB, ≤ 20 pages, Markdown only) — fine for quick reads.
|
|
125
341
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
npm pack # pack a local tarball
|
|
129
|
-
```
|
|
342
|
+
**Q: Why is only `mineru_activate` in my tool list?**
|
|
343
|
+
That is progressive exposure by design. Call `mineru_activate` once and the other three tools unlock; or set `exposeMode: always` to register everything globally.
|
|
130
344
|
|
|
131
|
-
|
|
345
|
+
**Q: My parse timed out — is the file lost?**
|
|
346
|
+
No. The task keeps running on MinerU's servers; use `mineru_task` (`taskId` + `api`) anytime to query progress and collect the result without resubmitting.
|
|
132
347
|
|
|
133
|
-
|
|
348
|
+
**Q: Why didn't the parse start after I dropped a file?**
|
|
349
|
+
Drag-and-drop only fills the path into the composer draft (to avoid accidental sends). Add your request and press send; the agent then starts parsing.
|
|
134
350
|
|
|
351
|
+
**Q: A0202 / A0211 errors?**
|
|
352
|
+
The token is invalid or expired. Re-enter it in Settings → Plugins → MinerU 解析 (a blank save keeps the old value).
|
|
353
|
+
|
|
354
|
+
**Q: Can I parse HTML pages?**
|
|
355
|
+
Yes, but Precision API only (token required), and the MinerU-HTML model is forced. Note the server cannot reach blocked URLs.
|
|
356
|
+
|
|
357
|
+
**Q: How do I batch-parse?**
|
|
358
|
+
Use `mineru_batch_parse` with a list of paths/URLs — auto-chunked (local ≤ 50/batch, URLs ≤ 200/batch, ≤ 1000 per call).
|
|
359
|
+
|
|
360
|
+
**Q: What's the difference between the Agent and Precision results?**
|
|
361
|
+
Agent produces Markdown only. Precision additionally yields `content_list.json`, `layout.json`, `model.json`, embedded images, optional docx/html/latex exports, and table/formula recognition controls.
|
|
362
|
+
|
|
363
|
+
## Development & publishing
|
|
364
|
+
|
|
365
|
+
No build step: `lib/` ships loadable ESM and `lib/client.js` is the packed browser bundle.
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
node --check lib/*.js # syntax check
|
|
369
|
+
npm pack # pack a local tarball
|
|
135
370
|
```
|
|
136
|
-
|
|
137
|
-
npm publish
|
|
138
|
-
dsh plugin --profile web add dsh-mineru # user install after publishing
|
|
139
|
-
```
|
|
371
|
+
|
|
372
|
+
For a new release, follow the checklist in [RELEASE.md](RELEASE.md) (bump version → update CHANGELOG and both READMEs → pack & verify → tag & push → `npm publish`); see [CONTRIBUTING.md](CONTRIBUTING.md) for the full development loop.
|
|
140
373
|
|
|
141
374
|
## Contributing
|
|
142
375
|
|
|
143
|
-
Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Please never paste a MinerU token into an issue.
|
|
376
|
+
Issues and pull requests are welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Please **never paste a MinerU token** into an issue.
|
|
144
377
|
|
|
145
378
|
## License
|
|
146
379
|
|
|
147
|
-
[MIT](LICENSE). MinerU is provided by OpenDataLab; its official docs ([API](https://mineru.net/apiManage/docs), [rate limits](https://mineru.net/apiManage/limit)) remain authoritative.
|
|
380
|
+
[MIT](LICENSE). MinerU is provided by [OpenDataLab](https://opendatalab.com); its official docs ([API](https://mineru.net/apiManage/docs), [rate limits](https://mineru.net/apiManage/limit)) remain authoritative.
|
package/README.zh.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# dsh-mineru
|
|
2
2
|
|
|
3
3
|
[](LICENSE)
|
|
4
|
-
[](https://github.com/Lee-Hilex/dsh-mineru/releases)
|
|
5
5
|
[](https://github.com/deepseek-ai/deepseek-harness)
|
|
6
6
|
[](https://mineru.net/apiManage/docs)
|
|
7
7
|
|
|
@@ -9,139 +9,372 @@
|
|
|
9
9
|
|
|
10
10
|
[English](README.md) | 简体中文
|
|
11
11
|
|
|
12
|
+
**dsh-mineru** 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(简称 dsh)的 **MinerU 多模态文档解析插件**:把 PDF、Word、PPT、Excel、HTML 和图片一键转成**结构化 Markdown**。**配置了 MinerU Token 走 🎯 精准解析 API;不配 Token 也能用 ⚡ Agent 轻量解析 API(免登录,IP 限频)。**
|
|
13
|
+
|
|
12
14
|
## 目录
|
|
13
15
|
|
|
14
|
-
- [
|
|
16
|
+
- [简介](#简介) · [快速开始](#快速开始) · [两种 API 模式](#两种-api-模式) · [工具详解](#工具详解) · [解析结果与 Artifacts](#解析结果与-artifacts) · [配置参考](#配置参考) · [使用技巧](#使用技巧) · [Web 界面](#web-界面) · [限流与可靠性](#限流与可靠性) · [错误码速查](#错误码速查) · [安全模型](#安全模型) · [常见问题 FAQ](#常见问题-faq) · [开发与发布](#开发与发布) · [贡献](#贡献) · [许可](#许可)
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
## 简介
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
### 这是什么?
|
|
19
21
|
|
|
20
|
-
-
|
|
21
|
-
- **四个工具、渐进式曝光** — `mineru_parse`、`mineru_batch_parse`(自动分批)、`mineru_task`(超时续收),外加 `mineru-tools` 技能;平时只有极小的 `mineru_activate` 引导工具可见,激活后才挂载完整工具集。
|
|
22
|
-
- **拖拽上传,纯文本模型也能用** — 把 PDF/Office 文档/图片直接拖进聊天窗口:文件先落到会话工作区,其路径会**填入输入框草稿(不自动发送)**,由你补充需求后自行发送,完全绕开纯文本模型会拒绝的原生图片附件通道。
|
|
23
|
-
- **限流感知** — 内置令牌桶(提交 40 次/分钟、查询 900 次/分钟)、每日提交计数、HTTP 429 按 `Retry-After` 退避重试、全部错误码映射为可操作提示。
|
|
24
|
-
- **Artifact 与 Web 界面** — 结果解包到 `<workspace>/.dsh-mineru/artifacts/`,附带 HMAC 签名预览链接;Web 设置有专属卡片(Token 只写、高级设置折叠、操作即时反馈)与专属工具结果卡片。
|
|
22
|
+
dsh-mineru 把 [MinerU](https://mineru.net)(OpenDataLab 出品的高精度文档解析引擎)接入 DeepSeek Harness 的 Agent 生态,让**纯文本模型也能"看懂"文档**:模型拿到的是结构化 Markdown(含表格、公式、图片),而不是打不开的二进制文件。
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
典型场景:
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
- 读论文 / 合同 / 报告:让 Agent 解析 PDF 后总结要点、提取数据;
|
|
27
|
+
- 批量整理资料:一次解析几十份文档,逐项产出 Markdown;
|
|
28
|
+
- 图片 / 截图转文字:OCR 扫描件、网页截图转可检索文本;
|
|
29
|
+
- 公式与表格还原:论文中的数学公式、Excel 表格结构完整保留。
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
### 支持的文件格式
|
|
32
|
+
|
|
33
|
+
| 格式 | 精准解析 API(需 Token) | Agent 轻量 API(免 Token) |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| PDF | ✅ | ✅ |
|
|
36
|
+
| Word(`.doc` / `.docx`) | ✅ | ✅(仅 `.docx`) |
|
|
37
|
+
| PPT(`.ppt` / `.pptx`) | ✅ | ✅(仅 `.pptx`) |
|
|
38
|
+
| Excel(`.xls` / `.xlsx`) | ✅ | ✅(仅 `.xlsx`) |
|
|
39
|
+
| HTML(`.html` / `.htm`) | ✅(自动强制 MinerU-HTML 模型) | ❌ |
|
|
40
|
+
| 图片(`.png` `.jpg` `.jpeg` `.jp2` `.webp` `.gif` `.bmp`) | ✅ | ✅ |
|
|
41
|
+
|
|
42
|
+
> 注:Agent 轻量 API 不支持 `.doc` / `.ppt` / `.xls`(旧版 Office 格式)与 HTML,遇到这类文件请改用精准解析(需 Token)。
|
|
43
|
+
|
|
44
|
+
### 核心能力
|
|
45
|
+
|
|
46
|
+
- **双 API 自动切换** — 按是否配置 Token 自动选择精准解析或轻量解析,也可手动指定;
|
|
47
|
+
- **渐进式工具曝光** — 平时只挂一个极小的 `mineru_activate` 引导工具,激活后才挂载完整工具集,省上下文;
|
|
48
|
+
- **拖拽上传** — 文件直接拖进聊天窗口,路径自动填入输入框,纯文本模型也能处理文档;
|
|
49
|
+
- **自动分批批量解析** — 一次提交上百个文件/URL,自动按官方限额分批;
|
|
50
|
+
- **限流感知** — 内置令牌桶、每日限额、429 退避重试,错误码全部翻译成可操作提示;
|
|
51
|
+
- **结果落地为 Artifact** — 解析结果写入工作区文件,Web 界面可预览/打开,带签名链接。
|
|
52
|
+
|
|
53
|
+
## 快速开始
|
|
54
|
+
|
|
55
|
+
### 第 1 步:安装
|
|
56
|
+
|
|
57
|
+
前置条件:DeepSeek Harness `0.1.0-rc.6`(或兼容的 `0.1.x`),且 `dsh` 命令可用。
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
# Web 界面使用
|
|
31
61
|
dsh plugin --profile web add dsh-mineru
|
|
62
|
+
|
|
63
|
+
# 无头(Headless)模式使用
|
|
32
64
|
dsh plugin --profile headless add dsh-mineru
|
|
33
65
|
```
|
|
34
66
|
|
|
35
|
-
重启 Web profile 后,在 **设置 → 插件 → MinerU 解析**
|
|
67
|
+
重启 Web profile 后,在 **设置 → 插件 → MinerU 解析** 中即可看到本插件。
|
|
36
68
|
|
|
37
|
-
|
|
69
|
+
本地开发版用打包好的 tgz 安装(见 [开发与发布](#开发与发布)):
|
|
38
70
|
|
|
71
|
+
```bash
|
|
72
|
+
dsh plugin --profile web add <路径>/dsh-mineru-0.1.8.tgz
|
|
39
73
|
```
|
|
40
|
-
|
|
41
|
-
|
|
74
|
+
|
|
75
|
+
### 第 2 步:配置(可选)
|
|
76
|
+
|
|
77
|
+
**不配 Token 也能用**(自动走 Agent 轻量解析)。配 Token 可以解锁完整能力(精准解析 + 批量 + HTML + 更多格式):
|
|
78
|
+
|
|
79
|
+
- **Web 界面**:设置 → 插件 → **MinerU 解析** → 在 Token 输入框粘贴 Token(只写不读,留空保留现有值);
|
|
80
|
+
- **Headless / 命令行**:在 `$DSH_HOME/.credentials.yaml` 写入 `MINERU_API_TOKEN: <你的Token>`,或设置环境变量 `MINERU_API_TOKEN`。
|
|
81
|
+
|
|
82
|
+
Token 每次调用时实时解析,**轮换后无需重启立即生效**。Token 去哪领:<https://mineru.net> 注册后到 API 管理页面获取。
|
|
83
|
+
|
|
84
|
+
### 第 3 步:开始使用
|
|
85
|
+
|
|
86
|
+
**Web 界面**(推荐方式,支持拖拽):
|
|
87
|
+
|
|
88
|
+
1. 把 PDF/Word/图片直接**拖进聊天窗口** —— 文件会自动保存到会话工作区,路径填入输入框(不会自动发送);
|
|
89
|
+
2. 在输入框补一句需求,比如「把这份 PDF 解析成 Markdown,然后总结一下重点」;
|
|
90
|
+
3. 发送。Agent 会自动激活工具并调用 `mineru_parse`,解析结果以文件形式返回,可点击预览。
|
|
91
|
+
|
|
92
|
+
**URL 解析**:直接告诉 Agent「解析这个网页/文档:https://example.com/paper.pdf」即可。
|
|
93
|
+
|
|
94
|
+
**Headless / CLI**:Agent 看到文档路径或 URL 后会自动调用工具;也可以在会话中输入 `/mineru-tools` 加载使用说明技能。
|
|
42
95
|
|
|
43
96
|
## 两种 API 模式
|
|
44
97
|
|
|
45
98
|
| 维度 | 🎯 精准解析 API(需 Token) | ⚡ Agent 轻量解析 API(免 Token) |
|
|
46
99
|
| --- | --- | --- |
|
|
47
100
|
| 接口 | `/api/v4/extract/task`、`/api/v4/file-urls/batch`、`/api/v4/extract/task/batch` | `/api/v1/agent/parse/url`、`/api/v1/agent/parse/file` |
|
|
48
|
-
| 模型 | `pipeline` / `vlm`(默认)/ `MinerU-HTML` |
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
101
|
+
| 模型 | `pipeline` / `vlm`(默认)/ `MinerU-HTML` | 固定轻量 pipeline 模型 |
|
|
102
|
+
| 大小限制 | ≤ 200 MB | ≤ 10 MB |
|
|
103
|
+
| 页数限制 | ≤ 200 页 | ≤ 20 页 |
|
|
104
|
+
| 批量解析 | ✅(URL 每批 ≤200,本地上传每批 ≤50,自动分批) | ❌ 仅单文件 |
|
|
105
|
+
| 输出 | Zip:`full.md` + `content_list.json` + `layout.json` + 图片(可加 docx/html/latex) | 仅 Markdown |
|
|
106
|
+
| 适用场景 | 长文档、扫描件、公式表格、批量、HTML | 快速粗读、小文件、临时使用 |
|
|
107
|
+
|
|
108
|
+
**模式选择**(`mode` 参数或配置项):
|
|
109
|
+
|
|
110
|
+
- `auto`(默认)— 有 Token 走精准解析,没 Token 走 Agent 轻量;
|
|
111
|
+
- `precision` — 强制精准解析,没配 Token 会直接报错提示;
|
|
112
|
+
- `agent` — 强制 Agent 轻量解析。
|
|
113
|
+
|
|
114
|
+
想知道当前会话实际走的哪个 API:调用一次 `mineru_activate`,返回结果里的 `api` 字段会明确告诉你(`precision` 或 `agent`)。
|
|
115
|
+
|
|
116
|
+
## 工具详解
|
|
52
117
|
|
|
53
|
-
|
|
118
|
+
安装后,工具集默认**渐进式曝光**:一开始只有 `mineru_activate` 一个引导工具,调用一次即解锁其余三个工具,随后 `mineru_activate` 对本会话自动隐藏。
|
|
54
119
|
|
|
55
|
-
|
|
120
|
+
### `mineru_activate` —— 激活引导
|
|
56
121
|
|
|
57
|
-
|
|
|
122
|
+
| 项 | 说明 |
|
|
58
123
|
| --- | --- |
|
|
59
|
-
| `
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
124
|
+
| 用途 | 解锁 `mineru_parse` / `mineru_batch_parse` / `mineru_task` 并加载 `mineru-tools` 技能 |
|
|
125
|
+
| 参数 | 无 |
|
|
126
|
+
| 返回 | 当前生效的 API 模式、是否已配 Token、各 API 限制等现状摘要 |
|
|
127
|
+
|
|
128
|
+
### `mineru_parse` —— 解析单个文档
|
|
129
|
+
|
|
130
|
+
将**工作区文件路径**或 **http(s) URL** 解析为结构化 Markdown。
|
|
131
|
+
|
|
132
|
+
| 参数 | 必填 | 说明 |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `source` | ✅ | 工作区文件路径,或完整 http(s) URL |
|
|
135
|
+
| `mode` | | `auto`(默认)/ `precision` / `agent` |
|
|
136
|
+
| `modelVersion` | | 精准解析模型:`pipeline` / `vlm`(默认,推荐)/ `MinerU-HTML`(HTML 源自动强制) |
|
|
137
|
+
| `language` | | 文档语言包,默认 `ch`(中英),见 [language 取值](#配置参考) |
|
|
138
|
+
| `enableTable` | | 表格识别,默认 `true` |
|
|
139
|
+
| `enableFormula` | | 公式识别,默认 `true` |
|
|
140
|
+
| `isOcr` | | 强制 OCR(扫描件),默认 `false` |
|
|
141
|
+
| `pageRanges` | | 精准解析页码范围,逗号分隔,如 `"2,4-6"`;支持倒数页 `"2--2"`(倒数第 2 页) |
|
|
142
|
+
| `pageRange` | | Agent 解析页码范围,仅 `from-to` 或单页,如 `"1-10"` |
|
|
143
|
+
| `extraFormats` | | 额外导出格式(仅精准解析):`docx` / `html` / `latex` |
|
|
144
|
+
| `dataId` | | 业务数据 ID(可选,≤128 字符) |
|
|
145
|
+
| `timeoutMs` | | 整个操作(含轮询)超时,默认取插件配置(10 分钟) |
|
|
146
|
+
| `output` | | 结果目录基名,默认取源文件名 |
|
|
147
|
+
|
|
148
|
+
**返回要点**:`ok`、所用 `api`/`modelVersion`、`taskId`、耗时、`runDir` 结果目录、截断的 Markdown 预览、Artifact 列表(Web 含签名预览链接)。
|
|
149
|
+
|
|
150
|
+
### `mineru_batch_parse` —— 批量解析(仅精准解析)
|
|
151
|
+
|
|
152
|
+
一次解析多个文档,**本地文件路径与 URL 可混用**,自动分批提交(官方限额内),逐项报告成功/失败。
|
|
153
|
+
|
|
154
|
+
| 参数 | 必填 | 说明 |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| `sources` | ✅ | 文件路径 / URL 混合列表 |
|
|
157
|
+
| `outputPrefix` | | 结果目录基名,默认 `batch` |
|
|
158
|
+
| `dataIdPrefix` | | 业务数据 ID 前缀,每项自动追加序号(可选) |
|
|
159
|
+
| 其余 | | 同 `mineru_parse` 的公共选项(`mode` 除外——本工具强制精准解析) |
|
|
160
|
+
|
|
161
|
+
**分批规则**:本地文件每批 ≤ 50 个、URL 每批 ≤ 200 个、单次调用总共 ≤ 1000 个;超出会报错并提示拆分调用。
|
|
162
|
+
|
|
163
|
+
**返回要点**:成功/失败计数、各 `batchId`、逐项结果(每个成功项包含其 `full.md` 所在目录),失败项附错误信息。
|
|
164
|
+
|
|
165
|
+
### `mineru_task` —— 任务查询与结果收集
|
|
63
166
|
|
|
64
|
-
|
|
167
|
+
解析**超时后不丢任务**:凭 `mineru_parse` 返回的 `taskId` + `api` 继续查询进度、收集结果,无需重新提交。
|
|
65
168
|
|
|
66
|
-
|
|
169
|
+
| 参数 | 必填 | 说明 |
|
|
170
|
+
| --- | --- | --- |
|
|
171
|
+
| `taskId` | ✅ | 提交任务时返回的 task_id |
|
|
172
|
+
| `api` | ✅ | 任务所属:`precision` 或 `agent` |
|
|
173
|
+
| `wait` | | 是否轮询等待任务完成,默认 `false`(只查一次) |
|
|
174
|
+
| `collect` | | 任务完成时是否下载结果落地为 Artifact,默认 `true` |
|
|
175
|
+
| `output` | | 收集结果目录基名,默认 `task` |
|
|
176
|
+
| `timeoutMs` | | `wait` 模式下的超时 |
|
|
177
|
+
|
|
178
|
+
**典型场景**:解析大 PDF 时 `mineru_parse` 超时了 → 告诉 Agent「用 mineru_task 继续收集 taskId=xxx 的结果」。
|
|
179
|
+
|
|
180
|
+
### `mineru-tools` 技能
|
|
181
|
+
|
|
182
|
+
插件自带同名技能:会话中输入 `/mineru-tools` 或让 Agent 调用 `skill` 工具加载,即可获得工具清单、双 API 对比、使用要点与官方限制的完整说明(Agent 视角的使用手册)。
|
|
183
|
+
|
|
184
|
+
## 解析结果与 Artifacts
|
|
67
185
|
|
|
68
|
-
|
|
186
|
+
所有解析结果写入 **`<workspace>/.dsh-mineru/artifacts/<run>/`**(`<workspace>` 为当前会话工作区,`<run>` 为每次解析的独立目录):
|
|
69
187
|
|
|
70
188
|
```
|
|
189
|
+
.dsh-mineru/artifacts/<run>/
|
|
190
|
+
├── full.md # 结构化 Markdown 主结果(两模式都有)
|
|
191
|
+
├── run.json # 本次解析元数据(来源、API、模型、耗时等)
|
|
192
|
+
├── *_content_list.json # 内容结构化清单(仅精准解析)
|
|
193
|
+
├── layout.json # 版面布局数据(仅精准解析)
|
|
194
|
+
├── *_model.json # 模型原始输出(仅精准解析)
|
|
195
|
+
├── *_origin.pdf # 服务端转换的原始文件(仅精准解析)
|
|
196
|
+
├── images/ # 文档内嵌图片(仅精准解析)
|
|
197
|
+
└── result.zip # 服务端原始结果包(仅精准解析)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- 工具结果里附**限长 Markdown 预览**(默认前 12 KB),完整内容请用 `read` 工具读取 `full.md`;
|
|
201
|
+
- **Web 界面**:Artifact 带 HMAC 签名预览链接(默认有效期 24 小时),点开即可看/下载;工具结果卡片可直接打开文件;
|
|
202
|
+
- **Headless**:直接使用返回的绝对路径。
|
|
203
|
+
|
|
204
|
+
批量解析时每个文档在独立子目录:`<run>/<文件名>/full.md`。
|
|
205
|
+
|
|
206
|
+
## 配置参考
|
|
207
|
+
|
|
208
|
+
配置分三层解析:**schema 默认值 ← 组合层(profile patch 中的 `mineru` 行 config)← 用户设置(Web 设置卡片写入)**,后一层覆盖前一层。
|
|
209
|
+
|
|
210
|
+
```yaml
|
|
211
|
+
# 组合层配置示例(cordis.patch.yml 或 profile patch)
|
|
71
212
|
- id: mineru
|
|
72
213
|
config:
|
|
73
|
-
mode: auto
|
|
74
|
-
modelVersion: vlm
|
|
75
|
-
language: ch
|
|
76
|
-
enableTable: true
|
|
77
|
-
enableFormula: true
|
|
78
|
-
isOcr: false
|
|
79
|
-
extraFormats: []
|
|
80
|
-
exposeMode: progressive # progressive:
|
|
81
|
-
timeoutMs: 600000
|
|
82
|
-
pollIntervalMs: 3000
|
|
83
|
-
inlineMarkdownBytes: 12000
|
|
84
|
-
submitRatePerMin: 40
|
|
85
|
-
pollRatePerMin: 900
|
|
86
|
-
dailySubmitLimit: 5000
|
|
87
|
-
artifactRootName: .dsh-mineru
|
|
214
|
+
mode: auto # auto | precision | agent
|
|
215
|
+
modelVersion: vlm # pipeline | vlm | MinerU-HTML
|
|
216
|
+
language: ch # 文档语言包
|
|
217
|
+
enableTable: true # 表格识别
|
|
218
|
+
enableFormula: true # 公式识别
|
|
219
|
+
isOcr: false # 强制 OCR
|
|
220
|
+
extraFormats: [] # docx | html | latex(仅精准解析)
|
|
221
|
+
exposeMode: progressive # progressive: 引导激活; always: 全局注册全部工具
|
|
222
|
+
timeoutMs: 600000 # 整体超时(毫秒)
|
|
223
|
+
pollIntervalMs: 3000 # 结果轮询间隔(毫秒)
|
|
224
|
+
inlineMarkdownBytes: 12000 # 工具结果内联预览字节数
|
|
225
|
+
submitRatePerMin: 40 # 提交限速(次/分钟)
|
|
226
|
+
pollRatePerMin: 900 # 查询限速(次/分钟)
|
|
227
|
+
dailySubmitLimit: 5000 # 每日提交限额
|
|
228
|
+
artifactRootName: .dsh-mineru # Artifact 根目录名
|
|
88
229
|
```
|
|
89
230
|
|
|
90
|
-
###
|
|
231
|
+
### 完整配置项
|
|
91
232
|
|
|
92
|
-
|
|
233
|
+
| 配置项 | 默认值 | 说明 |
|
|
234
|
+
| --- | --- | --- |
|
|
235
|
+
| `mode` | `auto` | API 模式:`auto`(按 Token 自动)/ `precision` / `agent` |
|
|
236
|
+
| `modelVersion` | `vlm` | 精准解析模型:`pipeline` / `vlm` / `MinerU-HTML`(HTML 源自动强制) |
|
|
237
|
+
| `language` | `ch` | 文档语言包(见下表) |
|
|
238
|
+
| `enableTable` | `true` | 表格识别开关 |
|
|
239
|
+
| `enableFormula` | `true` | 公式识别开关 |
|
|
240
|
+
| `isOcr` | `false` | 强制 OCR(扫描件) |
|
|
241
|
+
| `extraFormats` | `[]` | 额外导出格式(仅精准解析):`docx` / `html` / `latex` |
|
|
242
|
+
| `exposeMode` | `progressive` | `progressive`:引导激活;`always`:全局注册全部工具 |
|
|
243
|
+
| `timeoutMs` | `600000` | 整个操作(含轮询)超时,范围 10 s ~ 1 h |
|
|
244
|
+
| `pollIntervalMs` | `3000` | 结果轮询间隔,范围 500 ~ 60000 ms |
|
|
245
|
+
| `pollJitterMs` | `500` | 轮询随机抖动,避免请求整齐划一 |
|
|
246
|
+
| `maxFileBytes` | `0` | 本地文件大小上限;`0` = 按 API 模式限额(200 MB / 10 MB) |
|
|
247
|
+
| `inlineMarkdownBytes` | `12000` | 工具结果内联的 Markdown 预览字节数 |
|
|
248
|
+
| `artifactUrlTtlSec` | `86400` | 签名预览链接有效期(秒),范围 60 s ~ 30 天 |
|
|
249
|
+
| `submitRatePerMin` | `40` | 提交限速(官方上限 50/分钟) |
|
|
250
|
+
| `pollRatePerMin` | `900` | 查询限速(官方上限 1000/分钟) |
|
|
251
|
+
| `dailySubmitLimit` | `5000` | 每日提交限额(官方上限 5000/天) |
|
|
252
|
+
| `tokenCredential` | `MINERU_API_TOKEN` | DSH 凭据引用名(只存引用,不存密钥) |
|
|
253
|
+
| `apiBaseUrl` | `https://mineru.net` | MinerU API 地址 |
|
|
254
|
+
| `artifactRootName` | `.dsh-mineru` | Artifact 根目录名(单层目录名) |
|
|
255
|
+
| `userAgent` | `dsh-mineru/<版本>` | 请求 User-Agent |
|
|
256
|
+
|
|
257
|
+
### Token 与凭据
|
|
258
|
+
|
|
259
|
+
配置中**只保存凭据引用名**(默认 `MINERU_API_TOKEN`),Token 值存放在 dsh 凭据层,三种方式任选:
|
|
260
|
+
|
|
261
|
+
1. **Web 设置卡片**:Token 输入框只写不读——留空保留现有值,点「清除」删除;
|
|
262
|
+
2. **Headless / 命令行**:`$DSH_HOME/.credentials.yaml` 写入 `MINERU_API_TOKEN: <token>`;
|
|
263
|
+
3. **环境变量**:设置 `MINERU_API_TOKEN`。
|
|
264
|
+
|
|
265
|
+
Token 每次操作实时解析——**轮换后下一次调用立即生效,无需重启**。日志、错误与设置响应**永不携带密钥**。
|
|
93
266
|
|
|
94
|
-
|
|
95
|
-
- Headless / 命令行:`$DSH_HOME/.credentials.yaml` 中写入 `MINERU_API_TOKEN: <token>`,或用环境变量 `MINERU_API_TOKEN`。
|
|
267
|
+
### language 取值
|
|
96
268
|
|
|
97
|
-
|
|
269
|
+
| 值 | 说明 | 值 | 说明 |
|
|
270
|
+
| --- | --- | --- | --- |
|
|
271
|
+
| `ch` | 中英(默认) | `ch_server` | 中文(服务端) |
|
|
272
|
+
| `en` | 英文 | `japan` | 日文 |
|
|
273
|
+
| `korean` | 韩文 | `chinese_cht` | 繁体中文 |
|
|
274
|
+
| `latin` | 拉丁语系 | `arabic` | 阿拉伯语 |
|
|
275
|
+
| `cyrillic` | 西里尔语系 | `east_slavic` | 东斯拉夫语系 |
|
|
276
|
+
| `devanagari` | 天城文 | `th` | 泰文 |
|
|
277
|
+
| `ta` | 泰米尔文 | `te` | 泰卢固文 |
|
|
278
|
+
| `ka` | 格鲁吉亚文 | `el` | 希腊文 |
|
|
279
|
+
|
|
280
|
+
## 使用技巧
|
|
281
|
+
|
|
282
|
+
- **拖拽上传**:把文件拖进聊天窗口即可——文件自动保存到会话工作区,**路径填入输入框草稿(不自动发送)**,你补一句需求再发送。这绕开了纯文本模型不支持的图片附件通道;
|
|
283
|
+
- **URL 注意**:MinerU 服务端会去抓取该 URL——**无法访问被墙站点**(如 github.com、aws 等)。这类文档请先下载到本地再传路径;
|
|
284
|
+
- **页码范围**:精准解析用 `pageRanges`(`"2,4-6"`,`"2--2"` 表示倒数第 2 页);Agent 用 `pageRange`(`"1-10"`);
|
|
285
|
+
- **长文档**:优先精准解析 + `pageRanges` 分段处理;`vlm` 模型对公式/复杂版面效果最好;
|
|
286
|
+
- **超时恢复**:解析超时不等于失败——任务还在服务端跑,用 `mineru_task` + `taskId` 继续收集;
|
|
287
|
+
- **HTML 文档**:仅精准解析支持,且自动强制 `MinerU-HTML` 模型(无需手动指定);
|
|
288
|
+
- **HTML 文件每日限额**:官方对 HTML 提交有单独限制(最多 100 个/天)。
|
|
98
289
|
|
|
99
|
-
|
|
290
|
+
## Web 界面
|
|
100
291
|
|
|
101
|
-
|
|
292
|
+
- **设置 → 插件 → MinerU 解析**:Token(只写)、模式、模型、语言、表格/公式/OCR 开关、额外导出格式,以及可折叠的**高级设置**(超时/轮询/限速/限额、API 地址、凭据引用名、Artifact 根目录名)。每个操作都有即时反馈(忙碌状态与结果消息);保存带修订冲突检测(409 冲突 → 重新加载后重试);
|
|
293
|
+
- **测试按钮**:「测试 Token」提交官方一页示例 PDF 验证密钥(约消耗 1 页额度);「测试 Agent API」验证免登录通道(受 IP 限频);
|
|
294
|
+
- **工具卡片**:三个解析工具的结果以专属卡片呈现——模式徽章、耗时、任务 ID、Artifact 列表(点击打开 / 链接预览)、限长预览、逐项批量结果。
|
|
102
295
|
|
|
103
296
|
## 限流与可靠性
|
|
104
297
|
|
|
105
|
-
|
|
106
|
-
- 命中 HTTP 429 时按 `Retry-After` 退避并自动重试;
|
|
107
|
-
- 轮询带随机抖动;整体超时后不丢任务——用 `mineru_task` 凭 `taskId` 继续收集;
|
|
108
|
-
- 错误码全部映射为可操作的中文提示(A0202/A0211 Token、-60005/-60006 尺寸/页数、-30001~-30003 Agent 限制、-60018 配额等)。
|
|
298
|
+
**MinerU 官方限流**(插件已内置本地限速与退避,超限的请求会被服务端以 HTTP 429 拒绝):
|
|
109
299
|
|
|
110
|
-
|
|
300
|
+
| 维度 | 官方限额 | 插件本地默认 |
|
|
301
|
+
| --- | --- | --- |
|
|
302
|
+
| 提交 | 50 个文件/分钟 | 40 个/分钟 |
|
|
303
|
+
| 每日提交 | 5000 个文件/天/用户(HTML 最多 100 个/天) | 5000(本地提前报错) |
|
|
304
|
+
| 结果查询 | 1000 次/分钟 | 900 次/分钟 |
|
|
111
305
|
|
|
112
|
-
|
|
113
|
-
|
|
306
|
+
插件行为:
|
|
307
|
+
|
|
308
|
+
- 内置**令牌桶**限速(提交/查询分开),超限的本地请求排队而不是打爆 API;
|
|
309
|
+
- 命中 HTTP 429 时按 `Retry-After` **退避自动重试**;
|
|
310
|
+
- 轮询带随机抖动(`pollJitterMs`),避免请求整齐划一触发风控;
|
|
311
|
+
- 整体超时(`timeoutMs`)后任务不丢——用 `mineru_task` 凭 `taskId` 继续收集。
|
|
312
|
+
|
|
313
|
+
## 错误码速查
|
|
314
|
+
|
|
315
|
+
| 错误码 | 含义 | 处理方式 |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
| `A0202` / `A0211` | Token 错误 / 过期 | 在设置中更新 MinerU Token |
|
|
318
|
+
| `-60005` / `-30001` | 文件超限(200 MB / 10 MB) | 压缩或拆分文件 |
|
|
319
|
+
| `-60006` / `-30003` | 页数超限(200 页 / 20 页) | 用 `pageRanges` / `pageRange` 分段 |
|
|
320
|
+
| `-60018` | 当日配额已满 | 明天再试,或检查 `dailySubmitLimit` |
|
|
321
|
+
| `429` | 请求过于频繁 | 稍后重试或降低并发 |
|
|
322
|
+
| `MINERU_TOKEN_REQUIRED` | 需要 Token 的操作未配 Token | 配置 Token 或改用 Agent 模式 |
|
|
323
|
+
| `MINERU_UNSUPPORTED_TYPE` | 该格式不被当前 API 支持 | 换格式或换 API 模式 |
|
|
324
|
+
| `MINERU_BATCH_TOO_LARGE` | 单次批量超过 1000 个 | 拆分后多次调用 |
|
|
325
|
+
|
|
326
|
+
所有错误都会映射为**可操作的中文提示**,而不是原始错误码。
|
|
114
327
|
|
|
115
328
|
## 安全模型
|
|
116
329
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
330
|
+
- **路径隔离**:输入路径以会话工作区为根解析,不能读取工作区外文件;
|
|
331
|
+
- **ZIP 解包防护**:拒绝绝对路径、`..` 穿越、加密条目与 ZIP64,带条目数量/体积上限,每个解出的条目都校验 CRC32;
|
|
332
|
+
- **Artifact 边界**:只写入 `<workspace>/.dsh-mineru`;预览 URL 为 HMAC 签名 + 过期时间,每次读取重新校验;
|
|
333
|
+
- **Web 路由**:仅接受同源请求;HTML/SVG 等 Artifact 以附件方式下发(`nosniff`);
|
|
334
|
+
- **可取消**:所有网络请求响应工具取消信号——会话取消/超时会立即停止上传、轮询与下载;
|
|
335
|
+
- **密钥不出库**:Token 只存在于凭据层,日志/错误/设置响应永不携带。
|
|
121
336
|
|
|
122
|
-
##
|
|
337
|
+
## 常见问题 FAQ
|
|
123
338
|
|
|
124
|
-
|
|
339
|
+
**Q:不配 Token 能用吗?**
|
|
340
|
+
能。自动走 Agent 轻量解析 API(≤10 MB、≤20 页、仅 Markdown、免登录),适合快速粗读。
|
|
125
341
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
npm pack # 打包本地 tgz
|
|
129
|
-
```
|
|
342
|
+
**Q:为什么工具列表里只有 `mineru_activate`?**
|
|
343
|
+
这是渐进式曝光设计。调用一次 `mineru_activate`,其余三个工具立即解锁;或者把配置项 `exposeMode` 改为 `always` 全局注册。
|
|
130
344
|
|
|
131
|
-
|
|
345
|
+
**Q:解析超时了,文件会不会丢?**
|
|
346
|
+
不会。任务在 MinerU 服务端继续执行,用 `mineru_task`(`taskId` + `api`)随时查询进度并收集结果,无需重新提交。
|
|
132
347
|
|
|
133
|
-
|
|
348
|
+
**Q:拖拽文件后为什么没有自动解析?**
|
|
349
|
+
拖拽只把文件路径填入输入框草稿(防误发送),需要你补充需求后手动发送,Agent 才会开始解析。
|
|
134
350
|
|
|
351
|
+
**Q:报错 A0202 / A0211 怎么办?**
|
|
352
|
+
Token 无效或过期。在「设置 → 插件 → MinerU 解析」重新填写 Token(留空再点保存不会覆盖旧值)。
|
|
353
|
+
|
|
354
|
+
**Q:HTML 网页能解析吗?**
|
|
355
|
+
能,但仅精准解析 API 支持(需 Token),且自动使用 MinerU-HTML 模型。注意服务端抓不到被墙的 URL。
|
|
356
|
+
|
|
357
|
+
**Q:怎么批量解析?**
|
|
358
|
+
用 `mineru_batch_parse`,把文件路径/URL 列成列表即可,自动分批(本地 ≤50/批、URL ≤200/批、单次 ≤1000)。
|
|
359
|
+
|
|
360
|
+
**Q:Agent 轻量解析和精准解析结果有什么差别?**
|
|
361
|
+
轻量解析只出 Markdown;精准解析额外产出 `content_list.json`、`layout.json`、`model.json`、内嵌图片,还可加导出 docx/html/latex,且支持表格/公式识别参数。
|
|
362
|
+
|
|
363
|
+
## 开发与发布
|
|
364
|
+
|
|
365
|
+
本包**无构建步骤**:`lib/` 为可直接加载的 ESM,`lib/client.js` 为打包形态的浏览器 bundle。
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
node --check lib/*.js # 语法检查
|
|
369
|
+
npm pack # 打包本地 tgz
|
|
135
370
|
```
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
dsh plugin --profile web add dsh-mineru # 发布后用户安装
|
|
139
|
-
```
|
|
371
|
+
|
|
372
|
+
新版本发布请严格按 [RELEASE.md](RELEASE.md) 清单执行(升版本号 → 更新 CHANGELOG 与双语 README → 打包验证 → 打 tag 推送 → `npm publish`),完整开发循环见 [CONTRIBUTING.md](CONTRIBUTING.md)。
|
|
140
373
|
|
|
141
374
|
## 贡献
|
|
142
375
|
|
|
143
|
-
欢迎 Issue 与 PR,见 [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
376
|
+
欢迎 Issue 与 PR,见 [CONTRIBUTING.md](CONTRIBUTING.md)。报告问题时请**勿粘贴 MinerU Token**。
|
|
144
377
|
|
|
145
378
|
## 许可
|
|
146
379
|
|
|
147
|
-
[MIT](LICENSE)。MinerU 由 OpenDataLab 提供,其官方文档([API 文档](https://mineru.net/apiManage/docs)、[限流策略](https://mineru.net/apiManage/limit))为权威依据。
|
|
380
|
+
[MIT](LICENSE)。MinerU 由 [OpenDataLab](https://opendatalab.com) 提供,其官方文档([API 文档](https://mineru.net/apiManage/docs)、[限流策略](https://mineru.net/apiManage/limit))为权威依据。
|
package/RELEASE.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
- 遵循 [SemVer](https://semver.org/lang/zh-CN/):`major.minor.patch`。
|
|
8
8
|
- **唯一来源:`package.json` 的 `version` 字段**。`lib/` 内的 `'0.1.0'` 仅为 fallback,不要修改。
|
|
9
|
-
- Git tag 格式:`v<version>`(如 `v0.1.
|
|
9
|
+
- Git tag 格式:`v<version>`(如 `v0.1.8`)。
|
|
10
10
|
|
|
11
11
|
## 发布清单
|
|
12
12
|
|
|
@@ -45,7 +45,7 @@ dsh plugin --profile web add D:\Users\Lee\Desktop\dsh\dsh-mineru-<version>.tgz
|
|
|
45
45
|
|
|
46
46
|
```powershell
|
|
47
47
|
git add -A
|
|
48
|
-
git commit -m "docs:
|
|
48
|
+
git commit -m "docs: release v<version> (CHANGELOG + bilingual README sync)"
|
|
49
49
|
git tag v<version>
|
|
50
50
|
git push origin main --tags
|
|
51
51
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mineru",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "dsh-mineru: MinerU 文档解析插件 for DeepSeek Harness — 多模态全格式 (PDF/Word/PPT/Excel/HTML/图片) → 结构化 Markdown. 填 Token 走精准解析 API, 留空走 Agent 轻量解析 API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|