@twinsearth/timemachine-dsh-plugin 0.2.0 → 0.2.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 CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1 — 2026-12-03
4
+
5
+ ### 标题与插件详情
6
+
7
+ - 完整面板标题改为随系统自适应:Windows「DeepSeekHarness:一键还原点」,macOS「DeepSeekHarness:时间机器」;`main` 槽位标签同步使用同一标题。
8
+ - 新增 `locale/en.json`、`locale/zh.json` 与 `docs/DETAIL.en.md`、`docs/DETAIL.zh.md`,插件管理器不再回退到包名 `@twinsearth/timemachine-dsh-plugin`。
9
+ - 中文详情改为五项能力:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原、一键修复会话引导。
10
+ - `package.json` 增加 `./locale/*.json` 导出与 `locale` 打包目录;`plugin.json` 名称/描述同步。
11
+
12
+ ### 发布
13
+
14
+ - npm 与 GitHub 同步发布 `0.2.1`。
15
+
3
16
  ## 0.2.0 — 2026-12-03
4
17
 
5
18
  ### 文件夹详情
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  DSH 一键还原点(Time Machine)。它把 DSH 客户端的会话、工作区、配置与插件清单打包成一个可迁移的还原点,并在需要时把整台机器上的 DSH 恢复成还原点里的样子。
4
4
 
5
- - 版本:`0.2.0`
5
+ - 版本:`0.2.1`
6
6
  - 宿主:DeepSeek Harness(DSH)桌面客户端 `0.2.x`
7
7
  - 平台:Windows / macOS / Linux(Windows 默认目录,macOS/Linux 由用户选择目录)
8
8
  - 许可:MIT
@@ -36,6 +36,21 @@ DSH 一键还原点(Time Machine)。它把 DSH 客户端的会话、工作
36
36
 
37
37
  完整面板倒数第二个区块是「文件夹详情」:创建或导入完成后,自动选中新还原点并读取归档结构;也可以从下拉框或还原点行的「文件夹」按钮切换。树按真实路径展示 `manifest.json`、`README.txt`、`RESTORE-POINT.json`、`sessions/`、`attachments/`、`profiles/` 等目录,右侧逐项给出中文说明和文件大小。同一时间只展开一个目录,切换还原点时会重置展开状态。
38
38
 
39
+ ### 1.5 标题与插件详情
40
+
41
+ 完整面板标题按操作系统自适应:Windows 为「DeepSeekHarness:一键还原点」,macOS 为「DeepSeekHarness:时间机器」;左侧栏入口仍保持短标签「一键还原点 / 时间机器」。
42
+
43
+ 插件管理器的标题和详情由 `locale/en.json`、`locale/zh.json` 与 `docs/DETAIL.en.md`、`docs/DETAIL.zh.md` 提供。中文详情固定为:
44
+
45
+ ```
46
+ DSH 一键还原点:
47
+ 1.手动/自动双还原点
48
+ 2.会话与工作区完整备份
49
+ 3.第三方插件 latest 重装
50
+ 4.配置迁移与一键还原
51
+ 5.一键修复会话引导
52
+ ```
53
+
39
54
  ### 2.1 用户插件:内置与实验性
40
55
 
41
56
  还原点记录 `dsh.profile.bundles`、`dependencies` 与 `cordis.patch.yml` 的插件行,包含:
@@ -159,16 +174,16 @@ node scripts/host-menu-patch.mjs --app-asar "D:\DSH\resources\app.asar" --restor
159
174
  ```powershell
160
175
  # 先在 DSH 客户端菜单「应用 -> 管理 dsh 命令」安装 CLI(如果尚未安装)
161
176
  # 从 npm 安装(推荐)
162
- dsh plugin --profile web add @twinsearth/timemachine-dsh-plugin
177
+ dsh plugin --profile web add @twinsearth/timemachine-dsh-plugin@0.2.1
163
178
 
164
179
  # 桌面客户端 profile 名为 desktop 时
165
- dsh plugin --profile desktop add @twinsearth/timemachine-dsh-plugin
180
+ dsh plugin --profile desktop add @twinsearth/timemachine-dsh-plugin@0.2.1
166
181
  ```
167
182
 
168
183
  离线安装可使用 GitHub Release 或本地 tarball:
169
184
 
170
185
  ```powershell
171
- dsh plugin --profile desktop add "file:E:\path\to\twinsearth-timemachine-dsh-plugin-0.2.0.tgz"
186
+ dsh plugin --profile desktop add "file:E:\path\to\twinsearth-timemachine-dsh-plugin-0.2.1.tgz"
172
187
  ```
173
188
 
174
189
  如果 `dsh` 不在 PATH,也可以直接用 profile 目录里的 pnpm 安装,但安装后必须手动把包名加入 `profiles/desktop/package.json` 的 `dsh.profile.bundles`,否则 Loader 不会加载:
@@ -212,7 +227,7 @@ npm run check # 静态交付检查
212
227
  npm run pack-check
213
228
  ```
214
229
 
215
- 测试覆盖:手动/自动创建、范围选择、保留份数、计划与还原、跳过插件安装、导入、设置持久化、损坏归档拒绝、HTTP 路由挂载、客户端 bundle 槽位注册、侧栏入口 10 秒自动隐藏与标题栏按钮 30 秒自动隐藏、文件夹结构树与单分支展开、运行中 `workspaceRegistry` 实时注册。真实客户端验收记录见 `docs/TESTPLAN.md`。
230
+ 测试覆盖:手动/自动创建、范围选择、保留份数、计划与还原、跳过插件安装、导入、设置持久化、损坏归档拒绝、HTTP 路由挂载、客户端 bundle 槽位注册、侧栏入口 10 秒自动隐藏与标题栏按钮 30 秒自动隐藏、标题随系统自适应、locale 五项详情、文件夹结构树与单分支展开、运行中 `workspaceRegistry` 实时注册。真实客户端验收记录见 `docs/TESTPLAN.md`。
216
231
 
217
232
  ## 数据与安全
218
233
 
@@ -144,6 +144,12 @@ service.restore -> restore.restorePoint
144
144
 
145
145
  树的前端只保留一个 `expandedPath`。`isTreePathOpen(path, openPath)` 只展开该路径本身及其祖先链,因此同一时间只有一个分支;切换还原点会重置为根节点展开。
146
146
 
147
+ ### 6.2 标题与插件管理元信息
148
+
149
+ `lib/client.js#panelTitle()` 与 `sidebarLabel()` 共用 `isMacPlatform()`:完整面板 `h2`、`main` 槽位 label 使用 `DeepSeekHarness:一键还原点`(Windows)或 `DeepSeekHarness:时间机器`(macOS),侧栏入口仍用短标签。
150
+
151
+ 插件管理器读取包根的 `locale/en.json`、`locale/zh.json`:`meta.title` 提供显示标题,`meta.description` 提供五项能力说明,`meta.detail` 指向 `docs/DETAIL.en.md` / `docs/DETAIL.zh.md`。这些资源不参与运行时激活,`package.json#exports` 暴露 `./locale/*.json`,`files` 包含 `locale` 与 `docs`。
152
+
147
153
  ## 7. 并发与失败
148
154
 
149
155
  - 服务端所有写操作经过 `guarded` 单操作互斥;并发的第二个请求返回 409。
@@ -0,0 +1,9 @@
1
+ # DeepSeekHarness: Restore Point
2
+
3
+ DSH restore points:
4
+
5
+ 1. Manual and automatic restore points
6
+ 2. Full session and workspace backup
7
+ 3. Reinstall third-party plugins at npm latest
8
+ 4. Migrate configuration and restore in one step
9
+ 5. Repair session restore guides in one step
@@ -0,0 +1,9 @@
1
+ # DeepSeekHarness:一键还原点
2
+
3
+ DSH 一键还原点:
4
+
5
+ 1. 手动/自动双还原点
6
+ 2. 会话与工作区完整备份
7
+ 3. 第三方插件 latest 重装
8
+ 4. 配置迁移与一键还原
9
+ 5. 一键修复会话引导
@@ -11,6 +11,8 @@
11
11
  | 1.4 | 文件夹详情区(倒数第二位置) | 已实现 | `lib/client.js#FolderDetails` 位于还原点列表之后、说明与边界之前;创建/导入后自动展开;下拉框与行内「文件夹」按钮切换 | 客户端 bundle 用例断言 `FolderDetails`、`isTreePathOpen`;创建/检查路由断言 `tree` |
12
12
  | 1.5 | 备份文件夹结构树 + 中文说明 | 已实现 | `src/tree.mjs#buildPointTree`;创建返回 `tree`;`src/service.mjs#inspectPoint` 返回同一棵树 | `creates one manual point...` 断言根目录、顶层文件、`sessions/` 与大小;`inspect` 路由断言 |
13
13
  | 1.6 | 单分支展开,其余折叠 | 已实现 | `FolderDetails` 单一 `expandedPath`;`isTreePathOpen` 只保留祖先链;切换还原点重置 | `folder details lists every healthy point and opens only one tree branch` |
14
+ | 1.7 | 插件标题随系统自适应 | 已实现 | `lib/client.js#panelTitle`:Windows「DeepSeekHarness:一键还原点」、macOS「DeepSeekHarness:时间机器」;完整面板 `h2` 与 `main` 槽位 label 共用 | `the panel title follows macOS and Windows`;静态检查 `client bundle keeps the adaptive panel title` |
15
+ | 1.8 | 插件详情五项能力 | 已实现 | `locale/zh.json` `meta.description` 与 `docs/DETAIL.zh.md`;`locale/en.json` / `docs/DETAIL.en.md` 为英文对照 | `plugin display metadata is localized and carries the five capabilities`;`pack-check` 包含 `locale` 与详情文档 |
14
16
  | 2.1 | 用户插件(内置/实验性)开启、关闭、参数配置 | 已实现 | `src/plugins.mjs#readProfilePlugins` 读取 bundles/rows/disabled;配置原文随 `cordis.patch.yml` 备份;`pluginInventory` 展示 | 创建用例断言 `status.plugins.user` 与实验性插件 |
15
17
  | 2.2 | 第三方插件列表,DSH 内由用户手动触发一键自动安装并还原 NPM latest,恢复原配置 | 已实现(真实网络安装待验收) | `lib/client.js` 还原计划弹窗「安装并还原第三方插件」勾选框,默认勾选,可取消;`src/plugins.mjs#reinstallPlugins`;`src/restore.mjs#restorePoint` 安装后重放 package.json 并保留新版本 | 临时 DSH 页面确认 2 个插件时显示勾选框且可切换;`restorePoint skips plugin installation...`;真机 11 个第三方插件清单;联网 latest 仅用假 runner 验证 |
16
18
  | 2.2 | 不保存安装包,可手动勾选同时备份安装包 | 已实现 | `includePluginPackages`;`packPluginTarballs`;还原优先 `file:` tarball | 默认 `false` 静态检查 |
@@ -65,6 +67,8 @@ node scripts/host-menu-patch.mjs --app-asar "D:\DSH\resources\app.asar" --restor
65
67
  - [x] 纯插件 Windows 标题栏备用按钮(`installCaptionEntry`;静态检查 + 浏览器无宿主不报错)
66
68
  - [x] 原生「应用-开发者工具」菜单补丁器(asar 副本验证)
67
69
  - [x] 完整面板「文件夹详情」区与备份结构树(创建后自动展开,单分支)
70
+ - [x] 插件标题随系统自适应(Windows / macOS)
71
+ - [x] 插件管理器五项能力详情(locale + detail 文档)
68
72
  - [x] 预还原副本与失败回滚
69
73
 
70
74
  ### P1(增强)
@@ -83,4 +87,5 @@ node scripts/host-menu-patch.mjs --app-asar "D:\DSH\resources\app.asar" --restor
83
87
  - [x] 真实 `D:\DSH\resources\app.asar` 原生菜单补丁(已 `patched:true`,`app.asar.timemachine-backup` 已保留)
84
88
  - [ ] 重启 DSH 后点击「应用 -> 开发者工具 -> DSH一键还原点」验收
85
89
  - [ ] 第三方插件真实联网 latest 安装验收
86
- - [ ] npm 发布(按约定不主动执行)
90
+ - [x] npm 与 GitHub 发布 `0.2.1`
91
+ - [ ] 插件管理器标题/详情在真实 DSH 中的渲染验收
package/docs/TESTPLAN.md CHANGED
@@ -13,7 +13,7 @@ npm run pack-check
13
13
  测试文件:
14
14
 
15
15
  - `test/timemachine.test.mjs`:11 项服务端/路由用例
16
- - `test/client-bundle.test.mjs`:7 项浏览器 bundle 用例(合计 18)
16
+ - `test/client-bundle.test.mjs`:8 项浏览器 bundle 用例(合计 19)
17
17
 
18
18
  覆盖矩阵:
19
19
 
@@ -38,6 +38,9 @@ npm run pack-check
38
38
  | 17 | 文件夹结构树 | 创建返回 `tree`;根目录、顶层文件、`sessions/`、中文说明与精确大小;`/inspect` 返回同一棵树 |
39
39
  | 18 | 单分支展开 | 所有健康还原点进入下拉框;`isTreePathOpen` 只展开目标路径与祖先链,其他分支折叠 |
40
40
  | 19 | 树渲染 | 自定义 `createElement` 断言中文说明、文件大小、切换分支后旧分支折叠 |
41
+ | 20 | 标题自适应 | `panelTitle('Win32')` 返回「DeepSeekHarness:一键还原点」,`panelTitle('MacIntel')` 返回「DeepSeekHarness:时间机器」;`main` 槽位 label 同步 |
42
+
43
+ > 矩阵按断言主题列出,部分用例同时覆盖多个主题;自动化用例总数为 19。
41
44
 
42
45
  ## 2. 零残留
43
46
 
@@ -147,6 +150,14 @@ npm run pack-check
147
150
  - `isTreePathOpen` 只保留目标路径及祖先链,保证同一时间只展开一个分支。
148
151
  - 真实宿主内点击树节点、切换下拉框、创建后自动滚动到文件夹详情仍待人工点击验收。
149
152
 
153
+ ### 3.10 0.2.1 标题与插件详情(静态通过,待真机渲染)
154
+
155
+ - `npm test` 19/19、`npm run check` 23/23、`npm run pack-check` 30 个文件。
156
+ - 完整面板标题与 `main` 槽位 label 使用 `panelTitle()`:Windows「DeepSeekHarness:一键还原点」,macOS「DeepSeekHarness:时间机器」。
157
+ - `locale/zh.json` 的 `meta.description` 与 `docs/DETAIL.zh.md` 保持五项能力原文;`locale/en.json` / `docs/DETAIL.en.md` 提供英文对照。
158
+ - `package.json` 暴露 `./locale/*.json`,`files` 包含 `locale`;`pack-check` 确认 30 个文件。
159
+ - 插件管理器中的标题和详情渲染仍待在真实 DSH 中验收。
160
+
150
161
  ## 4. 待人工验收
151
162
 
152
163
  - 安装 tarball 到真实 DSH profile `desktop` 后:
@@ -156,6 +167,8 @@ npm run pack-check
156
167
  - 设置行「一键还原」打开还原计划确认弹窗,确认后完成还原并自动打开会话
157
168
  - 创建/还原按钮走真实 HTTP 路由
158
169
  - 创建完成后「文件夹详情」自动选中新还原点并显示树;多个还原点切换时只展开一个分支
170
+ - 完整面板标题:Windows「DeepSeekHarness:一键还原点」,macOS「DeepSeekHarness:时间机器」
171
+ - 插件管理器详情显示五项能力,不再回退到包名
159
172
  - 真实 DSH 桌面客户端左上角标题栏:
160
173
  - 「应用 / 编辑」右侧出现「DSH一键还原点」
161
174
  - 点击打开插件面板;关闭/卸载插件后按钮消失
@@ -171,7 +184,7 @@ npm run pack-check
171
184
 
172
185
  ## 5. 回归门槛
173
186
 
174
- - `npm test` 18/18 通过
175
- - `npm run check` 21/21 通过
176
- - `npm run pack-check` tarball 内容符合 `files`(26 个文件)
187
+ - `npm test` 19/19 通过
188
+ - `npm run check` 23/23 通过
189
+ - `npm run pack-check` tarball 内容符合 `files`(30 个文件)
177
190
  - 任何失败先定位到具体断言,不通过放宽断言“修复”
package/lib/client.js CHANGED
@@ -82,11 +82,22 @@ window.__ModuleLoader__.load({
82
82
  return parts[parts.length - 1] || '还原点';
83
83
  }
84
84
 
85
- function sidebarLabel(platform = null) {
86
- const detected = platform ?? (typeof navigator === 'undefined'
85
+ function platformName(platform = null) {
86
+ return platform ?? (typeof navigator === 'undefined'
87
87
  ? ''
88
88
  : `${navigator.userAgentData?.platform ?? ''} ${navigator.platform ?? ''} ${navigator.userAgent ?? ''}`);
89
- return /mac|darwin/iu.test(String(detected)) ? '时间机器' : '一键还原点';
89
+ }
90
+
91
+ function isMacPlatform(platform = null) {
92
+ return /mac|darwin/iu.test(String(platformName(platform)));
93
+ }
94
+
95
+ function sidebarLabel(platform = null) {
96
+ return isMacPlatform(platform) ? '时间机器' : '一键还原点';
97
+ }
98
+
99
+ function panelTitle(platform = null) {
100
+ return isMacPlatform(platform) ? 'DeepSeekHarness:时间机器' : 'DeepSeekHarness:一键还原点';
90
101
  }
91
102
 
92
103
  function latestLocalPoint(status) {
@@ -664,7 +675,7 @@ window.__ModuleLoader__.load({
664
675
  if (status?.root_chosen !== true) {
665
676
  return h('div', { className: 'tm-root' },
666
677
  h('div', { className: 'tm-head' }, [
667
- h('div', { key: 't' }, [h('h2', { className: 'tm-title' }, 'DSH 一键还原点'), h('div', { className: 'tm-sub' }, '先选择保存文件夹,之后所有还原点都放在这里。')]),
678
+ h('div', { key: 't' }, [h('h2', { className: 'tm-title' }, panelTitle()), h('div', { className: 'tm-sub' }, '先选择保存文件夹,之后所有还原点都放在这里。')]),
668
679
  ]),
669
680
  h('div', { className: 'tm-card' }, [
670
681
  h('div', { key: 'h', className: 'tm-cardTitle' }, '选择还原点保存文件夹'),
@@ -685,7 +696,7 @@ window.__ModuleLoader__.load({
685
696
  return h('div', { className: 'tm-root', 'data-tm-surface': compact ? 'settings' : 'main' },
686
697
  h('div', { className: 'tm-head' }, [
687
698
  h('div', { key: 't', style: { minWidth: 220 } }, [
688
- h('h2', { className: 'tm-title' }, 'DSH 一键还原点'),
699
+ h('h2', { className: 'tm-title' }, panelTitle()),
689
700
  h('div', { key: 's', className: 'tm-sub' }, `保存到 ${status?.root ?? ''} · DSH ${status?.dsh_home ?? ''} · ${counts.plugins ?? 0} 个第三方插件`),
690
701
  ]),
691
702
  h('div', { key: 'a', className: 'tm-row' }, [
@@ -1124,7 +1135,7 @@ window.__ModuleLoader__.load({
1124
1135
  mountSlot('settings.general.item', { id: 'timemachine-general', order: 80, label: () => 'DSH 一键还原点', inject: () => ({ open: openPanel, onRestoreDone: openRestored }) }, SettingsGeneralRow, 'the general-settings row');
1125
1136
  const sidebarDisposer = mountSlot('sidebar.panellist', { id: PANEL_ID, order: -100, label: () => sidebarLabel() }, SidebarEntry, 'the sidebar entry');
1126
1137
  scheduleAutoHide(sidebarDisposer, SIDEBAR_AUTO_HIDE_MS);
1127
- mountSlot('main', { key: PANEL_ID, label: () => 'DSH 一键还原点', inject: () => ({ onRestoreDone: openRestored }) }, MainPage, 'the main panel');
1138
+ mountSlot('main', { key: PANEL_ID, label: () => panelTitle(), inject: () => ({ onRestoreDone: openRestored }) }, MainPage, 'the main panel');
1128
1139
  return () => {
1129
1140
  try {
1130
1141
  if (window.__DSH_TIMEMACHINE_OPEN__ === openPanel) delete window.__DSH_TIMEMACHINE_OPEN__;
@@ -1142,6 +1153,7 @@ window.__ModuleLoader__.load({
1142
1153
  exports.SettingsGeneralRow = SettingsGeneralRow;
1143
1154
  exports.SidebarEntry = SidebarEntry;
1144
1155
  exports.sidebarLabel = sidebarLabel;
1156
+ exports.panelTitle = panelTitle;
1145
1157
  exports.SIDEBAR_AUTO_HIDE_MS = SIDEBAR_AUTO_HIDE_MS;
1146
1158
  exports.CAPTION_AUTO_HIDE_MS = CAPTION_AUTO_HIDE_MS;
1147
1159
  exports.latestLocalPoint = latestLocalPoint;
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeekHarness: Restore Point",
4
+ "description": "DSH restore points:\n1. Manual and automatic restore points\n2. Full session and workspace backup\n3. Reinstall third-party plugins at npm latest\n4. Migrate configuration and restore in one step\n5. Repair session restore guides in one step",
5
+ "detail": "docs/DETAIL.en.md"
6
+ }
7
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeekHarness:一键还原点",
4
+ "description": "DSH 一键还原点:\n1.手动/自动双还原点\n2.会话与工作区完整备份\n3.第三方插件 latest 重装\n4.配置迁移与一键还原\n5.一键修复会话引导",
5
+ "detail": "docs/DETAIL.zh.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@twinsearth/timemachine-dsh-plugin",
3
- "version": "0.2.0",
4
- "description": "DSH 一键还原点:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原。",
3
+ "version": "0.2.1",
4
+ "description": "DSH 一键还原点:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原、一键修复会话引导。",
5
5
  "type": "module",
6
6
  "icon": "./icon.png",
7
7
  "exports": {
8
8
  ".": "./lib/index.js",
9
9
  "./client": "./lib/client.js",
10
- "./package.json": "./package.json"
10
+ "./package.json": "./package.json",
11
+ "./locale/*.json": "./locale/*.json"
11
12
  },
12
13
  "main": "lib/index.js",
13
14
  "files": [
@@ -16,6 +17,7 @@
16
17
  "plugin.json",
17
18
  "cordis.patch.yml",
18
19
  "icon.png",
20
+ "locale",
19
21
  "README.md",
20
22
  "CHANGELOG.md",
21
23
  "docs",
package/plugin.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "timemachine",
3
- "name": "DSH 一键还原点",
4
- "version": "0.2.0",
5
- "description": "手动/自动还原点、会话与工作区备份、第三方插件 latest 重装、DSH 配置迁移。",
3
+ "name": "DeepSeekHarness:一键还原点",
4
+ "version": "0.2.1",
5
+ "description": "DSH 一键还原点:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原、一键修复会话引导。",
6
6
  "entry": "lib/index.js",
7
7
  "client": "lib/client.js",
8
8
  "bundle": "cordis.patch.yml"