dsh-pdf-mineru 0.0.15 → 0.1.1
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 +26 -0
- package/README.md +16 -7
- package/lib/client.js +1356 -552
- package/lib/client.js.map +1 -1
- package/lib/index.js +72 -25
- package/lib/types/adapters/dsh-document-source.d.ts +15 -0
- package/lib/types/client/DisclosureCard.d.ts +15 -0
- package/lib/types/client/NumericInput.d.ts +3 -1
- package/lib/types/client/StorageOperations.d.ts +3 -1
- package/lib/types/client/icons.d.ts +17 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/sections/AdvancedSections.d.ts +3 -1
- package/lib/types/tools.d.ts +7 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Accept `attachment_id` as an alternative to `file_path` in `read_pdf` content, cursor and page requests and in `async_parse_pdf`. Both source fields are optional in schemas; exactly one is required at runtime, and callers should retain the same source selector on continuation; existing cursor identity validation is unchanged.
|
|
8
|
+
- Resolve full SHA-256 content IDs or unique 8–64 hexadecimal digest prefixes (optionally `sha256:`-prefixed) from current-session visible file and nested tool-result refs. Reject ambiguous matches and pass the exact matched ref to DSH `fileHostPath`; compacted-out refs are not searched.
|
|
9
|
+
|
|
10
|
+
DSH retains ownership of stored files. Hosts without local-path capability return `UNSUPPORTED_OPTION`; no stream materialization, new integrity checks, storage migration or Provider changes are introduced.
|
|
11
|
+
|
|
12
|
+
## 0.1.0
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- Added eight accessible settings cards with configuration summaries, expand/collapse-all controls, native keyboard-navigable Provider selection, and bilingual labels. Collapsed panels remain mounted to preserve form drafts.
|
|
17
|
+
- Added browser regressions for keyboard navigation, disclosure state, draft preservation, load-error recovery, immutable security limits, dark/light themes, and narrow-pane overflow, plus bilingual dictionary coverage.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Redesigned the MinerU settings page with DSH theme-aware cards, lightweight SVG icons, clearer action hierarchy, and progressive disclosure for advanced configuration. Narrow settings panes use compact layouts, and reduced-motion preferences are respected.
|
|
22
|
+
- Refreshed setup instructions and the settings preview to match the current configuration page. Existing Provider, credential, numeric validation, storage-maintenance, reader cursor v3, and index v2 contracts remain unchanged.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Show configuration load failures with an explicit retry action instead of leaving the page in an ambiguous loading state.
|
|
27
|
+
- Display restart-only security limits as disabled controls rather than accepting edits that the running host cannot save. Preserve explicit preview/confirmation boundaries for destructive maintenance operations.
|
|
28
|
+
|
|
3
29
|
## 0.0.15
|
|
4
30
|
|
|
5
31
|
### Added
|
package/README.md
CHANGED
|
@@ -66,7 +66,9 @@ PDF.js 包解压约34.8 MB,Canvas JS 约0.13 MB,Linux x64 glibc 二进制约
|
|
|
66
66
|
|
|
67
67
|
### 2. 配置与连接
|
|
68
68
|
|
|
69
|
-
打开 DSH 界面中的 **Settings →
|
|
69
|
+
打开 DSH 界面中的 **Settings → MinerU**,根据您的使用场景选择 Provider。设置页按卡片分组,高级配置按需展开;修改后点击 **Save Configuration / 保存配置** 生效。连接测试使用当前草稿,缓存清理仍需先预览再确认。
|
|
70
|
+
|
|
71
|
+
设置页包含 Provider、解析默认值、存储与缓存、轮询、重试、输出限制、安全上限和存储维护八张卡片。支持全部展开/折叠,折叠不会丢失表单草稿;启动时固定的安全上限只读展示,需修改宿主配置并重启。界面沿用 DSH 深浅色主题,并支持键盘导航和紧凑布局。
|
|
70
72
|
|
|
71
73
|
<p align="center">
|
|
72
74
|
<img src="./docs/assets/mineru-settings-preview.webp" width="780" alt="dsh-pdf-mineru 在 DSH Settings 中的设置界面">
|
|
@@ -120,26 +122,33 @@ Agent 会自动根据文档长度和指令意图,智能选择同步返回或
|
|
|
120
122
|
|
|
121
123
|
1. 用 `focus: "toc"` 看目录,或用 `query: "图 7"` 字面检索。空格有意义,“图7”与“图 7”不同。
|
|
122
124
|
2. 用返回的 `block_id` 精读完整块,或用物理页码与focus选择内容。标题块不代表整节。
|
|
123
|
-
3. `content_status: "partial"`
|
|
125
|
+
3. `content_status: "partial"` 时,以同一来源选择器(`file_path` 或 `attachment_id`)和原样cursor继续,不重复pages/focus/block_id/query;结束时cursor为null。
|
|
124
126
|
4. 对关键公式、数值和图表,用 `view: "page"` 回看原页;可传source_sha256作为expected_sha256。
|
|
125
127
|
|
|
126
128
|
**complete只表示所选解析文本交付完成,不保证OCR正确或图像全部展示。** 检查当前块的diagnostics、公式verification_hints及visuals;metadata_shortened表示元数据因预算未完整列出。
|
|
127
129
|
|
|
128
130
|
- 默认响应预算12,000个UTF-16单元、正文每块最多8,000;JSON和Native文本各最多48,000字节。默认不重复返回缓存路径;导出用focus: artifacts。
|
|
129
131
|
- `inline_images` 首次省略默认true,续读省略继承,显式布尔值覆盖;模型能力和图像预算始终构成上限。
|
|
130
|
-
- **0.0.14起使用v3游标,0.
|
|
132
|
+
- **0.0.14起使用v3游标,0.1.1保持该协议及索引v2;旧v1/v2游标需重新开始,解析缓存无需迁移。** 续读不会在缓存丢失时偷偷重新上传。
|
|
131
133
|
- 原页模式优先使用 PATH 中的 Poppler(pdfinfo/pdftoppm),命令缺失或明确不可执行时自动回退到 PDF.js + Node Canvas 子进程;仍需图像模型、附件服务及大于0的图像预算。结果以 `renderer: "poppler" | "pdfjs"` 标明后端,不会上传PDF或要求模型重新调用。它是本地有界执行,不是OS级隔离沙箱。
|
|
132
134
|
|
|
133
135
|
字段语义、完整示例、来源/索引版本、预算、安全边界、错误恢复和离线验收见 **[PDF阅读指南](docs/model-reading.md)**。更新插件后需要让宿主重新加载工具定义;只构建源码或刷新Web页面不等于后端已重载。
|
|
134
136
|
|
|
137
|
+
### 文件来源
|
|
138
|
+
|
|
139
|
+
`read_pdf` 的正文、续读、原页模式及 `async_parse_pdf` 都保留 `file_path`,也可改用互斥的 `attachment_id`,例如 `{"attachment_id":"<当前附件的完整内容ID>","focus":"toc"}`。两个来源字段在 schema 中均可选,但每次调用运行时必须且只能提供一个;调用方续读应保留同一选择器;游标仍按既有结果/投影身份校验,不新增选择器字符串绑定。
|
|
140
|
+
|
|
141
|
+
附件 ID 可为完整 `sha256:` 加 64 位十六进制摘要,或 8–64 位摘要前缀(可带 `sha256:`)。只匹配当前会话可见消息中的文件及嵌套工具结果引用;已压缩移出的引用不可见。多个不同内容 ID 匹配时拒绝,需提供更长前缀或完整 ID;不会猜测路径或搜索全局附件库。附件仍由 DSH 管理;宿主不提供本地路径能力时返回 `UNSUPPORTED_OPTION`,插件不会将附件流落盘。Provider、缓存和既有完整性校验不变。
|
|
142
|
+
|
|
135
143
|
### 常用解析参数(均可通过自然语言告知 Agent)
|
|
136
144
|
|
|
137
145
|
| 参数 | 类型 | 适用工具 | 作用说明 |
|
|
138
146
|
| --- | --- | --- | --- |
|
|
139
|
-
| `file_path` | `string` | 全部 |
|
|
147
|
+
| `file_path` | `string` | 全部 | 本地文件路径;与 `attachment_id` 必须且只能选一个 |
|
|
148
|
+
| `attachment_id` | `string` | 全部 | 当前会话可见文件附件的完整内容 ID 或唯一摘要前缀(8–64 位十六进制,可带 `sha256:`) |
|
|
140
149
|
| `pages` | `number` / `string` / `number[]` | `read_pdf` | 1-based 页码选择,支持单页(如 `3`)、数组(如 `[1, 2, 5]`)或范围字符串(如 `"1-3, 5"`) |
|
|
141
150
|
| `focus` | `string` / `string[]` | `read_pdf` | `all`(默认)、`text`、`table`、`image`、`toc` 或 `artifacts` |
|
|
142
|
-
| `cursor` | `string` | `read_pdf` | 原样传回上一条部分阅读响应的 token;与 `pages`/`focus`/`block_id`/`query`
|
|
151
|
+
| `cursor` | `string` | `read_pdf` | 原样传回上一条部分阅读响应的 token;与 `pages`/`focus`/`block_id`/`query` 互斥,仍须传同一来源选择器(`file_path` 或 `attachment_id`) |
|
|
143
152
|
| `block_id` | `string` | `read_pdf` | 原样使用此前返回的稳定块 ID;与 `query`、`cursor` 互斥 |
|
|
144
153
|
| `query` | `string` | `read_pdf` | 1–256 字符、不区分大小写的字面检索;返回上下文摘要与块 ID,再用 `block_id` 读全文 |
|
|
145
154
|
| `view` | `"content"` / `"page"` | `read_pdf` | 默认解析文本;page 模式只接受一页 `pages`,本地渲染原页,不调用 Provider |
|
|
@@ -192,7 +201,7 @@ flowchart LR
|
|
|
192
201
|
|
|
193
202
|
## 🛠️ 设置与配置参考
|
|
194
203
|
|
|
195
|
-
推荐直接在 **DSH Web GUI (Settings →
|
|
204
|
+
推荐直接在 **DSH Web GUI (Settings → MinerU)** 中进行可视化调整。若需要直接编辑配置文件(`cordis.patch.yml`),可参考以下常用配置:
|
|
196
205
|
|
|
197
206
|
<details>
|
|
198
207
|
<summary><strong>📋 点击展开:YAML 配置示例</strong></summary>
|
|
@@ -284,7 +293,7 @@ limits:
|
|
|
284
293
|
<summary><strong>Q: 解析结果保存在哪里?如何清理缓存?</strong></summary>
|
|
285
294
|
|
|
286
295
|
解析结果按源文件内容、解析语义及 Provider 兼容标识寻址,默认存放在 `$DSH_HOME/cache/pdf-mineru/results/`。启用缓存复用时,后续阅读可复用已发布结果;同进程并发请求合并,但不同进程仍可能分别提交上游解析,不保证跨进程只计费一次。`storage.cacheEnabled=false` 仅禁用解析前的缓存复用,结果仍会不可变发布,不等同于清空缓存或强制覆盖已有结果。
|
|
287
|
-
您可以在 **Settings →
|
|
296
|
+
您可以在 **Settings → MinerU** 的运维区域中:
|
|
288
297
|
- 点击 **Verify Cache** 检查缓存完整性;
|
|
289
298
|
- 点击 **Clear Cache** 预览,再显式确认清除。破坏性维护在存在活跃读取或解析时拒绝执行,不会为了清理而取消它们。
|
|
290
299
|
</details>
|