dsh-crossterm 0.8.15 → 0.9.1
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/CHANGELOG.md +28 -0
- package/MAINTAINERS.md +18 -0
- package/README.md +14 -12
- package/cordis.patch.yml +69 -61
- package/lib/bus.js +1 -1
- package/lib/index.js +48 -1
- package/lib/restart/core.js +524 -0
- package/lib/restart/runtime.js +65 -0
- package/lib/restart/scripts/busy-check.mjs +193 -0
- package/lib/restart/scripts/countdown.html +427 -0
- package/lib/restart/scripts/dsh-restart-helper.mjs +299 -0
- package/lib/restart/scripts/get-geom.ps1 +23 -0
- package/lib/restart/scripts/rearm-watch.mjs +76 -0
- package/lib/restart/scripts/run-helper.cmd +13 -0
- package/lib/restart/scripts/topmost.ps1 +133 -0
- package/lib/restart/scripts/trigger-restart.mjs +186 -0
- package/package.json +4 -2
- package/parts/restart.manifest.json +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# dsh-crossterm 变更记录
|
|
2
2
|
|
|
3
|
+
## 0.9.1 — 2026-10-20
|
|
4
|
+
|
|
5
|
+
**修 0.9.0 的致命笔误:`cordis.patch.yml` 注释少写两个 `#`,整份 overlay 解析失败**
|
|
6
|
+
|
|
7
|
+
- 现象:升级到 0.9.0 的机器启动时 `YAMLException: end of the stream or a document separator is expected (41:1)`,
|
|
8
|
+
`dsh plugin list` 报 `Cannot validate installed package dsh-crossterm`,插件整包不加载(卡片、总线、工具全没了)。
|
|
9
|
+
- 根因:加第 ⑥ 行说明时把两行注释写成了正文(缩进 4 空格、没有 `#`),YAML 走到 `- insert:` 就认为文档已结束。
|
|
10
|
+
- 修法:这两行补回 `#`;`js-yaml` 解析校验 `insert` 共 6 行,id 依次为
|
|
11
|
+
`crossterm-ui / crossterm-session / crossterm-terminal / crossterm-device / crossterm-account / crossterm-restart`。
|
|
12
|
+
- **教训(写进发版流程)**:改完 `cordis.patch.yml` 必须真实解析一次(`js-yaml` 读一遍、看 `insert` 行数与 id),
|
|
13
|
+
光靠肉眼看注释块不够 —— 这类错误会让插件启动即失效,而且探针只测文本、测不出解析失败。
|
|
14
|
+
## 0.9.0 — 2026-10-20
|
|
15
|
+
|
|
16
|
+
**自动重启并进互通插件(插件页第 6 个组件)**
|
|
17
|
+
|
|
18
|
+
User said (m12143):“将自动重启插件变成组件融合到互通插件内,任命原会话继续负责自动重启模块,
|
|
19
|
+
不再单独发版也不负责发版,每次修改更新后向你汇报,由你上传插件新版本”
|
|
20
|
+
|
|
21
|
+
- 原 `dsh-restart` 插件(包名 `dsh-restart-module` 0.3.28)代码并入 `lib/restart/`:`core.js`(`dsh_restart` 全套动作)
|
|
22
|
+
+ `scripts/`(`trigger-restart.mjs` / `dsh-restart-helper.mjs` / `busy-check.mjs` / `rearm-watch.mjs` / UI 页面等 8 个)
|
|
23
|
+
+ `runtime.js`(`ensureRestartRuntime()` 按版本把脚本同步到运行目录)。
|
|
24
|
+
- 新组件 `parts/restart`(插件页显示「自动重启」):`cordis.patch.yml` 第 6 行 insert、`config.part: restart`;
|
|
25
|
+
它不参与总线,只把 `dsh_restart` 工具挂到每个会话上。
|
|
26
|
+
- 运行目录:`<busDir>/restart-module/`(默认 `C:\Users\<你>\.dsh\crossterm\restart-module`),
|
|
27
|
+
启动时按版本同步脚本;`logs/`、`request.json`、`result.json` 一律不动,重启记录不会因为升级丢失。
|
|
28
|
+
- 旧插件 `dsh-restart-module` 若还装着,会与本组件重复注册 `dsh_restart`,需在 profile 里摘掉。
|
|
29
|
+
- 负责人:自动重启模块由原 `dsh-restart` 会话(`a3e9f80e`,会话名「自动重启」)继续维护,不单独发版;
|
|
30
|
+
改动汇报给插件主维护会话,由主维护会话并入 `dsh-crossterm` 一起发版。
|
|
3
31
|
## 0.8.15 — 2026-10-20
|
|
4
32
|
|
|
5
33
|
**为什么发这版**:YOCE_C 从 0.8.13 点更新到 0.8.14 后回归发现,没重启前 `/status` 仍只有 `version=0.8.13`、
|
package/MAINTAINERS.md
CHANGED
|
@@ -26,6 +26,17 @@
|
|
|
26
26
|
"since": "2026-10-18T00:00:00+08:00",
|
|
27
27
|
"scope": "按负责人派活改 lib/*.js;不得改版本号、总线状态、重启、C 盘写入、AGENTS.md"
|
|
28
28
|
},
|
|
29
|
+
"modules": {
|
|
30
|
+
"restart": {
|
|
31
|
+
"session": "session-a3e9f80e-6f28-425c-9807-0b9d8b872b5e",
|
|
32
|
+
"short": "a3e9f80e",
|
|
33
|
+
"name": "自动重启",
|
|
34
|
+
"role": "自动重启模块负责人(原 dsh-restart 插件作者会话)",
|
|
35
|
+
"since": "2026-10-20",
|
|
36
|
+
"scope": "lib/restart/ 下的 core.js、runtime.js、scripts/**",
|
|
37
|
+
"rule": "不单独发版、不自己发版;改完向主维护会话(b6aa099b)汇报,由主维护并入 dsh-crossterm 发版"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
29
40
|
"previous": [
|
|
30
41
|
{
|
|
31
42
|
"session": "session-6ef6da30-a7f1-4a4e-...",
|
|
@@ -42,6 +53,13 @@
|
|
|
42
53
|
}
|
|
43
54
|
-->
|
|
44
55
|
|
|
56
|
+
## 模块负责人(大插件里的小模块,可以分工)
|
|
57
|
+
|
|
58
|
+
一份插件里可以拆给多人:模块负责人只管自己那几支文件,发版仍由插件负责人统一做。
|
|
59
|
+
|
|
60
|
+
| 模块 | 负责人 | 范围 | 规矩 |
|
|
61
|
+
|---|---|---|---|
|
|
62
|
+
| 自动重启(`lib/restart/`,插件页第 ⑥ 个组件) | `a3e9f80e`(会话名「自动重启」) | `core.js` / `runtime.js` / `scripts/**` | 不单独发版、不自己发版;改完汇报给 `b6aa099b`,由插件负责人并入 `dsh-crossterm` 一起发版 |
|
|
45
63
|
## 任期表
|
|
46
64
|
|
|
47
65
|
| 起(本地时间) | 止(本地时间) | 会话 | 终端 / nodeId | 角色 | 交接依据 |
|
package/README.md
CHANGED
|
@@ -23,28 +23,30 @@ A 终端看不到 B 终端里有哪个会话、在干什么,也没法把一条
|
|
|
23
23
|
| ③ | 跨终端 | 同一台机器上的多个 DSH 终端/进程之间互发邮件与文件 | `term_whoami` `term_list` `term_send` `term_send_files` |
|
|
24
24
|
| ④ | 跨设备 | 经云端总线,在多台机器的 DSH 之间互发邮件与文件 | `term_cloud` |
|
|
25
25
|
| ⑤ | 跨账号 | 预留位:后续用于跨账号互通,当前不挂工具 | — |
|
|
26
|
+
| ⑥ | 自动重启 | 改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 `dsh-restart` 插件,0.9.0 起并入) | `dsh_restart` |
|
|
26
27
|
|
|
27
28
|
> 入口行为什么必须用裸包名:浏览器 client 半端只对裸包名行生效(`dsh-client-modules` 的
|
|
28
29
|
> `locatePkgJson()` 对子路径行返回 undefined),而插件页顶部标题与这一行共用同一份 `locale/zh.json` 的 meta,
|
|
29
30
|
> 所以它单独做入口(配置卡片 + 自动更新开关),标题带「(自更新)」;卡片头用 `shortTitle` 显示短名「跨端互通」。
|
|
30
31
|
|
|
31
|
-
**本版更新(0.
|
|
32
|
+
**本版更新(0.9.1)**
|
|
32
33
|
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
- 本机是 `link:` 源码版,没有这层差别;以上对用 npm 安装的设备生效。
|
|
34
|
+
- **修 0.9.0 的启动即失效**:`cordis.patch.yml` 里第 ⑥ 行的两行说明漏了开头的 `#`,
|
|
35
|
+
整份 overlay 解析失败,插件整包不加载(卡片、总线、工具全没有)。0.9.1 补回注释符;
|
|
36
|
+
发版流程加了一条硬规矩:**改完 `cordis.patch.yml` 必须用 `js-yaml` 真解析一次,核对 `insert` 行数与 id**。
|
|
37
|
+
- 0.9.0 的 npm 包与安装 zip 都带这份坏 YAML,请直接装 0.9.1。
|
|
38
38
|
|
|
39
|
-
**上一版(0.
|
|
39
|
+
**上一版(0.9.0)**
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
41
|
+
- **自动重启并进来当第 6 个组件**:原 `dsh-restart` 插件的 `dsh_restart` 工具与 8 个 helper 脚本并入 `lib/restart/`,
|
|
42
|
+
插件页多一行「自动重启」;脚本首次启动时同步到 `<总线目录>/restart-module/`(默认 `C:\Users\<你>\.dsh\crossterm\restart-module`)。
|
|
43
|
+
- 该模块不参与总线,只往每个会话挂 `dsh_restart`;由原 `dsh-restart` 会话(`a3e9f80e`,会话名「自动重启」)继续维护,
|
|
44
|
+
**不再单独发版**,改完报主维护会话、由主维护会话并入本插件一起发。
|
|
45
|
+
- 旧的 `dsh-restart-module` 插件若还装着会重复注册 `dsh_restart`,需在 profile 里摘掉。
|
|
45
46
|
|
|
46
|
-
**更早(0.8.13 / 0.8.12 / 0.8.11 / 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7 / 0.8.6 / 0.8.5 / 0.8.0)**
|
|
47
|
+
**更早(0.8.14 / 0.8.13 / 0.8.12 / 0.8.11 / 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7 / 0.8.6 / 0.8.5 / 0.8.0)**
|
|
47
48
|
|
|
49
|
+
- 0.8.14:装完未重启时卡片显示「待重启」、更新按钮变灰「已装待重启」,`/check` 回 `needRestart=true`。
|
|
48
50
|
- 0.8.13:已经是最新就不装;没写收件人的信优先投给 `MAINTAINERS.md` 里的维护者会话。
|
|
49
51
|
- 0.8.12 / 0.8.11:修「点更新必定失败」(pnpm 不认 `--prefer-online`)、装低自动回滚、最新版取两个源的最大值。
|
|
50
52
|
- 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7:云端设备只列别人、带权限与状态、版本仅在差异时显示;插件页标题改「跨端互通(自更新)」;
|
package/cordis.patch.yml
CHANGED
|
@@ -1,61 +1,69 @@
|
|
|
1
|
-
# ============================================================================
|
|
2
|
-
# dsh-crossterm —— DSH bundle patch
|
|
3
|
-
# ============================================================================
|
|
4
|
-
# 安装(本地目录,对每个要互通的 profile 各装一次):
|
|
5
|
-
# dsh plugin --profile desktop add link:F:\dsh\001X\dsh-crossterm
|
|
6
|
-
# dsh plugin --profile web add link:F:\dsh\001X\dsh-crossterm
|
|
7
|
-
# 卸载:
|
|
8
|
-
# dsh plugin --profile desktop remove dsh-crossterm
|
|
9
|
-
#
|
|
10
|
-
# 每个 insert 行在 DSH「插件 → 跨端互通 → 包含的组件」里是一行组件,可单独开关。
|
|
11
|
-
# 五行指向同一个包,只是走不同子路径 / 不同 config.part:
|
|
12
|
-
#
|
|
13
|
-
# ① dsh-crossterm 自更新(入口):插件页标题/简介/配置卡片,不挂任何工具
|
|
14
|
-
# (config.part: ui)。0.8.9 起它不再是总开关 —— 关掉它只失去
|
|
15
|
-
# 卡片与「自动更新」,下面四个组件照常跑。
|
|
16
|
-
# 自动更新默认关,开关在卡片里,值落 config.json 的 autoUpdate。
|
|
17
|
-
# ② dsh-crossterm/parts/session 跨会话:term_link / term_unlink / term_broadcast / term_inbox / term_config
|
|
18
|
-
# ③ dsh-crossterm/parts/terminal 跨终端:term_whoami / term_list / term_send / term_send_files
|
|
19
|
-
# ④ dsh-crossterm/parts/device 跨设备:term_cloud(云端总线同步)
|
|
20
|
-
# ⑤ dsh-crossterm/parts/account 跨账号:预留占位,暂不挂工具
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
# ============================================================================
|
|
2
|
+
# dsh-crossterm —— DSH bundle patch
|
|
3
|
+
# ============================================================================
|
|
4
|
+
# 安装(本地目录,对每个要互通的 profile 各装一次):
|
|
5
|
+
# dsh plugin --profile desktop add link:F:\dsh\001X\dsh-crossterm
|
|
6
|
+
# dsh plugin --profile web add link:F:\dsh\001X\dsh-crossterm
|
|
7
|
+
# 卸载:
|
|
8
|
+
# dsh plugin --profile desktop remove dsh-crossterm
|
|
9
|
+
#
|
|
10
|
+
# 每个 insert 行在 DSH「插件 → 跨端互通 → 包含的组件」里是一行组件,可单独开关。
|
|
11
|
+
# 五行指向同一个包,只是走不同子路径 / 不同 config.part:
|
|
12
|
+
#
|
|
13
|
+
# ① dsh-crossterm 自更新(入口):插件页标题/简介/配置卡片,不挂任何工具
|
|
14
|
+
# (config.part: ui)。0.8.9 起它不再是总开关 —— 关掉它只失去
|
|
15
|
+
# 卡片与「自动更新」,下面四个组件照常跑。
|
|
16
|
+
# 自动更新默认关,开关在卡片里,值落 config.json 的 autoUpdate。
|
|
17
|
+
# ② dsh-crossterm/parts/session 跨会话:term_link / term_unlink / term_broadcast / term_inbox / term_config
|
|
18
|
+
# ③ dsh-crossterm/parts/terminal 跨终端:term_whoami / term_list / term_send / term_send_files
|
|
19
|
+
# ④ dsh-crossterm/parts/device 跨设备:term_cloud(云端总线同步)
|
|
20
|
+
# ⑤ dsh-crossterm/parts/account 跨账号:预留占位,暂不挂工具
|
|
21
|
+
# ⑥ dsh-crossterm/parts/restart 自动重启:dsh_restart(原 dsh-restart 插件,0.9.0 起并入)
|
|
22
|
+
# 它不碰总线,只把 dsh_restart 工具挂到每个会话上。
|
|
23
|
+
#
|
|
24
|
+
# 组件名来自 package.json 的 exports 映射:
|
|
25
|
+
# "./parts/session/package.json" -> "./parts/session.manifest.json"
|
|
26
|
+
# 每个组件显示自己的中文名,实际加载的仍是 lib/index.js,靠 config.part 决定挂哪组工具。
|
|
27
|
+
#
|
|
28
|
+
# 为什么入口行必须用「裸包名」:浏览器的 client 半端只对裸包名行生效
|
|
29
|
+
# (dsh-client-modules 的 locatePkgJson 对子路径行直接返回 undefined),而插件页顶部标题
|
|
30
|
+
# 与裸包名行共用同一份 locale/zh.json 的 meta —— 所以裸包名行单独做入口(卡片 + 自动更新),
|
|
31
|
+
# 标题写「跨端互通(自更新)」,四个业务组件排在它后面、名字仍是跨会话/跨终端/跨设备/跨账号。
|
|
32
|
+
#
|
|
33
|
+
# 0.8.9 起五个组件互不依赖:谁都不用 provide/inject 别人,各挂各的工具与开销。
|
|
34
|
+
# 关掉入口行只失去「配置卡片 + 自动更新」,四个业务组件照常工作、各自仍可单独关。
|
|
35
|
+
# 之前(0.7.x–0.8.8)是 ui 行 provide('crossterm')、其余四行 inject 它,关入口会连坐——已废弃。
|
|
36
|
+
#
|
|
37
|
+
# 前五个组件在同一 DSH 进程里共用一份总线实例(自动重启不参与,它只挂自己的工具):心跳只起一次,云同步只在 device 组件启用
|
|
38
|
+
# 且 config.json 里 cloudEnabled=true 时才跑。安装/改动后需重启对应的 DSH 进程。
|
|
39
|
+
# ============================================================================
|
|
40
|
+
|
|
41
|
+
- insert:
|
|
42
|
+
- id: crossterm-ui
|
|
43
|
+
# 入口(自更新):裸包名,浏览器半端的配置卡片 + 插件页标题/简介 + 「自动更新」开关。
|
|
44
|
+
# 关掉这一行只失去卡片与自动更新,四个业务组件不受影响;它自己不挂工具。
|
|
45
|
+
name: dsh-crossterm
|
|
46
|
+
config:
|
|
47
|
+
part: ui
|
|
48
|
+
- id: crossterm-session
|
|
49
|
+
name: dsh-crossterm/parts/session
|
|
50
|
+
config:
|
|
51
|
+
part: session
|
|
52
|
+
- id: crossterm-terminal
|
|
53
|
+
name: dsh-crossterm/parts/terminal
|
|
54
|
+
config:
|
|
55
|
+
part: terminal
|
|
56
|
+
- id: crossterm-device
|
|
57
|
+
name: dsh-crossterm/parts/device
|
|
58
|
+
config:
|
|
59
|
+
part: device
|
|
60
|
+
- id: crossterm-account
|
|
61
|
+
name: dsh-crossterm/parts/account
|
|
62
|
+
config:
|
|
63
|
+
part: account
|
|
64
|
+
- id: crossterm-restart
|
|
65
|
+
# 自动重启(原 dsh-restart 插件):不参与总线,只挂 dsh_restart 工具。
|
|
66
|
+
# helper 脚本随包分发在 lib/restart/scripts/,启动时复制到 <busDir>/restart-module/。
|
|
67
|
+
name: dsh-crossterm/parts/restart
|
|
68
|
+
config:
|
|
69
|
+
part: restart
|
package/lib/bus.js
CHANGED
|
@@ -23,7 +23,7 @@ import path from 'node:path'
|
|
|
23
23
|
import crypto from 'node:crypto'
|
|
24
24
|
import { rotateIfNeeded } from './logs.js'
|
|
25
25
|
|
|
26
|
-
export const VERSION = '0.
|
|
26
|
+
export const VERSION = '0.9.1'
|
|
27
27
|
|
|
28
28
|
/** DSH 的家目录:与宿主其它状态(sessions / profiles)同一个根,多终端天然共享 */
|
|
29
29
|
export function dshHome() {
|
package/lib/index.js
CHANGED
|
@@ -42,6 +42,7 @@ import { runSetup } from './cloud/setup.js'
|
|
|
42
42
|
import { deviceRow, matchDevice } from './cloud/match.js'
|
|
43
43
|
import { registerWeb, selfUpdate } from './web.js'
|
|
44
44
|
import { recordOwnership, readMaintainersDoc } from './logs.js'
|
|
45
|
+
import { ensureRestartRuntime } from './restart/runtime.js'
|
|
45
46
|
|
|
46
47
|
const PLUGIN = 'dsh-crossterm'
|
|
47
48
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
@@ -1511,7 +1512,7 @@ const TOOL_PART = {
|
|
|
1511
1512
|
term_cloud: 'device',
|
|
1512
1513
|
}
|
|
1513
1514
|
|
|
1514
|
-
const PARTS = ['all', 'ui', 'session', 'terminal', 'device', 'account']
|
|
1515
|
+
const PARTS = ['all', 'ui', 'session', 'terminal', 'device', 'account', 'restart']
|
|
1515
1516
|
|
|
1516
1517
|
const PART_LABEL = {
|
|
1517
1518
|
all: '全部组件',
|
|
@@ -1520,6 +1521,7 @@ const PART_LABEL = {
|
|
|
1520
1521
|
terminal: '跨终端',
|
|
1521
1522
|
device: '跨设备',
|
|
1522
1523
|
account: '跨账号(预留)',
|
|
1524
|
+
restart: '自动重启',
|
|
1523
1525
|
}
|
|
1524
1526
|
|
|
1525
1527
|
function normalizePart(raw) {
|
|
@@ -2079,10 +2081,55 @@ function releaseTerm(term) {
|
|
|
2079
2081
|
|
|
2080
2082
|
// ── 入口 ──────────────────────────────────────────────────────────────────
|
|
2081
2083
|
|
|
2084
|
+
const RESTART_SRC = path.join(ROOT, 'lib', 'restart', 'scripts')
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* 「自动重启」组件(原 dsh-restart 插件,0.9.0 起并入)。
|
|
2088
|
+
*
|
|
2089
|
+
* 它不参与总线:只把 dsh_restart 工具挂到每个会话上,并把 helper 脚本复制到
|
|
2090
|
+
* 可写目录后交给 ./restart/core.js。脚本必须在 import core.js **之前**落到
|
|
2091
|
+
* DSH_RESTART_MODULE_DIR,因为 core.js 在模块顶层读这个环境变量。
|
|
2092
|
+
*/
|
|
2093
|
+
function mountRestart(root, config) {
|
|
2094
|
+
const label = 'dsh-crossterm(自动重启)'
|
|
2095
|
+
let destDir = ''
|
|
2096
|
+
const mark = (line) => {
|
|
2097
|
+
const text = `[${new Date().toISOString()}] ${label}: ${line}\n`
|
|
2098
|
+
try {
|
|
2099
|
+
if (destDir) {
|
|
2100
|
+
const dir = path.join(destDir, 'logs')
|
|
2101
|
+
fs.mkdirSync(dir, { recursive: true })
|
|
2102
|
+
fs.appendFileSync(path.join(dir, 'plugin.log'), text)
|
|
2103
|
+
}
|
|
2104
|
+
} catch { /* ignore */ }
|
|
2105
|
+
}
|
|
2106
|
+
try {
|
|
2107
|
+
const cfg = readConfig()
|
|
2108
|
+
destDir = path.join(cfg.busDir, 'restart-module')
|
|
2109
|
+
const info = ensureRestartRuntime({ srcDir: RESTART_SRC, destDir, version: VERSION })
|
|
2110
|
+
if (info.skipped.length) mark(`脚本缺失:${info.skipped.join(', ')}`)
|
|
2111
|
+
if (!process.env.DSH_RESTART_MODULE_DIR) process.env.DSH_RESTART_MODULE_DIR = destDir
|
|
2112
|
+
mark(`运行目录就绪:${destDir}(本次复制 ${info.copied.length} 个脚本)`)
|
|
2113
|
+
void import('./restart/core.js')
|
|
2114
|
+
.then((mod) => {
|
|
2115
|
+
mod.default.apply(root, { ...config, part: 'restart' })
|
|
2116
|
+
mark('已挂载 dsh_restart 工具')
|
|
2117
|
+
})
|
|
2118
|
+
.catch((e) => mark(`加载失败:${(e && e.message) || String(e)}`))
|
|
2119
|
+
} catch (e) {
|
|
2120
|
+
mark(`启动失败:${(e && e.message) || String(e)}`)
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2082
2124
|
export default {
|
|
2083
2125
|
name: PLUGIN,
|
|
2084
2126
|
apply(root, config) {
|
|
2085
2127
|
const part = normalizePart(config?.part)
|
|
2128
|
+
// 「自动重启」是独立组件:不碰总线,只挂 dsh_restart 工具。
|
|
2129
|
+
if (part === 'restart') {
|
|
2130
|
+
mountRestart(root, config)
|
|
2131
|
+
return
|
|
2132
|
+
}
|
|
2086
2133
|
// 0.8.9 起「入口」组件不再当总开关:它只负责插件卡片与「自动更新」,
|
|
2087
2134
|
// 四个业务组件(跨会话/跨终端/跨设备/跨账号)各挂各的 —— 关掉入口行不会连坐。
|
|
2088
2135
|
// 自动更新默认关(cfg.autoUpdate=false),开关在卡片里,改了落 config.json。
|