@michengai/dsh-archive-manager 0.1.3 → 0.1.5
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/README.md
CHANGED
|
@@ -21,17 +21,20 @@
|
|
|
21
21
|
<img src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=nodedotjs&logoColor=white" alt="Node.js 22 or later">
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="assets/screenshots/archived-sessions.png" alt="Archived Sessions settings page" width="1200">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
24
28
|
> DSH Archive Manager is a community-maintained plugin, not an official DeepSeek AI product.
|
|
25
29
|
|
|
26
30
|
## Features
|
|
27
31
|
|
|
32
|
+
- Archives a session from the sidebar session menu.
|
|
28
33
|
- Lists archived sessions by workspace in **Settings → Archived Sessions**.
|
|
29
34
|
- Safely restores a session to its original workspace position.
|
|
30
35
|
- Permanently deletes a confirmed session, its workspace association, archive marker, and projection cache.
|
|
31
36
|
- Removes unloaded deleted sessions from connected sidebars immediately.
|
|
32
37
|
|
|
33
|
-

|
|
34
|
-
|
|
35
38
|
## Prerequisites
|
|
36
39
|
|
|
37
40
|
- A working DeepSeek Harness Web installation with `dsh` available in PowerShell.
|
|
@@ -73,11 +76,15 @@ Restart DSH Web and hard-refresh the browser. Local installation applies `cordis
|
|
|
73
76
|
|
|
74
77
|
## Usage
|
|
75
78
|
|
|
76
|
-
1. Open
|
|
77
|
-
2.
|
|
78
|
-
3. Select **Unarchive** to restore a session, or
|
|
79
|
+
1. Open the sidebar session menu and choose **Archive session**.
|
|
80
|
+
2. Open **Settings → Archived Sessions** to inspect sessions by workspace.
|
|
81
|
+
3. Select **Unarchive** to restore a session, or use the delete icon to remove it permanently.
|
|
79
82
|
4. Confirm deletion. **It cannot be undone.**
|
|
80
83
|
|
|
84
|
+
<p align="center">
|
|
85
|
+
<img src="assets/screenshots/archive-session-menu.png" alt="Archive a session from the session menu" width="1200">
|
|
86
|
+
</p>
|
|
87
|
+
|
|
81
88
|
If the entry is missing after installation or upgrade, restart DSH Web and hard-refresh the browser. It is located directly after **Connectors** in Settings.
|
|
82
89
|
|
|
83
90
|
## Data handling limits
|
package/README.zh-CN.md
CHANGED
|
@@ -21,17 +21,20 @@
|
|
|
21
21
|
<img src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=nodedotjs&logoColor=white" alt="Node.js 22 或更高版本">
|
|
22
22
|
</p>
|
|
23
23
|
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="assets/screenshots/archived-sessions.png" alt="已归档会话设置页面" width="1200">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
24
28
|
> DSH Archive Manager 是社区维护的插件,并非 DeepSeek AI 官方产品。
|
|
25
29
|
|
|
26
30
|
## 功能概览
|
|
27
31
|
|
|
32
|
+
- 在侧栏会话菜单中选择「归档会话」。
|
|
28
33
|
- 在「设置 → 已归档」按工作区展示归档会话。
|
|
29
34
|
- 安全取消归档,将会话恢复到原工作区位置。
|
|
30
35
|
- 经确认后永久删除会话、工作区归属、归档标记和投影缓存。
|
|
31
36
|
- 已删除的未加载归档会话会立即从已连接客户端的侧栏移除。
|
|
32
37
|
|
|
33
|
-

|
|
34
|
-
|
|
35
38
|
## 前置条件
|
|
36
39
|
|
|
37
40
|
- 已可正常运行 DeepSeek Harness Web,且可在 PowerShell 中使用 `dsh`。
|
|
@@ -73,12 +76,16 @@ dsh --profile web --dump-config
|
|
|
73
76
|
|
|
74
77
|
## 使用
|
|
75
78
|
|
|
76
|
-
1.
|
|
77
|
-
2.
|
|
78
|
-
3.
|
|
79
|
+
1. 在侧栏右键或打开会话菜单,选择「归档会话」。
|
|
80
|
+
2. 打开「设置 → 已归档」,按工作区查看归档会话。
|
|
81
|
+
3. 点击「取消归档」恢复会话;点击删除图标永久移除会话。
|
|
79
82
|
4. 删除前确认提示。**删除无法撤销。**
|
|
80
83
|
|
|
81
|
-
|
|
84
|
+
<p align="center">
|
|
85
|
+
<img src="assets/screenshots/archive-session-menu.png" alt="从会话菜单归档会话" width="1200">
|
|
86
|
+
</p>
|
|
87
|
+
|
|
88
|
+
安装或升级后找不到入口时,重启 DSH Web 并硬刷新浏览器;入口位于「设置」中,连接器之后。
|
|
82
89
|
|
|
83
90
|
## 数据处理边界
|
|
84
91
|
|
|
Binary file
|
|
Binary file
|
package/lib/workspace.js
CHANGED
|
@@ -17,7 +17,7 @@ import { sessionDir } from "@deepseek-ai/dsh-spill-local";
|
|
|
17
17
|
*
|
|
18
18
|
* 所有可失败的持久化清理都先于不可逆的物理删除。此前任一步失败时,
|
|
19
19
|
* 转录仍保留,可重试删除;物理删除失败时记录残留路径供人工排查。
|
|
20
|
-
* `unarchiveSession` 与 `deleteSession` 通过 Typert Remote
|
|
20
|
+
* `unarchiveSession` 与 `deleteSession` 通过 Typert Remote 暴露给浏览器,并注册到 typert.local,避免生产环境只靠 SRC 扫描时 404。
|
|
21
21
|
*/
|
|
22
22
|
function markRemoteMethod(instance, method) {
|
|
23
23
|
// Simulate the TS decorator pipeline `@Remote(method)` for one method:
|
|
@@ -33,17 +33,100 @@ function markRemoteMethod(instance, method) {
|
|
|
33
33
|
};
|
|
34
34
|
Remote(method)(void 0, context);
|
|
35
35
|
}
|
|
36
|
+
const sessionIdSchema = {
|
|
37
|
+
parse(value) {
|
|
38
|
+
if (typeof value !== "string" || value.length === 0) throw new TypeError(`sessionId must be a non-empty string, got ${String(value)}`);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const archivedSetSchema = {
|
|
43
|
+
parse(value) {
|
|
44
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new TypeError("result must be an object");
|
|
45
|
+
const ids = value.archivedSessionIds;
|
|
46
|
+
if (!Array.isArray(ids) || ids.some((id) => typeof id !== "string")) throw new TypeError("archivedSessionIds must be a string array");
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const deletedSchema = {
|
|
51
|
+
parse(value) {
|
|
52
|
+
if (typeof value !== "object" || value === null || Array.isArray(value) || value.deleted !== true) throw new TypeError("deleted must be true");
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Host 严格描述符。网关优先读 typert.local,避免 SRC 扫描缓存
|
|
58
|
+
* 或协议包双份导致 /api/workspaceRegistry/deleteSession 在生产环境 404。
|
|
59
|
+
*/
|
|
60
|
+
const ARCHIVE_MANAGER_INVOCATIONS = [
|
|
61
|
+
{
|
|
62
|
+
id: "@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",
|
|
63
|
+
service: "workspaceRegistry",
|
|
64
|
+
namespace: "workspaceRegistry",
|
|
65
|
+
method: "unarchiveSession",
|
|
66
|
+
invocation: { kind: "direct" },
|
|
67
|
+
parameters: [{
|
|
68
|
+
name: "sessionId",
|
|
69
|
+
wire: "sessionId",
|
|
70
|
+
source: "json",
|
|
71
|
+
codec: { mode: "strict", typeSymbol: "@deepseek-ai/dsh-session/types#SessionId", schema: sessionIdSchema }
|
|
72
|
+
}],
|
|
73
|
+
result: {
|
|
74
|
+
mode: "strict",
|
|
75
|
+
typeSymbol: "@michengai/dsh-archive-manager/types#ArchivedSessionIds",
|
|
76
|
+
schema: archivedSetSchema
|
|
77
|
+
},
|
|
78
|
+
sourceLocation: { file: "@michengai/dsh-archive-manager/lib/workspace.js", line: 1, column: 1 }
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",
|
|
82
|
+
service: "workspaceRegistry",
|
|
83
|
+
namespace: "workspaceRegistry",
|
|
84
|
+
method: "deleteSession",
|
|
85
|
+
invocation: { kind: "direct" },
|
|
86
|
+
parameters: [{
|
|
87
|
+
name: "sessionId",
|
|
88
|
+
wire: "sessionId",
|
|
89
|
+
source: "json",
|
|
90
|
+
codec: { mode: "strict", typeSymbol: "@deepseek-ai/dsh-session/types#SessionId", schema: sessionIdSchema }
|
|
91
|
+
}],
|
|
92
|
+
result: {
|
|
93
|
+
mode: "strict",
|
|
94
|
+
typeSymbol: "@michengai/dsh-archive-manager/types#Deleted",
|
|
95
|
+
schema: deletedSchema
|
|
96
|
+
},
|
|
97
|
+
sourceLocation: { file: "@michengai/dsh-archive-manager/lib/workspace.js", line: 1, column: 1 }
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
const ARCHIVE_MANAGER_TYPERT = {
|
|
101
|
+
package: "@michengai/dsh-archive-manager",
|
|
102
|
+
face: "host",
|
|
103
|
+
schemas: [],
|
|
104
|
+
model: { services: [], events: [], objects: [] },
|
|
105
|
+
invocations: ARCHIVE_MANAGER_INVOCATIONS
|
|
106
|
+
};
|
|
107
|
+
function registerHostRemote(ctx) {
|
|
108
|
+
const existing = ctx.get("typert");
|
|
109
|
+
if (existing !== undefined) {
|
|
110
|
+
existing.register(ARCHIVE_MANAGER_TYPERT);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
ctx.inject(["typert"], (typertCtx) => {
|
|
114
|
+
typertCtx.typert.register(ARCHIVE_MANAGER_TYPERT);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
36
117
|
var ArchiveWorkspaceRegistry = class extends WorkspaceRegistry {
|
|
37
118
|
static inject = [
|
|
38
119
|
"storageDomain",
|
|
39
120
|
"sessionPersistence",
|
|
40
|
-
"sessionProjectionCache"
|
|
121
|
+
"sessionProjectionCache",
|
|
122
|
+
"typert"
|
|
41
123
|
];
|
|
42
124
|
constructor(ctx) {
|
|
43
125
|
super(ctx);
|
|
44
126
|
this.typertRemote = bindTypertRemote(this, this.name);
|
|
45
127
|
markRemoteMethod(this, "unarchiveSession");
|
|
46
128
|
markRemoteMethod(this, "deleteSession");
|
|
129
|
+
registerHostRemote(this.ctx);
|
|
47
130
|
}
|
|
48
131
|
/**
|
|
49
132
|
* Move one session out of the registry-global archive set, restoring its
|