Bundle
dsh-open-workspace
Add an "打开工作区 / Open workspace" entry to the workspace sidebar session-row ⋯ menu and a button in the session header actions slot; opens the session's workspace folder with the system file manager. Compatible with DSH 0.1.2-alpha.5 and 0.1.2-rc.1.
- Source
- Xingkong42
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# dsh-open-workspace
为 DeepSeek Harness Web GUI 提供两个「**打开工作区**」入口,点击后用系统文件管理器(Windows 资源管理器 / macOS 访达 / Linux 文件管理器)打开当前会话所属工作区的文件夹:
1. **工作区侧边栏的会话行 ⋯ 菜单**中的「打开工作区」项;
2. **会话顶部标题栏**的「打开工作区」按钮——通过官方 slot `conversation.session.header.actions` 注册,与官方按钮(归档 / 移动至工作区 / 删除会话)及其他插件的按钮(如 Session 日志)按框架 order 并排组合,无 DOM 冲突。
适配 **DSH 0.1.2-rc.1**,同时兼容 0.1.2-alpha.5(两者相关运行时包经逐字节对比一致,仅版本号字符串不同,详见下方"版本兼容")。
## 功能
- 两个入口共用一套解析逻辑,语义为"打开工作区根目录":
- 标题栏按钮:按 `sessionId` 找到所属工作区 → 工作区 `path`/`cwd` → 会话 `cwd` 兜底;
- ⋯ 菜单项:按行所在的工作区分组 → 工作区 `path`/`cwd` → 同名会话 `cwd` → 扁平列表 → 当前会话。
- 宿主端直接 spawn `explorer.exe`(UTF-16 argv,**中文/非 ASCII 路径可靠**),而非 `powershell Invoke-Item`。
- 打开成功/失败均有右下角提示条。
- 宿主端注册 `POST /plugins/dsh-open-workspace/open` 与 `GET /plugins/dsh-open-workspace/status`(仅接受同源请求);激活探针写入 `$DSH_HOME/logs/dsh-open-workspace.probe.log`。
## 版本兼容
实测于 0.1.2-alpha.5 与 0.1.2-rc.1(隔离实例逐项验证:⋯ 菜单注入、标题栏 slot 按钮、两个入口的打开链路、设置页无残留)。两版的 CLI 引导、web 前端 dist、client-modules / client-ui-sidebar / client-ui-workspace / client-ui-conversation(标题栏 slot 宿主)/ host-webserver 等运行时代码字节级一致,仅版本号字符串不同。
## 安装到本机 web profile
```powershell
cd <本插件文件夹>
npm pack
dsh plugin --profile web add .\dsh-open-workspace-1.0.0.tgz
# 重启 dsh web
```
## 安装到其他电脑
把整个文件夹拷到目标电脑**任意位置**(脚本按自身所在目录定位插件包),目标电脑需有 Node.js ≥ 20、DSH、pnpm,然后:
```powershell
powershell -ExecutionPolicy Bypass -File .\install.ps1
```
脚本自动完成:环境检查 → 重复 id 守卫(`cordis.patch.yml` 已引用本插件时拒绝安装,防止 duplicate loader entry id 启动崩溃)→ 检测同功能插件(dsh-open-folder / dsh-open-explorer / dsh-open-session-folder)并询问是否停用 → `dsh plugin add` 安装并并入 bundles → 校验清单。装完重启 `dsh web`。
也可以手动安装:
```powershell
dsh plugin --profile web add D:\路径\dsh-open-workspace-1.0.0.tgz
# 若报 ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION(供应链策略拦截):
cd $env:USERPROFILE\.dsh\profiles\web
pnpm add D:\路径\dsh-open-workspace-1.0.0.tgz --config.minimum-release-age=0
# 确认 dsh.profile.bundles 含 "dsh-open-workspace" 后重启 dsh web
```
或发布到 GitHub 后按仓库安装:`dsh plugin --profile web add github:<用户名>/dsh-open-workspace`。
注意:
- **不要**在 bundles 层和用户补丁层同时 insert 本插件(同一 id 重复会让 `dsh web` 启动即崩)。
- 「打开工作区」的动作发生在**运行 dsh web 的那台电脑**上(远程访问 GUI 时,窗口弹在服务器端桌面)。
- 升级 DSH:`npm i -g @deepseek-ai/dsh@0.1.2-rc.1` 后重启 `dsh web`,插件零改动。
## 验证
1. `GET /plugins/dsh-open-workspace/status` 返回 `{"ok":true,...}` → 宿主半已加载。
2. 侧边栏任意会话行点 ⋯ → 菜单底部「打开工作区」→ 点击 → 资源管理器打开工作区目录 + 右下角提示。
3. 打开任一会话 → 顶部标题栏出现「打开工作区」按钮(位于删除会话与 Session 日志之间)→ 点击效果同上。
Install
dsh plugin --profile web add github:Xingkong42/dsh-open-workspace
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-open-workspace from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.