@twinsearth/timemachine-dsh-plugin 0.1.1 → 0.1.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 +21 -0
- package/README.md +15 -5
- package/icon.png +0 -0
- package/lib/client.js +50 -6
- package/package.json +17 -2
- package/plugin.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.3 — 2026-12-03
|
|
4
|
+
|
|
5
|
+
### UI
|
|
6
|
+
|
|
7
|
+
- 插件图标改为附图中的「Who Is Backing DeepSeek」图表,`package.json` 声明 `icon: "./icon.png"`,`icon.png` 随包发布,尺寸 512×512、体积低于 256 KiB。
|
|
8
|
+
- `sidebar.panellist` 顶部入口会在插件启动 10 秒后自动隐藏,避免长期占用左侧导航;仍可从「设置 -> 通用 -> DSH 一键还原点」打开完整面板。
|
|
9
|
+
- Windows 标题栏「DSH一键还原点」备用按钮会在启动 30 秒后自动隐藏。
|
|
10
|
+
|
|
11
|
+
### 发布
|
|
12
|
+
|
|
13
|
+
- npm 与 GitHub 同步发布 `0.1.3`;包内保留 `dsh.bundle.patch`、`dsh.client`、`repository` 与可复制的安装命令,满足插件市场静态抓取要求。
|
|
14
|
+
|
|
15
|
+
## 0.1.2 — 2026-12-03
|
|
16
|
+
|
|
17
|
+
### 市场发现与安装元数据
|
|
18
|
+
|
|
19
|
+
- `package.json` 增加 `repository`、`homepage`、`bugs`,指向真实 GitHub 仓库 `TwinsEarth/TimeMachine-dsh-plugin`。
|
|
20
|
+
- `package.json` 增加 `publishConfig.access: public`,并补充 `dsh-bundle`、`deepseek-harness` 关键词。
|
|
21
|
+
- README 增加可直接复制的 npm 安装命令:`dsh plugin --profile web add @twinsearth/timemachine-dsh-plugin`。
|
|
22
|
+
- GitHub 仓库补充 `dsh-plugin`、`dsh`、`deepseek-harness` 等 topics。
|
|
23
|
+
|
|
3
24
|
## 0.1.1 — 2026-12-03
|
|
4
25
|
|
|
5
26
|
### UI 入口
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
DSH 一键还原点(Time Machine)。它把 DSH 客户端的会话、工作区、配置与插件清单打包成一个可迁移的还原点,并在需要时把整台机器上的 DSH 恢复成还原点里的样子。
|
|
4
4
|
|
|
5
|
-
- 版本:`0.1.
|
|
5
|
+
- 版本:`0.1.3`
|
|
6
6
|
- 宿主:DeepSeek Harness(DSH)桌面客户端 `0.2.x`
|
|
7
7
|
- 平台:Windows / macOS / Linux(Windows 默认目录,macOS/Linux 由用户选择目录)
|
|
8
8
|
- 许可:MIT
|
|
@@ -127,8 +127,8 @@ sessions/<project-key>/<encoded-session-id>/
|
|
|
127
127
|
### 4. UI 入口
|
|
128
128
|
|
|
129
129
|
1. **DSH 通用设置**:`设置 -> 通用` 里新增「DSH 一键还原点」一行,可直接「立即备份」「一键还原」或「打开完整面板」。「一键还原」先打开还原计划确认弹窗,确认后还原最近一份手动/自动还原点,并自动打开还原后的会话。
|
|
130
|
-
2. **左上角侧栏**:`sidebar.panellist` 顶部新增入口,位置在品牌行下方、会话列表上方。macOS 显示「时间机器」,Windows
|
|
131
|
-
3. **Windows 标题栏(纯插件备用入口)**:插件运行时在左上角「应用 / 编辑」右侧追加「DSH
|
|
130
|
+
2. **左上角侧栏**:`sidebar.panellist` 顶部新增入口,位置在品牌行下方、会话列表上方。macOS 显示「时间机器」,Windows 显示「一键还原点」,点击打开完整面板。该入口在插件启动 **10 秒后自动隐藏**,让出导航位;之后仍可从通用设置行点「打开完整面板」。
|
|
131
|
+
3. **Windows 标题栏(纯插件备用入口)**:插件运行时在左上角「应用 / 编辑」右侧追加「DSH一键还原点」按钮,点击直接打开完整面板。该按钮在启动 **30 秒后自动隐藏**。它不需要改 `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
|
|
|
134
134
|
原生菜单必须由宿主补丁实现,因为 DSH 桌面端的「应用」菜单由主进程硬编码(关于/检查更新/管理 dsh 命令/开发者工具/重启应用/退出),插件 API 没有“向应用菜单追加菜单项”的能力,`windowsMenu` IPC 也只接受 `application`/`edit` 两个菜单名。标题栏第三个按钮是纯插件的降级入口;如果要求严格出现在「应用 -> 开发者工具」下面,执行下面的补丁。本机真实客户端已执行;换一台机器部署时仍需执行一次。
|
|
@@ -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
|
-
|
|
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.3.tgz"
|
|
158
168
|
```
|
|
159
169
|
|
|
160
170
|
如果 `dsh` 不在 PATH,也可以直接用 profile 目录里的 pnpm 安装,但安装后必须手动把包名加入 `profiles/desktop/package.json` 的 `dsh.profile.bundles`,否则 Loader 不会加载:
|
|
@@ -198,7 +208,7 @@ npm run check # 静态交付检查
|
|
|
198
208
|
npm run pack-check
|
|
199
209
|
```
|
|
200
210
|
|
|
201
|
-
测试覆盖:手动/自动创建、范围选择、保留份数、计划与还原、跳过插件安装、导入、设置持久化、损坏归档拒绝、HTTP 路由挂载、客户端 bundle
|
|
211
|
+
测试覆盖:手动/自动创建、范围选择、保留份数、计划与还原、跳过插件安装、导入、设置持久化、损坏归档拒绝、HTTP 路由挂载、客户端 bundle 槽位注册、侧栏入口 10 秒自动隐藏与标题栏按钮 30 秒自动隐藏、运行中 `workspaceRegistry` 实时注册。真实客户端验收记录见 `docs/TESTPLAN.md`。
|
|
202
212
|
|
|
203
213
|
## 数据与安全
|
|
204
214
|
|
package/icon.png
ADDED
|
Binary file
|
package/lib/client.js
CHANGED
|
@@ -12,6 +12,8 @@ window.__ModuleLoader__.load({
|
|
|
12
12
|
const PREFIX = '/api/twinsearth/timemachine';
|
|
13
13
|
const STYLE_ID = 'timemachine-dsh-style';
|
|
14
14
|
const PANEL_ID = 'timemachine';
|
|
15
|
+
const SIDEBAR_AUTO_HIDE_MS = 10_000;
|
|
16
|
+
const CAPTION_AUTO_HIDE_MS = 30_000;
|
|
15
17
|
|
|
16
18
|
async function request(path, init = {}) {
|
|
17
19
|
const response = await fetch(PREFIX + path, {
|
|
@@ -754,6 +756,7 @@ window.__ModuleLoader__.load({
|
|
|
754
756
|
let button = null;
|
|
755
757
|
let observer = null;
|
|
756
758
|
let timer = null;
|
|
759
|
+
let hideTimer = null;
|
|
757
760
|
|
|
758
761
|
const stopWatching = () => {
|
|
759
762
|
if (observer !== null) {
|
|
@@ -766,7 +769,25 @@ window.__ModuleLoader__.load({
|
|
|
766
769
|
}
|
|
767
770
|
};
|
|
768
771
|
|
|
772
|
+
const hide = () => {
|
|
773
|
+
hideTimer = null;
|
|
774
|
+
if (button !== null) {
|
|
775
|
+
try { button.remove(); } catch { /* already gone */ }
|
|
776
|
+
button = null;
|
|
777
|
+
}
|
|
778
|
+
stopWatching();
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
const scheduleHide = () => {
|
|
782
|
+
if (typeof window.setTimeout !== 'function') return;
|
|
783
|
+
hideTimer = window.setTimeout(hide, CAPTION_AUTO_HIDE_MS);
|
|
784
|
+
};
|
|
785
|
+
|
|
769
786
|
const cleanup = () => {
|
|
787
|
+
if (hideTimer !== null) {
|
|
788
|
+
try { window.clearTimeout(hideTimer); } catch { /* already gone */ }
|
|
789
|
+
hideTimer = null;
|
|
790
|
+
}
|
|
770
791
|
stopWatching();
|
|
771
792
|
if (button !== null) {
|
|
772
793
|
try { button.remove(); } catch { /* already gone */ }
|
|
@@ -801,14 +822,18 @@ window.__ModuleLoader__.load({
|
|
|
801
822
|
return true;
|
|
802
823
|
};
|
|
803
824
|
|
|
804
|
-
if (mount())
|
|
825
|
+
if (mount()) {
|
|
826
|
+
scheduleHide();
|
|
827
|
+
return cleanup;
|
|
828
|
+
}
|
|
829
|
+
scheduleHide();
|
|
805
830
|
try {
|
|
806
831
|
observer = new MutationObserver(() => {
|
|
807
832
|
if (!mount()) return;
|
|
808
833
|
stopWatching();
|
|
809
834
|
});
|
|
810
835
|
observer.observe(document.body ?? document.documentElement, { childList: true, subtree: true });
|
|
811
|
-
timer = window.setTimeout(stopWatching,
|
|
836
|
+
timer = window.setTimeout(stopWatching, CAPTION_AUTO_HIDE_MS);
|
|
812
837
|
} catch { /* no DOM observer in a test harness */ }
|
|
813
838
|
return cleanup;
|
|
814
839
|
}
|
|
@@ -825,16 +850,32 @@ window.__ModuleLoader__.load({
|
|
|
825
850
|
Object.defineProperty(slots, guard, { value: true, configurable: true, enumerable: false });
|
|
826
851
|
} catch { /* frozen host */ }
|
|
827
852
|
const disposers = [];
|
|
853
|
+
const scheduleAutoHide = (dispose, delay) => {
|
|
854
|
+
if (typeof dispose !== 'function' || typeof window === 'undefined' || typeof window.setTimeout !== 'function') return;
|
|
855
|
+
const timer = window.setTimeout(() => {
|
|
856
|
+
try { dispose(); } catch { /* already gone */ }
|
|
857
|
+
}, delay);
|
|
858
|
+
disposers.push(() => {
|
|
859
|
+
try { window.clearTimeout(timer); } catch { /* already gone */ }
|
|
860
|
+
});
|
|
861
|
+
};
|
|
828
862
|
const styleDisposer = injectStyle(typeof document === 'undefined' ? null : document);
|
|
829
863
|
if (typeof styleDisposer === 'function') disposers.push(styleDisposer);
|
|
830
864
|
const mountSlot = (seat, options, component, what) => {
|
|
831
865
|
try {
|
|
832
866
|
const dispose = slots.inject(seat, () => slots.register({ ...options, name: seat }, component));
|
|
833
|
-
if (typeof dispose
|
|
834
|
-
|
|
867
|
+
if (typeof dispose !== 'function') return null;
|
|
868
|
+
let active = true;
|
|
869
|
+
const once = () => {
|
|
870
|
+
if (!active) return;
|
|
871
|
+
active = false;
|
|
872
|
+
try { dispose(); } catch { /* already gone */ }
|
|
873
|
+
};
|
|
874
|
+
disposers.push(once);
|
|
875
|
+
return once;
|
|
835
876
|
} catch (error) {
|
|
836
877
|
console.error(`@twinsearth/timemachine-dsh-plugin: ${what} was not mounted`, error);
|
|
837
|
-
return
|
|
878
|
+
return null;
|
|
838
879
|
}
|
|
839
880
|
};
|
|
840
881
|
const getService = (name) => (typeof ctx?.get === 'function' ? ctx.get(name) : undefined);
|
|
@@ -884,7 +925,8 @@ window.__ModuleLoader__.load({
|
|
|
884
925
|
}
|
|
885
926
|
};
|
|
886
927
|
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');
|
|
928
|
+
const sidebarDisposer = mountSlot('sidebar.panellist', { id: PANEL_ID, order: -100, label: () => sidebarLabel() }, SidebarEntry, 'the sidebar entry');
|
|
929
|
+
scheduleAutoHide(sidebarDisposer, SIDEBAR_AUTO_HIDE_MS);
|
|
888
930
|
mountSlot('main', { key: PANEL_ID, label: () => 'DSH 一键还原点', inject: () => ({ onRestoreDone: openRestored }) }, MainPage, 'the main panel');
|
|
889
931
|
return () => {
|
|
890
932
|
try {
|
|
@@ -903,6 +945,8 @@ window.__ModuleLoader__.load({
|
|
|
903
945
|
exports.SettingsGeneralRow = SettingsGeneralRow;
|
|
904
946
|
exports.SidebarEntry = SidebarEntry;
|
|
905
947
|
exports.sidebarLabel = sidebarLabel;
|
|
948
|
+
exports.SIDEBAR_AUTO_HIDE_MS = SIDEBAR_AUTO_HIDE_MS;
|
|
949
|
+
exports.CAPTION_AUTO_HIDE_MS = CAPTION_AUTO_HIDE_MS;
|
|
906
950
|
exports.latestLocalPoint = latestLocalPoint;
|
|
907
951
|
exports.injectStyle = injectStyle;
|
|
908
952
|
exports.formatBytes = formatBytes;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twinsearth/timemachine-dsh-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "DSH 一键还原点:手动/自动双还原点、会话与工作区完整备份、第三方插件 latest 重装、配置迁移与一键还原。",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"icon": "./icon.png",
|
|
6
7
|
"exports": {
|
|
7
8
|
".": "./lib/index.js",
|
|
8
9
|
"./client": "./lib/client.js",
|
|
@@ -14,6 +15,7 @@
|
|
|
14
15
|
"src",
|
|
15
16
|
"plugin.json",
|
|
16
17
|
"cordis.patch.yml",
|
|
18
|
+
"icon.png",
|
|
17
19
|
"README.md",
|
|
18
20
|
"CHANGELOG.md",
|
|
19
21
|
"docs",
|
|
@@ -42,9 +44,22 @@
|
|
|
42
44
|
"keywords": [
|
|
43
45
|
"dsh",
|
|
44
46
|
"dsh-plugin",
|
|
47
|
+
"dsh-bundle",
|
|
48
|
+
"deepseek-harness",
|
|
45
49
|
"backup",
|
|
46
50
|
"restore",
|
|
47
51
|
"timemachine"
|
|
48
52
|
],
|
|
49
|
-
"license": "MIT"
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/TwinsEarth/TimeMachine-dsh-plugin.git"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/TwinsEarth/TimeMachine-dsh-plugin#readme",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/TwinsEarth/TimeMachine-dsh-plugin/issues"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
50
65
|
}
|