dsh-crossterm 0.9.1 → 0.9.3
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 +26 -0
- package/MAINTAINERS.md +48 -5
- package/README.md +23 -23
- package/client/client.js +7 -1
- package/components/account/manifest.json +5 -0
- package/components/device/manifest.json +5 -0
- package/{lib → components}/restart/core.js +1 -1
- package/{parts/restart.manifest.json → components/restart/manifest.json} +2 -1
- package/{lib → components}/restart/scripts/countdown.html +2 -1
- package/{lib → components}/restart/scripts/rearm-watch.mjs +3 -0
- package/components/session/manifest.json +5 -0
- package/components/terminal/manifest.json +5 -0
- package/components/ui/manifest.json +5 -0
- package/cordis.patch.yml +15 -14
- package/lib/bus.js +1 -1
- package/lib/index.js +4 -4
- package/lib/web.js +6 -3
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +16 -14
- package/parts/account.manifest.json +0 -4
- package/parts/device.manifest.json +0 -4
- package/parts/session.manifest.json +0 -4
- package/parts/terminal.manifest.json +0 -4
- /package/{lib → components}/restart/runtime.js +0 -0
- /package/{lib → components}/restart/scripts/busy-check.mjs +0 -0
- /package/{lib → components}/restart/scripts/dsh-restart-helper.mjs +0 -0
- /package/{lib → components}/restart/scripts/get-geom.ps1 +0 -0
- /package/{lib → components}/restart/scripts/run-helper.cmd +0 -0
- /package/{lib → components}/restart/scripts/topmost.ps1 +0 -0
- /package/{lib → components}/restart/scripts/trigger-restart.mjs +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
## 0.9.3 — 2026-10-20
|
|
2
|
+
|
|
3
|
+
修 0.9.2 的两处显示缺陷(代码逻辑没变,只动 `GET /crossterm/api/about` 与 ui 组件清单):
|
|
4
|
+
|
|
5
|
+
- **组件表漏了第 ⑥ 个**:`lib/web.js` 的 `PART_ORDER` 还停在四个业务组件,自动重启没进 `/about.components`,卡片「包含的组件」里看不到它。补 `restart`。
|
|
6
|
+
- **入口组件名字是 "ui"**:`components/ui/manifest.json` 的 `name` 没写人读文案。改成「跨端互通(入口)」,并补一句简介。
|
|
7
|
+
- `PART_ORDER` 现在按插件页顺序给六个组件:入口、跨会话、跨终端、跨设备、跨账号、自动重启;每个都带 `version`。
|
|
8
|
+
- **组件版本号按新规矩各升各的**:这次只动 ui 组件 → `components/ui/manifest.json` 0.9.2 → 0.9.3;其余五个仍是 0.9.2,自动重启仍是 0.3.28。
|
|
9
|
+
|
|
10
|
+
## 0.9.2 — 2026-10-20
|
|
11
|
+
|
|
12
|
+
**组件拆成目录 + 每个组件有自己的版本号**(User said:组件文件分开存放、插件页每个组件显示版本、改到哪个组件就升哪个)。
|
|
13
|
+
|
|
14
|
+
- 目录结构:每个组件一个目录 `components/<part>/`,内含 `manifest.json`(`name` / `description` / `version`)与自己的代码;
|
|
15
|
+
原 `parts/<part>.manifest.json` 与 `lib/restart/` 全部迁入,`parts/` 删除。
|
|
16
|
+
`components/restart/` 里是 `core.js` / `runtime.js` / `scripts/`(原 `dsh-restart` 的 8 个 helper)。
|
|
17
|
+
- 组件版本号:`ui` / `session` / `terminal` / `device` / `account` 记 `0.9.2`,`restart` 记 `0.3.28`(沿用并入时那版代码)。
|
|
18
|
+
规则:只在该组件自己的文件改动时升它的版本号,跟着插件一起发版;插件总版本仍按发版技能三分位判定。
|
|
19
|
+
- 插件页:`GET /crossterm/api/about` 的 `components[]` 增 `version`,卡片「包含的组件」显示「名称 vX.Y.Z」;
|
|
20
|
+
更新说明表格加「组件版本」列(`make-release-notes.mjs` 从 `components/<part>/manifest.json` 读)。
|
|
21
|
+
- 接线:`cordis.patch.yml` 五行 `name` 改 `dsh-crossterm/components/<part>`,`package.json` 的 `exports` 同步
|
|
22
|
+
(`./components/<part>` → `./lib/index.js`、`./components/<part>/package.json` → `./components/<part>/manifest.json`);
|
|
23
|
+
`files` 用 `components` 取代 `parts`。
|
|
24
|
+
- 清理:删掉 profile `node_modules` 里指向 `F:\dsh\001X\dsh-restart` 的两个旧 junction(`dsh-restart`、`dsh-restart-module`)。
|
|
25
|
+
- 升级后需重启 DSH;已装 0.9.1 的机器点卡片「更新」即可。
|
|
26
|
+
|
|
1
27
|
# dsh-crossterm 变更记录
|
|
2
28
|
|
|
3
29
|
## 0.9.1 — 2026-10-20
|
package/MAINTAINERS.md
CHANGED
|
@@ -27,14 +27,49 @@
|
|
|
27
27
|
"scope": "按负责人派活改 lib/*.js;不得改版本号、总线状态、重启、C 盘写入、AGENTS.md"
|
|
28
28
|
},
|
|
29
29
|
"modules": {
|
|
30
|
+
"ui": {
|
|
31
|
+
"session": "session-b6aa099b-cfa6-42b7-961c-10f720236219",
|
|
32
|
+
"short": "b6aa099b",
|
|
33
|
+
"role": "入口/自更新组件负责人(= 插件负责人)",
|
|
34
|
+
"since": "2026-10-20",
|
|
35
|
+
"scope": "components/ui/**、client/**、lib/web.js 的卡片与自动更新、locale/**"
|
|
36
|
+
},
|
|
37
|
+
"session": {
|
|
38
|
+
"session": "session-b6aa099b-cfa6-42b7-961c-10f720236219",
|
|
39
|
+
"short": "b6aa099b",
|
|
40
|
+
"role": "跨会话组件负责人(= 插件负责人)",
|
|
41
|
+
"since": "2026-10-20",
|
|
42
|
+
"scope": "components/session/**、lib/bus.js 的链/邮件/收件箱"
|
|
43
|
+
},
|
|
44
|
+
"terminal": {
|
|
45
|
+
"session": "session-b6aa099b-cfa6-42b7-961c-10f720236219",
|
|
46
|
+
"short": "b6aa099b",
|
|
47
|
+
"role": "跨终端组件负责人(= 插件负责人)",
|
|
48
|
+
"since": "2026-10-20",
|
|
49
|
+
"scope": "components/terminal/**、本机 presence / term_send / term_send_files"
|
|
50
|
+
},
|
|
51
|
+
"device": {
|
|
52
|
+
"session": "session-b6aa099b-cfa6-42b7-961c-10f720236219",
|
|
53
|
+
"short": "b6aa099b",
|
|
54
|
+
"role": "跨设备组件负责人(= 插件负责人)",
|
|
55
|
+
"since": "2026-10-20",
|
|
56
|
+
"scope": "components/device/**、lib/cloud/**(中转站、备份、layout)"
|
|
57
|
+
},
|
|
58
|
+
"account": {
|
|
59
|
+
"session": "session-b6aa099b-cfa6-42b7-961c-10f720236219",
|
|
60
|
+
"short": "b6aa099b",
|
|
61
|
+
"role": "跨账号组件负责人(= 插件负责人,预留位)",
|
|
62
|
+
"since": "2026-10-20",
|
|
63
|
+
"scope": "components/account/**(目前无代码)"
|
|
64
|
+
},
|
|
30
65
|
"restart": {
|
|
31
66
|
"session": "session-a3e9f80e-6f28-425c-9807-0b9d8b872b5e",
|
|
32
67
|
"short": "a3e9f80e",
|
|
33
68
|
"name": "自动重启",
|
|
34
69
|
"role": "自动重启模块负责人(原 dsh-restart 插件作者会话)",
|
|
35
70
|
"since": "2026-10-20",
|
|
36
|
-
"scope": "
|
|
37
|
-
"rule": "不单独发版、不自己发版;改完向主维护会话(b6aa099b)汇报,由主维护并入 dsh-crossterm
|
|
71
|
+
"scope": "components/restart/ 下的 core.js、runtime.js、scripts/**",
|
|
72
|
+
"rule": "不单独发版、不自己发版;改完向主维护会话(b6aa099b)汇报,由主维护并入 dsh-crossterm 发版;只改 components/restart/** 时把它的组件版本号(现 0.3.28)加一"
|
|
38
73
|
}
|
|
39
74
|
},
|
|
40
75
|
"previous": [
|
|
@@ -57,9 +92,17 @@
|
|
|
57
92
|
|
|
58
93
|
一份插件里可以拆给多人:模块负责人只管自己那几支文件,发版仍由插件负责人统一做。
|
|
59
94
|
|
|
60
|
-
|
|
|
61
|
-
|
|
62
|
-
|
|
|
95
|
+
| 组件(插件页顺序) | 当前版本 | 负责人 | 范围 | 规矩 |
|
|
96
|
+
|---|---|---|---|---|
|
|
97
|
+
| ① 跨端互通(自更新) | v0.9.2 | `b6aa099b` | `components/ui/**`、`client/**`、`locale/**`、`lib/web.js` | 组件版本号在 `components/ui/manifest.json` |
|
|
98
|
+
| ② 跨会话 | v0.9.2 | `b6aa099b` | `components/session/**`、`lib/bus.js` 的链/邮件 | 同上 |
|
|
99
|
+
| ③ 跨终端 | v0.9.2 | `b6aa099b` | `components/terminal/**`、presence / `term_send` | 同上 |
|
|
100
|
+
| ④ 跨设备 | v0.9.2 | `b6aa099b` | `components/device/**`、`lib/cloud/**` | 同上 |
|
|
101
|
+
| ⑤ 跨账号 | v0.9.2 | `b6aa099b` | `components/account/**`(预留) | 同上 |
|
|
102
|
+
| ⑥ 自动重启 | v0.3.28 | `a3e9f80e`(会话名「自动重启」) | `components/restart/**`(`core.js` / `runtime.js` / `scripts/**`) | 不单独发版、不自己发版;改完汇报 `b6aa099b`,由插件负责人并入 `dsh-crossterm` 发版;只动它就把它的版本号加一 |
|
|
103
|
+
|
|
104
|
+
**组件版本号怎么升**:只在该组件自己的文件改动时升它(在 `components/<part>/manifest.json` 的 `version`),
|
|
105
|
+
跟着插件一起发版;插件总版本仍按发版技能的三分位规则。插件页与 `GET /crossterm/api/about` 的 `components[].version` 读的就是这里。
|
|
63
106
|
## 任期表
|
|
64
107
|
|
|
65
108
|
| 起(本地时间) | 止(本地时间) | 会话 | 终端 / nodeId | 角色 | 交接依据 |
|
package/README.md
CHANGED
|
@@ -14,43 +14,43 @@ A 终端看不到 B 终端里有哪个会话、在干什么,也没法把一条
|
|
|
14
14
|
|
|
15
15
|
**插件名称**:`dsh-crossterm`(插件页显示 **跨端互通(自更新)**)| **插件简介**:同一 DSH 账号下的会话、终端、设备之间互通 —— 特征码链、内联邮件、云端中转站与自动备份。
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
**组件列表(插件页第一个是入口/自更新,后面五个是业务组件;名称、简介、版本号来自各自的 `components/<part>/manifest.json`)**
|
|
18
18
|
|
|
19
|
-
| 顺序 | 组件名称 | 作用 | 工具 |
|
|
20
|
-
|
|
21
|
-
| ① |
|
|
22
|
-
| ② | 跨会话 | 同一终端里的多个会话之间互通:特征码链、内联邮件、收件箱 | `term_link` `term_unlink` `term_broadcast` `term_inbox` `term_config` |
|
|
23
|
-
| ③ | 跨终端 | 同一台机器上的多个 DSH 终端/进程之间互发邮件与文件 | `term_whoami` `term_list` `term_send` `term_send_files` |
|
|
24
|
-
| ④ | 跨设备 |
|
|
25
|
-
| ⑤ | 跨账号 | 预留位:后续用于跨账号互通,当前不挂工具 | — |
|
|
26
|
-
| ⑥ | 自动重启 | 改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 `dsh-restart` 插件,0.9.0 起并入) | `dsh_restart` |
|
|
19
|
+
| 顺序 | 组件名称 | 版本 | 作用 | 工具 |
|
|
20
|
+
|---|---|---|---|---|
|
|
21
|
+
| ① | 跨端互通(入口/自更新) | v0.9.3 | 自更新开关:打开后定期检查 npm 新版本并自动安装(默认关;装完要重启 DSH 生效)。关掉它只失去卡片与自动更新,下面五个组件照常工作。裸包名行,承载插件标题/简介与配置卡片,不挂工具 | — |
|
|
22
|
+
| ② | 跨会话 | v0.9.2 | 同一终端里的多个会话之间互通:特征码链、内联邮件、收件箱 | `term_link` `term_unlink` `term_broadcast` `term_inbox` `term_config` |
|
|
23
|
+
| ③ | 跨终端 | v0.9.2 | 同一台机器上的多个 DSH 终端/进程之间互发邮件与文件 | `term_whoami` `term_list` `term_send` `term_send_files` |
|
|
24
|
+
| ④ | 跨设备 | v0.9.2 | 经云端中转站,在多台机器的 DSH 之间互发邮件与文件 | `term_cloud` |
|
|
25
|
+
| ⑤ | 跨账号 | v0.9.2 | 预留位:后续用于跨账号互通,当前不挂工具 | — |
|
|
26
|
+
| ⑥ | 自动重启 | v0.3.28 | 改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 `dsh-restart` 插件,0.9.0 起并入) | `dsh_restart` |
|
|
27
27
|
|
|
28
28
|
> 入口行为什么必须用裸包名:浏览器 client 半端只对裸包名行生效(`dsh-client-modules` 的
|
|
29
29
|
> `locatePkgJson()` 对子路径行返回 undefined),而插件页顶部标题与这一行共用同一份 `locale/zh.json` 的 meta,
|
|
30
30
|
> 所以它单独做入口(配置卡片 + 自动更新开关),标题带「(自更新)」;卡片头用 `shortTitle` 显示短名「跨端互通」。
|
|
31
|
+
>
|
|
32
|
+
> 组件版本号怎么升:**只在该组件自己的文件改动时升它**,跟着插件一起发版(例:只改自动重启 → `components/restart` 的 `0.3.28` → `0.3.29`,其余五个不动)。插件总版本仍按发版技能的三分位规则。
|
|
31
33
|
|
|
32
|
-
**本版更新(0.9.
|
|
34
|
+
**本版更新(0.9.3)**
|
|
33
35
|
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- 0.9.0 的 npm 包与安装 zip 都带这份坏 YAML,请直接装 0.9.1。
|
|
36
|
+
- **组件表补全**:`GET /crossterm/api/about` 的 `components` 现在按插件页顺序给六个组件 —— 入口、跨会话、跨终端、跨设备、跨账号、自动重启,每个都带 `version`;卡片「包含的组件」不会再漏掉自动重启。
|
|
37
|
+
- **入口组件的名字**:`components/ui/manifest.json` 的 `name` 从 `ui` 改成「跨端互通(入口)」,并补了简介。
|
|
38
|
+
- **组件版本号各升各的**(新规矩第一次落地):这次只改 ui 组件,所以只有它 0.9.2 → 0.9.3;其余五个仍是 0.9.2,自动重启仍是 0.3.28。
|
|
38
39
|
|
|
39
|
-
**上一版(0.9.
|
|
40
|
+
**上一版(0.9.2)**
|
|
40
41
|
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
- 旧的 `dsh-restart-module` 插件若还装着会重复注册 `dsh_restart`,需在 profile 里摘掉。
|
|
42
|
+
- **组件分目录存放**:`components/<part>/` 各放各的 `manifest.json` 与代码,`parts/` 删除;原 `lib/restart/` 整体搬进 `components/restart/`。
|
|
43
|
+
- **每个组件有独立版本号**:插件页与更新说明都显示「名称 vX.Y.Z」,方便看清这次改的是哪个组件、由谁维护。
|
|
44
|
+
- **组件维护分出去**:`MAINTAINERS.md` 的 `modules` 段记录每个组件的负责人;自动重启 = `a3e9f80e`,其余由主维护会话 `b6aa099b` 负责。
|
|
45
|
+
- 兼容:`cordis.patch.yml` 的 `name` 改为 `dsh-crossterm/components/<part>`,`exports` 同步;升级后重启 DSH 生效。
|
|
46
46
|
|
|
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
|
+
**更早(0.9.0 / 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)**
|
|
48
48
|
|
|
49
|
+
- 0.9.0:自动重启并进来当第 6 个组件(`dsh_restart` + 8 个 helper 脚本),由原 `dsh-restart` 会话继续维护、不再单独发版。
|
|
49
50
|
- 0.8.14:装完未重启时卡片显示「待重启」、更新按钮变灰「已装待重启」,`/check` 回 `needRestart=true`。
|
|
50
51
|
- 0.8.13:已经是最新就不装;没写收件人的信优先投给 `MAINTAINERS.md` 里的维护者会话。
|
|
51
52
|
- 0.8.12 / 0.8.11:修「点更新必定失败」(pnpm 不认 `--prefer-online`)、装低自动回滚、最新版取两个源的最大值。
|
|
52
|
-
- 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7
|
|
53
|
-
入口组件从「总开关」改为「自更新开关」,四个业务组件互不依赖。
|
|
53
|
+
- 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7:云端设备只列别人、带权限与状态、版本仅在差异时显示;插件页标题改「跨端互通(自更新)」;入口组件从「总开关」改为「自更新开关」。
|
|
54
54
|
- 0.8.5:负责人留痕 `MAINTAINERS.md`、运行日志可轮转、卡片「维护者」行与「运行日志」按钮。
|
|
55
55
|
- 0.8.0 安全加固:附件名净化 + 越界校验、写接口要 `x-crossterm-token`、信封 HMAC 签名、入站限额、按 id 去重。
|
|
56
56
|
|
package/client/client.js
CHANGED
|
@@ -83,6 +83,7 @@ window.__ModuleLoader__.load({
|
|
|
83
83
|
comp: { display: "grid", gridTemplateColumns: "max-content 1fr", gap: "4px 12px" },
|
|
84
84
|
compName: { fontWeight: 600 },
|
|
85
85
|
compDesc: { opacity: 0.75, lineHeight: 1.5 },
|
|
86
|
+
compVer: { opacity: 0.55, fontSize: "11px", marginLeft: "2px" },
|
|
86
87
|
log: {
|
|
87
88
|
whiteSpace: "pre-wrap",
|
|
88
89
|
fontSize: 11.5,
|
|
@@ -526,7 +527,12 @@ window.__ModuleLoader__.load({
|
|
|
526
527
|
h(
|
|
527
528
|
React.Fragment,
|
|
528
529
|
{ key: c.part },
|
|
529
|
-
h(
|
|
530
|
+
h(
|
|
531
|
+
"div",
|
|
532
|
+
{ style: S.compName },
|
|
533
|
+
c.name,
|
|
534
|
+
c.version ? h("span", { style: S.compVer }, " v" + c.version) : null,
|
|
535
|
+
),
|
|
530
536
|
h("div", { style: S.compDesc }, c.description || "—"),
|
|
531
537
|
),
|
|
532
538
|
),
|
|
@@ -27,7 +27,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
27
27
|
const PKG_ROOT = path.dirname(path.dirname(path.dirname(fileURLToPath(import.meta.url))))
|
|
28
28
|
// 源码里脚本在 lib/restart/scripts/;运行时由 lib/index.js 复制到可写目录,
|
|
29
29
|
// 再用 DSH_RESTART_MODULE_DIR 指过来(request.json 与 logs 都写在那个目录)。
|
|
30
|
-
export const SRC_DIR = path.join(PKG_ROOT, '
|
|
30
|
+
export const SRC_DIR = path.join(PKG_ROOT, 'components', 'restart', 'scripts')
|
|
31
31
|
const MODULE_DIR = process.env.DSH_RESTART_MODULE_DIR || SRC_DIR
|
|
32
32
|
const TRIGGER = path.join(MODULE_DIR, 'trigger-restart.mjs')
|
|
33
33
|
const LOG_DIR = path.join(MODULE_DIR, 'logs')
|
|
@@ -313,7 +313,8 @@ function fitWindow() {
|
|
|
313
313
|
try { if (fso.FileExists(REQ)) fso.DeleteFile(REQ, true); } catch (e) {}
|
|
314
314
|
dbg("checkpoint " + tag + " busy -> cancel + background: " + JSON.stringify(busy));
|
|
315
315
|
var wd = '"' + (req.nodeExe || "node") + '" "' + BASE + '\\rearm-watch.mjs" --self "' + selfId +
|
|
316
|
-
'" --quiet 5 --max-wait 600 --delay 15 --wake-file "' + BASE + '\\logs\\wake-list.json"'
|
|
316
|
+
'" --quiet 5 --max-wait 600 --delay 15 --wake-file "' + BASE + '\\logs\\wake-list.json"' +
|
|
317
|
+
(req.dryRun === true ? ' --dry' : '');
|
|
317
318
|
try { sh.Run(wd, 0, false); dbg("rearm-watch spawned"); } catch (e) { dbg("rearm spawn err " + e.message); }
|
|
318
319
|
el("mode").textContent = "后台";
|
|
319
320
|
el("clock").className = "big";
|
|
@@ -29,6 +29,8 @@ const maxWait = Math.max(0, Number(arg('--max-wait', '600')) || 600);
|
|
|
29
29
|
const delay = Math.max(5, Number(arg('--delay', '15')) || 15);
|
|
30
30
|
const wakeFile = String(arg('--wake-file', '') || '');
|
|
31
31
|
const note = String(arg('--note', '空闲后自动重排的重启') || '');
|
|
32
|
+
// 原来是不是试运行(dry-run):转后台重排后要保持同样的语义,别把试运行变成真重启。
|
|
33
|
+
const dry = process.argv.includes('--dry');
|
|
32
34
|
|
|
33
35
|
function log(line) {
|
|
34
36
|
try { fs.appendFileSync(path.join(LOGS, 'rearm.log'), `[${new Date().toISOString()}] ${line}\n`); } catch { /* ignore */ }
|
|
@@ -65,6 +67,7 @@ log(`quiet ${quiet}s reached (waited ${Math.round(res.waitedMs / 1000)}s) -> rea
|
|
|
65
67
|
const args = [TRIGGER, '--delay', String(delay), '--note', note];
|
|
66
68
|
if (self) args.push('--self-session', self);
|
|
67
69
|
if (wakeFile) args.push('--wake-file', wakeFile);
|
|
70
|
+
if (dry) args.push('--dry-run');
|
|
68
71
|
|
|
69
72
|
const child = spawn(process.execPath, args, { cwd: BASE, detached: true, stdio: 'ignore', windowsHide: true });
|
|
70
73
|
child.on('error', (error) => {
|
package/cordis.patch.yml
CHANGED
|
@@ -14,16 +14,17 @@
|
|
|
14
14
|
# (config.part: ui)。0.8.9 起它不再是总开关 —— 关掉它只失去
|
|
15
15
|
# 卡片与「自动更新」,下面四个组件照常跑。
|
|
16
16
|
# 自动更新默认关,开关在卡片里,值落 config.json 的 autoUpdate。
|
|
17
|
-
# ② dsh-crossterm/
|
|
18
|
-
# ③ dsh-crossterm/
|
|
19
|
-
# ④ dsh-crossterm/
|
|
20
|
-
# ⑤ dsh-crossterm/
|
|
21
|
-
#
|
|
17
|
+
# ② dsh-crossterm/components/session 跨会话:term_link / term_unlink / term_broadcast / term_inbox / term_config
|
|
18
|
+
# ③ dsh-crossterm/components/terminal 跨终端:term_whoami / term_list / term_send / term_send_files
|
|
19
|
+
# ④ dsh-crossterm/components/device 跨设备:term_cloud(云端总线同步)
|
|
20
|
+
# ⑤ dsh-crossterm/components/account 跨账号:预留占位,暂不挂工具
|
|
21
|
+
# ⑥ dsh-crossterm/components/restart 自动重启:dsh_restart(原 dsh-restart 插件,0.9.0 起并入)
|
|
22
22
|
# 它不碰总线,只把 dsh_restart 工具挂到每个会话上。
|
|
23
23
|
#
|
|
24
|
-
#
|
|
25
|
-
# "./
|
|
26
|
-
#
|
|
24
|
+
# 组件名/简介/版本来自 package.json 的 exports 映射 + components/<part>/manifest.json:
|
|
25
|
+
# "./components/session/package.json" -> "./components/session/manifest.json"
|
|
26
|
+
# 每个组件显示自己的中文名、简介和独立版本号,实际加载的仍是 lib/index.js,靠 config.part 决定挂哪组工具。
|
|
27
|
+
# 组件版本号由该组件负责人维护:只在该组件文件改动时升,跟着插件一起发版(见 MAINTAINERS.md)。
|
|
27
28
|
#
|
|
28
29
|
# 为什么入口行必须用「裸包名」:浏览器的 client 半端只对裸包名行生效
|
|
29
30
|
# (dsh-client-modules 的 locatePkgJson 对子路径行直接返回 undefined),而插件页顶部标题
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
# 关掉入口行只失去「配置卡片 + 自动更新」,四个业务组件照常工作、各自仍可单独关。
|
|
35
36
|
# 之前(0.7.x–0.8.8)是 ui 行 provide('crossterm')、其余四行 inject 它,关入口会连坐——已废弃。
|
|
36
37
|
#
|
|
37
|
-
#
|
|
38
|
+
# 前五个组件(ui/session/terminal/device/account)在同一 DSH 进程里共用一份总线实例(自动重启不参与,它只挂自己的工具):心跳只起一次,云同步只在 device 组件启用
|
|
38
39
|
# 且 config.json 里 cloudEnabled=true 时才跑。安装/改动后需重启对应的 DSH 进程。
|
|
39
40
|
# ============================================================================
|
|
40
41
|
|
|
@@ -46,24 +47,24 @@
|
|
|
46
47
|
config:
|
|
47
48
|
part: ui
|
|
48
49
|
- id: crossterm-session
|
|
49
|
-
name: dsh-crossterm/
|
|
50
|
+
name: dsh-crossterm/components/session
|
|
50
51
|
config:
|
|
51
52
|
part: session
|
|
52
53
|
- id: crossterm-terminal
|
|
53
|
-
name: dsh-crossterm/
|
|
54
|
+
name: dsh-crossterm/components/terminal
|
|
54
55
|
config:
|
|
55
56
|
part: terminal
|
|
56
57
|
- id: crossterm-device
|
|
57
|
-
name: dsh-crossterm/
|
|
58
|
+
name: dsh-crossterm/components/device
|
|
58
59
|
config:
|
|
59
60
|
part: device
|
|
60
61
|
- id: crossterm-account
|
|
61
|
-
name: dsh-crossterm/
|
|
62
|
+
name: dsh-crossterm/components/account
|
|
62
63
|
config:
|
|
63
64
|
part: account
|
|
64
65
|
- id: crossterm-restart
|
|
65
66
|
# 自动重启(原 dsh-restart 插件):不参与总线,只挂 dsh_restart 工具。
|
|
66
67
|
# helper 脚本随包分发在 lib/restart/scripts/,启动时复制到 <busDir>/restart-module/。
|
|
67
|
-
name: dsh-crossterm/
|
|
68
|
+
name: dsh-crossterm/components/restart
|
|
68
69
|
config:
|
|
69
70
|
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.9.
|
|
26
|
+
export const VERSION = '0.9.3'
|
|
27
27
|
|
|
28
28
|
/** DSH 的家目录:与宿主其它状态(sessions / profiles)同一个根,多终端天然共享 */
|
|
29
29
|
export function dshHome() {
|
package/lib/index.js
CHANGED
|
@@ -42,7 +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 '
|
|
45
|
+
import { ensureRestartRuntime } from '../components/restart/runtime.js'
|
|
46
46
|
|
|
47
47
|
const PLUGIN = 'dsh-crossterm'
|
|
48
48
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
@@ -2081,13 +2081,13 @@ function releaseTerm(term) {
|
|
|
2081
2081
|
|
|
2082
2082
|
// ── 入口 ──────────────────────────────────────────────────────────────────
|
|
2083
2083
|
|
|
2084
|
-
const RESTART_SRC = path.join(ROOT, '
|
|
2084
|
+
const RESTART_SRC = path.join(ROOT, 'components', 'restart', 'scripts')
|
|
2085
2085
|
|
|
2086
2086
|
/**
|
|
2087
2087
|
* 「自动重启」组件(原 dsh-restart 插件,0.9.0 起并入)。
|
|
2088
2088
|
*
|
|
2089
2089
|
* 它不参与总线:只把 dsh_restart 工具挂到每个会话上,并把 helper 脚本复制到
|
|
2090
|
-
* 可写目录后交给
|
|
2090
|
+
* 可写目录后交给 ../components/restart/core.js。脚本必须在 import core.js **之前**落到
|
|
2091
2091
|
* DSH_RESTART_MODULE_DIR,因为 core.js 在模块顶层读这个环境变量。
|
|
2092
2092
|
*/
|
|
2093
2093
|
function mountRestart(root, config) {
|
|
@@ -2110,7 +2110,7 @@ function mountRestart(root, config) {
|
|
|
2110
2110
|
if (info.skipped.length) mark(`脚本缺失:${info.skipped.join(', ')}`)
|
|
2111
2111
|
if (!process.env.DSH_RESTART_MODULE_DIR) process.env.DSH_RESTART_MODULE_DIR = destDir
|
|
2112
2112
|
mark(`运行目录就绪:${destDir}(本次复制 ${info.copied.length} 个脚本)`)
|
|
2113
|
-
void import('
|
|
2113
|
+
void import('../components/restart/core.js')
|
|
2114
2114
|
.then((mod) => {
|
|
2115
2115
|
mod.default.apply(root, { ...config, part: 'restart' })
|
|
2116
2116
|
mark('已挂载 dsh_restart 工具')
|
package/lib/web.js
CHANGED
|
@@ -15,7 +15,7 @@ import { listLogs, tailLogs, readMaintainersDoc, listOwnership } from './logs.js
|
|
|
15
15
|
|
|
16
16
|
const PKG = 'dsh-crossterm'
|
|
17
17
|
const NPM_REGISTRIES = ['https://registry.npmmirror.com', 'https://registry.npmjs.org']
|
|
18
|
-
// 包根目录:lib/web.js 的上一级(README.md / CHANGELOG.md / locale /
|
|
18
|
+
// 包根目录:lib/web.js 的上一级(README.md / CHANGELOG.md / locale / components 都在这里)
|
|
19
19
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
|
20
20
|
|
|
21
21
|
let installed = false
|
|
@@ -554,15 +554,17 @@ function statusOf(term) {
|
|
|
554
554
|
}
|
|
555
555
|
|
|
556
556
|
/**
|
|
557
|
-
* 插件自述(0.6.2):插件标题/简介 +
|
|
557
|
+
* 插件自述(0.6.2):插件标题/简介 + 六个组件(入口 + 五个业务组件)的名称/简介/版本 + 最近几版更新日志。
|
|
558
558
|
* 卡片(浏览器半端)与插件页顶部共用 locale/zh.json 的 meta,这里读同一份文件,
|
|
559
559
|
* 保证「插件页怎么显示」和「卡片里怎么显示」永远一致。
|
|
560
560
|
*/
|
|
561
561
|
const PART_ORDER = [
|
|
562
|
+
{ part: 'ui', fallback: '跨端互通(入口)' },
|
|
562
563
|
{ part: 'session', fallback: '跨会话' },
|
|
563
564
|
{ part: 'terminal', fallback: '跨终端' },
|
|
564
565
|
{ part: 'device', fallback: '跨设备' },
|
|
565
566
|
{ part: 'account', fallback: '跨账号' },
|
|
567
|
+
{ part: 'restart', fallback: '自动重启' },
|
|
566
568
|
]
|
|
567
569
|
|
|
568
570
|
let aboutCache = null
|
|
@@ -617,12 +619,13 @@ function aboutOf(term) {
|
|
|
617
619
|
const components = PART_ORDER.map((item) => {
|
|
618
620
|
let doc = {}
|
|
619
621
|
try {
|
|
620
|
-
doc = JSON.parse(fs.readFileSync(path.join(ROOT, '
|
|
622
|
+
doc = JSON.parse(fs.readFileSync(path.join(ROOT, 'components', item.part, 'manifest.json'), 'utf8'))
|
|
621
623
|
} catch { /* ignore */ }
|
|
622
624
|
return {
|
|
623
625
|
part: item.part,
|
|
624
626
|
name: doc.name || item.fallback,
|
|
625
627
|
description: doc.description || '',
|
|
628
|
+
version: doc.version || '',
|
|
626
629
|
}
|
|
627
630
|
})
|
|
628
631
|
const maintainers = readMaintainers()
|
package/locale/en.json
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "CrossTerm (self-update)",
|
|
4
4
|
"shortTitle": "CrossTerm",
|
|
5
|
-
"description": "Self-update switch: when on, the plugin periodically checks npm for a newer version and installs it (off by default; restart DSH afterwards to take effect — it never restarts on its own). Turning it off does not affect the
|
|
5
|
+
"description": "Self-update switch: when on, the plugin periodically checks npm for a newer version and installs it (off by default; restart DSH afterwards to take effect — it never restarts on its own). Turning it off does not affect the five components below — session / terminal / device / account / auto-restart — each has its own switch and version. About: synchronize sessions, terminals and devices under one DSH account, with feature-code chains, inline mail, a cloud relay and automatic session backups."
|
|
6
6
|
}
|
|
7
7
|
}
|
package/locale/zh.json
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "跨端互通(自更新)",
|
|
4
4
|
"shortTitle": "跨端互通",
|
|
5
|
-
"description": "自更新开关:打开后插件会定期检查 npm 上的新版本并自动安装(默认关;装完要重启 DSH
|
|
5
|
+
"description": "自更新开关:打开后插件会定期检查 npm 上的新版本并自动安装(默认关;装完要重启 DSH 才生效,不会自己重启)。关掉它不影响下面五个组件 —— 跨会话 / 跨终端 / 跨设备 / 跨账号 / 自动重启,各自独立开关、各有版本号。插件简介:同一 DSH 账号下的会话、终端、设备之间互通,支持特征码链、内联邮件、云端中转站与会话自动备份。"
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-crossterm",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "跨端互通:同一 DSH 账号下的会话、终端、设备之间互通 —— 特征码链、内联邮件、云端中转站与自动备份",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./lib/index.js",
|
|
9
|
-
"./client": "./client/client.js",
|
|
10
9
|
"./package.json": "./package.json",
|
|
10
|
+
"./client": "./client/client.js",
|
|
11
|
+
"./components/ui": "./lib/index.js",
|
|
12
|
+
"./components/ui/package.json": "./components/ui/manifest.json",
|
|
13
|
+
"./components/session": "./lib/index.js",
|
|
14
|
+
"./components/session/package.json": "./components/session/manifest.json",
|
|
15
|
+
"./components/terminal": "./lib/index.js",
|
|
16
|
+
"./components/terminal/package.json": "./components/terminal/manifest.json",
|
|
17
|
+
"./components/device": "./lib/index.js",
|
|
18
|
+
"./components/device/package.json": "./components/device/manifest.json",
|
|
19
|
+
"./components/account": "./lib/index.js",
|
|
20
|
+
"./components/account/package.json": "./components/account/manifest.json",
|
|
21
|
+
"./components/restart": "./lib/index.js",
|
|
22
|
+
"./components/restart/package.json": "./components/restart/manifest.json",
|
|
11
23
|
"./locale/en.json": "./locale/en.json",
|
|
12
|
-
"./locale/zh.json": "./locale/zh.json"
|
|
13
|
-
"./parts/session": "./lib/index.js",
|
|
14
|
-
"./parts/terminal": "./lib/index.js",
|
|
15
|
-
"./parts/device": "./lib/index.js",
|
|
16
|
-
"./parts/account": "./lib/index.js",
|
|
17
|
-
"./parts/session/package.json": "./parts/session.manifest.json",
|
|
18
|
-
"./parts/terminal/package.json": "./parts/terminal.manifest.json",
|
|
19
|
-
"./parts/device/package.json": "./parts/device.manifest.json",
|
|
20
|
-
"./parts/account/package.json": "./parts/account.manifest.json",
|
|
21
|
-
"./parts/restart": "./lib/index.js",
|
|
22
|
-
"./parts/restart/package.json": "./parts/restart.manifest.json"
|
|
24
|
+
"./locale/zh.json": "./locale/zh.json"
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
25
27
|
"lib",
|
|
28
|
+
"components",
|
|
26
29
|
"client",
|
|
27
30
|
"locale",
|
|
28
|
-
"parts",
|
|
29
31
|
"cordis.patch.yml",
|
|
30
32
|
"README.md",
|
|
31
33
|
"CHANGELOG.md",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|