@aaayeaaa-p1ws/dsh-plugin-auto-update 0.0.0-stage → 1.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 aaayeaaa-P1WS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,90 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-auto-update
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 插件装多了,更新就成了琐事:市场里隔几天就有新版本,你得自己去翻、去点。
4
+
5
+ 这个插件替你盯着。每次打开 DSH,它在后台查一轮已安装插件的更新,有就装上;装完给你一张小卡片,说清楚这次更新了什么、哪几个没装上、卡在哪里。
6
+
7
+ ## 它做什么
8
+
9
+ - **开机自动检查** — DSH 启动十几秒后在后台跑一轮,查完就装,你照常干活。
10
+ - **结果弹窗** — 当天第一次打开 DSH 时,把结果摆在你面前:更新了哪几个(旧版本 → 新版本)、失败的是哪几个、原因是什么。点「稍后」当天不再打扰。
11
+ - **失败能一键处理** — 插件正在使用的时候,DSH 不允许直接替换(`bundle-in-use`)。弹窗里会给一个按钮:停用 → 更新 → 装回 → 重启 DSH,一口气做完。
12
+ - **设置页** — 设置里的独立一页:检查时机(每次打开 / 每天定时 / 每隔 N 小时)、自动安装、开机弹窗三个开关,外加一份最近的更新日志,也可以手动「立即检查」。
13
+
14
+ ## 安装
15
+
16
+ ```bash
17
+ dsh plugin add dsh-plugin-auto-update
18
+ ```
19
+
20
+ 从 GitHub 装:
21
+
22
+ ```bash
23
+ dsh plugin add github:aaayeaaa-P1WS/dsh-plugin-auto-update
24
+ ```
25
+
26
+ 装好后重启一次 DSH,在「设置 → 插件自动更新」里能看到它。
27
+
28
+ ## 它怎么工作
29
+
30
+ 只走插件市场公开的 UPDATE-API v1:`updates/summary?force=1` 拿可更新列表 → `POST /updates` 发起安装 → 轮询操作状态。不读 profile 文件、不调 pnpm、不碰你的配置,安装全部交给市场自己做。
31
+
32
+ 市场同一时刻只允许一个操作,所以这里是串行安装,市场自己也排在最后。遇到「市场正忙」就推迟几分钟再来,不算失败。
33
+
34
+ ### 关于冷静期
35
+
36
+ 插件市场对刚发布的版本有一段冷静期(pnpm 默认 24 小时,本机 profile 里设成了 6 小时)。冷静期内的版本市场不会让人安装,插件会等它成熟后再试——所以「市场里显示有更新」和「这里稍晚一点才装上」是正常的,不是出错。
37
+
38
+ ### 失败原因对照
39
+
40
+ | 提示 | 含义 | 怎么办 |
41
+ | --- | --- | --- |
42
+ | `bundle-in-use` | 插件正在运行,桌面端不允许移除 | 用弹窗里的「关闭插件并更新,然后重启 DSH」 |
43
+ | 等待期(held) | 新版本还没过冷静期 | 等几小时,插件自己会重试 |
44
+ | 市场正忙 / 超时 | 别的安装或更新占着市场 | 几分钟后自动重试 |
45
+
46
+ ## 配置
47
+
48
+ 设置页会写进 `~/.dsh/auto-update/config.json`,也可以直接改:
49
+
50
+ | 键 | 含义 | 默认 |
51
+ | --- | --- | --- |
52
+ | `mode` | `startup` 每次打开 / `daily` 每天定时 / `interval` 每隔 N 小时 | `startup` |
53
+ | `dailyAt` | `daily` 模式的时间,`HH:MM` | `09:30` |
54
+ | `intervalHours` | `interval` 模式的间隔小时数(1–48) | `6` |
55
+ | `enabled` | 是否自动检查 | `true` |
56
+ | `autoApply` | 发现更新就安装(关掉则只检查) | `true` |
57
+ | `popupEnabled` | 当天首次打开时弹窗 | `true` |
58
+
59
+ ## 兼容性
60
+
61
+ - 宿主机逻辑跨平台;「停用 → 重启」依赖桌面端,Web 端只会提示无法重启。
62
+ - 需要 DSH `>= 0.2.2-rc.1`。
63
+
64
+ ## 开发
65
+
66
+ ```bash
67
+ git clone https://github.com/aaayeaaa-P1WS/dsh-plugin-auto-update.git
68
+ cd dsh-plugin-auto-update
69
+ dsh plugin add link:$(pwd)
70
+ ```
71
+
72
+ 代码不多:`index.js` 负责检查和安装、暴露 `/dsh-auto-update/*` 路由与 `dsh_auto_update_status` 工具;`client.js` 是弹窗和设置页;`lib/` 里是配置归一化和桌面端重启。
73
+
74
+ ## English
75
+
76
+ **dsh-plugin-auto-update** keeps your DSH plugins current without you thinking about it.
77
+
78
+ On every DSH launch it checks the plugin market for updates to your installed plugins and installs them in the background. A popup on your first launch of the day tells you what was updated (old version → new version) and what failed, and why. If a plugin couldn't be replaced because it is currently in use (`bundle-in-use`), the popup offers a one-click fix: disable it, update, restore, and restart DSH.
79
+
80
+ A settings page adds the schedule (on launch / daily at a time / every N hours), switches for auto-install and the popup, a recent update log, and a manual "check now".
81
+
82
+ It talks only to the market's public UPDATE-API v1 — no profile edits, no pnpm, no changes to your configuration.
83
+
84
+ Install: `dsh plugin add dsh-plugin-auto-update` (or `dsh plugin add github:aaayeaaa-P1WS/dsh-plugin-auto-update`).
85
+
86
+ Note: the market holds back freshly published versions for a release-age window (24h by default, 6h in this setup), so a version can show as available a few hours before it is actually installable.
87
+
88
+ ## License
89
+
90
+ MIT