dsh-pdf-mineru 0.1.1 → 0.1.4

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 CHANGED
@@ -1,5 +1,48 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.4
4
+
5
+ ### Changed
6
+
7
+ - Raise the minimum DSH host to 0.2.0-rc.1 and runtime DSH peers to ^0.2.0-rc.1; pin development SDK packages and workspace release-age exclusions to the exact new baseline and refresh the lockfile.
8
+ - Align package-contract, native-job and loopback RPC regressions with the published 0.2.0-rc.1 SDK; cover inherited bundle configuration when a profile overrides only non-config entry options.
9
+ - Document the 0.2 compatibility boundary: native jobs, attachment selection, PTC schemas, bundle configuration slots and loopback RPC retain their existing contracts. The plugin does not require the optional schedule bundle or call the changed native-command API.
10
+
11
+ Provider/config/cache formats, cursor v3, index v2 and tool arguments are unchanged; existing parsed caches require no migration or re-upload. Upgrade the DSH host before installing this plugin version.
12
+
13
+ ## 0.1.3
14
+
15
+ ### Changed
16
+
17
+ - Require DSH >= 0.1.7-rc.2 in engines and runtime peers; pin development SDK packages and workspace release-age exclusions to DSH 0.1.7-rc.2.
18
+ - Align integration tests, package manifests, and loopback RPC comments with DSH 0.1.7-rc.2.
19
+
20
+ Provider/config/cache formats, cursor v3, index v2, native jobs, and plugin configuration UI are unchanged; existing parsed caches require no migration.
21
+
22
+ ## 0.1.2
23
+
24
+ ### Added
25
+
26
+ - Report bounded, invocation-local parse phases through the native JobHandle progress surface, with a 48,000-byte model job output limit. Cache hits skip the waiting phase; progress never includes provider refs or sensitive request data.
27
+ - Add integration regressions against the published 0.1.7-rc.1 LocalJobRegistry for owner isolation, controller admission, consume-once final results, progress and kill/owner/plugin teardown, plus TypeScript/Python PTC schema projections.
28
+ - Add GUI boot diagnostics and an explicit browser-fixture-only unrelated-plugin exclusion option without changing the running host profile.
29
+
30
+ ### Changed
31
+
32
+ - Move the custom MinerU configuration page from the global Settings navigation to its Plugins bundle detail via the public `plugins.bundle.config` slot keyed by `dsh-pdf-mineru`. Preserve draft state, explicit saves, credential handling and maintenance confirmations; align client dependencies and GUI navigation checks with the plugin manager contract.
33
+ - Require DSH >= 0.1.7-rc.1 in engines and runtime peers; pin development SDK packages to that release, align Cordis/Schemastery versions, and replace the retired code-runtime dependency with ptc-runtime.
34
+ - Use SessionId job ownership and JobOutcome.result for both success summaries and failures. Keep lifecycle, output consumption, notification/wakeup and archive admission in the host registry; cancellation still stops only the current shared-operation waiter.
35
+ - Read attachment references from the current first-class tool-role message surface instead of the removed nested tool-result block protocol. Exact reference handoff and visible-session-only access are unchanged.
36
+ - Replace local Client slot/context type shims with published Locale, Connection, Remote and renderer/slot contracts. Preserve explicit draft saving, maintenance confirmation and channel-local loopback restrictions alongside native operator-Peer authentication.
37
+
38
+ ### Fixed
39
+
40
+ - Fix activation on DSH 0.1.7-rc.1 after removal of settings.register: consume Loader Config volatile references and published SettingsForms types, with automatic forms disabled for the custom draft/confirmation page.
41
+ - Save complete live fields to the actual profile entry id, preserving ordinary restart-only fields and explicit defaults over inherited profile values. Validate the complete domain config before persistence; avoid settings writes during activation.
42
+ - Cover activation, live updates without remount, profile persistence/restart, invalid-write rejection and inherited-default overrides using the published SettingsForms, ConfigEditor and Loader.
43
+
44
+ Provider/config/cache formats, cursor v3, index v2 and local page rendering are unchanged; existing parsed caches require no migration.
45
+
3
46
  ## 0.1.1
4
47
 
5
48
  ### Added
@@ -285,4 +328,4 @@ No canonical request, CacheKey, ProviderJobRef, or result manifest schema versio
285
328
 
286
329
  ## 0.0.1
287
330
 
288
- - Initial npm release with provider-independent tools, self-hosted v2 and official v4 adapters, session Jobs, immutable global results, request coalescing, restart recovery, safe ZIP extraction, and Provider-aware settings.
331
+ - Initial npm release with provider-independent tools, self-hosted v2 and official v4 adapters, session Jobs, immutable global results, request coalescing, restart recovery, safe ZIP extraction, and Provider-aware settings.
package/README.md CHANGED
@@ -12,7 +12,7 @@
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&amp;label=npm&amp;color=CB3837" alt="npm version"></a>
14
14
  <a href="./package.json"><img src="https://img.shields.io/badge/Node.js-%3E%3D22.19.0-339933?style=flat-square&amp;logo=nodedotjs&amp;logoColor=white" alt="Node.js 22.19.0 or newer"></a>
15
- <img src="https://img.shields.io/badge/DSH-%3E%3D0.1.5--rc.2%20(RC%20only)-111827?style=flat-square" alt="DSH >=0.1.5-rc.2 (RC only)">
15
+ <img src="https://img.shields.io/badge/DSH-%3E%3D0.2.0--rc.1%20(RC%20only)-111827?style=flat-square" alt="DSH >=0.2.0-rc.1 (RC only)">
16
16
  <img src="https://img.shields.io/badge/MinerU-Official%20v4%20%7C%20Self--hosted%20v2-2563EB?style=flat-square" alt="MinerU v2 and v4">
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>
@@ -38,11 +38,13 @@
38
38
  ### 0. 环境要求与版本兼容说明
39
39
 
40
40
  > ⚠️ **重要版本声明与环境要求**:
41
- > - **最低支持的 DSH 版本**:`>= 0.1.5-rc.2`。
41
+ > - **最低支持的 DSH 版本**:`>= 0.2.0-rc.1`。
42
42
  > - **仅支持 RC 版本**:本插件**只会对 DeepSeek Harness 的 RC(Release Candidate)版本及后续正式发布版本进行官方支持**。由于早期 `alpha` 测试版本包含较多实验性且剧烈变动的内部 API,本插件不再对 `alpha` 等非稳定测试版本提供兼容与维护支持。
43
43
  > - **运行环境要求**:Node.js `^22.19.0 || >=24.0.0`,包管理器推荐 `pnpm@11+`。
44
44
 
45
- 本次适配从插件 `0.0.12` 起以 DSH `v0.1.5-rc.2` 为基线。升级前请先升级宿主;现有 Provider 配置、缓存格式与工具参数无需因本次 DSH 适配而迁移。Web 设置与维护 RPC 仅在 `connection` 和 `webServer` 同时可用时注册;无 WebServer 的宿主仍可使用两个模型工具,但不提供这些 HTTP RPC。
45
+ 插件 `0.1.4` 起以 DSH `v0.2.0-rc.1` 为基线。升级前请先升级宿主;现有 Provider 配置、缓存格式与工具参数无需因本次 DSH 适配而迁移。Web 设置与维护 RPC 仅在 `connection` 和 `webServer` 同时可用时注册;无 WebServer 的宿主仍可使用两个模型工具,但不提供这些 HTTP RPC。
46
+
47
+ 后台任务使用 DSH 的 SessionId 归属与原生 JobRegistry:阶段进度显示为 `preparing`、`waiting-for-parse`、`reading-result`、`summarizing`,不是页数或百分比;缓存命中跳过等待阶段。完成摘要通过原生任务结果交付,通知、空闲唤醒、输出消费与会话归档准入由 DSH 负责。宿主必须为该会话装配任务控制器(如 `tool-jobs`),否则启动会在解析前拒绝。`job_kill` 仍只取消本次等待,不中止其他调用共用的解析生产者。
46
48
 
47
49
  ### 1. 安装插件
48
50
 
@@ -66,14 +68,18 @@ PDF.js 包解压约34.8 MB,Canvas JS 约0.13 MB,Linux x64 glibc 二进制约
66
68
 
67
69
  ### 2. 配置与连接
68
70
 
69
- 打开 DSH 界面中的 **Settings → MinerU**,根据您的使用场景选择 Provider。设置页按卡片分组,高级配置按需展开;修改后点击 **Save Configuration / 保存配置** 生效。连接测试使用当前草稿,缓存清理仍需先预览再确认。
71
+ 打开 DSH 界面中的 **Plugins / 插件 → dsh-pdf-mineru**,根据您的使用场景选择 Provider。配置页位于插件 bundle 详情中,不再单独出现在全局 Settings 导航。设置页按卡片分组,高级配置按需展开;修改后点击 **Save Configuration / 保存配置** 生效。连接测试使用当前草稿,缓存清理仍需先预览再确认。
72
+
73
+ 配置由 DSH Loader 的 Config 与 profile patch 管理;可热更新字段使用 `Volatile.get()`,保存后影响后续调用。插件关闭原生自动生成表单,保留显式草稿保存。Provider-based v1 配置在内存中规范化,启动不写回配置;旧 `settings.yaml` 的导入由 DSH 负责。
70
74
 
71
75
  设置页包含 Provider、解析默认值、存储与缓存、轮询、重试、输出限制、安全上限和存储维护八张卡片。支持全部展开/折叠,折叠不会丢失表单草稿;启动时固定的安全上限只读展示,需修改宿主配置并重启。界面沿用 DSH 深浅色主题,并支持键盘导航和紧凑布局。
72
76
 
73
77
  <p align="center">
74
- <img src="./docs/assets/mineru-settings-preview.webp" width="780" alt="dsh-pdf-mineru 在 DSH Settings 中的设置界面">
78
+ <img src="./docs/assets/mineru-settings-preview.webp" width="780" alt="MinerU 配置卡片预览(旧版导航,当前入口为 Plugins → dsh-pdf-mineru)">
75
79
  </p>
76
80
 
81
+ > 上图展示配置卡片;旧版 Settings 导航仅供参考,当前请从 **Plugins / 插件 → dsh-pdf-mineru** 打开。
82
+
77
83
  #### 方案 A:使用 MinerU 官方云(推荐,免部署)
78
84
  1. 前往 [MinerU 官网](https://mineru.net) 注册并获取 API Token。
79
85
  2. 在终端配置环境变量(或通过 DSH 凭据服务管理):
@@ -138,7 +144,7 @@ Agent 会自动根据文档长度和指令意图,智能选择同步返回或
138
144
 
139
145
  `read_pdf` 的正文、续读、原页模式及 `async_parse_pdf` 都保留 `file_path`,也可改用互斥的 `attachment_id`,例如 `{"attachment_id":"<当前附件的完整内容ID>","focus":"toc"}`。两个来源字段在 schema 中均可选,但每次调用运行时必须且只能提供一个;调用方续读应保留同一选择器;游标仍按既有结果/投影身份校验,不新增选择器字符串绑定。
140
146
 
141
- 附件 ID 可为完整 `sha256:` 加 64 位十六进制摘要,或 8–64 位摘要前缀(可带 `sha256:`)。只匹配当前会话可见消息中的文件及嵌套工具结果引用;已压缩移出的引用不可见。多个不同内容 ID 匹配时拒绝,需提供更长前缀或完整 ID;不会猜测路径或搜索全局附件库。附件仍由 DSH 管理;宿主不提供本地路径能力时返回 `UNSUPPORTED_OPTION`,插件不会将附件流落盘。Provider、缓存和既有完整性校验不变。
147
+ 附件 ID 可为完整 `sha256:` 加 64 位十六进制摘要,或 8–64 位摘要前缀(可带 `sha256:`)。只匹配当前会话可见消息中的文件引用(包括独立的 `role: "tool"` 工具结果消息);已压缩移出的引用不可见。多个不同内容 ID 匹配时拒绝,需提供更长前缀或完整 ID;不会猜测路径或搜索全局附件库。附件仍由 DSH 管理;宿主不提供本地路径能力时返回 `UNSUPPORTED_OPTION`,插件不会将附件流落盘。Provider、缓存和既有完整性校验不变。
142
148
 
143
149
  ### 常用解析参数(均可通过自然语言告知 Agent)
144
150
 
@@ -201,7 +207,7 @@ flowchart LR
201
207
 
202
208
  ## 🛠️ 设置与配置参考
203
209
 
204
- 推荐直接在 **DSH Web GUI (Settings → MinerU)** 中进行可视化调整。若需要直接编辑配置文件(`cordis.patch.yml`),可参考以下常用配置:
210
+ 推荐直接在 **DSH Web GUI (Plugins / 插件 → dsh-pdf-mineru)** 中进行可视化调整。若需要直接编辑配置文件(`cordis.patch.yml`),可参考以下常用配置:
205
211
 
206
212
  <details>
207
213
  <summary><strong>📋 点击展开:YAML 配置示例</strong></summary>
@@ -293,7 +299,7 @@ limits:
293
299
  <summary><strong>Q: 解析结果保存在哪里?如何清理缓存?</strong></summary>
294
300
 
295
301
  解析结果按源文件内容、解析语义及 Provider 兼容标识寻址,默认存放在 `$DSH_HOME/cache/pdf-mineru/results/`。启用缓存复用时,后续阅读可复用已发布结果;同进程并发请求合并,但不同进程仍可能分别提交上游解析,不保证跨进程只计费一次。`storage.cacheEnabled=false` 仅禁用解析前的缓存复用,结果仍会不可变发布,不等同于清空缓存或强制覆盖已有结果。
296
- 您可以在 **Settings → MinerU** 的运维区域中:
302
+ 您可以在 **Plugins / 插件 → dsh-pdf-mineru** 的运维区域中:
297
303
  - 点击 **Verify Cache** 检查缓存完整性;
298
304
  - 点击 **Clear Cache** 预览,再显式确认清除。破坏性维护在存在活跃读取或解析时拒绝执行,不会为了清理而取消它们。
299
305
  </details>
@@ -323,6 +329,8 @@ pnpm run build
323
329
 
324
330
  # 4. 在运行中的 DSH Web 中验证前端设置组件
325
331
  pnpm run verify:gui
332
+ # 若无关插件阻止 Web shell 启动,可显式限定浏览器 fixture 的排除列表(不修改宿主配置):
333
+ # DSH_GUI_EXCLUDE_PLUGINS=<unrelated-plugin-id> pnpm run verify:gui
326
334
 
327
335
  # 5. (可选)本地原页验证,无上传;第二条用空PATH验证PDF.js自动回退
328
336
  pnpm run smoke:reader-local -- /path/to/sample.pdf 1 --backend=auto
@@ -332,6 +340,8 @@ pnpm run smoke:reader-local -- /path/to/sample.pdf 1 .vitest-cache/pdfjs --backe
332
340
  MINERU_API_KEY=<token> pnpm run smoke:official-v4 -- /path/to/sample.pdf
333
341
  ```
334
342
 
343
+ GUI 验证在现有 Web 地址中注入当前构建,使用浏览器内的配置/凭据/插件清单 fixture,并隔离该测试浏览器的 HMR graph;不修改真实配置、凭据或缓存,也不代表已更新宿主安装的插件。
344
+
335
345
  > 文档入口:[PDF阅读指南](docs/model-reading.md) · [版本记录](CHANGELOG.md)。已完成的阶段性开发报告不作为当前使用契约维护,历史信息可从Git记录查阅。
336
346
 
337
347
  > 想要深入了解插件的架构设计、数据模型、并发请求合并、安全解包与存储隔离机制?请查阅 **[ARCHITECTURE.md](./ARCHITECTURE.md)**。
package/lib/client.js CHANGED
@@ -2841,16 +2841,13 @@ window.__ModuleLoader__.load({
2841
2841
  }), "dsh-pdf-mineru: dictionaries");
2842
2842
  const connection = ctx.get("connection");
2843
2843
  if (connection === void 0) throw new Error("dsh-pdf-mineru: connection service is unavailable");
2844
- const t = ctx.locale.bind(NS);
2845
2844
  const injected = () => ({
2846
2845
  rpc: connection.rpc,
2847
2846
  credentials: ctx.remote.credentials
2848
2847
  });
2849
- ctx.slots.inject("settings.section", () => ctx.slots.register({
2850
- name: "settings.section",
2851
- id: NS,
2852
- order: 40,
2853
- label: () => t("nav"),
2848
+ ctx.slots.inject("plugins.bundle.config", () => ctx.slots.register({
2849
+ name: "plugins.bundle.config",
2850
+ key: "dsh-pdf-mineru",
2854
2851
  locale: NS,
2855
2852
  inject: injected
2856
2853
  }, SettingsPage));