dsh-plugin-update-hub 0.0.0-stage → 0.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 darianzes
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,91 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-update-hub
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
+ **An update hub for the plugins you already installed in DeepSeek Harness.**
4
+
5
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-update-hub?style=flat-square&labelColor=2B3245&color=CB3837)](https://www.npmjs.com/package/dsh-plugin-update-hub)
6
+ [![License](https://img.shields.io/badge/license-MIT-3366CC?style=flat-square&labelColor=2B3245)](LICENSE)
7
+ [![DSH](https://img.shields.io/badge/DSH-%E2%89%A50.2.2%20%3C0.3.0-4B67B4?style=flat-square&labelColor=2B3245)](#compatibility)
8
+
9
+ [简体中文](README.zh.md) · [English](README.md)
10
+
11
+ Plugins installed from the market never told you when a newer version shipped — the stock plugin page has no version column at all, so the only upgrade path was uninstall and reinstall. This plugin adds a **Plugin updates** tab next to *Installed* and *Discover*: every installed plugin with its current version, install date, how many releases behind it is, and a version picker.
12
+
13
+ ## Install
14
+
15
+ ### CLI (recommended)
16
+
17
+ ```sh
18
+ # once per machine, if you don't have the CLI yet
19
+ npm i -g @deepseek-ai/dsh
20
+
21
+ # install the plugin into the profile you launch
22
+ dsh plugin --profile web add dsh-plugin-update-hub
23
+ ```
24
+
25
+ - Replace `web` with the profile you actually run (`tui`, `headless`, ...); `dsh plugin --profile <name> <args>` forwards the remaining arguments to pnpm inside that profile's directory.
26
+ - Requires Node ≥ 22.13 and a `pnpm` on `PATH` (the CLI reports `dsh: pnpm was not found` when it is missing).
27
+ - The Desktop app's `desktop` profile is owned by the application: the CLI refuses to manage it (`profile "desktop" is managed exclusively by the Electron application`). Desktop users install from **Plugins → Discover**, paste `dsh-plugin-update-hub` in **Add plugin**, or ask the agent to install it.
28
+ - Verify it loaded:
29
+
30
+ ```sh
31
+ dsh --profile web --dump-config | grep -A2 'dsh-plugin-update-hub'
32
+ ```
33
+
34
+ ### From a checkout
35
+
36
+ ```sh
37
+ git clone https://github.com/darianzes/dsh-plugin-update-hub
38
+ dsh plugin --profile web add ./dsh-plugin-update-hub
39
+ ```
40
+
41
+ ## Update
42
+
43
+ ```sh
44
+ # let pnpm move it to the newest release in range
45
+ dsh plugin --profile web update dsh-plugin-update-hub
46
+
47
+ # or pin the newest release explicitly
48
+ dsh plugin --profile web add dsh-plugin-update-hub@latest
49
+ ```
50
+
51
+ Every one of these is also handled by the tab itself once installed — see below.
52
+
53
+ ## Update from the tab
54
+
55
+ ![The Plugin updates tab sits in the Plugins page tab row](https://raw.githubusercontent.com/darianzes/dsh-plugin-update-hub/main/docs/screenshot-tab.png)
56
+
57
+ ![Version list: name, package, summary, current version, install date, status, versions](https://raw.githubusercontent.com/darianzes/dsh-plugin-update-hub/main/docs/screenshot-list.png)
58
+
59
+ - Every row shows: display name, package name, description, current version, install time, status (`up to date` / `N versions behind` / `built-in` / `git install` / `disabled`) and the newest version.
60
+ - Outdated rows get a version dropdown (releases newer than the installed one, newest first) and an **Update** button.
61
+ - Fuzzy search over name / package / description, several keywords combined.
62
+ - Page size 10 / 20 / 50, default 20, remembered in `localStorage`.
63
+ - **Show built-in** toggle, off by default (official bundles ship with DSH and cannot be upgraded alone).
64
+ - **Check updates** runs a concurrent check over every checkable row in the current result set — the rest show `等待检查…` (waiting) while queued; one automatic check runs when you open the tab, throttled to once every 6 hours.
65
+ - Concurrency starts at 2 / 3 / 4 depending on cores and memory, then adapts to registry latency: slows down when responses are slow, grows back up to the ceiling when they are fast.
66
+ - Batch upgrades: **批量更新 (N)** queues every upgradable row in the current filter at the chosen version; a single row's **Update** just enqueues one task.
67
+ - The queue is serial (installs share the profile's store, they cannot run in parallel), collapsible and collapsed by default — collapsed it shows one summary line (`更新队列 · 1 个更新中 · 2 个排队中`) plus the live percentage and a thin progress bar; expanded it shows each task's `waiting / checking / removing / installing / done / failed` and elapsed time.
68
+ - The queue lives in memory only: if DSH quits or is interrupted, queued tasks are simply gone on the next start. **Clear queue** / **Clear finished** are available too.
69
+ - Progress follows the Host's own `plugin-manager/update-state` steps (check / remove / install / restore); failures show the reason.
70
+
71
+ ## How it works
72
+
73
+ - `index.js` — Host half, `export const inject = ['webServer']`. Registers the exact route `/dsh-plugin-update-hub-api`, returning each requested package's install time (the mtime of the pnpm symlink in the profile's `node_modules`) plus the `description` / `version` from its `package.json`. The profile directory is resolved from `DSH_PROFILE_DIR`, `DSH_HOME/profiles/$DSH_PROFILE`, the host process argv, the module path, and finally `~/.dsh/profiles/*`, validated by `node_modules` + `cordis.patch.yml` so the read-only app install directory is never picked. No `@deepseek-ai` dependency.
74
+ - `client.js` — Client half. Registers `plugins.tab` as `{ id: 'updates', order: 10, label: '插件更新' }`; data comes from `ctx.get('remote.pluginManager')` (`listBundles` / `listVersions` / `updateBundle` / `cancelInstall`), progress from `ctx.get('remote').$on('plugin-manager/update-state' | 'plugin-manager/changed')`. Remote calls resolve to an `{ ok, value | error }` envelope, unwrapped in one place.
75
+ - Only `react` and `--dsw-alias-*` theme tokens are used — no Harness client packages, no JSX.
76
+
77
+ ## Compatibility
78
+
79
+ - DSH `>=0.2.2-0 <0.3.0`, Node `>=22.13.0`.
80
+ - Only bundles installed from an npm registry can be upgraded; git and link installs are labelled and left alone, official bundles follow the DSH release.
81
+ - Upgrades are performed by the Host plugin manager: it checks that the target version exists, declares a bundle, and accepts the running DSH version, and rolls back to the previous version if anything fails. Some upgrades need a DSH restart; the tab says so.
82
+
83
+ ## Development
84
+
85
+ ```sh
86
+ npm test # smoke test: runs client.js in a fake browser with a mocked remote
87
+ ```
88
+
89
+ ## License
90
+
91
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,91 @@
1
+ # dsh-plugin-update-hub
2
+
3
+ **给 DeepSeek Harness 已装插件补上「版本落后提示」与「按版本升级」。**
4
+
5
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-update-hub?style=flat-square&labelColor=2B3245&color=CB3837)](https://www.npmjs.com/package/dsh-plugin-update-hub)
6
+ [![License](https://img.shields.io/badge/license-MIT-3366CC?style=flat-square&labelColor=2B3245)](LICENSE)
7
+ [![DSH](https://img.shields.io/badge/DSH-%E2%89%A50.2.2%20%3C0.3.0-4B67B4?style=flat-square&labelColor=2B3245)](#兼容性)
8
+
9
+ [简体中文](README.zh.md) · [English](README.md)
10
+
11
+ 从插件市场装的插件落后了,原来的插件页不会提示,也没有版本列,只能卸载重装。这个插件在侧边栏的**插件**页加一个「插件更新」tab:一次列出所有已装插件的当前版本、安装时间、落后几个版本,并支持选版本升级。
12
+
13
+ ## 安装
14
+
15
+ ### 命令行(推荐)
16
+
17
+ ```sh
18
+ # 机器上还没装 CLI 时先装一次
19
+ npm i -g @deepseek-ai/dsh
20
+
21
+ # 装进你平时启动的那个 profile
22
+ dsh plugin --profile web add dsh-plugin-update-hub
23
+ ```
24
+
25
+ - 把 `web` 换成你实际用的 profile(`tui`、`headless` 等);`dsh plugin --profile <name> <args>` 会把后面的参数原样转给该 profile 目录里的 pnpm。
26
+ - 需要 Node ≥ 22.13,并且 `PATH` 上有 `pnpm`(缺了会报 `dsh: pnpm was not found`)。
27
+ - 桌面端用的是应用独占管理的 `desktop` profile,命令行改它会被拒绝(`profile "desktop" is managed exclusively by the Electron application`)。桌面用户走 **插件 → 发现**,或在「添加插件」里填 `dsh-plugin-update-hub`,也可以直接让 agent 安装。
28
+ - 装完确认已加载:
29
+
30
+ ```sh
31
+ dsh --profile web --dump-config | grep -A2 'dsh-plugin-update-hub'
32
+ ```
33
+
34
+ ### 从源码装
35
+
36
+ ```sh
37
+ git clone https://github.com/darianzes/dsh-plugin-update-hub
38
+ dsh plugin --profile web add ./dsh-plugin-update-hub
39
+ ```
40
+
41
+ ## 命令行更新
42
+
43
+ ```sh
44
+ # 让 pnpm 升到范围内的最新版本
45
+ dsh plugin --profile web update dsh-plugin-update-hub
46
+
47
+ # 或直接装最新版
48
+ dsh plugin --profile web add dsh-plugin-update-hub@latest
49
+ ```
50
+
51
+ 装好之后,这些也都能在这个 tab 里点着完成 —— 见下。
52
+
53
+ ## 在 tab 里更新
54
+
55
+ ![「插件更新」tab 在插件页的 tab 行里](https://raw.githubusercontent.com/darianzes/dsh-plugin-update-hub/main/docs/screenshot-tab.png)
56
+
57
+ ![版本列表:插件名、包名、简介、当前版本、安装时间、状态、可升级版本](https://raw.githubusercontent.com/darianzes/dsh-plugin-update-hub/main/docs/screenshot-list.png)
58
+
59
+ - 每行显示:插件名、包名、简介、当前版本、安装时间、状态(已是最新 / 落后 N 个版本 / 内置 / Git 安装 / 已禁用)和最新版本。
60
+ - 落后时出现版本下拉(比当前新的已发布版本,最新在前)+「更新」按钮。
61
+ - 插件名 / 包名 / 简介模糊搜索,多个关键词同时匹配。
62
+ - 分页:每页 10 / 20 / 50,默认 20,选择记在 `localStorage`。
63
+ - 「显示内置」开关,默认关闭(内置 bundle 随 DSH 发行,不能单独升级)。
64
+ - 「检查更新」一次并发检查当前结果集里所有可检查的插件,排队的显示「等待检查…」;打开 tab 时自动检查一次,6 小时内不重复。
65
+ - 并发数按核心数与内存起算 2 / 3 / 4,再随 registry 响应时间自适应:慢了就减,快了往上限加回来。
66
+ - 支持批量:「批量更新 (N)」把当前筛选结果里所有可升级插件按所选版本排进队列;单个「更新」也是入队一个任务。
67
+ - 队列串行(安装共用 profile 的 store,不能并行),**默认折叠**:折叠时只显示一行汇总(`更新队列 · 1 个更新中 · 2 个排队中`)、当前百分比和一条细进度条;展开后看每个任务的 `等待更新 / 正在校验 / 移除 / 安装 / 已完成 / 失败` 与已用时间。
68
+ - 队列只在内存里:DSH 意外关闭或中断后,排队任务直接消失,不会在下次启动时恢复。也可以手动「清空队列」/「清空已完成」。
69
+ - 进度按 Host 广播的 `plugin-manager/update-state` 步进(校验 / 移除 / 安装 / 回滚),失败会显示原因。
70
+
71
+ ## 实现
72
+
73
+ - `index.js`(Host 半边,`export const inject = ['webServer']`):注册 exact 路由 `/dsh-plugin-update-hub-api`,按包名返回 profile `node_modules` 的安装时间(pnpm symlink 自身的 mtime)以及包 `package.json` 的 `description` / `version`。profile 目录依次从 `DSH_PROFILE_DIR`、`DSH_HOME/profiles/$DSH_PROFILE`、宿主进程 argv、模块路径上溯、`~/.dsh/profiles/*` 里找,用 `node_modules` + `cordis.patch.yml` 判定,排除只读的 app 安装目录。不依赖任何 `@deepseek-ai` 包。
74
+ - `client.js`(Client 半边):把 `plugins.tab` 注册成 `{ id: 'updates', order: 10, label: '插件更新' }`;数据走 `ctx.get('remote.pluginManager')` 的 `listBundles` / `listVersions` / `updateBundle` / `cancelInstall`,进度走 `ctx.get('remote').$on('plugin-manager/update-state' | 'plugin-manager/changed')`。Remote 调用返回 `{ ok, value | error }` 信封,统一拆。
75
+ - 只用 `react` 和 `--dsw-alias-*` 主题 token,不引入 Harness 客户端包,不写 JSX。
76
+
77
+ ## 兼容性
78
+
79
+ - DSH `>=0.2.2-0 <0.3.0`,Node `>=22.13.0`。
80
+ - 只有从 npm registry 安装的 bundle 能升级;git 安装和 link 安装会被标注且不做版本升级,内置 bundle 跟随 DSH 发行。
81
+ - 升级由 Host 的 plugin manager 执行:先校验目标版本存在、声明了 bundle、接受当前 DSH 版本,失败会自动回滚重装旧版。有的更新需要重启 DSH 才生效,界面会提示。
82
+
83
+ ## 开发
84
+
85
+ ```sh
86
+ npm test # 冒烟测试:在假浏览器里跑 client.js,mock remote
87
+ ```
88
+
89
+ ## License
90
+
91
+ MIT