dsh-crossterm 0.9.0 → 0.9.2

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 CHANGED
@@ -1,5 +1,33 @@
1
+ ## 0.9.2 — 2026-10-20
2
+
3
+ **组件拆成目录 + 每个组件有自己的版本号**(User said:组件文件分开存放、插件页每个组件显示版本、改到哪个组件就升哪个)。
4
+
5
+ - 目录结构:每个组件一个目录 `components/<part>/`,内含 `manifest.json`(`name` / `description` / `version`)与自己的代码;
6
+ 原 `parts/<part>.manifest.json` 与 `lib/restart/` 全部迁入,`parts/` 删除。
7
+ `components/restart/` 里是 `core.js` / `runtime.js` / `scripts/`(原 `dsh-restart` 的 8 个 helper)。
8
+ - 组件版本号:`ui` / `session` / `terminal` / `device` / `account` 记 `0.9.2`,`restart` 记 `0.3.28`(沿用并入时那版代码)。
9
+ 规则:只在该组件自己的文件改动时升它的版本号,跟着插件一起发版;插件总版本仍按发版技能三分位判定。
10
+ - 插件页:`GET /crossterm/api/about` 的 `components[]` 增 `version`,卡片「包含的组件」显示「名称 vX.Y.Z」;
11
+ 更新说明表格加「组件版本」列(`make-release-notes.mjs` 从 `components/<part>/manifest.json` 读)。
12
+ - 接线:`cordis.patch.yml` 五行 `name` 改 `dsh-crossterm/components/<part>`,`package.json` 的 `exports` 同步
13
+ (`./components/<part>` → `./lib/index.js`、`./components/<part>/package.json` → `./components/<part>/manifest.json`);
14
+ `files` 用 `components` 取代 `parts`。
15
+ - 清理:删掉 profile `node_modules` 里指向 `F:\dsh\001X\dsh-restart` 的两个旧 junction(`dsh-restart`、`dsh-restart-module`)。
16
+ - 升级后需重启 DSH;已装 0.9.1 的机器点卡片「更新」即可。
17
+
1
18
  # dsh-crossterm 变更记录
2
19
 
20
+ ## 0.9.1 — 2026-10-20
21
+
22
+ **修 0.9.0 的致命笔误:`cordis.patch.yml` 注释少写两个 `#`,整份 overlay 解析失败**
23
+
24
+ - 现象:升级到 0.9.0 的机器启动时 `YAMLException: end of the stream or a document separator is expected (41:1)`,
25
+ `dsh plugin list` 报 `Cannot validate installed package dsh-crossterm`,插件整包不加载(卡片、总线、工具全没了)。
26
+ - 根因:加第 ⑥ 行说明时把两行注释写成了正文(缩进 4 空格、没有 `#`),YAML 走到 `- insert:` 就认为文档已结束。
27
+ - 修法:这两行补回 `#`;`js-yaml` 解析校验 `insert` 共 6 行,id 依次为
28
+ `crossterm-ui / crossterm-session / crossterm-terminal / crossterm-device / crossterm-account / crossterm-restart`。
29
+ - **教训(写进发版流程)**:改完 `cordis.patch.yml` 必须真实解析一次(`js-yaml` 读一遍、看 `insert` 行数与 id),
30
+ 光靠肉眼看注释块不够 —— 这类错误会让插件启动即失效,而且探针只测文本、测不出解析失败。
3
31
  ## 0.9.0 — 2026-10-20
4
32
 
5
33
  **自动重启并进互通插件(插件页第 6 个组件)**
package/README.md CHANGED
@@ -14,49 +14,42 @@ A 终端看不到 B 终端里有哪个会话、在干什么,也没法把一条
14
14
 
15
15
  **插件名称**:`dsh-crossterm`(插件页显示 **跨端互通(自更新)**)| **插件简介**:同一 DSH 账号下的会话、终端、设备之间互通 —— 特征码链、内联邮件、云端中转站与自动备份。
16
16
 
17
- **组件列表(插件页第一个是入口/自更新,后面四个是业务组件,名称与简介来自各自的 manifest)**
17
+ **组件列表(插件页第一个是入口/自更新,后面五个是业务组件;名称、简介、版本号来自各自的 `components/<part>/manifest.json`)**
18
18
 
19
- | 顺序 | 组件名称 | 作用 | 工具 |
20
- |---|---|---|---|
21
- | ① | 跨端互通(自更新) | 自更新开关:打开后定期检查 npm 新版本并自动安装(默认关;装完要重启 DSH 生效)。关掉它只失去卡片与自动更新,下面四个组件照常工作。裸包名行,承载插件标题/简介与配置卡片,不挂工具 | — |
22
- | ② | 跨会话 | 同一终端里的多个会话之间互通:特征码链、内联邮件、收件箱 | `term_link` `term_unlink` `term_broadcast` `term_inbox` `term_config` |
23
- | ③ | 跨终端 | 同一台机器上的多个 DSH 终端/进程之间互发邮件与文件 | `term_whoami` `term_list` `term_send` `term_send_files` |
24
- | ④ | 跨设备 | 经云端总线,在多台机器的 DSH 之间互发邮件与文件 | `term_cloud` |
25
- | ⑤ | 跨账号 | 预留位:后续用于跨账号互通,当前不挂工具 | — |
26
- | ⑥ | 自动重启 | 改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 `dsh-restart` 插件,0.9.0 起并入) | `dsh_restart` |
19
+ | 顺序 | 组件名称 | 版本 | 作用 | 工具 |
20
+ |---|---|---|---|---|
21
+ | ① | 跨端互通(自更新) | v0.9.2 | 自更新开关:打开后定期检查 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.0)**
34
+ **本版更新(0.9.2)**
33
35
 
34
- - **升级当次就能提示「待重启」**:以前这一步要等服务端换成新版才认得出来(YOCE_C 回归的第 3/4 步就是这样「看不见」)。
35
- 现在浏览器 client 自己带版本号(`CLIENT_VERSION`),点完更新就从 `/update` 响应的 `installed` / `before` 判断,
36
- 立刻把卡片切成「已装待重启」;渲染时还会按「磁盘版本 > 进程版本」持续推导,旧进程也提示得出来。
37
- - `/check` 多返回一个 `running`(= 进程版本),与 `current` 并列,旧客户端也能照常解析。
38
- - **自动重启并进来当第 6 个组件**:原 `dsh-restart` 插件的 `dsh_restart` 工具与 8 个 helper 脚本并入 `lib/restart/`,
39
- 插件页多一行「自动重启」。它不参与总线,只在每个会话上挂 `dsh_restart`;脚本首次启动时同步到
40
- `<总线目录>/restart-module/`(默认 `C:\Users\<你>\.dsh\crossterm\restart-module`)。
41
- - **不再单独发版**:自动重启模块由原 `dsh-restart` 会话(`a3e9f80e`,会话名「自动重启」)继续维护,
42
- 改动汇报给插件主维护会话,由主维护会话并入本插件一起发版。
43
- - 旧的 `dsh-restart-module` 插件还装着时会重复注册 `dsh_restart`,需在 profile 里摘掉它(本机另行处理)。
44
- - 本机是 `link:` 源码版,没有这层差别;以上对用 npm 安装的设备生效。
36
+ - **组件分目录存放**:`components/<part>/` 各放各的 `manifest.json` 与代码,`parts/` 删除;原 `lib/restart/` 整体搬进 `components/restart/`。npm 包与安装 zip 里也只带 `components/`。
37
+ - **每个组件有独立版本号**:插件页与更新说明都显示「名称 vX.Y.Z」,方便看清这次改的是哪个组件、由谁维护。
38
+ - **组件维护分出去**:`MAINTAINERS.md` 的 `modules` 段记录每个组件的负责人;自动重启 = `a3e9f80e`(只管 `components/restart/**`),其余由主维护会话 `b6aa099b` 负责。
39
+ - 兼容:`cordis.patch.yml` 的 `name` 改为 `dsh-crossterm/components/<part>`,`exports` 同步;升级后重启 DSH 生效。
45
40
 
46
- **上一版(0.8.15)**
41
+ **上一版(0.9.1)**
47
42
 
48
- - **「更新」按钮不再看起来没用**:装完新版但还没重启时,卡片多一行「待重启」、
49
- 更新按钮变成不可点的「已装待重启」,接口 `/check` 改回 `needRestart=true` 而不是继续报「有更新」。
50
- - 根因是状态表达:宿主进程里还是旧版本号,而磁盘上已经装了新版 —— 现在这两个版本分开显示。
51
- - 本机是 `link:` 源码版(磁盘版本永远等于源码版本),所以这行只会在 npm 安装的设备上出现。
43
+ - 修 0.9.0 的启动即失效:`cordis.patch.yml` 第 ⑥ 行两行说明漏了 `#`,整份 overlay 解析失败、插件整包不加载(卡片/总线/工具全没有)。0.9.1 补回注释符。
44
+ - 发版流程加硬规矩:**改完 `cordis.patch.yml` 必须用 `js-yaml` 真解析一次,核对 `insert` 行数与 id**。
52
45
 
53
- **更早(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)**
46
+ **更早(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)**
54
47
 
48
+ - 0.9.0:自动重启并进来当第 6 个组件(`dsh_restart` + 8 个 helper 脚本),由原 `dsh-restart` 会话继续维护、不再单独发版。
55
49
  - 0.8.14:装完未重启时卡片显示「待重启」、更新按钮变灰「已装待重启」,`/check` 回 `needRestart=true`。
56
50
  - 0.8.13:已经是最新就不装;没写收件人的信优先投给 `MAINTAINERS.md` 里的维护者会话。
57
51
  - 0.8.12 / 0.8.11:修「点更新必定失败」(pnpm 不认 `--prefer-online`)、装低自动回滚、最新版取两个源的最大值。
58
- - 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7:云端设备只列别人、带权限与状态、版本仅在差异时显示;插件页标题改「跨端互通(自更新)」;
59
- 入口组件从「总开关」改为「自更新开关」,四个业务组件互不依赖。
52
+ - 0.8.10 / 0.8.9 / 0.8.8 / 0.8.7:云端设备只列别人、带权限与状态、版本仅在差异时显示;插件页标题改「跨端互通(自更新)」;入口组件从「总开关」改为「自更新开关」。
60
53
  - 0.8.5:负责人留痕 `MAINTAINERS.md`、运行日志可轮转、卡片「维护者」行与「运行日志」按钮。
61
54
  - 0.8.0 安全加固:附件名净化 + 越界校验、写接口要 `x-crossterm-token`、信封 HMAC 签名、入站限额、按 id 去重。
62
55
 
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("div", { style: S.compName }, c.name),
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
  ),
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "跨账号",
3
+ "description": "预留位:后续用于跨账号互通,当前不挂工具",
4
+ "version": "0.9.2"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "跨设备",
3
+ "description": "经云端总线,在多台机器的 DSH 之间互发邮件与文件",
4
+ "version": "0.9.2"
5
+ }
@@ -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, 'lib', 'restart', 'scripts')
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')
@@ -1,4 +1,5 @@
1
1
  {
2
2
  "name": "自动重启",
3
- "description": "改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 dsh-restart 插件,0.9.0 起并入)"
3
+ "description": "改完插件/配置后让 DSH 自己重启一次,并自动拉起离线会话(原 dsh-restart 插件,0.9.0 起并入)",
4
+ "version": "0.3.28"
4
5
  }
@@ -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) => {
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "跨会话",
3
+ "description": "同一终端里的多个会话之间互通:特征码链、内联邮件、收件箱",
4
+ "version": "0.9.2"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "跨终端",
3
+ "description": "同一台机器上的多个 DSH 终端/进程之间互发邮件与文件",
4
+ "version": "0.9.2"
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "ui",
3
+ "description": "自更新开关:打开后插件会定期检查 npm 上的新版本并自动安装(默认关;装完要重启 DSH 才生效,不会自己重启)。关掉它不影响下面五个组件 —— 跨会话 / 跨终端 / 跨设备 / 跨账号 / 自动重启,各自独立开关、各有版本号。",
4
+ "version": "0.9.2"
5
+ }
package/cordis.patch.yml CHANGED
@@ -1,69 +1,70 @@
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
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/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
+ # 它不碰总线,只把 dsh_restart 工具挂到每个会话上。
23
+ #
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)。
28
+ #
29
+ # 为什么入口行必须用「裸包名」:浏览器的 client 半端只对裸包名行生效
30
+ # (dsh-client-modules 的 locatePkgJson 对子路径行直接返回 undefined),而插件页顶部标题
31
+ # 与裸包名行共用同一份 locale/zh.json 的 meta —— 所以裸包名行单独做入口(卡片 + 自动更新),
32
+ # 标题写「跨端互通(自更新)」,四个业务组件排在它后面、名字仍是跨会话/跨终端/跨设备/跨账号。
33
+ #
34
+ # 0.8.9 起五个组件互不依赖:谁都不用 provide/inject 别人,各挂各的工具与开销。
35
+ # 关掉入口行只失去「配置卡片 + 自动更新」,四个业务组件照常工作、各自仍可单独关。
36
+ # 之前(0.7.x–0.8.8)是 ui 行 provide('crossterm')、其余四行 inject 它,关入口会连坐——已废弃。
37
+ #
38
+ # 前五个组件(ui/session/terminal/device/account)在同一 DSH 进程里共用一份总线实例(自动重启不参与,它只挂自己的工具):心跳只起一次,云同步只在 device 组件启用
39
+ # 且 config.json 里 cloudEnabled=true 时才跑。安装/改动后需重启对应的 DSH 进程。
40
+ # ============================================================================
41
+
42
+ - insert:
43
+ - id: crossterm-ui
44
+ # 入口(自更新):裸包名,浏览器半端的配置卡片 + 插件页标题/简介 + 「自动更新」开关。
45
+ # 关掉这一行只失去卡片与自动更新,四个业务组件不受影响;它自己不挂工具。
46
+ name: dsh-crossterm
47
+ config:
48
+ part: ui
49
+ - id: crossterm-session
50
+ name: dsh-crossterm/components/session
51
+ config:
52
+ part: session
53
+ - id: crossterm-terminal
54
+ name: dsh-crossterm/components/terminal
55
+ config:
56
+ part: terminal
57
+ - id: crossterm-device
58
+ name: dsh-crossterm/components/device
59
+ config:
60
+ part: device
61
+ - id: crossterm-account
62
+ name: dsh-crossterm/components/account
63
+ config:
64
+ part: account
65
+ - id: crossterm-restart
66
+ # 自动重启(原 dsh-restart 插件):不参与总线,只挂 dsh_restart 工具。
67
+ # helper 脚本随包分发在 lib/restart/scripts/,启动时复制到 <busDir>/restart-module/。
68
+ name: dsh-crossterm/components/restart
69
+ config:
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.0'
26
+ export const VERSION = '0.9.2'
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 './restart/runtime.js'
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,7 +2081,7 @@ function releaseTerm(term) {
2081
2081
 
2082
2082
  // ── 入口 ──────────────────────────────────────────────────────────────────
2083
2083
 
2084
- const RESTART_SRC = path.join(ROOT, 'lib', 'restart', 'scripts')
2084
+ const RESTART_SRC = path.join(ROOT, 'components', 'restart', 'scripts')
2085
2085
 
2086
2086
  /**
2087
2087
  * 「自动重启」组件(原 dsh-restart 插件,0.9.0 起并入)。
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 / parts 都在这里)
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
@@ -617,12 +617,13 @@ function aboutOf(term) {
617
617
  const components = PART_ORDER.map((item) => {
618
618
  let doc = {}
619
619
  try {
620
- doc = JSON.parse(fs.readFileSync(path.join(ROOT, 'parts', `${item.part}.manifest.json`), 'utf8'))
620
+ doc = JSON.parse(fs.readFileSync(path.join(ROOT, 'components', item.part, 'manifest.json'), 'utf8'))
621
621
  } catch { /* ignore */ }
622
622
  return {
623
623
  part: item.part,
624
624
  name: doc.name || item.fallback,
625
625
  description: doc.description || '',
626
+ version: doc.version || '',
626
627
  }
627
628
  })
628
629
  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 four components below — cross-session / cross-terminal / cross-device / cross-account each have their own switch. About: synchronize sessions, terminals and devices under one DSH account, with feature-code chains, inline mail, a cloud relay and automatic session backups."
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 才生效,不会自己重启)。关掉它不影响下面四个组件 —— 跨会话 / 跨终端 / 跨设备 / 跨账号 各自独立开关。插件简介:同一 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.0",
3
+ "version": "0.9.2",
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",
@@ -1,4 +0,0 @@
1
- {
2
- "name": "跨账号",
3
- "description": "预留位:后续用于跨账号互通,当前不挂工具"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "name": "跨设备",
3
- "description": "经云端总线,在多台机器的 DSH 之间互发邮件与文件"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "name": "跨会话",
3
- "description": "同一终端里的多个会话之间互通:特征码链、内联邮件、收件箱"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "name": "跨终端",
3
- "description": "同一台机器上的多个 DSH 终端/进程之间互发邮件与文件"
4
- }
File without changes
File without changes