dsh-aupdate 0.7.3 → 0.7.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/README.md CHANGED
@@ -206,6 +206,28 @@ stargazers)与「分享」(复制项目地址到剪贴板,任何环境都
206
206
  一律 503。不用「只认回环地址」这种判据:浏览器里任何网页都能向 127.0.0.1 发请求。
207
207
  `/state` 和 `/logs` 也照样要过,因为它们分别会吐全量设置和读磁盘上的日志文件。
208
208
 
209
+ ## 版本管理
210
+
211
+ 「插件」页顶栏多了一个「版本管理」标签:列出每个已装插件、已装版本,以及该插件的全部已发布
212
+ 版本;点某一版就直接切过去。走的是和定时更新同一条安装路径——安装、回读磁盘上的版本、记一条
213
+ 更新记录、就地生效——所以切完能在「更新记录」里看到,也能再回滚回来。
214
+
215
+ 每个版本先和这台宿主的 DSH 版本比一次:装不了的版本标红、按钮禁用(宿主的闸门是在 bundle
216
+ 已经卸下之后才拒绝的,不能让它走到那一步)。版本列表按包按需拉,不进首屏:整页一次拉一排
217
+ 包的 packument,在镜像上会慢到没法用。
218
+
219
+ ## 安装源与兼容性预检
220
+
221
+ 设置页的「安装源」有三档预设加一个自定义:**跟随 pnpm**(默认,一个字节都不改)/ 官方源 /
222
+ 大陆镜像 / 自定义 `http(s)` 地址。选了之后,查版本和装包都走这个源;装包只把这个源写进
223
+ 子进程的 `npm_config_registry`,不动 `~/.npmrc`,也不改 pnpm 自己的配置。
224
+
225
+ 用了镜像就会顺手比一次官方源:「已经是最新」有可能只是镜像还没同步。落后的那些写进「上一次」
226
+ 卡片,按名字列出「镜像 x.y.z → 官方 a.b.c」。
227
+
228
+ 「装前检查 DSH 兼容性」默认开着:真要装某个版本之前,读一次该版本的 manifest(几 KB),按
229
+ `engines.dsh`(没有才看 `@deepseek-ai/dsh*` 的 peer)和当前宿主版本比一遍。装不了的不进
230
+ 安装队列,日志留一行。**读不到 DSH 版本时不拦**——宁可漏拦,也不要按猜的版本误拦。
209
231
  ## 更新提醒
210
232
 
211
233
  发现可更新版本时,界面右下角浮一条提醒,列出插件名和「当前 → 新」版本;超过 8 条
@@ -219,8 +241,18 @@ stargazers)与「分享」(复制项目地址到剪贴板,任何环境都
219
241
  关掉「发现更新时提醒我」就完全不弹,日志和设置页照常记录——提醒只是别让它装完你
220
242
  还不知道,不是唯一的告知渠道。
221
243
 
222
- 提醒卡沿用同一套版式:标题行 + `×`、可滚动的插件清单、「知道了」主按钮,按 Esc 也能关;
223
- `prefers-reduced-motion` 下不播进场动画。
244
+ 提醒卡照 `dsh-cost-meter` 的「峰/谷切换提醒」做:最上面是**圆点徽标**(已更新 / 可更新),
245
+ 下面标题行带 `×`,再一句正文说明「装好就地生效,不用重启」,然后是可滚动的插件清单和
246
+ 右对齐的「知道了」主按钮;按 Esc 也能关,`prefers-reduced-motion` 下不播进场动画。
247
+
248
+ **「已更新」只在真的装完之后说**。`lastRun.updates` 记的是「发现了哪些新版本」——自动安装
249
+ 被关掉、被空闲门槛让开、或者装失败时它照样有值。所以徽标、标题和「上一次」的统计卡都改看
250
+ `installed`(去掉带 `!failed` 的条目)算出来的「真装成了几个」:装成了说「已更新 N 个」,
251
+ 只查到不动手说「可更新 N 个」,两个数字不会互相冒充。
252
+
253
+ 「上一次」里的时间显示成 `26/11/26 12:38`(两位年/月/日 + 时:分,本地时区)。秒不显示,
254
+ 因为统计卡里它只会把数字挤窄;年月日的顺序也写死成「年/月/日」,不跟 `Intl` 的
255
+ 区域顺序走,中文环境下不会跳成 `2026/11/26`。
224
256
 
225
257
  提醒用的是原生 DOM 浮层,不是新的槽位:槽位只在宿主页挂载时才渲染,而提醒要能在
226
258
  会话、插件页、设置页都出现。
@@ -454,15 +486,58 @@ once and, like every other setting, is persisted immediately. The choice is stor
454
486
  `~/.dsh/aupdate-settings.json` (key `lang`), so another browser or machine opens the page
455
487
  in the same language. Wording only — it changes no update behaviour.
456
488
 
489
+ ## Version manager
490
+
491
+ The plugins page gains a **Versions** tab: it lists every installed plugin, the version you have,
492
+ and every published version of it. Click one and it switches. The switch uses the same install
493
+ path as the scheduled cycle — install, read the version back from disk, append a history row,
494
+ apply in place — so it shows up in Update history and can be rolled back again.
495
+
496
+ Each version is compared against this host's DSH version first: versions that cannot run here are
497
+ marked and their button disabled (the host's gate only refuses after the bundle is gone, so it
498
+ must not be allowed to get that far). Version lists are fetched per package on demand, never on
499
+ first paint: fetching packuments for a whole page of packages is unusably slow on a mirror.
500
+
501
+ ## Registry and compatibility pre-check
502
+
503
+ Under Settings, **Registry** has three presets plus a custom value: **Follow pnpm** (the default,
504
+ which changes nothing) / Official / China mirror / a custom `http(s)` URL. Once picked, both
505
+ version lookups and installs use it; an install only passes it to the child process as
506
+ `npm_config_registry`, so `~/.npmrc` and pnpm's own config are never touched.
507
+
508
+ When a mirror is in use the official registry is checked too, because "already up to date" may
509
+ only mean the mirror has not synced yet. Those are listed in the Last run card as
510
+ "mirror x.y.z → upstream a.b.c".
511
+
512
+ **Check DSH compatibility first** (on by default) reads the target version's manifest (a few KB)
513
+ before installing and compares `engines.dsh` (falling back to the `@deepseek-ai/dsh*` peer range)
514
+ against the running host. Unusable versions are kept out of the install queue and leave a log
515
+ line. When the DSH version cannot be read, **nothing is blocked** — a missed block is better than
516
+ blocking on a guessed version.
457
517
  ### Update notices
458
518
 
459
519
  When a check finds updates, a notice appears in the bottom-right corner listing each
460
520
  plugin and its current → new version; past eight it adds "and N more", and it closes
461
521
  itself after 15 seconds. Long package names are truncated on the name side so the
462
522
  versions stay visible, and past six entries the list scrolls. The Last run card on the
463
- settings page lists the same plugins and version pairs. The notice uses the same card
464
- language: a title row with `×`, a scrollable plugin list and a primary "Got it" button;
465
- `Esc` closes it too, and the entrance animation is skipped under `prefers-reduced-motion`.
523
+ settings page lists the same plugins and version pairs. The notice follows the
524
+ `dsh-cost-meter` peak/off-peak switch alert: a **dot badge** at the top (Updated /
525
+ Update available), a title row with `×`, one body line saying it was applied in place
526
+ without a restart, then the scrollable plugin list and a right-aligned primary "Got it"
527
+ button. `Esc` closes it too, and the entrance animation is skipped under
528
+ `prefers-reduced-motion`.
529
+
530
+ **"Updated" is only claimed once an install actually happened.** `lastRun.updates` records
531
+ which new versions were *found* — it is populated even when auto-install is off, when the
532
+ idle gate holds the run back, or when an install fails. The badge, the notice title and the
533
+ Last run stat card therefore read `installed` (minus entries ending in `!failed`): a real
534
+ install says "N updated", a check-only run says "N can update", and neither number
535
+ impersonates the other.
536
+
537
+ The Last run timestamp renders as `26/11/26 12:38` — two-digit year/month/day plus
538
+ hour:minute in local time. Seconds are dropped because they only squeeze the stat card, and
539
+ the field order is fixed to year/month/day rather than following `Intl`'s locale order, so a
540
+ Chinese locale does not produce `2026/11/26`.
466
541
  Each batch is announced once — the signature is kept in
467
542
  `localStorage` — and turning "Tell me when updates are found" off silences it entirely
468
543
  while the log and settings page keep recording.