@twinsearth/timemachine-dsh-plugin 0.1.0 → 0.1.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,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2 — 2026-12-03
4
+
5
+ ### 市场发现与安装元数据
6
+
7
+ - `package.json` 增加 `repository`、`homepage`、`bugs`,指向真实 GitHub 仓库 `TwinsEarth/TimeMachine-dsh-plugin`。
8
+ - `package.json` 增加 `publishConfig.access: public`,并补充 `dsh-bundle`、`deepseek-harness` 关键词。
9
+ - README 增加可直接复制的 npm 安装命令:`dsh plugin --profile web add @twinsearth/timemachine-dsh-plugin`。
10
+ - GitHub 仓库补充 `dsh-plugin`、`dsh`、`deepseek-harness` 等 topics。
11
+
12
+ ## 0.1.1 — 2026-12-03
13
+
14
+ ### UI 入口
15
+
16
+ - 通用设置「DSH 一键还原点」行新增「一键还原」:先打开还原计划确认弹窗,确认后还原最近一份手动/自动还原点,并自动打开还原后的会话。
17
+ - 保留「立即备份」,原「打开」改为「打开完整面板」。
18
+ - 左侧 `sidebar.panellist` 入口移到面板列表顶部(`order: -100`);macOS 显示「时间机器」,Windows 显示「一键还原点」,其他系统回退「一键还原点」。
19
+ - 设置行与侧栏入口都不修改真实 DSH profile;安装后重启 DSH 客户端生效。
20
+
3
21
  ## 0.1.0 — 2026-12-03
4
22
 
5
23
  首个可交付版本。
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  DSH 一键还原点(Time Machine)。它把 DSH 客户端的会话、工作区、配置与插件清单打包成一个可迁移的还原点,并在需要时把整台机器上的 DSH 恢复成还原点里的样子。
4
4
 
5
- - 版本:`0.1.0`
5
+ - 版本:`0.1.2`
6
6
  - 宿主:DeepSeek Harness(DSH)桌面客户端 `0.2.x`
7
7
  - 平台:Windows / macOS / Linux(Windows 默认目录,macOS/Linux 由用户选择目录)
8
8
  - 许可:MIT
@@ -14,7 +14,7 @@ DSH 一键还原点(Time Machine)。它把 DSH 客户端的会话、工作
14
14
  ### 1.1 一键还原点与定时还原点
15
15
 
16
16
  - 通用设置里的「DSH 一键还原点」行可以直接创建手动还原点。
17
- - 左侧「DSH 一键还原点」面板同样可以创建,还能设置每日自动还原点时间。
17
+ - 左侧「时间机器 / 一键还原点」面板同样可以创建,还能设置每日自动还原点时间。
18
18
  - 自动还原点只会在 DSH 客户端运行时触发;DSH 未启动的时间段不会补跑。触发后会在 profile 的 `.timemachine/auto-slot.txt` 记录当天时间槽,避免同一分钟重复创建。
19
19
 
20
20
  ### 1.2 手动与自动分开存储、分开显示
@@ -126,8 +126,8 @@ sessions/<project-key>/<encoded-session-id>/
126
126
 
127
127
  ### 4. UI 入口
128
128
 
129
- 1. **DSH 通用设置**:`设置 -> 通用` 里新增「DSH 一键还原点」一行,可直接立即备份或打开完整面板。
130
- 2. **左上角侧栏**:`sidebar.panellist` 顶部新增「DSH 一键还原点」项,位置在品牌行下方、会话列表上方。点击打开完整面板。
129
+ 1. **DSH 通用设置**:`设置 -> 通用` 里新增「DSH 一键还原点」一行,可直接「立即备份」「一键还原」或「打开完整面板」。「一键还原」先打开还原计划确认弹窗,确认后还原最近一份手动/自动还原点,并自动打开还原后的会话。
130
+ 2. **左上角侧栏**:`sidebar.panellist` 顶部新增入口,位置在品牌行下方、会话列表上方。macOS 显示「时间机器」,Windows 显示「一键还原点」,点击打开完整面板。
131
131
  3. **Windows 标题栏(纯插件备用入口)**:插件运行时在左上角「应用 / 编辑」右侧追加「DSH一键还原点」按钮,点击直接打开完整面板。它不需要改 `app.asar`;只在 DSH 桌面客户端存在 `[data-windows-menu]` 时生效,用浏览器打开 Web UI 不会显示。
132
132
  4. **原生应用菜单(需求 4.2 的精确入口)**:包内提供 `scripts/host-menu-patch.mjs`,在 DSH 的 `app.asar` 的「应用 -> 开发者工具」后插入「DSH一键还原点」,点击后调用插件暴露的 `window.__DSH_TIMEMACHINE_OPEN__()` 打开面板。
133
133
 
@@ -154,7 +154,17 @@ node scripts/host-menu-patch.mjs --app-asar "D:\DSH\resources\app.asar" --restor
154
154
 
155
155
  ```powershell
156
156
  # 先在 DSH 客户端菜单「应用 -> 管理 dsh 命令」安装 CLI(如果尚未安装)
157
- dsh plugin --profile desktop add "file:E:\path\to\twinsearth-timemachine-dsh-plugin-0.1.0.tgz"
157
+ # 从 npm 安装(推荐)
158
+ dsh plugin --profile web add @twinsearth/timemachine-dsh-plugin
159
+
160
+ # 桌面客户端 profile 名为 desktop 时
161
+ dsh plugin --profile desktop add @twinsearth/timemachine-dsh-plugin
162
+ ```
163
+
164
+ 离线安装可使用 GitHub Release 或本地 tarball:
165
+
166
+ ```powershell
167
+ dsh plugin --profile desktop add "file:E:\path\to\twinsearth-timemachine-dsh-plugin-0.1.2.tgz"
158
168
  ```
159
169
 
160
170
  如果 `dsh` 不在 PATH,也可以直接用 profile 目录里的 pnpm 安装,但安装后必须手动把包名加入 `profiles/desktop/package.json` 的 `dsh.profile.bundles`,否则 Loader 不会加载:
@@ -183,7 +193,7 @@ dsh plugin --profile desktop remove @twinsearth/timemachine-dsh-plugin
183
193
 
184
194
  ## 使用
185
195
 
186
- 1. 打开 `设置 -> 通用 -> DSH 一键还原点`,或点击左上角「DSH 一键还原点」。
196
+ 1. 打开 `设置 -> 通用 -> DSH 一键还原点`,或点击左上角「时间机器 / 一键还原点」。
187
197
  2. Windows 首次默认使用 `D:\ToFuture`;macOS/Linux 点击「选择文件夹」。
188
198
  3. 勾选要备份的内容,点击「一键设置还原点」。
189
199
  4. 需要还原时,在手动/自动/导入页签选择还原点,点击「还原」。
@@ -119,8 +119,8 @@ service.restore -> restore.restorePoint
119
119
 
120
120
  | 槽位 | id/key | 作用 |
121
121
  | --- | --- | --- |
122
- | `settings.general.item` | `timemachine-general` | 通用设置一行:立即备份 / 打开 |
123
- | `sidebar.panellist` | `timemachine` | 左上角侧栏入口 |
122
+ | `settings.general.item` | `timemachine-general` | 通用设置一行:立即备份 / 一键还原(计划确认)/ 打开完整面板 |
123
+ | `sidebar.panellist` | `timemachine` | 左上角侧栏顶部入口(`order: -100`);macOS「时间机器」、Windows「一键还原点」 |
124
124
  | `main` | key `timemachine` | 完整面板 |
125
125
 
126
126
  `layout.selectPanel('timemachine')` 依赖 `main` 注册项的 `options.key === 'timemachine'`。客户端必须声明 `inject: ['slots', 'layout']`;缺少 `layout` 时 Cordis 会在访问 `ctx.layout` 时抛 `cannot get property "layout" without inject`,整个客户端模块不会激活。`uiWorkspace` / `sessions` 用 `ctx.get` 可选读取,不加入硬注入;直接属性访问 `ctx.uiWorkspace` 会抛 `cannot get property "uiWorkspace" without inject`,这也是 0.1.0 修复过的坑。
@@ -18,10 +18,11 @@
18
18
  | 2.4 | 备份默认不选中已归档会话 | 已实现 | `sessionScope: active`;`selectSessions` | `selectSessions honours active, all and archived scopes` |
19
19
  | 2.5 | 一键还原时自动导入新 DSH 客户端工作区并显示 | 已实现 | `src/restore.mjs#registerRestoredWorkspaces` 通过运行中 `workspaceRegistry` 创建/复用工作区并 `attachSession`;`lib/client.js#openRestored` 刷新 sessions 后 `uiWorkspace.openSession` | 真实 API 198 会话 / 6 工作区 `live_registration.ok=true`、`restart_required=false`;UI 单会话还原后自动跳到真实会话 `OpenClaw 插件接线与端点实现`(工作区 `DS`) |
20
20
  | 3 | 保存/还原 DSH 全量配置(账户除外) | 已实现 | `src/scan.mjs#scanConfig`;`src/restore.mjs` 写回;凭据排除清单 | 计划+还原用例断言 `fontSize: 16` 与 `ui.json` |
21
- | 4.1 | 入口增加到 DSH 通用设置 | 已实现 | `settings.general.item` 槽位,id `timemachine-general` | 客户端 bundle 用例;临时真实宿主 UI 验收通过 |
22
- | 4.2 | 左上角(应用)下增加「DSH 一键还原点」 | **双入口**:纯插件标题栏备用按钮 + 宿主补丁原生菜单 | `lib/client.js#installCaptionEntry` 在 DSH 桌面端 `[data-windows-menu]` 的「应用 / 编辑」右侧追加按钮,点击打开面板;`scripts/host-menu-patch.mjs` 修改 `app.asar` 的 `applicationItems()`,在 `toggleDevTools` 后插入 `id: "twinsearth-timemachine-menu-v1"` | 标题栏按钮静态检查 + 临时 DSH 页面无宿主时不报错;`app.asar` 副本与本机真实 `D:\DSH\resources\app.asar` 均已 `patched:true`,备份 `app.asar.timemachine-backup` 已保留;其他机器仍需退出 DSH 后执行补丁命令;重启后菜单点击待验收 |
21
+ | 4.1 | 通用设置入口 | 已实现 | `settings.general.item` 槽位,id `timemachine-general`;立即备份 / 一键还原(计划确认)/ 打开完整面板 | 客户端 bundle 用例;临时真实宿主 UI 验收通过 |
22
+ | 4.2 | 左上角侧栏入口 | 已实现 | `sidebar.panellist`,id `timemachine`,`order: -100`;macOS「时间机器」、Windows「一键还原点」 | 客户端 bundle 用例断言顺序与自适应 label;临时真实宿主 UI 验收通过 |
23
+ | 4.3 | 标题栏 / 原生菜单备用入口 | **双入口**:纯插件标题栏备用按钮 + 宿主补丁原生菜单 | `lib/client.js#installCaptionEntry` 在 DSH 桌面端 `[data-windows-menu]` 的「应用 / 编辑」右侧追加按钮,点击打开面板;`scripts/host-menu-patch.mjs` 修改 `app.asar` 的 `applicationItems()`,在 `toggleDevTools` 后插入 `id: "twinsearth-timemachine-menu-v1"` | 标题栏按钮静态检查 + 临时 DSH 页面无宿主时不报错;`app.asar` 副本与本机真实 `D:\DSH\resources\app.asar` 均已 `patched:true`,备份 `app.asar.timemachine-backup` 已保留;其他机器仍需退出 DSH 后执行补丁命令;重启后菜单点击待验收 |
23
24
 
24
- ## 4.2 的实现方式与宿主限制
25
+ ## 4.2 / 4.3 的实现方式与宿主限制
25
26
 
26
27
  DSH 桌面端原生菜单由主进程 `D:\DSH\resources\app.asar` 内的 `applicationItems()` 硬编码,插件没有追加菜单项的 API;`DESKTOP_IPC.windowsMenu` 只接受 `application` / `edit` 两个菜单名。纯插件无法在「应用-开发者工具」下插入条目。
27
28
 
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`:2 项浏览器 bundle 用例(合计 13)
16
+ - `test/client-bundle.test.mjs`:4 项浏览器 bundle 用例(合计 15)
17
17
 
18
18
  覆盖矩阵:
19
19
 
@@ -34,6 +34,7 @@ npm run pack-check
34
34
  | 13 | 客户端包名 | bundle id 不含子路径 |
35
35
  | 14 | 标题栏备用入口 | bundle 含 `data-windows-menu`、`DSH一键还原点`、`data-timemachine-caption` |
36
36
  | 15 | 第三方插件手动开关 | bundle 含「安装并还原第三方插件」、`installPlugins`、`useSavedPackages` |
37
+ | 16 | 通用设置快捷入口 / 侧栏自适应 | bundle 含「立即备份」「一键还原」「打开完整面板」「时间机器」、`order: -100` |
37
38
 
38
39
  ## 2. 零残留
39
40
 
@@ -69,7 +70,7 @@ npm run pack-check
69
70
  - 工作区:DS / 2Xray / default-workspace / IM2A / IM / Master
70
71
  - 说明:目标会话文件、注册表、配置均已写入临时 home;未触碰真实 profile
71
72
 
72
- ### 3.4 临时真实宿主 UI 验收(profile `tmtest`,未触碰 `desktop`)
73
+ ### 3.4 临时真实宿主 UI 验收(0.1.0,profile `tmtest`,未触碰 `desktop`)
73
74
 
74
75
  - 通过 DSH CLI plugin manager 将 tarball 安装到临时 DSH home 的 `tmtest` profile
75
76
  - 启动 `dsh --profile tmtest --no-open --port 43124`,`/api/twinsearth/timemachine/health` 返回 200
@@ -88,7 +89,7 @@ npm run pack-check
88
89
  - 工作区映射:
89
90
  - `E:\DSH\DS` -> `E:\DBH\_tm-livehome\ws\DS`
90
91
  - `E:\DB\2Xray` -> `...\2Xray`
91
- - `C:\Users\fangw\Documents\deepseek-harness\default-workspace` -> `...\default-workspace`
92
+ - `C:\Users\<用户名>\Documents\deepseek-harness\default-workspace` -> `...\default-workspace`
92
93
  - `E:\DSH\DS\IM2A` -> `...\IM2A`
93
94
  - `E:\WB\IM` -> `...\IM`
94
95
  - `E:\DSH\DS\Master` -> `...\Master`
@@ -127,12 +128,20 @@ npm run pack-check
127
128
  - 本次还原提示需要重启,原因是测试环境同一 `session-aaaaaaaa-1111-4111-8111-aaaaaaaaaaaa` 已存在于 `UI` 和 `PluginPreview` 两个项目目录,`sessionPersistence.list()` 报 duplicate;这不是第三方插件开关导致,属于已知同名 Session ID 限制。
128
129
  - 标题栏按钮只做静态检查与无宿主时静默检查;真实 DSH 桌面客户端点击验收仍在待人工验收列表。
129
130
 
131
+ ### 3.8 0.1.1 UI 入口变更(静态通过,待真机点击)
132
+
133
+ - `npm test` 15/15、`npm run check` 16/16、`npm run pack-check` 24 个文件。
134
+ - 通用设置行含「立即备份」「一键还原」「打开完整面板」;「一键还原」复用 `/plan` 与 `/restore`,先显示还原计划确认弹窗。
135
+ - 侧栏 `sidebar.panellist` 注册 `order: -100`;`sidebarLabel('MacIntel')` 返回「时间机器」,`sidebarLabel('Win32')` 返回「一键还原点」。
136
+ - 真实宿主内点击「一键还原」并完成还原、macOS 真机侧栏文案仍待人工验收。
137
+
130
138
  ## 4. 待人工验收
131
139
 
132
140
  - 安装 tarball 到真实 DSH profile `desktop` 后:
133
- - 通用设置出现「DSH 一键还原点」行
134
- - 左上角侧栏出现入口
141
+ - 通用设置出现「DSH 一键还原点」行,含「立即备份」「一键还原」「打开完整面板」
142
+ - 左上角侧栏顶部出现入口:Windows「一键还原点」、macOS「时间机器」
135
143
  - 点击入口打开 `main` 面板
144
+ - 设置行「一键还原」打开还原计划确认弹窗,确认后完成还原并自动打开会话
136
145
  - 创建/还原按钮走真实 HTTP 路由
137
146
  - 真实 DSH 桌面客户端左上角标题栏:
138
147
  - 「应用 / 编辑」右侧出现「DSH一键还原点」
@@ -149,7 +158,7 @@ npm run pack-check
149
158
 
150
159
  ## 5. 回归门槛
151
160
 
152
- - `npm test` 13/13 通过
153
- - `npm run check` 15/15 通过
161
+ - `npm test` 15/15 通过
162
+ - `npm run check` 16/16 通过
154
163
  - `npm run pack-check` tarball 内容符合 `files`(24 个文件)
155
164
  - 任何失败先定位到具体断言,不通过放宽断言“修复”
package/lib/client.js CHANGED
@@ -54,6 +54,22 @@ window.__ModuleLoader__.load({
54
54
  return `会话 ${counts.sessions ?? 0} · 配置 ${counts.config ?? 0} · 状态 ${counts.state ?? 0} · 插件 ${counts.plugins ?? 0}`;
55
55
  }
56
56
 
57
+ function sidebarLabel(platform = null) {
58
+ const detected = platform ?? (typeof navigator === 'undefined'
59
+ ? ''
60
+ : `${navigator.userAgentData?.platform ?? ''} ${navigator.platform ?? ''} ${navigator.userAgent ?? ''}`);
61
+ return /mac|darwin/iu.test(String(detected)) ? '时间机器' : '一键还原点';
62
+ }
63
+
64
+ function latestLocalPoint(status) {
65
+ const points = [
66
+ ...(status?.stores?.manual?.points ?? []),
67
+ ...(status?.stores?.auto?.points ?? []),
68
+ ].filter((point) => typeof point?.file === 'string' && point.ok !== false);
69
+ points.sort((a, b) => String(b?.point?.created_at ?? '').localeCompare(String(a?.point?.created_at ?? '')));
70
+ return points[0] ?? null;
71
+ }
72
+
57
73
  async function pickDirectory() {
58
74
  const api = typeof window === 'undefined' ? null : window.__DSH_DIRECTORY_PICKER__;
59
75
  if (api === null || api === undefined || typeof api.pick !== 'function') return null;
@@ -594,23 +610,81 @@ window.__ModuleLoader__.load({
594
610
  return h('div', { style: { padding: '18px 20px', maxWidth: 1080, margin: '0 auto' } }, h(RestorePointBody, { onDone: onRestoreDone }));
595
611
  }
596
612
 
597
- function SettingsGeneralRow({ open }) {
598
- const { status, loading } = useStatus();
613
+ function SettingsGeneralRow({ open, onRestoreDone = null }) {
614
+ const { status, loading, refresh } = useStatus();
599
615
  const [busy, setBusy] = useState('');
600
616
  const [note, setNote] = useState('');
617
+ const [plan, setPlan] = useState(null);
618
+ const [pathMap, setPathMap] = useState({});
619
+ const [installPlugins, setInstallPlugins] = useState(true);
620
+ const latestPoint = useMemo(() => latestLocalPoint(status), [status]);
621
+
601
622
  const create = async () => {
602
623
  if (busy !== '') return;
603
624
  setBusy('create');
604
625
  setNote('');
605
626
  try {
606
- await request('/create', { method: 'POST', body: JSON.stringify({ kind: 'manual' }) });
607
- setNote('已创建');
627
+ const result = await request('/create', { method: 'POST', body: JSON.stringify({ kind: 'manual' }) });
628
+ setNote(`已创建 ${formatBytes(result.bytes)}`);
629
+ await refresh();
608
630
  } catch (caught) {
609
631
  setNote(caught.payload?.detail ?? caught.message);
610
632
  } finally {
611
633
  setBusy('');
612
634
  }
613
635
  };
636
+
637
+ const quickRestore = async () => {
638
+ if (busy !== '') return;
639
+ if (latestPoint === null) {
640
+ setNote('还没有可还原的还原点');
641
+ return;
642
+ }
643
+ setBusy('plan');
644
+ setNote('');
645
+ try {
646
+ const next = await request('/plan', { method: 'POST', body: JSON.stringify({ file: latestPoint.file }) });
647
+ const map = {};
648
+ for (const workspace of next.workspaces ?? []) {
649
+ map[workspace.source_path] = workspace.target_path;
650
+ }
651
+ setPathMap(map);
652
+ setInstallPlugins((next.plugins ?? []).length > 0);
653
+ setPlan(next);
654
+ } catch (caught) {
655
+ setNote(caught.payload?.detail ?? caught.message);
656
+ } finally {
657
+ setBusy('');
658
+ }
659
+ };
660
+
661
+ const confirmRestore = async () => {
662
+ if (plan === null || busy !== '') return;
663
+ setBusy('restore');
664
+ setNote('');
665
+ try {
666
+ const result = await request('/restore', {
667
+ method: 'POST',
668
+ body: JSON.stringify({
669
+ file: plan.file,
670
+ confirm: 'restore',
671
+ pathMap: Object.entries(pathMap).map(([from, to]) => ({ from, to })),
672
+ installPlugins,
673
+ useSavedPackages: (plan.plugin_packages && Object.keys(plan.plugin_packages).length > 0) || false,
674
+ }),
675
+ });
676
+ setPlan(null);
677
+ setNote(result.live_registration?.ok === true ? '还原完成,正在打开工作区' : '还原完成,需要重启 DSH');
678
+ await refresh();
679
+ onRestoreDone?.(result);
680
+ } catch (caught) {
681
+ setPlan(null);
682
+ setNote(caught.payload?.detail ?? caught.message);
683
+ } finally {
684
+ setBusy('');
685
+ }
686
+ };
687
+
614
688
  const counts = status?.counts ?? {};
615
689
  return h('div', {
616
690
  className: 'tm-row',
@@ -621,17 +695,36 @@ window.__ModuleLoader__.load({
621
695
  h('div', { key: 'title', style: { fontWeight: 600, fontSize: 13 } }, 'DSH 一键还原点'),
622
696
  h('div', { key: 'desc', className: 'tm-muted', style: { marginTop: 2 } }, loading
623
697
  ? '正在读取…'
624
- : `手动 ${counts.manual ?? 0} 份 · 自动 ${counts.auto ?? 0} 份 · 保存到 ${status?.root ?? '未设置'}${note ? ` · ${note}` : ''}`),
698
+ : `手动 ${counts.manual ?? 0} 份 · 自动 ${counts.auto ?? 0} 份 · ${latestPoint ? `最近 ${formatTime(latestPoint.point?.created_at)}` : '尚无还原点'} · 保存到 ${status?.root ?? '未设置'}${note ? ` · ${note}` : ''}`),
625
699
  ]),
626
700
  h('div', { key: 'actions', className: 'tm-row' }, [
627
- h('button', { key: 'create', type: 'button', className: 'tm-btn', disabled: busy !== '' || status?.root_chosen !== true, onClick: create }, busy === 'create' ? '正在备份…' : '立即备份'),
701
+ h('button', { key: 'create', type: 'button', className: 'tm-btn', disabled: busy !== '' || status?.root_chosen !== true, onClick: () => void create() }, busy === 'create' ? '正在备份…' : '立即备份'),
702
+ h('button', {
703
+ key: 'restore',
704
+ type: 'button',
705
+ className: 'tm-btn danger',
706
+ disabled: busy !== '' || status?.root_chosen !== true || latestPoint === null,
707
+ title: latestPoint ? `还原最近一份:${formatTime(latestPoint.point?.created_at)}` : '还没有可还原的还原点',
708
+ onClick: () => void quickRestore(),
709
+ }, busy === 'plan' ? '准备中…' : '一键还原'),
628
710
  h('button', {
629
711
  key: 'open',
630
712
  type: 'button',
631
713
  className: 'tm-btn primary',
632
714
  onClick: () => { try { open?.(); } catch { /* layout unavailable */ } },
633
- }, '打开'),
715
+ }, '打开完整面板'),
634
716
  ]),
717
+ plan === null ? null : h(PlanModal, {
718
+ key: 'plan',
719
+ plan,
720
+ busy: busy === 'restore',
721
+ pathMap,
722
+ setPathMap,
723
+ installPlugins,
724
+ setInstallPlugins,
725
+ onCancel: () => setPlan(null),
726
+ onConfirm: () => void confirmRestore(),
727
+ }),
635
728
  ]);
636
729
  }
637
730
 
@@ -790,8 +883,8 @@ window.__ModuleLoader__.load({
790
883
  start();
791
884
  }
792
885
  };
793
- mountSlot('settings.general.item', { id: 'timemachine-general', order: 80, label: () => 'DSH 一键还原点', inject: () => ({ open: openPanel }) }, SettingsGeneralRow, 'the general-settings row');
794
- mountSlot('sidebar.panellist', { id: PANEL_ID, order: 3, label: () => 'DSH 一键还原点' }, SidebarEntry, 'the sidebar entry');
886
+ mountSlot('settings.general.item', { id: 'timemachine-general', order: 80, label: () => 'DSH 一键还原点', inject: () => ({ open: openPanel, onRestoreDone: openRestored }) }, SettingsGeneralRow, 'the general-settings row');
887
+ mountSlot('sidebar.panellist', { id: PANEL_ID, order: -100, label: () => sidebarLabel() }, SidebarEntry, 'the sidebar entry');
795
888
  mountSlot('main', { key: PANEL_ID, label: () => 'DSH 一键还原点', inject: () => ({ onRestoreDone: openRestored }) }, MainPage, 'the main panel');
796
889
  return () => {
797
890
  try {
@@ -809,6 +902,8 @@ window.__ModuleLoader__.load({
809
902
  exports.MainPage = MainPage;
810
903
  exports.SettingsGeneralRow = SettingsGeneralRow;
811
904
  exports.SidebarEntry = SidebarEntry;
905
+ exports.sidebarLabel = sidebarLabel;
906
+ exports.latestLocalPoint = latestLocalPoint;
812
907
  exports.injectStyle = injectStyle;
813
908
  exports.formatBytes = formatBytes;
814
909
  exports.formatTime = formatTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/timemachine-dsh-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "DSH 一键还原点:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原。",
5
5
  "type": "module",
6
6
  "exports": {
@@ -42,9 +42,22 @@
42
42
  "keywords": [
43
43
  "dsh",
44
44
  "dsh-plugin",
45
+ "dsh-bundle",
46
+ "deepseek-harness",
45
47
  "backup",
46
48
  "restore",
47
49
  "timemachine"
48
50
  ],
49
- "license": "MIT"
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/TwinsEarth/TimeMachine-dsh-plugin.git"
55
+ },
56
+ "homepage": "https://github.com/TwinsEarth/TimeMachine-dsh-plugin#readme",
57
+ "bugs": {
58
+ "url": "https://github.com/TwinsEarth/TimeMachine-dsh-plugin/issues"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ }
50
63
  }
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "timemachine",
3
3
  "name": "DSH 一键还原点",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "手动/自动还原点、会话与工作区备份、第三方插件 latest 重装、DSH 配置迁移。",
6
6
  "entry": "lib/index.js",
7
7
  "client": "lib/client.js",
package/src/point.mjs CHANGED
@@ -122,7 +122,7 @@ function guideFor(input) {
122
122
  pinned: input.session.flags?.pinned === true,
123
123
  header: input.header,
124
124
  restore_hint:
125
- 'DSH -> 通用设置 -> DSH 一键还原点(或左侧“DSH 一键还原点”)-> 还原这份。' +
125
+ 'DSH -> 通用设置 -> DSH 一键还原点(或左侧“时间机器 / 一键还原点”)-> 还原这份。' +
126
126
  '还原会把本文件写回 sessions/<project-key>/<Session ID>/,并写入工作区注册表;显示工作区需要重启 DSH 客户端。',
127
127
  };
128
128
  }
@@ -414,7 +414,7 @@ export async function createRestorePoint(input) {
414
414
  `plugins : ${counts.plugins}`,
415
415
  '',
416
416
  '每个会话在 sessions/<project-key>/<Session ID>/ 下独立存放,并带有 RESTORE-GUIDE.json / .md。',
417
- '在 DSH 中打开:通用设置 -> DSH 一键还原点,选择本文件还原。',
417
+ '在 DSH 中打开:通用设置 -> DSH 一键还原点,或左侧「时间机器 / 一键还原点」,选择本文件还原。',
418
418
  '',
419
419
  'Excluded on purpose:',
420
420
  ...point.exclusions.map((line) => `- ${line}`),