dsh-update-center 0.8.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 +29 -0
- package/README.md +93 -0
- package/cordis.patch.yml +4 -0
- package/data/extra-plugins.json +112 -0
- package/data/registry-snapshot.json +7636 -0
- package/lib/client.js +606 -0
- package/lib/client.js.map +1 -0
- package/lib/github-topic.mjs +80 -0
- package/lib/index.js +1048 -0
- package/lib/index.js.map +1 -0
- package/lib/npm-mapping.mjs +43 -0
- package/lib/run-command.mjs +58 -0
- package/lib/types/client/index.d.ts +12 -0
- package/lib/types/index.d.ts +43 -0
- package/package.json +76 -0
- package/plugins.json +7636 -0
- package/scripts/build.mjs +101 -0
- package/scripts/build.sh +4 -0
- package/scripts/refresh-snapshot.mjs +93 -0
- package/scripts/update-worker.mjs +598 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Britneycode
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# dsh-update-center
|
|
2
|
+
|
|
3
|
+
DeepSeek Harness 的本地更新中心:内置插件市场(浏览/搜索/一键安装/卸载/禁用),统一管理已装插件与 dsh 本体、profile 中的 npm/link 插件以及 agent preset 的更新。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
插件声明了 `dsh.bundle`(bundle patch 位于 `cordis.patch.yml`),构建产物随仓库分发,用官方 CLI 安装即可挂载为 profile 层:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
dsh plugin --profile web add github:Britneycode/dsh-update-center
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
本地开发时也可以 link 安装:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
dsh plugin --profile web add link:<本插件目录>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
安装后重启 dsh web,设置页会出现「更新中心」面板。不需要第三方注入器。
|
|
20
|
+
|
|
21
|
+
## 插件市场
|
|
22
|
+
|
|
23
|
+
- 注册表:本仓库根目录 [`plugins.json`](./plugins.json)(raw 直链拉取,可独立于插件发版更新),初始内容为 GitHub `topic:dsh-plugin` 星标前 500 + 本插件,共 501 条。
|
|
24
|
+
- 增量扫描:后台每 12 小时扫描 GitHub `topic:dsh-plugin`(星标前 500,排除 fork),与注册表按 owner/name 去重合并——重复条目仅刷新星标,新条目追加;掉出扫描窗口的老条目在 plugins.json 中保留(累计语义,上限 2000 防膨胀)。
|
|
25
|
+
- npm 包名映射:同一轮扫描会查询 npm 关键词搜索(`keywords:dsh-plugin`,约 800+ 包),按 repository 地址与市场条目匹配——仓库一致才映射(天然防抢注);命中的条目显示 npm 标记并走 npm 秒级安装,未命中的走 `github:` 安装。
|
|
26
|
+
- 更新注册表:`npm run refresh:snapshot` 会以现有 plugins.json 为基底累计合并最新扫描结果并连同离线快照一起重写,提交推送后生效。
|
|
27
|
+
- 离线兜底:磁盘缓存 → 随包快照(`data/registry-snapshot.json`);常驻条目(`data/extra-plugins.json`)无条件并入,保证 0 星新插件始终可见。
|
|
28
|
+
- 清单自动刷新:缓存超过 24 小时会在打开面板时自动拉取最新;「刷新清单」按钮随时强制更新。
|
|
29
|
+
- 出网请求仅允许 https 且 host 白名单(raw.githubusercontent.com 额外限定为清单仓库路径,防 SSRF);安装目标只接受清单内条目,不接受任意包名。
|
|
30
|
+
- 安装优先走 npm 包(秒级),并做防抢注校验:npm 包的 repository 与清单 GitHub owner/repo 不一致时自动回退 `github:owner/repo`。
|
|
31
|
+
- 安装后校验包可解析且存在可运行入口(dsh 清单或 main 文件);校验失败自动回滚卸载,不会留下坏包。
|
|
32
|
+
- pnpm ≥10 拒绝或跳过构建脚本时,错误信息会带 pnpm-workspace.yaml 放行指引。
|
|
33
|
+
- 卸载 = `pnpm remove` + 移出 `dsh.profile.bundles`,仅对 npm 安装的插件开放;link/preset 插件请直接编辑 profile。
|
|
34
|
+
- 禁用/启用 = 在 profile 的 `cordis.patch.yml` 写入/移除受管的 `disabled: true` 条目(按插件自身 insert id 定位,带标记区块与备份),不删文件、可随时恢复,重启后生效。
|
|
35
|
+
- 市场条目与已安装列表互通元数据:已安装插件显示市场描述与 GitHub 链接,市场里已装的插件显示「可更新」徽标。
|
|
36
|
+
- 市场支持排序:星标最多(默认)/ 默认策展顺序 / 最近添加,可叠加搜索与分类筛选。
|
|
37
|
+
|
|
38
|
+
## 一键全部更新
|
|
39
|
+
|
|
40
|
+
- 检查更新后,工具栏出现「全部更新」:把所有可更新插件(npm 版本落后 + link/preset 落后且无未提交改动)排成一个后台批量任务串行执行。
|
|
41
|
+
- 单个子任务失败不中断其余;结束后汇总「N 成功 / M 失败」,全部失败才标记任务失败。
|
|
42
|
+
- dsh 本体更新有独立的构建语义(完整更新/仅拉取),不并入批量。
|
|
43
|
+
|
|
44
|
+
## 当前能力
|
|
45
|
+
|
|
46
|
+
- 手动检查远端状态,不在打开设置页时自动发起网络请求。
|
|
47
|
+
- 检查与状态查询全部异步执行(子进程不再阻塞 dsh web 的事件循环),插件检查并行、`/status` 带 5 秒快照缓存。
|
|
48
|
+
- dsh 完整更新会依次执行快进拉取、`pnpm install` 和 `pnpm run build`。
|
|
49
|
+
- 更新由 `$DSH_HOME/update-center` 下的独立 worker 执行,停止或重启 dsh 不会中断任务。
|
|
50
|
+
- npm 插件按包名精准更新,不会因为点击单个插件而更新整个 profile。
|
|
51
|
+
- npm 更新完成后核对 `node_modules` 中的实际版本;版本没有变化时返回失败。
|
|
52
|
+
- npm 更新/安装/卸载后按官方 `dsh plugin` 的规则对账 `dsh.profile.bundles`;模板 bundle 不受影响。
|
|
53
|
+
- link 与 preset 只能通过已安装清单中的包名更新,API 不接受任意目录。
|
|
54
|
+
- Git 插件只更新了 `src` 而没有更新 `lib/dist` 时,自动执行包的 `build` 脚本。
|
|
55
|
+
- 插件来源(upstream)优先读取 git remote 的真实地址,内置映射仅作兜底。
|
|
56
|
+
- dsh 或本地插件存在未提交改动时停止更新,避免覆盖本地工作。
|
|
57
|
+
- 任一步骤失败都会返回失败阶段;不会把依赖安装或构建失败显示成成功。
|
|
58
|
+
- 更新写入磁盘后明确提示重启 dsh web。
|
|
59
|
+
- POST 动作仅接受同源请求(Origin 与 Host 一致)。
|
|
60
|
+
- `Start-DSH.ps1` 会等待后台更新完成再启动,`Stop-DSH.ps1` 不会结束更新 worker。
|
|
61
|
+
|
|
62
|
+
## 构建
|
|
63
|
+
|
|
64
|
+
构建脚本支持 Windows、macOS 和 Linux。它会从 `DSH_CHECKOUT`、相邻目录及常见用户目录中寻找 DeepSeek Harness checkout,并复用 checkout 的 TypeScript 与 tsdown。
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run typecheck
|
|
68
|
+
npm test
|
|
69
|
+
npm run build
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
无法自动找到 checkout 时,先设置 `DSH_CHECKOUT`:
|
|
73
|
+
|
|
74
|
+
```powershell
|
|
75
|
+
$env:DSH_CHECKOUT = 'D:\App\dsh\deepseek-harness'
|
|
76
|
+
npm run build
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 配置
|
|
80
|
+
|
|
81
|
+
| 字段 | 说明 | 默认值 |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `repoDir` | dsh 源码仓库 | 自动探测 |
|
|
84
|
+
| `profileDir` | web profile | `$DSH_HOME/profiles/web` |
|
|
85
|
+
| `presetDir` | agent preset 目录 | `$DSH_HOME/.agent-presets` |
|
|
86
|
+
| `proxy` | npm/pnpm 代理 | dsh 仓库的 `http.proxy` |
|
|
87
|
+
| `remote` | Git 远端名 | `origin` |
|
|
88
|
+
| `branch` | dsh 更新分支 | `master` |
|
|
89
|
+
| `upstreams` | 插件名到 GitHub 仓库的来源映射 | 内置常用插件 |
|
|
90
|
+
|
|
91
|
+
## 更新边界
|
|
92
|
+
|
|
93
|
+
更新中心只修改已明确识别的 dsh 仓库、profile npm 依赖和已安装的 Git 插件。它不会自动 stash、强制切换普通分支、执行非快进合并,也不会自动结束正在运行的 dsh 进程。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": 1335736564,
|
|
4
|
+
"node_id": "R_kgDOT5249A",
|
|
5
|
+
"name": "dsh-update-center",
|
|
6
|
+
"full_name": "Britneycode/dsh-update-center",
|
|
7
|
+
"private": false,
|
|
8
|
+
"owner": {
|
|
9
|
+
"login": "Britneycode",
|
|
10
|
+
"id": 267921491,
|
|
11
|
+
"node_id": "U_kgDOD_goUw",
|
|
12
|
+
"avatar_url": "https://avatars.githubusercontent.com/u/267921491?v=4",
|
|
13
|
+
"gravatar_id": "",
|
|
14
|
+
"url": "https://api.github.com/users/Britneycode",
|
|
15
|
+
"html_url": "https://github.com/Britneycode",
|
|
16
|
+
"followers_url": "https://api.github.com/users/Britneycode/followers",
|
|
17
|
+
"following_url": "https://api.github.com/users/Britneycode/following{/other_user}",
|
|
18
|
+
"gists_url": "https://api.github.com/users/Britneycode/gists{/gist_id}",
|
|
19
|
+
"starred_url": "https://api.github.com/users/Britneycode/starred{/owner}{/repo}",
|
|
20
|
+
"subscriptions_url": "https://api.github.com/users/Britneycode/subscriptions",
|
|
21
|
+
"organizations_url": "https://api.github.com/users/Britneycode/orgs",
|
|
22
|
+
"repos_url": "https://api.github.com/users/Britneycode/repos",
|
|
23
|
+
"events_url": "https://api.github.com/users/Britneycode/events{/privacy}",
|
|
24
|
+
"received_events_url": "https://api.github.com/users/Britneycode/received_events",
|
|
25
|
+
"type": "User",
|
|
26
|
+
"user_view_type": "public",
|
|
27
|
+
"site_admin": false
|
|
28
|
+
},
|
|
29
|
+
"html_url": "https://github.com/Britneycode/dsh-update-center",
|
|
30
|
+
"description": null,
|
|
31
|
+
"fork": false,
|
|
32
|
+
"url": "https://api.github.com/repos/Britneycode/dsh-update-center",
|
|
33
|
+
"forks_url": "https://api.github.com/repos/Britneycode/dsh-update-center/forks",
|
|
34
|
+
"keys_url": "https://api.github.com/repos/Britneycode/dsh-update-center/keys{/key_id}",
|
|
35
|
+
"collaborators_url": "https://api.github.com/repos/Britneycode/dsh-update-center/collaborators{/collaborator}",
|
|
36
|
+
"teams_url": "https://api.github.com/repos/Britneycode/dsh-update-center/teams",
|
|
37
|
+
"hooks_url": "https://api.github.com/repos/Britneycode/dsh-update-center/hooks",
|
|
38
|
+
"issue_events_url": "https://api.github.com/repos/Britneycode/dsh-update-center/issues/events{/number}",
|
|
39
|
+
"events_url": "https://api.github.com/repos/Britneycode/dsh-update-center/events",
|
|
40
|
+
"assignees_url": "https://api.github.com/repos/Britneycode/dsh-update-center/assignees{/user}",
|
|
41
|
+
"branches_url": "https://api.github.com/repos/Britneycode/dsh-update-center/branches{/branch}",
|
|
42
|
+
"tags_url": "https://api.github.com/repos/Britneycode/dsh-update-center/tags",
|
|
43
|
+
"blobs_url": "https://api.github.com/repos/Britneycode/dsh-update-center/git/blobs{/sha}",
|
|
44
|
+
"git_tags_url": "https://api.github.com/repos/Britneycode/dsh-update-center/git/tags{/sha}",
|
|
45
|
+
"git_refs_url": "https://api.github.com/repos/Britneycode/dsh-update-center/git/refs{/sha}",
|
|
46
|
+
"trees_url": "https://api.github.com/repos/Britneycode/dsh-update-center/git/trees{/sha}",
|
|
47
|
+
"statuses_url": "https://api.github.com/repos/Britneycode/dsh-update-center/statuses/{sha}",
|
|
48
|
+
"languages_url": "https://api.github.com/repos/Britneycode/dsh-update-center/languages",
|
|
49
|
+
"stargazers_url": "https://api.github.com/repos/Britneycode/dsh-update-center/stargazers",
|
|
50
|
+
"contributors_url": "https://api.github.com/repos/Britneycode/dsh-update-center/contributors",
|
|
51
|
+
"subscribers_url": "https://api.github.com/repos/Britneycode/dsh-update-center/subscribers",
|
|
52
|
+
"subscription_url": "https://api.github.com/repos/Britneycode/dsh-update-center/subscription",
|
|
53
|
+
"commits_url": "https://api.github.com/repos/Britneycode/dsh-update-center/commits{/sha}",
|
|
54
|
+
"git_commits_url": "https://api.github.com/repos/Britneycode/dsh-update-center/git/commits{/sha}",
|
|
55
|
+
"comments_url": "https://api.github.com/repos/Britneycode/dsh-update-center/comments{/number}",
|
|
56
|
+
"issue_comment_url": "https://api.github.com/repos/Britneycode/dsh-update-center/issues/comments{/number}",
|
|
57
|
+
"contents_url": "https://api.github.com/repos/Britneycode/dsh-update-center/contents/{+path}",
|
|
58
|
+
"compare_url": "https://api.github.com/repos/Britneycode/dsh-update-center/compare/{base}...{head}",
|
|
59
|
+
"merges_url": "https://api.github.com/repos/Britneycode/dsh-update-center/merges",
|
|
60
|
+
"archive_url": "https://api.github.com/repos/Britneycode/dsh-update-center/{archive_format}{/ref}",
|
|
61
|
+
"downloads_url": "https://api.github.com/repos/Britneycode/dsh-update-center/downloads",
|
|
62
|
+
"issues_url": "https://api.github.com/repos/Britneycode/dsh-update-center/issues{/number}",
|
|
63
|
+
"pulls_url": "https://api.github.com/repos/Britneycode/dsh-update-center/pulls{/number}",
|
|
64
|
+
"milestones_url": "https://api.github.com/repos/Britneycode/dsh-update-center/milestones{/number}",
|
|
65
|
+
"notifications_url": "https://api.github.com/repos/Britneycode/dsh-update-center/notifications{?since,all,participating}",
|
|
66
|
+
"labels_url": "https://api.github.com/repos/Britneycode/dsh-update-center/labels{/name}",
|
|
67
|
+
"releases_url": "https://api.github.com/repos/Britneycode/dsh-update-center/releases{/id}",
|
|
68
|
+
"deployments_url": "https://api.github.com/repos/Britneycode/dsh-update-center/deployments",
|
|
69
|
+
"created_at": "2026-08-16T08:11:15Z",
|
|
70
|
+
"updated_at": "2026-08-16T09:09:18Z",
|
|
71
|
+
"pushed_at": "2026-08-16T09:08:55Z",
|
|
72
|
+
"git_url": "git://github.com/Britneycode/dsh-update-center.git",
|
|
73
|
+
"ssh_url": "git@github.com:Britneycode/dsh-update-center.git",
|
|
74
|
+
"clone_url": "https://github.com/Britneycode/dsh-update-center.git",
|
|
75
|
+
"svn_url": "https://github.com/Britneycode/dsh-update-center",
|
|
76
|
+
"homepage": null,
|
|
77
|
+
"size": 0,
|
|
78
|
+
"stargazers_count": 0,
|
|
79
|
+
"watchers_count": 0,
|
|
80
|
+
"language": "TypeScript",
|
|
81
|
+
"has_issues": true,
|
|
82
|
+
"has_projects": true,
|
|
83
|
+
"has_downloads": false,
|
|
84
|
+
"has_wiki": true,
|
|
85
|
+
"has_pages": false,
|
|
86
|
+
"has_discussions": false,
|
|
87
|
+
"forks_count": 0,
|
|
88
|
+
"mirror_url": null,
|
|
89
|
+
"archived": false,
|
|
90
|
+
"disabled": false,
|
|
91
|
+
"open_issues_count": 0,
|
|
92
|
+
"license": null,
|
|
93
|
+
"allow_forking": true,
|
|
94
|
+
"is_template": false,
|
|
95
|
+
"web_commit_signoff_required": false,
|
|
96
|
+
"has_pull_requests": true,
|
|
97
|
+
"pull_request_creation_policy": "all",
|
|
98
|
+
"topics": [
|
|
99
|
+
"deepseek-harness",
|
|
100
|
+
"dsh",
|
|
101
|
+
"dsh-plugin"
|
|
102
|
+
],
|
|
103
|
+
"visibility": "public",
|
|
104
|
+
"forks": 0,
|
|
105
|
+
"open_issues": 0,
|
|
106
|
+
"watchers": 0,
|
|
107
|
+
"default_branch": "main",
|
|
108
|
+
"temp_clone_token": null,
|
|
109
|
+
"network_count": 0,
|
|
110
|
+
"subscribers_count": 0
|
|
111
|
+
}
|
|
112
|
+
]
|