dsh-quick-restart 0.1.3 → 0.1.4
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 +55 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,69 +2,92 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
给 **DeepSeek Harness(DSH)**
|
|
5
|
+
给 **DeepSeek Harness(DSH)** 标题栏加两个按钮:**重载插件**、**重启 DSH**。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
平时改插件代码要「完全退出客户端再打开」才生效。有了这两个按钮,大部分情况点一下就够。
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 「重载插件」到底是什么
|
|
10
10
|
|
|
11
|
-
DSH
|
|
12
|
-
这个插件在标题栏菜单栏加两个按钮,把这件事变成点一下:
|
|
11
|
+
先说清楚一件事:**DSH 的插件不是独立程序。**
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
它没有自己的 exe、没有自己的进程,而是**跑在 DSH 主进程里的一个模块**——跟主程序挤在同一个进程里。所以严格说,没有「插件程序」可以启动或停止。
|
|
14
|
+
|
|
15
|
+
**「重载」做的事**:在 DSH 还开着的前提下,把这个插件模块的缓存清掉、重新加载一次、替换掉旧的那一份。效果等于「插件这一块被拆开重建了一遍」。
|
|
16
|
+
|
|
17
|
+
**重载之后,下面这些全都不变**:
|
|
18
|
+
|
|
19
|
+
| | 重载后 |
|
|
20
|
+
|---|---|
|
|
21
|
+
| DSH 主程序 | 还在跑,没退出 |
|
|
22
|
+
| 当前对话、上下文 | 全都在 |
|
|
23
|
+
| 窗口、界面 | 不动 |
|
|
24
|
+
| 本地端口 | 不变(重启才会变) |
|
|
25
|
+
| 耗时 | 1~2 秒 |
|
|
26
|
+
|
|
27
|
+
**什么时候该点它**:你改的是插件的**服务端代码**(那些 apply()、路由、定时任务),想立刻生效又不想关程序。
|
|
28
|
+
|
|
29
|
+
**什么时候它不管用**(这两点最容易被误会):
|
|
30
|
+
|
|
31
|
+
- 改的是插件的**前端界面**(client.js、样式、按钮)→ 重载只管服务端,界面还是旧的。按一下 Ctrl + R 刷新窗口即可,不用重启。
|
|
32
|
+
- 改的是 DSH 自己的**内置插件**(@deepseek-ai/*)→ 它们在安装包的 app.asar 里,只能靠重启。
|
|
33
|
+
|
|
34
|
+
它重载的是**第三方插件**(你从市场装的、自己写的那些),逐个报结果;失败时鼠标悬停在按钮上能看到是哪个包、什么错误。
|
|
35
|
+
|
|
36
|
+
## 「重启」是另一件事
|
|
37
|
+
|
|
38
|
+
重启 = 把 DSH 整个关掉再打开。耗时十几秒,**本地端口会变**(连着的 QQ 桥接之类要重连)。装新插件、换了前端、动了内置插件,才需要它。
|
|
39
|
+
|
|
40
|
+
> 重启的引擎用的是 dsh-hot-restart(作者 xiaolu511,MIT)。它已经作为**依赖内置**在这个包里,你不需要另外安装。
|
|
16
41
|
|
|
17
42
|
## 安装
|
|
18
43
|
|
|
19
44
|
**方式一:DSH 插件市场**(推荐)
|
|
20
45
|
|
|
21
|
-
设置 → 插件 → 搜索
|
|
46
|
+
设置 → 插件 → 搜索 dsh-quick-restart → 安装 → **完全退出 DSH 再打开**(按钮是宿主启动时注入的,刷新页面出不来)。
|
|
22
47
|
|
|
23
48
|
**方式二:命令行 / 直链**
|
|
24
49
|
|
|
25
|
-
|
|
26
|
-
npm i dsh-quick-restart
|
|
27
|
-
```
|
|
50
|
+
npm i dsh-quick-restart
|
|
28
51
|
|
|
29
52
|
或把下面这个地址填进 DSH 的插件安装入口:
|
|
30
53
|
|
|
31
|
-
|
|
32
|
-
https://registry.npmjs.org/dsh-quick-restart/-/dsh-quick-restart-0.1.2.tgz
|
|
33
|
-
```
|
|
34
|
-
|
|
54
|
+
https://registry.npmjs.org/dsh-quick-restart/-/dsh-quick-restart-0.1.4.tgz
|
|
35
55
|
|
|
36
56
|
## 用起来什么效果
|
|
37
57
|
|
|
38
|
-
|
|
39
|
-
|
|
58
|
+
标题栏菜单栏(文件 / 编辑那一条的右侧)多出两个小按钮:**重载插件**、**重启**。
|
|
59
|
+
|
|
60
|
+
点「重载插件」后按钮会短暂显示结果(成功几个、失败几个);点「重启」会先弹一句确认,然后程序关闭并自动重开。
|
|
40
61
|
|
|
41
62
|
## 边界(老实说)
|
|
42
63
|
|
|
43
|
-
-
|
|
44
|
-
- **前端 bundle
|
|
45
|
-
-
|
|
46
|
-
-
|
|
64
|
+
- **只重载第三方插件**。@deepseek-ai/*(宿主内置,在 app.asar 里)和 cordis:*(虚拟分组条目)会被跳过,碰它们必然失败。
|
|
65
|
+
- **前端 bundle 不跟着换**,见上面「什么时候它不管用」。
|
|
66
|
+
- **插件自己 spawn 的子进程不受影响**。重载只管插件模块本体,插件另起的进程(比如重启助手的 vbs)不会被回收,也不会重载。
|
|
67
|
+
- **重启只在 Windows 桌面版验证过**;重载是纯 JS,理论上平台无关,但未实测。
|
|
47
68
|
|
|
48
69
|
## 卸载
|
|
49
70
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
再从 `dsh.profile.bundles` 里删掉对应条目,重启 DSH。
|
|
71
|
+
pnpm remove dsh-quick-restart
|
|
72
|
+
|
|
73
|
+
再从 dsh.profile.bundles 里删掉对应条目,重启 DSH。
|
|
54
74
|
|
|
55
75
|
## 它是怎么做的(给好奇的人)
|
|
56
76
|
|
|
57
|
-
桌面壳的
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
桌面壳的 index.html 直接读安装包里的静态 dist,不走 renderIndex,所以 webServer.tapIndex 无效。唯一可用的通道是宿主启动时**一次性收集**的 webserver/index-inject 注入表——所以插件里不能写对象级 inject = ["webServer"],否则 apply() 会推迟到 webServer 就绪之后,错过那次收集,界面上永远看不到按钮。
|
|
78
|
+
|
|
79
|
+
重载本身是:取 loader 的 entries → 清掉该包在 loader.internal.loadCache 里的模块 → 重新 import → 用新插件替换旧的 fiber。
|
|
60
80
|
|
|
61
|
-
|
|
81
|
+
重启是调用 dsh-hot-restart 的 apply()(作为依赖装在同一个包里),由它的 vbs 助手完成脱离进程树的重开。
|
|
62
82
|
|
|
63
83
|
## English (short)
|
|
64
84
|
|
|
65
|
-
**dsh-quick-restart** adds two titlebar buttons to DeepSeek Harness
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
**dsh-quick-restart** adds two titlebar buttons to DeepSeek Harness.
|
|
86
|
+
|
|
87
|
+
- **Reload**: re-imports third-party plugins **inside the running host process**. The main process, your conversation, the window and the port all stay as they are. It only replaces server-side plugin modules — front-end changes still need a window refresh (Ctrl+R), and built-in @deepseek-ai/* plugins are skipped.
|
|
88
|
+
- **Restart**: fully quits and relaunches DSH, using the dsh-hot-restart engine (bundled as a dependency, nothing extra to install).
|
|
89
|
+
|
|
90
|
+
Windows desktop only for the restart path. MIT licensed.
|
|
68
91
|
|
|
69
92
|
## License
|
|
70
93
|
|