dsh-zed-cc-workbench 0.0.0-stage → 2.0.0
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/LICENSE +21 -0
- package/README.md +56 -2
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/client.js +1445 -0
- package/cordis.patch.yml +3 -0
- package/docs/DELIVERY.md +194 -0
- package/docs/DETAIL.md +27 -0
- package/docs/DETAIL.zh.md +27 -0
- package/docs/INSTALL.zh.md +58 -0
- package/docs/icon-180.html +18 -0
- package/docs/icon-180.png +0 -0
- package/icon.svg +5 -0
- package/index.js +616 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +54 -4
package/cordis.patch.yml
ADDED
package/docs/DELIVERY.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# 交付报告:全部会话(All sessions)插件
|
|
2
|
+
|
|
3
|
+
日期:2026-11-17
|
|
4
|
+
位置:`C:\Users\hande\dsh-all-sessions-plugin`(版本 1.7.1,桌面 profile 以 `link:` 方式安装)
|
|
5
|
+
|
|
6
|
+
## 0. 本次更新(v1.9.0)
|
|
7
|
+
|
|
8
|
+
- 更名:插件从「全部会话 / @local/all-sessions」改为 **Zed / Claude Code 会话工作台**,npm 包名 `dsh-session-workbench`,版本 1.9.0。
|
|
9
|
+
- 客户端模块 id、bundle patch 行、locale 元数据、侧栏标签与页面标题同步改名;内部布局 key(`all-sessions`)保持不变,已有面板位置/状态不受影响。
|
|
10
|
+
- 本机 profile 已改为 link 到 `dsh-session-workbench`(pnpm 安装完成),重启 DSH 后以新名字加载。
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## 0.1 本次更新(v1.8.3)
|
|
14
|
+
|
|
15
|
+
- 修复:Zed / VS Code / CLI 里新开的 Claude Code 会话也不会自动出现。原因是 CC 会话索引(`claude-sessions.json`)只在页面加载时读一次;现在页面每 10 秒、窗口聚焦时重读该索引,索引变化时清空消息摘要缓存(下次搜索重读,包含新会话正文)。
|
|
16
|
+
- Host 侧 CC 扫描间隔从 60s 降到 10s(按文件 mtime 增量;未变化的文件不重新解析)。
|
|
17
|
+
- 实测:页面打开状态下向索引加入新会话,10 秒内出现在列表;Zed 新会话的计数随索引更新(当前 116)。
|
|
18
|
+
|
|
19
|
+
## 0.2 本次更新(v1.8.2)
|
|
20
|
+
|
|
21
|
+
- 修复:Zed 上新建的会话不能及时出现在列表。客户端会话目录(session.list)平时只在拉起时做一次 baseline,外部进程(Zed 的 ACP proxy / 另一个 dsh 进程)新建的会话不会被推送到这个 Host。现在打开「全部会话」页会立即调用一次 `ctx.sessions.refresh()`,之后每 4 秒、以及窗口重新聚焦时再拉一次,Zed 新建的会话通常几秒内出现,不需要重启。
|
|
22
|
+
|
|
23
|
+
## 0.3 本次更新(v1.8.1)
|
|
24
|
+
|
|
25
|
+
- 修复:内嵌终端点「关闭」后再次点击 CC 会话打不开。原因是 `webTerminals.view()` 按 key 缓存视图,关闭后复用同一个 key 会拿到已经 dispose 的 view;现在每次打开都用唯一 key/contentId(`all-sessions-cc-<id>-<nonce>`、`all-sessions:<id>:<nonce>`),关闭后再点会创建新的终端并重新执行 resume。
|
|
26
|
+
- 关闭按钮加 `aria-label="关闭终端"`,便于识别(与页面上其他「关闭」区分)。
|
|
27
|
+
|
|
28
|
+
## 0.4 本次更新(v1.8.0)
|
|
29
|
+
|
|
30
|
+
- **页面内嵌终端**:DSH 在全局页面模式下会隐藏右侧栏(`sidebar-right` 的 `visible = activePanelId === null`),所以改为在「全部会话」页面右侧内嵌一个真正的终端(打包 xterm 5.3.0,MIT)。
|
|
31
|
+
- 点 CC 行 → 页面右侧出现「终端 · <会话名>」面板,自动执行 `cd /d "<cwd>" && "<claude.exe>" --resume <id>`;实测起 `claude.exe --resume …` 且能看到之前的对话与 REPL。
|
|
32
|
+
- 终端是真实 PTY(`webTerminals`),可输入、可滚动;「关闭」按钮结束终端进程;xterm 不可用/终端服务缺失时自动退回复制命令。
|
|
33
|
+
- client.js 体积约 352 KB(含 xterm),tarball 98.4 KB。
|
|
34
|
+
|
|
35
|
+
## 0.5 本次更新(v1.7.1)
|
|
36
|
+
|
|
37
|
+
- 修正(v1.7.1):cmd.exe 终端里 `claude` 可能不在 PATH(npm shim 被删/未生成)→ Host 解析 CLI 绝对路径(npm 全局包 `@anthropic-ai/claude-code/bin/claude.exe` → npm shim → PATH 扫描),写进 `claude-sessions.json` 的 `cli` 字段;命令用绝对路径执行。实测 cmd 下点击后成功起 `claude.exe --resume …`。
|
|
38
|
+
|
|
39
|
+
## 0.6 点击 CC 会话直接在终端恢复(v1.7.0)
|
|
40
|
+
|
|
41
|
+
- 点击 CC 会话行:通过 DSH 客户端服务 `sidebarRight` + `webTerminals` 在右侧栏开一个终端,等它可写后自动输入 `cd /d "<cwd>" && claude --resume <id>` 并回车;已实测起 `claude.exe --resume <id>`。
|
|
42
|
+
- 右侧按钮「复制恢复命令」仍只复制命令;终端服务不可用(旧版 DSH / 终端 plugin 未启用 / 找不到 tab)时自动退回复制,不报错。
|
|
43
|
+
- 实现要点:`sidebar.openTabIn(sessionId,'terminal',{params:{}})` → 从 `openTabs` 快照找 `{sessionId,tabId,kind:'terminal'}` → `tabDomain.occurrence` 取 address/params → `webTerminals.view(...)` → `view.mount()` → 等 `state.writable` → `view.write(text+'\r')`。
|
|
44
|
+
|
|
45
|
+
## 0.7 打包分发给同事(v1.6.1)
|
|
46
|
+
|
|
47
|
+
- 跨平台/可移植性修正:
|
|
48
|
+
- 客户端不再写死 `C:\Users\hande`:从会话 `cwd` 推导候选 home,用 `workspaceFiles.list(<home>/.dsh)` / `readBytes(claude-sessions.json|zed-thread-titles.json)` / `stat` 多路探测(失败每 4s 重试,最多 3 次),命中后缓存到 localStorage;找不到时页面提示「无法定位 DSH 数据目录」,DSH 会话列表仍可用。
|
|
49
|
+
- Host 的 Zed 数据库路径按 `process.platform` 分支(Windows / macOS / Linux)。
|
|
50
|
+
- CC 恢复命令按 cwd 形态生成:Windows 用 `cd /d`,macOS/Linux 用 `cd`。
|
|
51
|
+
- 修正:`workspaceFiles.stat(<home>/.dsh)` 对目录探测不可靠,曾导致升级后 CC 区/标题同步整体消失;已改为多路探测。
|
|
52
|
+
- 产出 tarball:`dsh-zed-cc-workbench-2.0.0.tgz`(105.2 KB,13 个文件,sha256 `4BA4E7A6…B66522748`);旧版包已删除,避免误发。
|
|
53
|
+
- 安装步骤见 `docs/INSTALL.zh.md`:`dsh plugin --profile desktop add <tgz>` → 在 `dsh.profile.bundles` 加 `@local/all-sessions`(或设置页启用)→ 重启 DSH。
|
|
54
|
+
- 已在临时 npm 项目中验证 tarball 可安装、文件齐全;未修改本机 desktop profile。
|
|
55
|
+
|
|
56
|
+
## 0.8 本次更新(v1.6)
|
|
57
|
+
|
|
58
|
+
**把 Claude Code 会话也接进来(CLI / VS Code 插件 / Zed ACP)**
|
|
59
|
+
|
|
60
|
+
- Host 半侧扫描 `~/.claude/projects/**/<uuid>.jsonl`(只收顶层会话,跳过 `agent-*` 子代理日志),解析出:
|
|
61
|
+
- 会话 id、cwd、最后活动时间、`ai-title`(Claude 自己生成的名字)、入口类型;
|
|
62
|
+
- 可搜索消息:用户文本、助手文本、工具调用名称+参数(不含工具结果)。
|
|
63
|
+
- 来源识别:`entrypoint` → `sdk-cli` = CLI、`claude-vscode` = VS Code、`sdk-ts` = Zed/ACP;若该 id 命中 Zed 的 `claude-acp` 线程,则用 Zed 标题(含改名)并标记为 Zed。
|
|
64
|
+
- 写出 `~/.dsh/storages/claude-sessions.json`(114 个会话,19 KB)与 `claude-messages.json`(1.9 万条,13 MB),每 60s 按文件 mtime 增量刷新。
|
|
65
|
+
- Client 页面新增「Claude Code 会话」区:按时间排序,行上带 `CC` + 来源标签(CLI / VS Code / Zed)、工作目录短名;点击行或按钮复制恢复命令 `cd /d "<cwd>" && claude --resume <id>`;默认显示最近 12 条,可「显示全部」。
|
|
66
|
+
- 搜索:CC 消息并入统一的内容命中(与 DSH 会话同一套片段展示);归档筛选为「已归档」时不显示 CC 行(CC 没有归档状态)。
|
|
67
|
+
|
|
68
|
+
## 0.9 本次更新(v1.5)
|
|
69
|
+
|
|
70
|
+
**插件自带的会话正文搜索(不再依赖 DSH 的 session-query-sqlite)**
|
|
71
|
+
|
|
72
|
+
- Host 半侧扫描 `~/.dsh/sessions/**`(多帧 zstd 逐帧解压,坏帧跳过),提取:
|
|
73
|
+
- `u` 用户消息、`a` 助手文本、`c` 工具调用名称 + 参数;
|
|
74
|
+
- **不包含** `tool/result` 工具输出(命令 stdout、文件内容、搜索结果)。
|
|
75
|
+
- 写成 `~/.dsh/storages/all-sessions-messages.json`(当前 11 MB / 1.27 万条),启动后每 15s 增量刷新(只重读变化的会话日志)。
|
|
76
|
+
- Client 首次搜索时通过 `workspaceFiles.readBytes` 读入内存,直接子串匹配(约 2–3 ms),命中显示片段;工具调用命中带「工具:」前缀。
|
|
77
|
+
- 优点:中文子串可搜(DSH 原生 FTS 的 unicode61 对中文无效);不需要开 DSH 搜索索引;旧版日志也能读,不会被 seq gap 阻塞;不改任何会话文件。
|
|
78
|
+
- 兼容:会话目录名不一定是 `session-*`(Zed/ACP 会话用裸 session id),扫描时按"目录里有会话日志"判断;同一会话的旧版日志与 v4 日志会合并去重(按 时间+文本),避免迁移后丢历史。
|
|
79
|
+
- 验证:`灰阶过渡`、`调节PAM3`、`工作仓库`、`经济学人`、`六爻` 均命中;`Get-ChildItem` 命中工具调用参数;真机搜索 `灰阶过渡` 在 `dsh_3280 PAM3` 行显示「正文匹配:…白色的灰阶过渡光滑的曲线」。
|
|
80
|
+
|
|
81
|
+
## 0.10 本次更新(v1.4)
|
|
82
|
+
|
|
83
|
+
在 v1.3 基础上继续增强工作区浏览:
|
|
84
|
+
|
|
85
|
+
1. **一键折叠 / 一键展开**:工具栏新增「全部折叠」「全部展开」,对当前(含筛选后的)所有工作组生效。
|
|
86
|
+
2. **默认全部折叠**:进入页面时只显示组头与「最近打开」,需要时再展开某个工作区。
|
|
87
|
+
3. **最近打开**:列表顶部新增「最近打开」区(最多 6 条),按最近活动排序;在本页打开过的会话会记录本地时间(`localStorage`)并优先置顶,行内带工作目录短名,方便跨工作区快速回到刚用过的会话。
|
|
88
|
+
4. 「最近打开」同样受搜索与「全部 / 未归档 / 已归档」筛选约束。
|
|
89
|
+
5. **v1.4.1 修正**:最近打开的排序改为 `max(DSH 更新时间, Zed 线程更新时间, 本页打开记录)`。Zed ACP 会话在 DSH 里的 header 时间往往停留在旧值(如 11/13),而 Zed 自己的 `sidebar_threads.updated_at` 才是真实使用时间;现在 `dsh_3280 PAM3` 这类 Zed 会话会按 Zed 时间(09:20)出现在最近打开里,行内时间也显示 Zed 时间。
|
|
90
|
+
|
|
91
|
+
## 0.11 本次更新(v1.3)
|
|
92
|
+
|
|
93
|
+
按反馈新增四项工作区浏览能力:
|
|
94
|
+
|
|
95
|
+
1. **按工作区分组**:列表按 `cwd` 分组,组头显示路径与数量,按组内会话数降序排列。
|
|
96
|
+
2. **工作区可折叠**:点击组头折叠/展开(`aria-expanded` + `ExpandCollapsePattern` 可访问),组头在滚动时吸顶。
|
|
97
|
+
3. **列表可滚动**:页面改为「顶部固定(标题/搜索/筛选)+ 列表独立滚动」布局,超出视口的内容上下滚动浏览。
|
|
98
|
+
4. **类型筛选**:`全部 / 未归档 / 已归档` 分段控件,实时显示各自数量(如 `全部 267 / 未归档 253 / 已归档 14`)。
|
|
99
|
+
|
|
100
|
+
真机验证(UIAutomation + 截图):24 个工作组、267 行;折叠 `WorkBuddy\Claw` 后行数 267 → 213,展开后回到 267;切到「已归档」只剩已归档行,切回「全部」恢复;筛选与折叠均在真实页面上生效。
|
|
101
|
+
|
|
102
|
+
## 1. 交付目标
|
|
103
|
+
|
|
104
|
+
在 DSH 左侧栏提供「全部会话」页,让本机所有 DSH 会话(包括 Zed ACP 起的会话)可跨工作目录查看、搜索、打开,并满足:
|
|
105
|
+
|
|
106
|
+
1. 显示的名字与 Zed 里改过的线程名一致;
|
|
107
|
+
2. 每行有「归档 / 取消归档」,点击先确认再执行(不做物理删除);
|
|
108
|
+
3. 显示当前会话运行状态(运行中 / 已停止)。
|
|
109
|
+
|
|
110
|
+
## 2. 实现要点
|
|
111
|
+
|
|
112
|
+
| 部分 | 改动 |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| `client.js` | 侧栏面板 + 主页面;搜索(标题/目录/ID 即时匹配 + 250ms 防抖的 Host 正文搜索);运行状态;确认式归档;Zed 标题投影读取;`PageErrorBoundary` 崩溃可视化 + 错误自动上报;`apply` 失败兜底页 |
|
|
115
|
+
| `index.js`(Host 半侧) | 每 5s 只读扫描 Zed `sidebar_threads`(`title_override` 优先),原子写入 `~/.dsh/storages/zed-thread-titles.json` |
|
|
116
|
+
| `dsh-acp-proxy.mjs` | Zed 连接期间同样刷新上述投影(复用 Host 半侧导出函数) |
|
|
117
|
+
| `~/.dsh/profiles/desktop/cordis.patch.yml` | 覆盖 `session-query-sqlite`:`path: C:\Users\hande\.dsh\storages\session-search.db`、`openAt: first-search`(开启 Host 正文索引) |
|
|
118
|
+
|
|
119
|
+
关键回归点:客户端插件访问 remote 命名空间必须声明完整服务名。
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
inject: ['slots', 'locale', 'layout', 'uiWorkspace', 'sessions', 'workspaces', 'remote', 'remote.workspaceFiles']
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
只写 `'remote'` 会报 `cannot get property "remote.workspaceFiles" without inject`(页面黑屏/红字的直接原因)。
|
|
126
|
+
|
|
127
|
+
## 3. 验收证据
|
|
128
|
+
|
|
129
|
+
### 3.1 自动化测试(全部通过)
|
|
130
|
+
|
|
131
|
+
- `C:\Users\hande\_verify_all_sessions.mjs`:25 项 ALL PASS(语法、投影标题、inject 回归、归档/状态文案、profile patch、代理同步)
|
|
132
|
+
- `C:\Users\hande\_render_all_sessions.mjs`:react-test-renderer + 模拟 Cordis inject 约束
|
|
133
|
+
- 页面渲染、Zed 标题经 `workspaceFiles` 生效
|
|
134
|
+
- 归档按钮 → 确认框 → 确认后才调用 `archiveSession(id, { stopActivity: true })` → 对话框关闭、行变「取消归档」
|
|
135
|
+
- 崩溃边界渲染错误文本(不再黑屏)
|
|
136
|
+
|
|
137
|
+
### 3.2 真机验证(Windows 桌面应用,UIAutomation 读取实际页面)
|
|
138
|
+
|
|
139
|
+
- 页面:`全部会话 · 本机所有 DSH 会话 · 267 个会话 · 24 个工作目录`
|
|
140
|
+
- 搜索 `PAM3` 过滤后精确命中目标行:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
dsh_3280 PAM3 [Zed] 已停止 11/13 18:50 · 289ac838 [归档]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- 已归档会话行显示 `[已归档]` + `[取消归档]`
|
|
147
|
+
- 目标会话投影:`threads["289ac838-77e6-4739-a335-c3a9598a05df"].title = "dsh_3280 PAM3"`(`storedTitle` 保留原始长标题)
|
|
148
|
+
- 页面无红色错误;投影文件在页面挂载后被周期读取
|
|
149
|
+
|
|
150
|
+
## 4. 已知限制
|
|
151
|
+
|
|
152
|
+
**正文(全文)搜索当前不可用**,但页面按设计降级:标题 / 工作目录 / 会话 ID 搜索正常,并在正文搜索失败时显示明确提示。
|
|
153
|
+
|
|
154
|
+
原因(与插件无关,属 DSH 旧版日志兼容问题):
|
|
155
|
+
|
|
156
|
+
- `session-query-sqlite` 在首次搜索时会对**全部持久化会话**做 reconcile;
|
|
157
|
+
- 本机 275 个会话日志中有 **112 个旧版 `session.jsonl.zstd`**(共 31.7 MB)存在事件序号跳号;
|
|
158
|
+
- v3 → v4 迁移失败会抛 `SessionFormatError: … seq gap …`,导致整个全文搜索请求返回 `session search failed`。
|
|
159
|
+
|
|
160
|
+
用户决定:**保持现状,不移动/不删除任何会话数据**。
|
|
161
|
+
|
|
162
|
+
## 5. 运维与回滚
|
|
163
|
+
|
|
164
|
+
- 客户端插件支持 HMR:修改 `client.js` 后宿主每 500ms 轮询产物并热替换,通常无需重启应用。
|
|
165
|
+
- desktop profile patch 备份:`~/.dsh/profiles/desktop/cordis.patch.yml.bak-search-20261116-224220`。
|
|
166
|
+
- 若以后要开启正文搜索,可用备用工具(当前未执行):
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
node C:\Users\hande\dsh-quarantine-legacy-sessions.mjs # dry-run,只报告
|
|
170
|
+
node C:\Users\hande\dsh-quarantine-legacy-sessions.mjs --apply # 隔离 112 个旧会话目录 + 生成 manifest
|
|
171
|
+
node C:\Users\hande\dsh-quarantine-legacy-sessions.mjs --restore <manifest.json>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
隔离会把旧会话目录移到 `~/.dsh/sessions-quarantine/<时间戳>/`,可一键还原;副作用是这些旧会话暂时从列表消失。
|
|
175
|
+
|
|
176
|
+
- 物理删除会话未实现(DSH 持久化层没有删除接口),归档可恢复。
|
|
177
|
+
|
|
178
|
+
## 6. 验收清单
|
|
179
|
+
|
|
180
|
+
- [x] Zed 改名后页面显示新名字(`dsh_3280 PAM3`)
|
|
181
|
+
- [x] 每行显示运行状态(运行中 / 已停止)
|
|
182
|
+
- [x] 行内归档 / 取消归档按钮,确认后执行
|
|
183
|
+
- [x] 归档状态与按钮文案同步(已归档行显示「取消归档」)
|
|
184
|
+
- [x] 页面崩溃时可显示错误文本并自动上报,不再纯黑
|
|
185
|
+
- [x] 标题 / 目录 / ID 搜索可用
|
|
186
|
+
- [ ] 正文全文搜索(被旧日志阻塞,按用户选择暂不处理)
|
|
187
|
+
- [x] 按工作区分组、组头显示路径与数量
|
|
188
|
+
- [x] 工作区可折叠/展开(组头吸顶)
|
|
189
|
+
- [x] 列表独立上下滚动(顶部标题/搜索/筛选固定)
|
|
190
|
+
- [x] 一键折叠 / 一键展开全部工作区
|
|
191
|
+
- [x] 默认全部折叠(只显示组头与最近打开)
|
|
192
|
+
- [x] 「最近打开」区(最近活动 + 本页打开记录,最多 6 条)
|
|
193
|
+
- [x] 类型筛选:全部 / 未归档 / 已归档(带实时计数)
|
|
194
|
+
- [x] 自动化测试与真机验证通过
|
package/docs/DETAIL.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Session workbench — usage and limitations
|
|
2
|
+
|
|
3
|
+
Adds a global **Session workbench** page to the left sidebar. It lists every Session the Host knows about, grouped by working directory, newest first inside each group, and opens one when selected.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
1. Open **Session workbench** in the sidebar.
|
|
8
|
+
2. The search box matches title, working directory, and Session ID immediately, and also searches message text through the Host content index (250 ms debounce, with snippets). If content search is disabled or fails, the page keeps metadata matches and prints a hint instead of failing silently.
|
|
9
|
+
3. Click a row to open that Session's conversation.
|
|
10
|
+
4. Each row shows `Running` / `Stopped` and an **Archive** / **Unarchive** button; both open a confirmation dialog before anything is executed. Archiving a running Session stops it first (`stopActivity`).
|
|
11
|
+
5. A **Zed** tag marks Sessions whose displayed title comes from the Zed thread projection. The page reads `<DSH_HOME>/storages/zed-thread-titles.json`, which the Host half (or the ACP proxy while a Zed thread is connected) writes from Zed's `sidebar_threads` table, preferring Zed's `title_override` over the stored title.
|
|
12
|
+
|
|
13
|
+
## Data sources
|
|
14
|
+
|
|
15
|
+
- Client Session catalog: `useSessions` (the same source as the sidebar).
|
|
16
|
+
- Archive state: the Client `workspaces` model (`archivedSessionIds`).
|
|
17
|
+
- Zed titles: `workspaceFiles.readBytes` reads the JSON projection; the projection is best-effort and absent when no Zed data is available.
|
|
18
|
+
- Opening: `ctx.uiWorkspace.openSession(id)`.
|
|
19
|
+
|
|
20
|
+
## Limitations
|
|
21
|
+
|
|
22
|
+
- Lists only Sessions visible to the current Host catalog; Sessions from other machines or other Hosts do not appear.
|
|
23
|
+
- Subagent-origin Sessions follow the sidebar rule and are hidden.
|
|
24
|
+
- Archived Sessions still appear in the list (marked) so they can be unarchived.
|
|
25
|
+
- Message-text search depends on the Host enabling its content index (`session-query-sqlite` `openAt: first-search` or `startup`). When the index is off, the page shows the metadata-only hint.
|
|
26
|
+
- There is no delete action: DSH's persistence seam exposes no delete interface. Use archive instead.
|
|
27
|
+
- Zed titles refresh at the projection poll interval (5 s) and only while the Host half or a connected ACP proxy keeps the projection fresh.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# 会话工作台 —— 使用与限制
|
|
2
|
+
|
|
3
|
+
在左侧栏新增一个全局「会话工作台」页:按工作目录分组列出 Host 能查到的所有会话,每组内按最近更新时间倒序,点击一行即打开该会话。
|
|
4
|
+
|
|
5
|
+
## 使用
|
|
6
|
+
|
|
7
|
+
1. 在左侧栏打开「会话工作台」。
|
|
8
|
+
2. 搜索框会立即按标题、工作目录、会话 ID 匹配;同时通过 Host 的正文索引搜索消息内容(250ms 防抖,命中行显示摘要片段)。如果正文索引未启用或失败,页面保留元数据匹配并显示提示,而不是静默失败。
|
|
9
|
+
3. 点击一行打开该会话的对话。
|
|
10
|
+
4. 每行显示「运行中 / 已停止」以及「归档 / 取消归档」按钮;两者都会先弹确认框再执行。归档正在运行的会话会先停止它(`stopActivity`)。
|
|
11
|
+
5. 标题旁带 **Zed** 标签的行表示标题来自 Zed 线程投影。页面读取 `<DSH_HOME>/storages/zed-thread-titles.json`,该文件由 Host 半侧(或 Zed 连接期间的 ACP 代理)从 Zed 的 `sidebar_threads` 表生成,优先使用 Zed 的 `title_override`(在 Zed 里改过的名字),否则用存储标题。
|
|
12
|
+
|
|
13
|
+
## 数据来源
|
|
14
|
+
|
|
15
|
+
- 会话目录:Client 端 `useSessions`(与侧栏同源)。
|
|
16
|
+
- 归档状态:Client 端 `workspaces` 模型的 `archivedSessionIds`。
|
|
17
|
+
- Zed 标题:通过 `workspaceFiles.readBytes` 读取上述 JSON 投影;该投影是尽力而为,没有 Zed 数据时自动回退到 DSH 标题。
|
|
18
|
+
- 打开会话:`ctx.uiWorkspace.openSession(id)`。
|
|
19
|
+
|
|
20
|
+
## 限制
|
|
21
|
+
|
|
22
|
+
- 只列出当前 Host 会话目录里的会话;其他机器或其他 Host 的会话不会出现。
|
|
23
|
+
- 按侧栏规则隐藏子代理来源的会话。
|
|
24
|
+
- 已归档会话仍会显示(带标记),方便取消归档。
|
|
25
|
+
- 正文搜索依赖 Host 启用内容索引(`session-query-sqlite` 的 `openAt: first-search` 或 `startup`);索引关闭时页面会提示只能按元数据匹配。
|
|
26
|
+
- 没有删除按钮:DSH 的会话持久化层没有删除接口,请使用归档。
|
|
27
|
+
- Zed 标题按投影轮询周期刷新(5 秒),且只在 Host 半侧或已连接的 ACP 代理持续更新投影时保持新鲜。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 安装说明(给同事)
|
|
2
|
+
|
|
3
|
+
本插件是一个 DSH bundle(Host + 浏览器两半),安装到 **DSH profile** 后会在左侧栏出现「会话工作台」页面。
|
|
4
|
+
|
|
5
|
+
## 包内容
|
|
6
|
+
|
|
7
|
+
- `index.js` / `client.js`:Host 半侧与页面
|
|
8
|
+
- `cordis.patch.yml`:bundle 插入行
|
|
9
|
+
- `locale/*.json`、`icon.svg`、`docs/`
|
|
10
|
+
- 需要 DSH 0.2.x(Host 使用 `node:sqlite`,不可用时仅影响 Zed 标题同步)
|
|
11
|
+
|
|
12
|
+
## 安装步骤(Windows,DSH 桌面版)
|
|
13
|
+
|
|
14
|
+
1. 把 `dsh-zed-cc-workbench-2.0.0.tgz` 放到本机任意目录,例如 `D:\dsh-plugins\`。
|
|
15
|
+
2. 在命令行执行(`dsh` 不可用时用 DeepSeek Harness 自带 CLI,见文末):
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
dsh plugin --profile desktop add "D:\dsh-plugins\dsh-zed-cc-workbench-2.0.0.tgz"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
这会把包装进 `%USERPROFILE%\.dsh\profiles\desktop\node_modules`。
|
|
22
|
+
|
|
23
|
+
3. 启用 bundle:编辑 `%USERPROFILE%\.dsh\profiles\desktop\package.json`,在 `dsh.profile.bundles` 数组末尾加一行:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
"dsh-zed-cc-workbench"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
(也可以在 DSH 的「设置 → 插件」里找到「Zed / Claude Code 会话工作台」并启用。)
|
|
30
|
+
|
|
31
|
+
4. 完全退出并重启 DSH。左侧栏出现「会话工作台」。
|
|
32
|
+
|
|
33
|
+
> 如果 `dsh` 命令不在 PATH:用
|
|
34
|
+
> `"C:\Users\<你>\AppData\Local\Programs\DeepSeek Harness\DeepSeek Harness.exe" --expose-internals "C:\Users\<你>\AppData\Local\Programs\DeepSeek Harness\resources\app.asar\dsh\node_modules\@deepseek-ai\dsh-desktop-host\lib\cli.js" plugin --profile desktop add "<tgz 路径>"`
|
|
35
|
+
> 并设置环境变量 `ELECTRON_RUN_AS_NODE=1`。
|
|
36
|
+
|
|
37
|
+
## 会读取什么(隐私)
|
|
38
|
+
|
|
39
|
+
- `<你的用户目录>\.dsh\sessions`:DSH 会话日志(只读,用于生成标题/搜索摘要)
|
|
40
|
+
- `<你的用户目录>\.dsh\storages\*.json`:插件自己生成的投影/搜索摘要(明文,含对话文本)
|
|
41
|
+
- `%LOCALAPPDATA%\Zed\db\0-stable\db.sqlite`:只读,仅用于同步 Zed 线程标题(Zed 未安装则跳过)
|
|
42
|
+
- `%USERPROFILE%\.claude\projects`:只读,用于列出/搜索 Claude Code 会话(未安装 Claude Code 则跳过)
|
|
43
|
+
|
|
44
|
+
插件**不会修改**任何会话文件;归档操作走 DSH 自带 API(可恢复);没有删除功能。
|
|
45
|
+
|
|
46
|
+
## 卸载
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
dsh plugin --profile desktop remove "dsh-zed-cc-workbench"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
并从 `package.json` 的 `dsh.profile.bundles` 删除该行,重启 DSH。
|
|
53
|
+
|
|
54
|
+
## 说明
|
|
55
|
+
|
|
56
|
+
- 页面通过 `workspaceFiles.stat/readBytes` 探测 `~/.dsh`,不依赖固定用户名路径;如果所有会话的工作目录都不在用户目录下,首页会提示「无法定位 DSH 数据目录」,此时标题同步/正文搜索/CC 会话不可用,但 DSH 会话列表本身仍可用。
|
|
57
|
+
- 「正文搜索」用的是插件自己生成的 8–14 MB 本地摘要(不入 DSH 的搜索索引),首次搜索会读一次该文件。
|
|
58
|
+
- 「Claude Code 会话」区点击行会在「会话工作台」页面右侧内嵌终端里自动执行 `claude --resume <id>`(页面内嵌 xterm,需要 DSH 启用终端);右侧按钮只复制命令。终端不可用时自动退回复制。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<style>
|
|
6
|
+
html, body { margin: 0; width: 180px; height: 180px; background: #0b0e13; }
|
|
7
|
+
body { display: flex; align-items: center; justify-content: center; }
|
|
8
|
+
svg { width: 120px; height: 120px; }
|
|
9
|
+
</style>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
|
13
|
+
<rect x="3.25" y="4.25" width="17.5" height="15.5" rx="3.25" stroke="#5577d9" stroke-width="1.5"/>
|
|
14
|
+
<path d="M7.5 9.25h9M7.5 12.25h9M7.5 15.25h5.5" stroke="#5577d9" stroke-width="1.5" stroke-linecap="round"/>
|
|
15
|
+
<circle cx="17.6" cy="15.25" r="1.1" fill="#2fa36b"/>
|
|
16
|
+
</svg>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
Binary file
|
package/icon.svg
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<rect x="3.25" y="4.25" width="17.5" height="15.5" rx="3.25" stroke="#5577d9" stroke-width="1.5"/>
|
|
3
|
+
<path d="M7.5 9.25h9M7.5 12.25h9M7.5 15.25h5.5" stroke="#5577d9" stroke-width="1.5" stroke-linecap="round"/>
|
|
4
|
+
<circle cx="17.6" cy="15.25" r="1.1" fill="#2fa36b"/>
|
|
5
|
+
</svg>
|