dsh-session-manager 0.7.2 → 0.7.4
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 +22 -0
- package/README.md +7 -7
- package/README.zh.md +5 -5
- package/lib/client.js +401 -66
- package/lib/compat/dsh-adapter.js +213 -9
- package/lib/index.js +1286 -75
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.7.4 — 2026-10-20
|
|
6
|
+
|
|
7
|
+
- **fix(workspace)**: Repair workspace session membership on DSH 0.2.x. New and forked sessions are now attributed to the workspace owning their `cwd` as soon as the session is announced (runtime repair, no restart needed), and historical sessions whose `cwd` matches a registered workspace are re-registered on startup — all through the official DSH workspace entity API (#41).
|
|
8
|
+
- **fix(move)**: "Move to workspace" on a session whose `cwd` already equals the target workspace path now repairs the missing membership instead of returning a silent no-op. The response reports whether a membership was written (`attached`); the artifact's content, size and mtime are untouched and running sessions are never restarted (#41).
|
|
9
|
+
- **fix(compat)**: Resolve the DSH home through the official `$DSH_HOME` → `~/.dsh` order (tilde-expanded, absolute) when the `dshHomePath` service is not visible to the plugin scope, so session scans and stores work with a custom DSH home (#41).
|
|
10
|
+
- **fix(workspace)**: Read durable workspace membership from the registry record instead of the runtime-filtered projection when deleting sessions, so stale runtime indexes can no longer leave dead entries behind.
|
|
11
|
+
- **test**: Add regression coverage for runtime new/forked session attribution, boot repair, same-path move repair (including artifact byte/size/mtime invariants), idempotence, cross-workspace moves, cwd mismatch safety, incomplete-scan safety, restart stability, archived-session preservation, and custom DSH home resolution (#41).
|
|
12
|
+
- **compat**: Compatible with DSH Desktop v0.2.1-rc.2 (and v0.2.0-rc.2); workspace membership repair uses the official workspace registry entity API.
|
|
13
|
+
- **fix(safety)**: Workspace membership repair never migrates a session that is already accounted by another workspace: such a conflict is refused with `409 workspace-membership-conflict` and both records stay untouched, because an account removed from a different workspace cannot be restored through the official API. Completing a missing membership still goes through the official `attachSession()` after its validation conditions (header readability, cwd resolution, canonical path equality) are pre-checked, so a predictable rejection fails before any write (#41).
|
|
14
|
+
- **fix(api)**: "Move to workspace" no longer reports success when a repair cannot be completed: hosts without the official `attachSession` API answer `501 workspace-attach-unavailable`, an unconfirmable membership state is refused, a membership conflict answers `409 workspace-membership-conflict`, and unsafe or failed repairs answer `500` with `workspace-repair-unsafe` / `workspace-repair-failed`. Successful repairs report `membership` (`already-member` / `attached`) next to the existing `moved` / `attached` fields (#41).
|
|
15
|
+
|
|
16
|
+
## 0.7.3 — 2026-10-18
|
|
17
|
+
|
|
18
|
+
- **fix(update)**: Fix built-in one-click update and resolve `cannot get property "remote" without inject` by routing update requests through the plugin's own Host API instead of client-side `remote.pluginManager`.
|
|
19
|
+
- **feat(update)**: Implement completely independent one-click self-update without relying on `dsh-market`. Support both HMR (`removeBundle` -> `installBundle` sequence with automatic rollback to previous version on failure) and non-HMR environments.
|
|
20
|
+
- **feat(update)**: Add persistent update status tracking (`.dsh-session-manager-update.json` in profile directory) and `GET /update/status` polling recovery, ensuring seamless result delivery even if the client connection is temporarily interrupted during HMR reload.
|
|
21
|
+
- **feat(update)**: Install source protection: automatically identify `linked` (local development) and `github` install sources to refuse npm package overwrites and protect local workspaces.
|
|
22
|
+
- **fix(update)**: Prevent accidental version downgrades with `400 not-upgrade` checks, properly handle `application: "failed"` responses from the bundle installer, and add post-install disk file/entry point verification.
|
|
23
|
+
- **fix(ui)**: Fix button hover contrast in light and dark themes: ensure `.sm-nativeDialogConfirm` retain blue background and white text when hovered.
|
|
24
|
+
- **test**: Add comprehensive regression tests covering update checking, install source protection, HMR safe self-update and automatic rollback, status polling recovery, and button hover styling.
|
|
25
|
+
- **compat**: Compatible with DSH Desktop V0.2.1-rc.2 (and V0.2.0-rc.2).
|
|
26
|
+
|
|
5
27
|
## 0.7.2 — 2026-10-17
|
|
6
28
|
|
|
7
29
|
- **fix(encoding)**: Correct session directory encoding and candidate matching for IM and non-UUID sessions (`encodeFsSessionSegment` matching DSH `encodeSegment` with `~XXXX` hex escapes). Support colons and non-alphanumeric characters in session IDs without directory traversal risks, distinguish project keys from session directory segments, and maintain multi-candidate fallback compatibility for existing sessions (#39).
|
package/README.md
CHANGED
|
@@ -20,14 +20,14 @@ Verified with the official DSH Desktop client; see [5 Compatibility](#5-compatib
|
|
|
20
20
|
|
|
21
21
|
- **Delete** is irreversible and always asks for confirmation. Subagent sessions and transient blank placeholders (no persisted artifact) cannot be deleted.
|
|
22
22
|
- **Archive / Unarchive** moves a session in and out of the active list without touching its disk content.
|
|
23
|
-
- **Move to workspace** keeps history, title, archive state and derived-session relationships intact, rewrites the session's `cwd` to the target workspace, and updates the live writer's header in place so any pending tool calls keep landing on the new path.
|
|
23
|
+
- **Move to workspace** keeps history, title, archive state and derived-session relationships intact, rewrites the session's `cwd` to the target workspace, and updates the live writer's header in place so any pending tool calls keep landing on the new path. When the session's `cwd` already equals the target workspace path but its membership was never recorded, only the missing membership is repaired: no `cwd` rewrite, no artifact rewrite or move, and no session restart.
|
|
24
24
|
- **Migrate Agent preset** rewrites the latest `agent-preset/selected` event (or the session header if no such event exists) so a session whose preset was renamed or removed can resume. Message history is never altered.
|
|
25
25
|
|
|
26
26
|
### 1.2 Session shortcuts
|
|
27
27
|
|
|
28
28
|
- **Favorites / Review-later** are manual flags that survive archive and session end; neither is cleared automatically.
|
|
29
29
|
- **Search** matches title, session ID, note and tags case-insensitively, trims whitespace, and never reads chat history.
|
|
30
|
-
- **Filters and sorting** combine a workspace selector (All / Ungrouped / specific) with an archive filter (All / Active / Archived), then layer favorites / review, tag and priority filters on top. Sort by recently updated (default), least recently updated, newest created, oldest created, or **priority (1 → 5)**.
|
|
30
|
+
- **Filters and sorting** combine a workspace selector (All / Ungrouped / specific) with an archive filter (All / Active / Archived), then layer favorites / review, tag and priority filters on top. Sort by recently updated (default), least recently updated, newest created, oldest created, name ascending (A-Z), name descending (Z-A), or **priority (1 → 5)**.
|
|
31
31
|
- **Priority** is a dropdown **1 Highest, 2 High, 3 Normal, 4 Low, 5 Lowest**, default **3 (Normal)**; legacy `null` priorities are normalized to 3.
|
|
32
32
|
- **Tags / Notes**: up to 20 tags per session (≤ 32 characters each) and a 2000-character note. Both English `,` and Chinese `,` are separators, whitespace is trimmed, duplicate tags are merged case-insensitively.
|
|
33
33
|
- **AI-assisted tagging** is manual and opt-in: **Copy Prompt** writes a structured prompt (Chinese or English, matched to the active UI) to the clipboard; **Import** parses the clipboard JSON (tolerating Markdown fences, conversational wrappers, smart quotes, stray backslashes and a leading BOM), validates it against the same limits, and populates the editor fields. Neither button calls a model automatically.
|
|
@@ -45,7 +45,7 @@ Verified with the official DSH Desktop client; see [5 Compatibility](#5-compatib
|
|
|
45
45
|
|
|
46
46
|
### 1.4 Plugin updates and settings
|
|
47
47
|
|
|
48
|
-
- **Self-update check**:
|
|
48
|
+
- **Self-update check**: An **npm icon button** (Check for updates) in the session manager panel header checks for updates and displays a notification dot when a new version is available. Click to open the update dialog with current and latest versions, and one-click update via the DSH Plugin Manager with support for both HMR and non-HMR environments, persistent status tracking, automatic rollback on failure, and restart/refresh prompts.
|
|
49
49
|
- **Settings Card**: Registered under DSH Settings (`settings.plugin.item`). Displays current version, latest version, inline check/update buttons, an auto-check toggle, and GitHub repository link.
|
|
50
50
|
- **Install Source (Registry)**: Select between **npm official registry** (`registry.npmjs.org`, default) and **China mainland mirror** (`registry.npmmirror.com`) in the Settings Card. Check for updates and download packages directly from the selected registry.
|
|
51
51
|
- **Dialog opacity**: A 50%–100% slider (5% steps, default 100%) with a "Reset to default" button in the Settings Card's preferences section. Adjusts the background fill opacity of plugin dialogs in real time while keeping text, buttons, inputs, tags, and borders fully opaque.
|
|
@@ -68,9 +68,9 @@ Verified with the official DSH Desktop client; see [5 Compatibility](#5-compatib
|
|
|
68
68
|
|
|
69
69
|
The right side of the title area exposes actions for the **current session**: **Archive / Unarchive**, **Tags / Notes**, **Move to workspace**, **Delete session**.
|
|
70
70
|
|
|
71
|
-
### 2.2
|
|
71
|
+
### 2.2 Sessions and workspaces management entry and interface
|
|
72
72
|
|
|
73
|
-
Open
|
|
73
|
+
Open **Sessions & Workspaces** from the bottom of DSH's sidebar to browse all sessions and workspaces: the session management tab supports switching workspaces, searching by title / ID / notes / tags, applying filters and sorting, and running **Open / Archive / Unarchive / Tags / Notes / Move / Migrate preset / Delete** on any session row; the workspace management tab supports searching, sorting, bulk actions, and visibility toggling.
|
|
74
74
|
|
|
75
75
|
### 2.3 Bulk management
|
|
76
76
|
|
|
@@ -136,7 +136,7 @@ After changing plugin dependencies, `package.json`, bundle configuration, or oth
|
|
|
136
136
|
- Cold rewrites preserve the artifact's stored format (V1 / V2 / V3 / V4 are all readable; the plugin never forces an upgrade). Moves and rewrites refuse corrupt / truncated Zstd logs or JSONL logs with incomplete final lines instead of publishing partial history.
|
|
137
137
|
- Preset migration separates backup, publication and rollback. If rollback fails, recovery files are retained and their paths are included in the error; do not remove them.
|
|
138
138
|
- **Workspace archiving rollback protection**: archiving is refused if active sessions are present, and batch session archiving automatically rolls back on partial failures to preserve state consistency.
|
|
139
|
-
-
|
|
139
|
+
- On startup, sessions whose `cwd` names a registered workspace but whose membership record is missing are re-registered through the official DSH API (idempotent). Incomplete scans skip pruning only: existing membership is never dropped, and live sessions or memberships added during the scan are always preserved.
|
|
140
140
|
- Plugin mutations are serialized per session and request bodies are limited to 64 KiB. This queue supplements, rather than replaces, DSH's own persistence coordination.
|
|
141
141
|
|
|
142
142
|
## 5 Compatibility
|
|
@@ -147,7 +147,7 @@ The table below lists verified version combinations between DeepSeek Harness (DS
|
|
|
147
147
|
|
|
148
148
|
| DeepSeek Harness (DSH) | dsh-session-manager | Verified Environment |
|
|
149
149
|
| :--- | :--- | :--- |
|
|
150
|
-
| **v0.2.1-rc.2** | `0.7.2` | Desktop |
|
|
150
|
+
| **v0.2.1-rc.2** | `0.7.4`, `0.7.3`, `0.7.2` | Desktop |
|
|
151
151
|
| **v0.2.0-rc.2** | `0.7.1`, `0.7.0`, `0.6.4`, `0.6.3`, `0.6.2`, `0.5.4` | Desktop |
|
|
152
152
|
| **v0.1.7-rc.2** | `0.5.3` | Desktop / Web UI |
|
|
153
153
|
| **v0.1.7-rc.1** | `0.5.2` | Desktop / Web UI |
|
package/README.zh.md
CHANGED
|
@@ -20,14 +20,14 @@ DSH 会话与工作区管理——工作区:归档与显示。会话:跨工
|
|
|
20
20
|
|
|
21
21
|
- **删除**:不可逆操作,UI 始终要求二次确认。subagent 会话和尚未落盘的空白会话占位不能删除。
|
|
22
22
|
- **归档 / 移出归档**:把会话移出或移回主列表,不删除磁盘内容。
|
|
23
|
-
- **移动至工作区**:跨工作区移动时保留历史、标题、归档状态和派生会话关系,同时把 `cwd` 重写为目标工作区,并就地更新 live writer 的 header
|
|
23
|
+
- **移动至工作区**:跨工作区移动时保留历史、标题、归档状态和派生会话关系,同时把 `cwd` 重写为目标工作区,并就地更新 live writer 的 header,使挂起的工具调用继续落到新路径。若会话的 `cwd` 本来就等于目标工作区、只是归属未登记,则只补全归属记录,不改写 `cwd`、不重写或移动工件、不重启会话。
|
|
24
24
|
- **迁移 Agent 预设**:原预设被改名或删除导致会话无法恢复时,可修复该会话。迁移会就地重写最后一条 `agent-preset/selected` 事件(若从未记录则修改会话 header),不改动历史消息。
|
|
25
25
|
|
|
26
26
|
### 1.2 会话快捷管理
|
|
27
27
|
|
|
28
28
|
- **收藏 / 待回看**:长期标记和手动提醒;不会随归档或会话结束自动清除。
|
|
29
29
|
- **搜索**:按标题、会话 ID、备注、标签不区分大小写匹配,自动去除首尾空格,不读取聊天历史。
|
|
30
|
-
- **筛选与排序**:工作区(全部 / 未分组 / 具体)与归档状态(全部 / 未归档 / 已归档)可叠加;可叠加收藏 /
|
|
30
|
+
- **筛选与排序**:工作区(全部 / 未分组 / 具体)与归档状态(全部 / 未归档 / 已归档)可叠加;可叠加收藏 / 待回看、标签和优先级筛选;排序支持最近更新(默认)、最早更新、最新创建、最早创建、名称升序(A → Z)、名称降序(Z → A)以及**优先级(1 → 5)**。
|
|
31
31
|
- **优先级**:下拉 **1 最高、2 高、3 普通、4 低、5 最低**,**默认 3(普通)**;旧数据中的 `null` 归一化为 3。
|
|
32
32
|
- **标签 / 备注**:每会话最多 20 个标签(每个 ≤ 32 字符)、备注最多 2000 字符。英文 `,` 与中文 `,` 都是分隔符,首尾空白被去除,重复标签按大小写不敏感合并。
|
|
33
33
|
- **AI 整理(手动、可选)**:标签 / 备注编辑窗口内的 **复制 Prompt** 把结构化提示复制到剪贴板,**导入** 解析剪贴板 JSON(可识别 Markdown 代码块、对话包裹、智能引号、孤立反斜杠和开头 BOM),按相同规则校验后填入字段;两者都不会自动调用模型。
|
|
@@ -43,7 +43,7 @@ DSH 会话与工作区管理——工作区:归档与显示。会话:跨工
|
|
|
43
43
|
|
|
44
44
|
### 1.4 插件更新与设置卡片
|
|
45
45
|
|
|
46
|
-
- **检查更新**:会话管理窗口顶部提供
|
|
46
|
+
- **检查更新**:会话管理窗口顶部提供 **npm 图标按钮**(检查更新),点击可检查新版本并在有更新时展示小红点提示;点击弹出更新窗口,展示当前版本与最新版本,支持完全独立的一键自动更新,内置安装源保护、HMR 与非 HMR 环境自适应协调、更新状态持久化校验、失败自动回滚和重启/刷新提示。
|
|
47
47
|
- **设置卡片**:注册在 DSH 设置的插件配置页(`settings.plugin.item`)。展示当前安装版本、最新版本状态、卡片内检查更新与更新按钮、自动检查偏好开关以及 GitHub 仓库链接。
|
|
48
48
|
- **安装源选择**:在设置卡片中可随时切换安装源,可选 **npm 官方源**(`registry.npmjs.org`,默认)与 **中国大陆镜像源**(`registry.npmmirror.com`);检查更新与版本下载将直接请求所选源。
|
|
49
49
|
- **弹窗透明度**:设置卡片「偏好设置」区域提供 50%–100% 滑块(步长 5%,默认 100%)与「恢复默认」按钮,支持调节插件弹窗的背景填充透明度,文字、按钮、输入框、标签与边框等内容保持不透明并即时生效。
|
|
@@ -134,7 +134,7 @@ dsh plugin --profile web add <本仓库路径>
|
|
|
134
134
|
- 冷会话重写保留原工件格式(V1 / V2 / V3 / V4 都可读,绝不强制升级)。损坏或截断的 Zstd 日志、缺少完整尾行的 JSONL 会拒绝移动 / 重写,不会把部分历史当作完整日志保存。
|
|
135
135
|
- 迁移预设按"备份 → 发布 → 回滚"分阶段处理。如果回滚失败,会保留恢复文件并在错误中报告路径;不要删除这些文件。
|
|
136
136
|
- **工作区归档事务保护**:若工作区内存在运行中会话则拒绝归档;批量归档会话若中途遇到异常会自动回滚已变更状态,避免部分成功导致状态不一致。
|
|
137
|
-
-
|
|
137
|
+
- 启动时若发现 `cwd` 对应已注册工作区但归属记录遗漏的会话,会通过 DSH 官方接口补全登记(幂等);扫描不完整时只跳过清理,不会误删现有归属,也不会清除仍在内存中或扫描期间新加入的会话。
|
|
138
138
|
- 同一会话的插件写操作按顺序执行;请求体限制为 64 KiB。该队列不替代 DSH 自身的持久化写入协调。
|
|
139
139
|
|
|
140
140
|
## 5 兼容性
|
|
@@ -145,7 +145,7 @@ dsh plugin --profile web add <本仓库路径>
|
|
|
145
145
|
|
|
146
146
|
| DeepSeek Harness (DSH) | dsh-session-manager | 验证环境 |
|
|
147
147
|
| :--- | :--- | :--- |
|
|
148
|
-
| **v0.2.1-rc.2** | `0.7.2` | Desktop |
|
|
148
|
+
| **v0.2.1-rc.2** | `0.7.4`, `0.7.3`, `0.7.2` | Desktop |
|
|
149
149
|
| **v0.2.0-rc.2** | `0.7.1`, `0.7.0`, `0.6.4`, `0.6.3`, `0.6.2`, `0.5.4` | Desktop |
|
|
150
150
|
| **v0.1.7-rc.2** | `0.5.3` | Desktop / Web UI |
|
|
151
151
|
| **v0.1.7-rc.1** | `0.5.2` | Desktop / Web UI |
|