dsh-pdf-mineru 0.2.4 → 0.2.5
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 +15 -0
- package/README.md +6 -6
- package/lib/client.js +9 -6
- package/lib/client.js.map +1 -1
- package/lib/index.js +288 -277
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
4
4
|
|
|
5
|
+
## 0.2.5
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Self-hosted `self-hosted-v1` now speaks the MinerU 4.1+ Tasks API only (`POST /v1/tasks`, `GET /v1/tasks/{task_id}`, per-file `result_url`). Connection tests look for `features.task_output_formats` including `default` and `sources` including `upload`.
|
|
10
|
+
- MinerU 4.1+ no longer returns `model_output.json`. Canonical requests for this provider omit the `model-output` artifact, which changes cache identity; previously cached 4.0 results are not reused.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- Support for the MinerU 4.0.x Jobs API (`/v1/uploads`, `/v1/parse/jobs`, `output_formats: zip`). Deployments still on 4.0.x need to upgrade to MinerU 4.1 or later.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Self-hosted MinerU 4.1+ (including 4.2.x) can be used again: connection tests no longer report a missing zip output, and parsing follows the Tasks protocol ([#6](https://github.com/Yurzi/dsh-pdf-mineru/issues/6)).
|
|
19
|
+
|
|
5
20
|
## 0.2.4
|
|
6
21
|
|
|
7
22
|
### Changed
|
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
**用 MinerU 解析 PDF,让 DeepSeek Harness 里的 Agent 按证据阅读文档**
|
|
8
8
|
|
|
9
|
-
支持 MinerU 官方云(v4)、自部署 MinerU 4.
|
|
9
|
+
支持 MinerU 官方云(v4)、自部署 MinerU 4.1+(Tasks API)和 3.x(旧版任务 API)。Agent 可以分段读取正文、公式、表格和插图,长文档在后台解析,关键内容可在本地回看原页核对。
|
|
10
10
|
|
|
11
11
|
<p>
|
|
12
12
|
<a href="https://awesome-dsh-plugin.com"><img src="https://awesome-dsh-plugin.com/badge.svg" alt="Awesome DSH Plugin"></a>
|
|
13
13
|
<a href="https://www.npmjs.com/package/dsh-pdf-mineru"><img src="https://img.shields.io/npm/v/dsh-pdf-mineru?style=flat-square&label=npm&color=CB3837" alt="npm version"></a>
|
|
14
14
|
<a href="./package.json"><img src="https://img.shields.io/badge/Node.js-%3E%3D24.9.0-339933?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >=24.9.0"></a>
|
|
15
15
|
<a href="./package.json"><img src="https://img.shields.io/badge/DSH-%3E%3D0.2.2--rc.5%20%3C0.3.0--0-111827?style=flat-square" alt="DSH >=0.2.2-rc.5 <0.3.0-0"></a>
|
|
16
|
-
<img src="https://img.shields.io/badge/MinerU-Official%20v4%20%7C%20Self--hosted%204.
|
|
16
|
+
<img src="https://img.shields.io/badge/MinerU-Official%20v4%20%7C%20Self--hosted%204.1%2B%20Tasks%20%7C%203.x%20legacy-2563EB?style=flat-square" alt="MinerU Official v4, Self-hosted 4.1+ Tasks, 3.x legacy">
|
|
17
17
|
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-2EA44F?style=flat-square" alt="MIT License"></a>
|
|
18
18
|
</p>
|
|
19
19
|
|
|
@@ -75,9 +75,9 @@ dsh plugin --profile web add link:/absolute/path/to/dsh-pdf-mineru
|
|
|
75
75
|
2. 选择「MinerU 云服务」,在 API Key 输入框粘贴 Token,点击 **保存**。密钥由 DSH 凭据服务保管,不写入插件配置。
|
|
76
76
|
3. 点击 **测试连接** 确认可用。
|
|
77
77
|
|
|
78
|
-
**B. 自部署 MinerU 4.
|
|
78
|
+
**B. 自部署 MinerU 4.1+(Tasks API)**
|
|
79
79
|
|
|
80
|
-
1. 启动 MinerU 4.
|
|
80
|
+
1. 启动 MinerU 4.1 或更高版本的 API 服务(常见地址 `http://localhost:8000`,例如 `mineru-kit api-server --host 127.0.0.1 --port 8000 --tier standard`)。MinerU 4.0.x 已不再支持。
|
|
81
81
|
2. 选择「自部署 4.x」,填写服务地址;本机 HTTP 地址需在「连接选项」中开启「允许 HTTP 明文连接」。
|
|
82
82
|
3. 按需选择解析档位(tier)和 OCR 模式(auto / txt / ocr),测试连接后保存。
|
|
83
83
|
|
|
@@ -129,13 +129,13 @@ dsh plugin --profile web add link:/absolute/path/to/dsh-pdf-mineru
|
|
|
129
129
|
<details>
|
|
130
130
|
<summary><strong>扫描件识别效果不好怎么办?</strong></summary>
|
|
131
131
|
|
|
132
|
-
在设置页把解析方式改为 `ocr
|
|
132
|
+
在设置页把解析方式改为 `ocr`(自部署 4.1+ 对应各 profile 的 OCR 模式)。模型工具不接受 `ocr`、`model` 等解析参数,不能让 Agent 通过工具参数切换。修改解析配置会产生新的缓存身份,下次读取会重新解析。
|
|
133
133
|
</details>
|
|
134
134
|
|
|
135
135
|
<details>
|
|
136
136
|
<summary><strong>Pipeline 和 VLM 有什么区别?</strong></summary>
|
|
137
137
|
|
|
138
|
-
两者是官方云和 3.x 旧版服务的解析模型。Pipeline 速度快、资源占用低,适合多数常规版面;VLM
|
|
138
|
+
两者是官方云和 3.x 旧版服务的解析模型。Pipeline 速度快、资源占用低,适合多数常规版面;VLM 使用视觉多模态模型,复杂图文混排和特殊公式效果通常更好。自部署 4.1+ 不选择模型,改用解析档位。
|
|
139
139
|
</details>
|
|
140
140
|
|
|
141
141
|
<details>
|
package/lib/client.js
CHANGED
|
@@ -31,7 +31,7 @@ window.__ModuleLoader__.load({
|
|
|
31
31
|
const asProviderConfigId = (value) => assertPrefixedId(value, "mp");
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/config/model.ts
|
|
34
|
-
/** Parse tiers advertised by the MinerU 4.
|
|
34
|
+
/** Parse tiers advertised by the MinerU 4.1+ self-hosted Tasks API. */
|
|
35
35
|
const SELF_HOSTED_TIERS = [
|
|
36
36
|
"flash",
|
|
37
37
|
"basic",
|
|
@@ -41,15 +41,18 @@ window.__ModuleLoader__.load({
|
|
|
41
41
|
const PROVIDER_TRAITS = {
|
|
42
42
|
"self-hosted-v1": {
|
|
43
43
|
requiresCredential: false,
|
|
44
|
-
selectsModel: false
|
|
44
|
+
selectsModel: false,
|
|
45
|
+
includesModelOutput: false
|
|
45
46
|
},
|
|
46
47
|
"self-hosted-legacy-v2": {
|
|
47
48
|
requiresCredential: false,
|
|
48
|
-
selectsModel: true
|
|
49
|
+
selectsModel: true,
|
|
50
|
+
includesModelOutput: true
|
|
49
51
|
},
|
|
50
52
|
"official-v4": {
|
|
51
53
|
requiresCredential: true,
|
|
52
|
-
selectsModel: true
|
|
54
|
+
selectsModel: true,
|
|
55
|
+
includesModelOutput: true
|
|
53
56
|
}
|
|
54
57
|
};
|
|
55
58
|
const PROVIDER_DEFAULTS = {
|
|
@@ -2346,7 +2349,7 @@ window.__ModuleLoader__.load({
|
|
|
2346
2349
|
"provider.official": "MinerU Cloud",
|
|
2347
2350
|
"provider.official.desc": "Official API, needs a key",
|
|
2348
2351
|
"provider.v1": "Self-hosted 4.x",
|
|
2349
|
-
"provider.v1.desc": "MinerU 4.
|
|
2352
|
+
"provider.v1.desc": "MinerU 4.1 or later (Tasks API)",
|
|
2350
2353
|
"provider.legacy": "Self-hosted 3.x",
|
|
2351
2354
|
"provider.legacy.desc": "Legacy task API",
|
|
2352
2355
|
"field.baseURL": "Server URL",
|
|
@@ -2490,7 +2493,7 @@ window.__ModuleLoader__.load({
|
|
|
2490
2493
|
"provider.official": "MinerU 云服务",
|
|
2491
2494
|
"provider.official.desc": "官方 API,需要 API Key",
|
|
2492
2495
|
"provider.v1": "自部署 4.x",
|
|
2493
|
-
"provider.v1.desc": "MinerU 4.
|
|
2496
|
+
"provider.v1.desc": "MinerU 4.1 及以上(Tasks API)",
|
|
2494
2497
|
"provider.legacy": "自部署 3.x",
|
|
2495
2498
|
"provider.legacy.desc": "旧版任务接口",
|
|
2496
2499
|
"field.baseURL": "服务地址",
|