dsh-deferred-boot 0.3.0 → 0.3.2

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,56 +1,103 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented in this file.
4
- The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
- and this project adheres to [Semantic Versioning](https://semver.org/).
6
-
7
- ## [0.3.0] - 2026-11-07
8
-
9
- ### Added
10
- - Per-field hints in the configuration form (zh/en), explaining what each
11
- value changes.
12
- - Plugin-market publishing: `scripts/gen-market-index.mjs` generates a
13
- format-1 market index (`market/index.json`), and `docs/PUBLISHING.md`
14
- documents the npm + index-source flow.
15
- - npm metadata: keywords, author, engines, files whitelist, and
16
- `@deepseek-ai/schemastery` as a runtime dependency.
17
-
18
- ### Changed
19
- - The form no longer depends on `props.ctx`; it reads the ctx captured in
20
- `apply()`, matching the reference web-search card.
21
- - README rewritten for the plugin page and npm: badges, install steps,
22
- configuration table, development layout.
23
-
24
- ### Fixed
25
- - Configuration form showing "配置服务暂不可用" on newer DSH clients.
26
-
27
- ## [0.2.0] - 2026-11-07
28
-
29
- ### Added
30
- - Graphical configuration form on the plugin page (`plugins.bundle.config`),
31
- backed by the `deferred-boot` settings namespace; values are saved to the
32
- current profile's Cordis patch, so `cordis.patch.yml` no longer has to be
33
- edited by hand.
34
- - `Config` schema with four volatile fields: `idleDelay`, `disposeTimeout`,
35
- `readyFallbackMs`, `deferredPlugins`.
36
- - Locale dictionaries (zh/en) for the plugin page and the form.
37
- - Icon, LICENSE (MIT), CI workflow, and packaging scripts.
38
-
39
- ### Fixed
40
- - `cannot set property "deferredBoot" without provide`: the service is now
41
- exposed with `ctx.provide('deferredBoot', api)`, which the strict Cordis 4
42
- context requires.
43
-
44
- ## [0.1.0] - 2026-11-07
45
-
46
- ### Added
47
- - Initial scheduler: mounts deferred plugins after the main UI is ready, one
48
- target per idle slice.
49
- - Existence check before `loader.create`, per-target failure isolation,
50
- `dispose` raced against `disposeTimeout`, three failed attempts freeze a
51
- target as `failed`, and manual `ctx.deferredBoot.ensure(id)` mounting.
52
- - Strategies: `idle`, `manual`, `inline-lazy`, `disabled`.
53
- - Tests for the scheduler, config normalization, and the client module.
54
-
55
- [0.2.0]: https://github.com/your-name/dsh-deferred-boot/releases/tag/v0.2.0
56
- [0.1.0]: https://github.com/your-name/dsh-deferred-boot/releases/tag/v0.1.0
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.3.2] - 2026-11-07
8
+
9
+ ### Fixed
10
+ - Readiness detection now uses signals that actually exist on the desktop Web
11
+ GUI: `typertGateway.hasLiveClient()` first, then `webApp.getAdvertisedUrl()`.
12
+ The previous probes (`connection.hostDescription`, `connection.host`,
13
+ `app.ready`) are not exported by those services, so every boot waited out
14
+ `readyFallbackMs` and the plugin effectively just slept 5 s instead of
15
+ waiting for the first screen.
16
+ - `deferredPlugins` ids are stored without the loader's `include:` prefix:
17
+ `loader.create` used to reintroduce the full id and collide with the entry a
18
+ bundle patch had already inserted, which surfaced as duplicate entries and
19
+ `异常` badges on the plugin page. `normalizeDeferred` / `shortEntryId` in the
20
+ configuration form and the profile patch use the short id now.
21
+ - Deferred targets are mounted into the loader's `include` group (the same place
22
+ a bundle patch inserts them) and existing entries are looked up through
23
+ `loader.resolve`, including the nested `include:<id>` path.
24
+
25
+ ### Changed
26
+ - The plugin page no longer offers deferring the loader's own `cordis:*`
27
+ namespace nodes, and duplicates are dropped by plugin name before saving.
28
+
29
+ ## [0.3.1] - 2026-11-07
30
+
31
+ ### Added
32
+ - Plugin list inside the configuration form: installed plugins are grouped into
33
+ third-party and official entries (official collapsed by default), each with a
34
+ lightweight / medium / heavy startup-cost grade and an estimated mount cost.
35
+ - Checkbox selection writes `deferredPlugins` entries (`id`, `name`,
36
+ `strategy: "idle"`); the plugin itself and `@deepseek-ai/*` core rows are locked.
37
+ - Estimated extra startup wait shown at the bottom of the form.
38
+
39
+ ### Changed
40
+ - The plugin page item renders a one-line summary in the list and the full form
41
+ when opened (view-aware: `summary` vs `page`).
42
+ - Right-side columns of the plugin list are fixed-width so grades, state and
43
+ cost line up.
44
+
45
+ ### Fixed
46
+ - The form no longer crashes (and disappears) before the settings controller is
47
+ ready: snapshot reads, strict-context access and JSON edits are guarded.
48
+ - The list entry is registered through `plugins.item` so settings → plugins
49
+ shows the card again.
50
+
51
+ ## [0.3.0] - 2026-11-07
52
+
53
+ ### Added
54
+ - Per-field hints in the configuration form (zh/en), explaining what each
55
+ value changes.
56
+ - Plugin-market publishing: `scripts/gen-market-index.mjs` generates a
57
+ format-1 market index (`market/index.json`), and `docs/PUBLISHING.md`
58
+ documents the npm + index-source flow.
59
+ - npm metadata: keywords, author, engines, files whitelist, and
60
+ `@deepseek-ai/schemastery` as a runtime dependency.
61
+
62
+ ### Changed
63
+ - The form no longer depends on `props.ctx`; it reads the ctx captured in
64
+ `apply()`, matching the reference web-search card.
65
+ - README rewritten for the plugin page and npm: badges, install steps,
66
+ configuration table, development layout.
67
+
68
+ ### Fixed
69
+ - Configuration form showing "配置服务暂不可用" on newer DSH clients.
70
+
71
+ ## [0.2.0] - 2026-11-07
72
+
73
+ ### Added
74
+ - Graphical configuration form on the plugin page (`plugins.bundle.config`),
75
+ backed by the `deferred-boot` settings namespace; values are saved to the
76
+ current profile's Cordis patch, so `cordis.patch.yml` no longer has to be
77
+ edited by hand.
78
+ - `Config` schema with four volatile fields: `idleDelay`, `disposeTimeout`,
79
+ `readyFallbackMs`, `deferredPlugins`.
80
+ - Locale dictionaries (zh/en) for the plugin page and the form.
81
+ - Icon, LICENSE (MIT), CI workflow, and packaging scripts.
82
+
83
+ ### Fixed
84
+ - `cannot set property "deferredBoot" without provide`: the service is now
85
+ exposed with `ctx.provide('deferredBoot', api)`, which the strict Cordis 4
86
+ context requires.
87
+
88
+ ## [0.1.0] - 2026-11-07
89
+
90
+ ### Added
91
+ - Initial scheduler: mounts deferred plugins after the main UI is ready, one
92
+ target per idle slice.
93
+ - Existence check before `loader.create`, per-target failure isolation,
94
+ `dispose` raced against `disposeTimeout`, three failed attempts freeze a
95
+ target as `failed`, and manual `ctx.deferredBoot.ensure(id)` mounting.
96
+ - Strategies: `idle`, `manual`, `inline-lazy`, `disabled`.
97
+ - Tests for the scheduler, config normalization, and the client module.
98
+
99
+ [0.3.2]: https://github.com/Bu-sheng/dsh-deferred-boot/releases/tag/v0.3.2
100
+ [0.3.1]: https://github.com/Bu-sheng/dsh-deferred-boot/releases/tag/v0.3.1
101
+ [0.3.0]: https://github.com/Bu-sheng/dsh-deferred-boot/releases/tag/v0.3.0
102
+ [0.2.0]: https://github.com/Bu-sheng/dsh-deferred-boot/releases/tag/v0.2.0
103
+ [0.1.0]: https://github.com/Bu-sheng/dsh-deferred-boot/releases/tag/v0.1.0
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  ## 特性
10
10
 
11
- - 就绪后再调度:优先 `connection.hostDescription`,退化为 `connection.host`、`app.ready` 轮询与兜底超时
11
+ - 就绪后再调度:优先 `typertGateway.hasLiveClient()`(浏览器页面已接上 RPC 网关),退化为 `webApp.getAdvertisedUrl()`,再退 `app.ready` / `connection` 与兜底超时
12
12
  - 分段空闲调度:`scheduler.postTask(background)` → `requestIdleCallback` → `setTimeout`,一次回调只挂一个目标
13
13
  - 安全挂载:`loader.create` 前检查同名/同 id 条目,已存在则跳过并标记 `mounted`
14
14
  - 故障隔离:每个目标独立 `try/catch`,连续 3 次失败冻结为 `failed`,不影响其余目标
package/docs/design.md CHANGED
@@ -32,13 +32,19 @@
32
32
 
33
33
  ### 就绪等待的多重兜底
34
34
 
35
- 1. `ctx.connection.hostDescription`(字符串或函数)
36
- 2. `ctx.connection.host`(ready 握手发布的 `{ home }` 对象,流一断即清空)
37
- 3. 任一暴露 `ready === true` 的服务(`app` / `webApp`)
38
- 4. `readyFallbackMs` 计时兜底
35
+ 按顺序探测,第一个命中即返回(实现见 `src/scheduler.js` 的 `probeReadySource`):
36
+
37
+ 1. `typertGateway.hasLiveClient() === true` —— 浏览器页面已接上 RPC 网关,这是桌面 Web GUI 上真正存在的「首屏活了」信号
38
+ 2. `webApp.getAdvertisedUrl()` 返回非空 URL —— Web GUI 已在服务(无页面连接时也能命中)
39
+ 3. `ctx.app.ready === true`
40
+ 4. `ctx.connection.hostDescription`(字符串或函数)
41
+ 5. `ctx.connection.host`(ready 握手发布的 `{ home }` 对象,流一断即清空)
42
+ 6. `readyFallbackMs` 计时兜底
39
43
 
40
44
  不硬编码任何宿主事件名。
41
45
 
46
+ > 注意:桌面 Web GUI 的 `connection` 服务**没有** `hostDescription` / `host`,`webApp` 也没有 `ready`;这三项只为非 Web 宿主保留。0.3.2 之前只探这三项,实测 60 秒一次都不命中,最终总是走兜底超时,等价于「盲等 5 秒」。
47
+
42
48
  ### HMR 重载后的状态重建
43
49
 
44
50
  插件重载后从当前 loader 的存在性检查重建状态(`status()` 内部调用 `rebuildFromLoader()`),不会把已挂载目标再挂一遍。
@@ -73,6 +79,7 @@
73
79
 
74
80
  ## 已知限制
75
81
 
76
- - `hostDescription` 在当前 checkout 的 connection 服务上未以该名字导出;实际可用信号是 `host`(ready 握手对象)。探测顺序已按仓库现状适配。
82
+ - 桌面 Web GUI 的 `connection` 服务不导出 `hostDescription` / `host`,`webApp` 也不导出 `ready`;这三项只在非 Web 宿主上可能命中。Web GUI 上的实际信号是 `typertGateway.hasLiveClient()` 与 `webApp.getAdvertisedUrl()`。
83
+ - 延迟挂载不能只把目标从 bundles 摘掉:DSH 插件页用 `dsh.profile.bundles` 判断启用状态,摘掉后页面会显示为关闭/异常。`loader.create` 与 bundle patch 插入的 entry 同名不同 patchId,同时存在会撞成重复 entry。因此 `deferredPlugins` 只适合「确实想延后、且愿意接受插件页状态不一致」的场景,默认留空。
77
84
  - 调度器只负责挂载时机;目标插件在 `apply` 内的同步重活不会被本插件拆分。
78
85
  - 图形界面依赖 settings 服务;settings 不可用时表单显示「配置服务尚未就绪」,插件本身仍正常工作。