Compare commits
2 Commits
feat/remot
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
97f4c3e07f | |
|
|
637c62f1f3 |
|
|
@ -1,5 +1,11 @@
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## 1.3.1 — 2026-11-19
|
||||||
|
|
||||||
|
### 文档
|
||||||
|
- README 重写为面向插件市场的清爽入口页(项目介绍 + 主要功能 + 最短安装/上手 + 文档入口)。
|
||||||
|
- 清理开发期遗留的内部文档。
|
||||||
|
|
||||||
## 1.3.0 — 2026-11-13
|
## 1.3.0 — 2026-11-13
|
||||||
|
|
||||||
### 新增 / 重构
|
### 新增 / 重构
|
||||||
|
|
|
||||||
189
DEVELOPMENT.md
189
DEVELOPMENT.md
|
|
@ -1,189 +0,0 @@
|
||||||
# 开发说明(DEVELOPMENT)
|
|
||||||
|
|
||||||
> 面向「在这个仓库上做扩展」的人。仓库是 DeepSeek Harness 插件
|
|
||||||
> `@dsh-xhl/workspace-groups`:侧栏三级工作区分组浏览器 + 顶部会话标签条
|
|
||||||
> + Ctrl+R 快切面板。宿主半边(node)负责 sidecar 配置读写,浏览器半边负责 UI。
|
|
||||||
|
|
||||||
## 1. 这份工作树的来源
|
|
||||||
|
|
||||||
当前分支 `feat/base-0.4.2` 的工作树,是从**用户机器上实际安装运行的那份 0.4.2 构建**
|
|
||||||
反推重建的,而不是仓库 HEAD 的原样代码:
|
|
||||||
|
|
||||||
- 来源:`~/.dsh/profiles/desktop/node_modules/@dsh-xhl/workspace-groups/lib/client.js.map`
|
|
||||||
(内联 `sourcesContent`,含全部 `src/client/*` 的 TypeScript 源码)
|
|
||||||
- 仓库 HEAD(`942babe`,package 版本仍写着 `0.1.0`)里只有侧栏分组浏览器,
|
|
||||||
没有会话标签条 / 快切面板 / 分支视图这些模块,即上游 GitHub 的公开代码落后于
|
|
||||||
已发布构建。
|
|
||||||
- 因此重建树 = 安装版 0.4.2 的完整源码,并补齐宿主侧 `src/host-tabs.ts` 与
|
|
||||||
`/workspace-groups/tabs` 路由。
|
|
||||||
|
|
||||||
重建后的对齐校验(可用下面第 3 节的命令复现):
|
|
||||||
|
|
||||||
| 产物 | 与安装版对比 |
|
|
||||||
| --- | --- |
|
|
||||||
| `lib/index.js`(宿主) | diff 行数 **0**(逐字节) |
|
|
||||||
| `lib/client.js`(浏览器) | 仅 **1** 行差异:CSS 虚拟模块注释里的构建绝对路径 |
|
|
||||||
| `lib/types/**/*.d.ts` | **27/27 完全一致** |
|
|
||||||
|
|
||||||
git 历史里 `942babe` 及更早的提交原样保留;重建工作作为 `b30f771` 一次提交落在
|
|
||||||
`feat/base-0.4.2` 分支上。合回 `master` / 推上游前请自行决定如何叙事。
|
|
||||||
|
|
||||||
## 2. 目录结构
|
|
||||||
|
|
||||||
宿主半边(node,平台 `node`,输出 ESM):
|
|
||||||
|
|
||||||
| 文件 | 职责 |
|
|
||||||
| --- | --- |
|
|
||||||
| `src/index.ts` | 插件入口。`inject = ['webServer']`,注册 4 组路由:`GET /workspace-groups/config`、`GET|PUT /workspace-groups/tabs`、`PUT /workspace-groups/manual`、`GET|PUT|POST /workspace-groups/folders` |
|
|
||||||
| `src/host-config.ts` | 读用户 YAML 分类规则(默认 `~/.dsh/workspace-groups.yaml`),校验后以 JSON 下发 |
|
|
||||||
| `src/host-manual.ts` | 运行期分组覆盖(手动分组 + 单工作区归类覆盖),落 `$DSH_HOME/workspace-groups.manual.json` |
|
|
||||||
| `src/host-folders.ts` | 每个工作区的额外文件夹 + 根目录,落 `$DSH_HOME/workspace-groups.folders.json`(写时严格、读时宽容)。另提供 `defaultRemoteMirrorBase()`:`~/.dsh/remote-workspaces`,即 `@zhangfengshun/dsh-remote-ssh` 的本地镜像根,GET 时随文档下发 |
|
|
||||||
| `src/host-tabs.ts` | 会话标签条的宿主侧持久化。放在宿主是因为**浏览器存储按 origin 隔离,而 origin 含端口**,`dsh web`/测试/桌面壳端口各不相同 |
|
|
||||||
| `src/context-types.ts` | 本插件消费的 cordis 服务结构类型(第三方插件拿不到 monorepo 内的 `declare module` 合并) |
|
|
||||||
|
|
||||||
共享纯逻辑(浏览器 / node 两半都编译):
|
|
||||||
|
|
||||||
| 文件 | 职责 |
|
|
||||||
| --- | --- |
|
|
||||||
| `src/core/types.ts` | 规则配置类型,零运行时依赖 |
|
|
||||||
| `src/core/matcher.ts` | 归类与排序的纯函数:工作区归哪个分类、分类/工作区怎么排。宿主校验与客户端建树共用,语义不会漂移 |
|
|
||||||
| `src/core/folders.ts` | 多文件夹的纯函数:有效文件夹列表、根目录解析、cwd 归属(最具体优先)、镜像判定与相对子路径拼装(`isUnderBase` / `joinSubpath`)。宿主校验与客户端建树共用 |
|
|
||||||
|
|
||||||
浏览器半边(`src/client/`,输出 CJS 闭包工厂):
|
|
||||||
|
|
||||||
| 文件 | 职责 |
|
|
||||||
| --- | --- |
|
|
||||||
| `index.ts` | 客户端入口:向 `sidebar.workspaces` 槽注册(priority -1,shadow 官方浏览器)、注册 i18n、绑定各视图 |
|
|
||||||
| `contract.ts` | 注入共享契约(`GroupsBrowserInjected`),镜像官方 ui-workspace 的注入形状 |
|
|
||||||
| `GroupsBrowser.tsx` | 主 UI:分区头(标题/搜索/新建分组/添加工作区)+ 三级树 + 分组/工作区/会话对话框 |
|
|
||||||
| `rows.tsx` | 树的行组件(行内菜单、状态点、图标),对话框挂在 browser root 以免折叠时卸载 |
|
|
||||||
| `tree.ts` | 纯派生:分类文件夹 → 项目文件夹 →(可选)文件夹行 → 会话行;可见性规则对齐官方树 |
|
|
||||||
| `folders-persist.ts` | 文件夹 overlay 的客户端侧,读写宿主 `/workspace-groups/folders` |
|
|
||||||
| `locales.ts` | `workspaceGroups` 命名空间词典(zh/en + key 联合类型) |
|
|
||||||
| `styles.css` | 全部样式,`?inline` 导入后由构建期 lightningcss 压缩内联 |
|
|
||||||
| `branch.ts` / `FlowerBranch.tsx` | 侧栏当前行的「花朵」标记(几何计算在 `branch.ts`,仍由单测覆盖;连线与逐行圆点已移除,只画花朵) |
|
|
||||||
| `tabs.ts` | 标签条**纯**状态:打开顺序、激活项、派生展示 |
|
|
||||||
| `tab-store.ts` | `defineStore` 绑定(只做绑定,变换留在 `tabs.ts`) |
|
|
||||||
| `tab-seat.ts` | DOM 挂载点:标签条要贴在会话列顶部(ui-layout `AppFrame` 的 `.centerCol` 是 `pI_x6G_centerCol`,没有对应 slot) |
|
|
||||||
| `tab-persist.ts` | 标签条持久化的客户端侧,读写宿主 `/workspace-groups/tabs` |
|
|
||||||
| `SessionTabs.tsx` | 标签条 UI:每个打开的会话一枚 chip |
|
|
||||||
| `quick.ts` / `QuickPanel.tsx` | Ctrl+R 快切面板(工作区 / 会话两个页签) |
|
|
||||||
| `open-folder.ts` | 调 `@deepseek-ai/dsh-host-open-in-app` 的宿主路由,打开项目目录 |
|
|
||||||
| `subagent-lineage.ts` | 子代理后代计数的本地投影(0.1.2 起 runtime 不再提供 `indexSubagentDescendants`) |
|
|
||||||
| `store-core.ts` | 展开状态的**纯**变换(无运行时 import,便于单测) |
|
|
||||||
| `stores.ts` | 视图 store 工厂(展开状态,独立持久化 key,不碰官方 `dsh.workspace.view.v5`) |
|
|
||||||
| `store-hook.ts` | 面向 store 实例的框架形状选择器 hook(`useSyncExternalStoreWithSelector`) |
|
|
||||||
|
|
||||||
其它:`tests/*.test.ts`(vitest,覆盖 core matcher/tree/store/tabs/folders),
|
|
||||||
`tools/verify-folders.mjs`(沙箱内 vitest 起不来时的等价纯 node 断言),`cordis.patch.yml`
|
|
||||||
(cordis 插件补丁层),`scripts/verify-groups.mjs`,`workspace-groups.example.yaml`。
|
|
||||||
|
|
||||||
## 3. 构建 / 校验 / 装回去
|
|
||||||
|
|
||||||
本机的 DSH 沙箱里没有把 node/pnpm 放进 PATH,用下面这份绝对路径脚本跑(含备选写法说明):
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$nodeDir = "C:\Users\qyh15\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\node\bin"
|
|
||||||
$pnpm = "C:\Users\qyh15\.dsh\dsh-runtimes\dsh-primary-runtime\dependencies\pnpm\bin\pnpm.cjs"
|
|
||||||
$env:Path = "$nodeDir;$PWD\node_modules\.bin;" + $env:Path
|
|
||||||
|
|
||||||
# 依赖(已装过可跳过)
|
|
||||||
& "$nodeDir\node.exe" $pnpm install
|
|
||||||
|
|
||||||
# 类型检查(tsc 两次:node 半边 + 浏览器半边)
|
|
||||||
& "$nodeDir\node.exe" $pnpm typecheck
|
|
||||||
|
|
||||||
# 构建:先 tsc 出 lib/types,再 tsdown 出 lib/index.js + lib/client.js
|
|
||||||
& "$nodeDir\node.exe" $pnpm build
|
|
||||||
|
|
||||||
# 单测(注意:DSH 沙箱内 vitest 起子进程会被 EPERM 拦掉,用普通终端跑)
|
|
||||||
& "$nodeDir\node.exe" .\node_modules\vitest\vitest.mjs run
|
|
||||||
```
|
|
||||||
|
|
||||||
对齐校验(重建时用过,改动后也可用来确认没伤到宿主半边):
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
$installed = "C:\Users\qyh15\.dsh\profiles\desktop\node_modules\@dsh-xhl\workspace-groups"
|
|
||||||
& "$nodeDir\node.exe" ..\tools\diff-text.mjs "$installed\lib\index.js" lib\index.js 3
|
|
||||||
& "$nodeDir\node.exe" ..\tools\compare-types.mjs "$installed\lib\types" lib\types
|
|
||||||
```
|
|
||||||
|
|
||||||
装回正在运行的 DSH 做真机验证:
|
|
||||||
|
|
||||||
1. `pnpm build`
|
|
||||||
2. 把 `lib\`(`index.js`、`client.js`、`client.js.map`、`types\`)覆盖到
|
|
||||||
`C:\Users\qyh15\.dsh\profiles\desktop\node_modules\@dsh-xhl\workspace-groups\lib\`
|
|
||||||
3. 重启 DSH(Web GUI 在 `http://127.0.0.1:1282`)
|
|
||||||
|
|
||||||
> `lib/` 是**入库**的(上游仓库也这么干),改完源码要记得重新 build 再提交,
|
|
||||||
> 否则安装方拿到的还是旧产物。
|
|
||||||
|
|
||||||
## 4. 扩展时必须知道的三条约束
|
|
||||||
|
|
||||||
1. **平台模块表外置,其它一律内联。** `tsdown.config.ts` 的 `CLIENT_EXTERNALS`
|
|
||||||
只允许 `react`、`react/jsx-runtime`、`react-dom*`、`@deepseek-ai/cordis`、
|
|
||||||
`dsh-client-ui-slots`、`dsh-client-ui-primitives`、`dsh-client-store`、
|
|
||||||
`dsh-client-runtime/client`。**任何其它 `@deepseek-ai/*` 值导入都会让构建失败**
|
|
||||||
(`dsh-workspace-groups-client-purity` 纯净门);跨插件协作只能走 cordis 服务或 slot。
|
|
||||||
单纯类型导入没问题(会被擦除)。
|
|
||||||
2. **CSS 走 `?inline` 虚拟模块,前缀名不能改。** `CSS_VIRTUAL_PREFIX` 是
|
|
||||||
`\0dsh-workspace-groups-inline-css:`,`styles.css` 里的类名会被 lightningcss
|
|
||||||
压成哈希。加样式直接写 `styles.css`,组件里 `import css from './styles.css?inline'` 即可。
|
|
||||||
3. **Node 内置模块不许进浏览器包**(`NODE_BUILTINS` 参与判定)。需要 node 能力就往宿主半边加路由。
|
|
||||||
|
|
||||||
## 5. 常见扩展动作
|
|
||||||
|
|
||||||
- **加一块侧栏 UI / 一个按钮**:`rows.tsx` 加行内动作 →
|
|
||||||
`GroupsBrowser.tsx` 接 handler;文案加进 `locales.ts` 的 `zh`/`en` 与
|
|
||||||
`WorkspaceGroupsKey` 联合类型(漏加会被 tsc 抓到)。
|
|
||||||
- **加一份视图状态**:纯变换写 `store-core.ts`(或新开 `xxx.ts`,保持零运行时 import)
|
|
||||||
→ `stores.ts` 里 `defineStore` 绑定 → 组件用 `store-hook.ts` 的选择器 hook。
|
|
||||||
这样单测能直接测语义,不必起浏览器 module loader。
|
|
||||||
- **加宿主能力**:新建 `src/host-xxx.ts`(读写 sidecar、做校验)→ 在 `src/index.ts`
|
|
||||||
里用 `ctx.effect(() => ctx.webServer.register({ kind: 'exact', path, handler }), '...')`
|
|
||||||
挂路由 → 客户端照 `tab-persist.ts` 的 `fetch` 封装去调,注意 `Cache-Control: no-store`。
|
|
||||||
- **加标签条行为**:状态变换进 `tabs.ts`(纯),store 绑定在 `tab-store.ts`,
|
|
||||||
渲染在 `SessionTabs.tsx`,落盘走 `tab-persist.ts`;位置模型是「首次入列时定序」,
|
|
||||||
改动前先读 `tabs.ts` 顶部的 position model 注释。两条不变量:**固定标签恒在未固定
|
|
||||||
之前**(`moveTab` 在固定区边界夹紧、`togglePinTab` 插到固定区尾/未固定区头),
|
|
||||||
**标签名与会话标题互不影响**(`renameTab` 只动 `title`)。除 `order` 之外的标签状态
|
|
||||||
(固定、自定义名)也必须由 `restoreTabsImpl` 原样复原,否则每次重启都丢配置。
|
|
||||||
- **加一个分组展示元数据(颜色 / 图标 / 置顶等)**:字段进 `types.ts`
|
|
||||||
(`CategoryAppearance` + `GROUP_COLORS`/`GROUP_ICON_IDS` 白名单)→ 校验进
|
|
||||||
`host-manual.ts` 的 `parseAppearance`(**严格写、宽容读**:不校验键对应的分类是否
|
|
||||||
还存在,否则删掉一条 YAML 分类就会让之后每次保存都 400)→ 派生进 `matcher.ts`
|
|
||||||
(要影响排序就必须放 `effectiveCategories`,只在渲染层排会让拖拽落点与看到的顺序
|
|
||||||
不一致)→ `tree.ts` 节点带 `appearance` → `rows.tsx` 渲染 → `styles.css` 配色/
|
|
||||||
动画 → `locales.ts` 双语文案。写路径统一走
|
|
||||||
`GroupsBrowser.tsx` 的 `updateCategoryAppearance`;**改名要重映射 `appearance` 的键、
|
|
||||||
删除要清掉**(键空间是 display name,与 `categoryOrder` 一致)。
|
|
||||||
- **新增平台依赖**:先确认 DSH shell 的 module table 真有那一行,再往
|
|
||||||
`CLIENT_EXTERNALS` 里加,否则运行时 `require` 会拿不到模块。
|
|
||||||
|
|
||||||
## 6. 已知坑
|
|
||||||
|
|
||||||
- **沙箱内跑不了 vitest**:`spawn` 被 DSH 沙箱拦(EPERM),在普通 PowerShell 终端里跑。
|
|
||||||
- **`node_modules/.bin/*.CMD` 直调会挂**:pnpm 里嵌套的 pnpm 脚本在 DSH 沙箱下会
|
|
||||||
`Could not determine executable`,统一用 `node <pnpm.cjs> <script>` 形式。
|
|
||||||
- **单测覆盖不齐**:`tests/` 是早期版本写的,现已补 `tests/tabs.test.ts`(标签条纯逻辑:
|
|
||||||
固定区不变量、拖动夹紧、关闭其他/右侧、持久化恢复);**快切面板
|
|
||||||
(`quick.ts` / `QuickPanel.tsx`)与分组外观仍无单测**,改到这些区域时补。
|
|
||||||
- **改持久化格式一律「严格写、宽容读」**:新增字段必须是可选的,旧文件读不进来不算
|
|
||||||
错;悬挂键(如已删除的分类/会话)不得拒写,否则用户会卡在 400 上再也保存不了;
|
|
||||||
新字段在 `restore*` 里必须原样带过去(`pinned`/`title` 漏带就等于重启丢配置)。
|
|
||||||
- **package 版本号语义混乱**:仓库 HEAD 里是 `0.1.0`,但提交里写 `feat(v0.7)`;
|
|
||||||
重建树统一对齐到安装版的 `0.4.2`。发布前自己定一版号。
|
|
||||||
- **远程(`@zhangfengshun/dsh-remote-ssh`)工作区是镜像,不是真实远端目录**:它用
|
|
||||||
`workspaceRegistry.create(mirrorDir)` 把远端根登记成普通工作区,`mirrorDir` 就是
|
|
||||||
`~/.dsh/remote-workspaces/<workspaceId>`。所以对付这类项目时:
|
|
||||||
额外文件夹只能是镜像内子目录(用 `joinSubpath` 拼、`isUnderBase` 判定,**绝不要让
|
|
||||||
用户用原生选择器挑任意本地目录**);`cwd` 分区逻辑照常可用,因为会话本身也在本地跑。
|
|
||||||
真正"服务器上另一个根目录"应当由 SSH 插件单独建成工作区,再用分组归到一起。
|
|
||||||
`POST /workspace-groups/folders` 已停用(410):禁止复制子 marker,避免绕过父写回规则。
|
|
||||||
统一创建入口在 `src/client/folder-directory.ts`:listWorkspaces 判归属,本地使用 DSH
|
|
||||||
createDirectory,远端用专属 mkdir API(递归幂等),不走可能降级本地的 sidebar fs.mkdir。
|
|
||||||
缺 SSH 的已知镜像、网络/鉴权失败、坏目录清单和重叠根一律报错。远程子目录会话暂阻断,
|
|
||||||
因 remote-ssh 2.4.40 模型工具仍只匹配注册根 cwd。历史 marker 不自动清理。
|
|
||||||
验证:`node tools/verify-folder-directory.mjs`(模拟 API)和
|
|
||||||
`node --experimental-transform-types tools/verify-folders.mjs`(含 marker POST 拒绝回归)。
|
|
||||||
不要把静态检查/模拟通过当成实机 SSH 联调通过。
|
|
||||||
135
README.md
135
README.md
|
|
@ -2,123 +2,62 @@
|
||||||
<strong>English</strong> · <a href="./README_ZH.md">简体中文</a>
|
<strong>English</strong> · <a href="./README_ZH.md">简体中文</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# dsh-better-workspace-group
|
<h1 align="center">Workspace Groups · Remote SSH</h1>
|
||||||
|
|
||||||
A workspace grouping plugin for DeepSeek Harness. Built on [z-col/dsh-workspace-groups](https://github.com/z-col/dsh-workspace-groups), it keeps workspaces, folders, and sessions easier to organize and use from the sidebar.
|
<p align="center">
|
||||||
|
<em>One plugin for DeepSeek Harness — organize workspaces, projects and sessions into a clean grouped sidebar, and develop on remote machines over SSH.</em>
|
||||||
|
</p>
|
||||||
|
|
||||||
## Merged bundle: workspace-groups-remote
|
<p align="center">
|
||||||
|
<a href="https://git.qyhhh.top/DeepsSeekHarness/workspace-groups-remote"><img alt="version" src="https://img.shields.io/badge/version-1.3.1-2f6feb"></a>
|
||||||
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-3fb950">
|
||||||
|
<img alt="platform" src="https://img.shields.io/badge/platform-DeepSeek%20Harness-5b6bff">
|
||||||
|
<img alt="node" src="https://img.shields.io/badge/node-%E2%89%A5%2020-339933">
|
||||||
|
</p>
|
||||||
|
|
||||||
This tree merges two DSH plugins into **one installable bundle** (package `workspace-groups-remote`):
|
<p align="center">
|
||||||
|
<img src="./screenshot.png" alt="Workspace Groups preview" width="720">
|
||||||
|
</p>
|
||||||
|
|
||||||
- **workspace-groups** (this repository's original content): the sidebar grouping manager and session tab strip. Its host half builds from `src/` to `lib/groups.js`; its client half lives in `src/client/groups-client.ts`.
|
## ✨ Features
|
||||||
- **@zhangfengshun/dsh-remote-ssh** 2.4.45 (MIT, © ZhangFengshun): vendored verbatim under `vendor/dsh-remote-ssh/`. Its host half ships **unbundled** as `lib/remote-ssh/index.js` — it must resolve `@deepseek-ai/schemastery` from the host's module table, because its Config schema relies on the DSH-branch schemastery `.volatile()` marker. The shipped host artifact carries **a small local patch set**, applied at build time by `scripts/patch-remote-ssh.mjs` with the vendor tree kept pristine (see "Duplicate remote folders" and "Security hardening" below). Its client ships upstream as a self-registering module-loader bundle; `scripts/build-remote-ssh-client.mjs` extracts the bare factory at build time and the merged client entry (`src/client/index.ts`) applies it next to the groups client.
|
|
||||||
|
|
||||||
### Duplicate remote folders — fixed in this bundle
|
- **Grouped sidebar** — browse by **group → project → session**, with create / rename / delete / fold / pin and drag-and-drop ordering.
|
||||||
|
- **Group appearance** — colors and icons, including a Materials & Lab set for lab work, material structures and devices.
|
||||||
|
- **Multiple folders per project** — attach extra folders, pick the default root, and keep each session under the folder that matches its working directory.
|
||||||
|
- **Remote SSH workspaces** — a VS Code Remote-SSH-like experience: remote workspaces, file access and an integrated terminal, built into the same plugin.
|
||||||
|
- **Remote-SSH settings page** — connection cards, SSH-key / password auth, import from your system SSH config, per-workspace write-back & sync options. (1.3.0)
|
||||||
|
- **Duplicate remote folders fixed** — the same remote directory spelled differently no longer registers twice.
|
||||||
|
- **Session tab strip** — open, switch, pin, rename, reorder and close tabs.
|
||||||
|
- **Search & persistence** — search sessions in context; groups, order, tabs and folder settings survive refreshes and restarts.
|
||||||
|
|
||||||
Upstream's `createRemoteWorkspace` matched existing records by the raw `remotePath` string, so the same remote directory spelled two ways (`~/proj` vs `/home/u/proj` vs `proj/`) registered a **second workspace record, local mirror and native workspace** — visible as two folder rows for one remote project. This bundle fixes it in two layers:
|
## 🚀 Install
|
||||||
|
|
||||||
- **Host (build-time patch, `scripts/patch-remote-ssh.mjs`)**: registration compares light-normalized spellings first; on a miss it resolves the path once over SSH (`pwd -P` + `$HOME`) and compares canonical forms, storing the canonical spelling. Resolution failures are fail-open (creation proceeds as upstream). Behavior is covered by `npm run test:patch`; the vendored tree stays pristine, so upstream updates still drop in.
|
In DeepSeek Harness open **Discover**, search for **Workspace Groups · Remote SSH** and click **Install**. Or install from the command line:
|
||||||
- **Client (groups)**: adding a cloud folder also refuses when an existing member is backed by the same workspace, or names the same connection + remote directory, regardless of mirror paths.
|
|
||||||
|
|
||||||
Already-duplicated projects are not merged automatically (sessions belong to their workspace). Detaching a member keeps its backing workspace. Deleting the duplicate remote record requires the separate explicit “Delete workspace too” choice; review the affected entry before using it.
|
|
||||||
|
|
||||||
### Security hardening (also in the patch set)
|
|
||||||
|
|
||||||
Fixes from a 2026-11-11 audit, all applied by the same build-time patch script (behavior covered by `npm run test:patch`, including end-to-end runs of the generated terminal wrapper):
|
|
||||||
|
|
||||||
- **ssh option injection**: every internal connection is built by `sshArgv`, which now inserts `--` before the `user@host` target, so a user/host value starting with `-` (e.g. `-oProxyCommand=...`, reachable via the remote_ssh tools' inline arguments) can no longer be parsed as an ssh option and execute local commands. The terminal wrapper's own argv gets the same `--`.
|
|
||||||
- **POSIX password handling**: `sshpass -p` (password visible in the process list to every local user) becomes `sshpass -e`, with the password passed via the `SSHPASS` environment variable — matching the Windows env-based path.
|
|
||||||
- **Terminal wrapper trust**: the generated `dsh-remote-shell` previously honored a `.remote-ssh.json` in ANY directory with host-key checking fully off. It now only honors the marker when the cwd is a registered mirror root (a direct child of `~/.dsh/remote-workspaces`, exactly where the host writes it), uses `StrictHostKeyChecking=accept-new`, and passes `remotePath` to the remote shell base64-encoded so quotes/`$()` in a directory name stay inert data.
|
|
||||||
- **Remote path escape**: `localToRemote` now folds `.`/`..` segments lexically and refuses a path whose `..` would climb above the mirror root, instead of mapping fs requests outside the remote workspace root.
|
|
||||||
- **Write-back guard fails closed**: if the workspace settings cannot be read, the write-back push is skipped (and surfaced through the `writeBackFailure` channel) instead of pushing with the `writeBack` / `writeBackExclude` guard never evaluated.
|
|
||||||
|
|
||||||
`lib/index.js` (source: `bundle/index.js`) is composition only — it applies both plugins on one fiber. `cordis.patch.yml` inserts a single row for this package and carries remote-ssh's `better-sidebar` / `terminal-controller` shell overrides over verbatim.
|
|
||||||
|
|
||||||
### Remote-SSH settings page (1.3.0)
|
|
||||||
|
|
||||||
The settings page is a maintainable source component in this repository (`src/client/rssh-settings/`). At build time `scripts/build-remote-ssh-client.mjs` replaces the vendored compiled settings section with it through anchor assertions, so the vendor tree stays pristine. The page has four regions — My connections / Add connection / Remote workspaces / Advanced settings. Remote workspaces and Advanced settings start collapsed; collapsing only changes visibility, never clears drafts or triggers a save, and the collapsed Advanced region shows no inner save button.
|
|
||||||
|
|
||||||
- **My connections**: each card tests independently (success, connected-with-warning, failure and diagnostics are shown separately); delete asks for confirmation in-card, naming the connection and its effect.
|
|
||||||
- **Add connection**: every field and conditional display is kept (key auth shows the private key path; password auth shows a masked input and hides the key path); an invalid port is rejected with a clear error instead of silently falling back to 22; ProxyJump lives in the collapsed “More connection options”.
|
|
||||||
- **Import from the system SSH config**: a multi-select dialog that checks every save result, counts real successes/failures separately, and can retry failed entries only (successful ones are never resubmitted).
|
|
||||||
- **Remote workspaces**: per-workspace write-back, write-back exclude, sync scope, sync exclude and size cap (GiB), saved by workspace id; pull/push are blocked with a “save first” notice while a draft is unsaved.
|
|
||||||
- **Advanced settings**: terminal node path, write-back policy and new-workspace sync defaults; read and written separately from per-workspace settings, so neither overwrites the other.
|
|
||||||
|
|
||||||
New copy uses its own `dsh-remote-ssh-settings` locale namespace (Chinese + English); CSS is scoped under `.rsui-root` and does not leak into other plugins.
|
|
||||||
|
|
||||||
### Install / migrate
|
|
||||||
|
|
||||||
1. Remove the two old bundles from the profile (`workspace-groups-local` and `@zhangfengshun/dsh-remote-ssh`).
|
|
||||||
2. Add this package instead and fully restart DSH.
|
|
||||||
|
|
||||||
Stored data is untouched by the merge: `~/.dsh/workspace-groups.yaml` and the `$DSH_HOME` sidecars, the `dsh-remote-ssh` settings namespace, and `~/.dsh/remote-ssh/` all keep working. If you ever set remote-ssh options in its old bundle row, they now nest: `config: { remoteSsh: { ... } }` (connection profiles live in DSH settings either way).
|
|
||||||
|
|
||||||
### Verify
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
dsh plugin --profile desktop add https://git.qyhhh.top/DeepsSeekHarness/workspace-groups-remote.git
|
||||||
npm run build
|
|
||||||
npm run verify:bundle # composition checks over the built artifacts, incl. vendor integrity + an executable client smoke
|
|
||||||
npm run verify # everything: tsc + vitest + verify:bundle + patch behavior tests
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The vendored upstream suite also runs in place once its dependencies resolve — from the repo root: `ln -s ../../node_modules vendor/dsh-remote-ssh/node_modules`, then `node tests/run-all.mjs` inside `vendor/dsh-remote-ssh`. Known pre-existing failures off Windows: 6 groups folders tests use `C:\` paths, and a few remote-ssh suites assume WSL / Windows path semantics; both fail identically in the unmerged upstreams.
|
Use `web` instead of `desktop` for a Web profile, then fully restart DSH.
|
||||||
|
|
||||||
### Known trade-offs
|
> **Upgrading from the old two-bundle setup?** Remove `workspace-groups-local` and `@zhangfengshun/dsh-remote-ssh` first, install this single package, and restart. Your existing workspaces, sessions and settings are kept.
|
||||||
|
|
||||||
- **Load coupling**: the two halves load as one bundle, so if either half ever fails to import, the whole package fails — grouping included. That is the price of the single install entry; splitting failure domains would need the host to support lazy per-half loading, which it does not promise today.
|
## 🧭 Quick start
|
||||||
- **Shell overrides apply to every install**: the bundle carries remote-ssh's `better-sidebar` / `terminal-controller` shell overrides, so installing this package also replaces the profile's terminal shell integration (that is what makes mirror terminals auto-connect). What the host's patch engine does when an override target is absent from a future host version is not verified — it is on the real-machine checklist.
|
|
||||||
- **First connection to a new SSH host is not fingerprint-confirmed** (`accept-new`, the same default as VS Code Remote-SSH): the internal channel trusts a host key on first sight and fails loudly if it changes afterwards. The terminal wrapper was raised from `no` to the same `accept-new` level by the patch set.
|
|
||||||
|
|
||||||
### Maintenance
|
1. Click **New Group** in the sidebar header, then drag projects into it.
|
||||||
|
2. Use the `⋯` menu on a project or group to manage grouping, appearance and folders.
|
||||||
The vendored code is not a fork: to update remote-ssh, replace `vendor/dsh-remote-ssh/` with the new upstream tree, run `npm run vendor:manifest` to re-record its sha256 manifest, and rebuild — the client transform asserts its anchors and fails loudly if upstream changes its bundle wrapper shape. The settings-face replacement is anchor-asserted as well: if upstream changes the settings section structure, the build fails instead of silently keeping the old page. Local changes outside the vendor tree: `src/client/GroupsBrowser.tsx` narrows a possibly-null ref explicitly (`pending !== null && ...`) because the fork's `tsc` types step rejected the optional-chain form (semantics unchanged), and the duplicate-folder guards described above (`src/core/folders.ts`, `addRemoteFolderTo`). The host patch script likewise asserts its anchors and fails loudly if upstream changes the anchored code.
|
|
||||||
|
|
||||||
## Preview
|
|
||||||
|
|
||||||
<img src="screenshot.png" alt="Workspace grouping plugin preview" width="280" />
|
|
||||||
|
|
||||||
## Implemented features
|
|
||||||
|
|
||||||
- **Workspace groups**: browse by group → project → session, with group creation, renaming, deletion, folding, and pinning.
|
|
||||||
- **Drag-and-drop organization**: move projects into or out of groups and reorder groups and projects.
|
|
||||||
- **Group appearance**: set group colors and icons, including a new Materials & Lab section for lab work, material structures, characterization, and functional devices.
|
|
||||||
- **Multiple folders per project**: attach extra folders, choose the default root, and place sessions under the folder that matches their working directory.
|
|
||||||
- **Local and remote directories**: create folders in local workspaces and registered SSH remote workspaces without falling back to a local mirror when a remote operation fails.
|
|
||||||
- **Session tabs**: open, switch, pin, rename, reorder, and close tabs, including closing other tabs or tabs to the right.
|
|
||||||
- **Sidebar refinements**: keep the default workspace pinned at the bottom, align row metadata and actions consistently, and scroll long appearance dialogs.
|
|
||||||
- **Search and persistence**: search sessions without losing their group context and keep groups, ordering, tabs, and folder settings across refreshes and restarts.
|
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
For the Desktop profile:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
dsh plugin --profile desktop add github:newbieQQ/dsh-better-workspace-group
|
|
||||||
```
|
|
||||||
|
|
||||||
For Web, replace `desktop` with `web`. Fully restart DSH or the corresponding Web profile after installation.
|
|
||||||
|
|
||||||
## Basic use
|
|
||||||
|
|
||||||
1. Click **New Group** in the workspace header, then drag projects into it.
|
|
||||||
2. Use the `⋯` menu on a project or group to manage grouping, appearance, and folders.
|
|
||||||
3. Open **Folders…** on a project to attach folders or choose its default root.
|
3. Open **Folders…** on a project to attach folders or choose its default root.
|
||||||
|
4. For remote work: add an SSH connection in the plugin settings, then create a **remote workspace**.
|
||||||
|
|
||||||
**Add a linked-folder workspace** creates a separate entry after confirmation. Existing workspaces and sessions stay in place; it does not migrate sessions or remove old entries. If registration fails after the directory is created, the error identifies that directory; retrying with the same name and folders reuses its verified links.
|
Automatic grouping by path or name is optional — see [workspace-groups.example.yaml](./workspace-groups.example.yaml) and configure `~/.dsh/workspace-groups.yaml`.
|
||||||
|
|
||||||
Detaching a member folder keeps its backing workspace and sessions, so that workspace can appear independently again, even when empty. Both the sidebar and folder dialog ask for this decision. No automatic cleanup is inferred from an empty sidebar count: existing records do not reliably distinguish plugin-created members from independently registered workspaces. Remote record deletion remains a separate explicit choice; it attempts to clean up an unshared local mirror and registration, while session files and the original server directory remain.
|
## 📚 More
|
||||||
|
|
||||||
For automatic grouping by path or name, see [workspace-groups.example.yaml](./workspace-groups.example.yaml) and configure `~/.dsh/workspace-groups.yaml`. Manual grouping works without this file.
|
- [Changelog](./CHANGELOG.md)
|
||||||
|
- [Example grouping config](./workspace-groups.example.yaml)
|
||||||
|
|
||||||
## Uninstall
|
## 🙏 Credits & License
|
||||||
|
|
||||||
```sh
|
Built on [z-col/dsh-workspace-groups](https://github.com/z-col/dsh-workspace-groups) (MIT). This package also bundles [@zhangfengshun/dsh-remote-ssh](https://github.com/zhangfengshun) 2.4.45 (MIT, © ZhangFengshun).
|
||||||
dsh plugin --profile desktop remove workspace-groups-local
|
|
||||||
```
|
|
||||||
|
|
||||||
## Credit and license
|
|
||||||
|
|
||||||
The original project was created by [zcol](https://github.com/z-col) under the MIT License. This fork adds Materials & Lab icons, the bottom default-workspace bar, consistent row actions, remote-workspace folders, and other refinements.
|
|
||||||
|
|
||||||
Original work © 2026 zcol; modifications © 2026 newbieQQ. See [LICENSE](./LICENSE) and [NOTICE.md](./NOTICE.md).
|
Original work © 2026 zcol; modifications © 2026 newbieQQ. See [LICENSE](./LICENSE) and [NOTICE.md](./NOTICE.md).
|
||||||
|
|
|
||||||
137
README_ZH.md
137
README_ZH.md
|
|
@ -2,123 +2,62 @@
|
||||||
<a href="./README.md">English</a> · <strong>简体中文</strong>
|
<a href="./README.md">English</a> · <strong>简体中文</strong>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# dsh-better-workspace-group
|
<h1 align="center">工作区分组 · 远程 SSH</h1>
|
||||||
|
|
||||||
DeepSeek Harness 工作区分组插件。基于 [z-col/dsh-workspace-groups](https://github.com/z-col/dsh-workspace-groups) 二次开发,让工作区、文件夹和会话在侧栏里更容易整理和使用。
|
<p align="center">
|
||||||
|
<em>DeepSeek Harness 的一个插件 —— 把工作区、项目和会话整理成清爽的分组侧栏,并可通过 SSH 在远程主机上开发。</em>
|
||||||
|
</p>
|
||||||
|
|
||||||
## 合并包:workspace-groups-remote
|
<p align="center">
|
||||||
|
<a href="https://git.qyhhh.top/DeepsSeekHarness/workspace-groups-remote"><img alt="version" src="https://img.shields.io/badge/version-1.3.1-2f6feb"></a>
|
||||||
|
<img alt="license" src="https://img.shields.io/badge/license-MIT-3fb950">
|
||||||
|
<img alt="platform" src="https://img.shields.io/badge/platform-DeepSeek%20Harness-5b6bff">
|
||||||
|
<img alt="node" src="https://img.shields.io/badge/node-%E2%89%A5%2020-339933">
|
||||||
|
</p>
|
||||||
|
|
||||||
本仓库已把两个 DSH 插件合并为**一个可安装的 bundle**(包名 `workspace-groups-remote`):
|
<p align="center">
|
||||||
|
<img src="./screenshot.png" alt="工作区分组插件预览" width="720">
|
||||||
|
</p>
|
||||||
|
|
||||||
- **workspace-groups**(本仓库原有内容):侧边栏分组管理 + 会话标签条。宿主半边由 `src/` 构建为 `lib/groups.js`,客户端半边在 `src/client/groups-client.ts`。
|
## ✨ 主要功能
|
||||||
- **@zhangfengshun/dsh-remote-ssh** 2.4.45(MIT,© ZhangFengshun):原样收录于 `vendor/dsh-remote-ssh/`。其宿主半边**不打包**、以 `lib/remote-ssh/index.js` 文件形式发布——它必须从宿主模块表解析 `@deepseek-ai/schemastery`(其 Config 依赖 DSH 分支 schemastery 的 `.volatile()`)。发布出的宿主文件带**一组本地补丁**,构建时由 `scripts/patch-remote-ssh.mjs` 打上,vendor 树保持原样(见下文「重复的远程文件夹」「安全加固」)。其客户端在上游是自注册的模块加载器 bundle,构建时由 `scripts/build-remote-ssh-client.mjs` 提取出工厂函数,由合并后的客户端入口(`src/client/index.ts`)与分组客户端一并应用。
|
|
||||||
|
|
||||||
### 重复的远程文件夹——本合并包已修复
|
- **分组侧栏** —— 按「分组 → 项目 → 会话」浏览;支持新建、重命名、删除、折叠、置顶和拖拽排序。
|
||||||
|
- **分组外观** —— 颜色与图标;内含「材料与实验」图标集。
|
||||||
|
- **一个项目多个文件夹** —— 为项目添加额外文件夹、选择默认根目录,会话按工作目录归入对应文件夹。
|
||||||
|
- **远程 SSH 工作区** —— 类似 VS Code Remote-SSH:远程工作区、文件访问与集成终端,同一个插件内完成。
|
||||||
|
- **Remote-SSH 设置页** —— 连接卡片、密钥/密码认证、从系统 SSH 配置导入、按工作区的写回与同步设置。(1.3.0)
|
||||||
|
- **修复重复的远程文件夹** —— 同一远程目录换种写法不再重复注册。
|
||||||
|
- **会话标签栏** —— 打开、切换、固定、重命名、拖动排序与关闭标签。
|
||||||
|
- **搜索与保存** —— 保留分组层级搜索会话;分组、排序、标签和文件夹设置刷新或重启后仍生效。
|
||||||
|
|
||||||
上游的 `createRemoteWorkspace` 按 `remotePath` 原始字符串比对已有记录,同一个远程目录换个写法(`~/proj` 与 `/home/u/proj` 与 `proj/`)就会再注册**一条工作区记录、一个本地镜像、一个原生工作区**,界面上就是同一个远程项目出现两个文件夹行。本包分两层修复:
|
## 🚀 安装
|
||||||
|
|
||||||
- **宿主侧(构建时补丁,`scripts/patch-remote-ssh.mjs`)**:注册时先比轻度规范化后的写法;对不上时走一次 SSH 把路径解析成规范形式(`pwd -P` + `$HOME`)再比对,存入的也用规范写法。解析失败不拦创建(退回上游行为)。补丁行为由 `npm run test:patch` 覆盖;vendor 树保持原样,上游更新仍可直接替换。
|
在 DeepSeek Harness 打开「发现」,搜索「工作区分组 · 远程 SSH」点击安装;或用命令行:
|
||||||
- **客户端(分组侧)**:添加云端文件夹时,若已有成员由同一工作区支撑、或指向同一连接 + 同一远程目录,一律拒绝,不再只看镜像路径。
|
|
||||||
|
|
||||||
已经产生的重复不会自动合并(会话归属各自的工作区)。解除成员关联会保留其工作区;删除重复远程记录需要单独明确选择「连工作区一起删」,操作前请核对目标入口。
|
|
||||||
|
|
||||||
### 安全加固(同一组补丁)
|
|
||||||
|
|
||||||
2026-11-11 审查发现的问题,同样由构建时补丁修复,行为由 `npm run test:patch` 覆盖(含把生成的终端 wrapper 真跑起来的端到端用例):
|
|
||||||
|
|
||||||
- **ssh 选项注入**:所有内部连接都经 `sshArgv` 构建,现已在 `user@host` 目标前插入 `--`,以 `-` 开头的用户名/主机名(如 `-oProxyCommand=...`,可经 remote_ssh 工具的内联参数到达)不再会被 ssh 当成选项在本机执行命令。终端 wrapper 自建的参数同样加了 `--`。
|
|
||||||
- **POSIX 密码传递**:`sshpass -p`(密码出现在进程列表里,同机所有用户可见)改为 `sshpass -e`,密码走 `SSHPASS` 环境变量,与 Windows 侧口径一致。
|
|
||||||
- **终端 wrapper 的信任域**:生成的 `dsh-remote-shell` 原先认任意目录下的 `.remote-ssh.json` 且完全关闭主机密钥校验;现只认当前目录确为已注册镜像根(`~/.dsh/remote-workspaces` 的直接子目录,正是宿主自己写标记的位置)时才自动连接,校验改为 `accept-new`,且 remotePath 以 base64 编码传给远端 shell,目录名里的引号/`$()` 只作数据、不再能逃逸成命令。
|
|
||||||
- **远端路径越界**:`localToRemote` 现会先把 `.`/`..` 段按字面折叠,`..` 爬出镜像根的路径直接拒绝,不再把 fs 请求映射到远端工作区之外。
|
|
||||||
- **写回护栏 fail-closed**:读不到工作区设置时本次不推送(并经 `writeBackFailure` 通道报错),不再在护栏(`writeBack` / `writeBackExclude`)根本没被评估的情况下照推。
|
|
||||||
|
|
||||||
`lib/index.js`(源文件 `bundle/index.js`)只做组合:在同一 fiber 上加载两个插件。`cordis.patch.yml` 只插入一行,并原样保留 remote-ssh 对 `better-sidebar` / `terminal-controller` 的 shell 覆盖。
|
|
||||||
|
|
||||||
### Remote-SSH 设置页(1.3.0)
|
|
||||||
|
|
||||||
设置页由本仓库可维护源码组件提供(`src/client/rssh-settings/`),构建期由 `scripts/build-remote-ssh-client.mjs` 按锚点断言替换上游编译产物中的设置小节,vendor 树保持原样。页面为「我的连接 / 添加连接 / 远程工作区 / 高级设置」四个分区;远程工作区与高级设置默认收起,折叠只改变可见性,不清空草稿、不触发保存,收起的高级设置不显示内部保存按钮。
|
|
||||||
|
|
||||||
- **我的连接**:每卡独立测试(成功 / 成功带 warning / 失败与诊断分别显示),删除前卡内确认并明确连接名与影响范围。
|
|
||||||
- **添加连接**:保留全部字段与条件显示(密钥显示私钥路径、密码显示遮罩输入并隐藏私钥路径),端口非法明确报错而不是静默回退 22;ProxyJump 收进默认收起的「更多连接选项」。
|
|
||||||
- **从系统 SSH 配置导入**:多选弹窗,逐项检查保存结果,分别统计成功 / 失败,部分失败可只重试失败项(成功项不重复提交)。
|
|
||||||
- **远程工作区**:每个工作区独立写回、写回排除、同步范围、同步排除与体积上限(GiB),按工作区 ID 保存;有未保存设置时拉取 / 推送会被阻止并提示先保存。
|
|
||||||
- **高级设置**:终端 node 路径、写回策略与新工作区同步默认值;与工作区独立配置分开读写,互不覆盖。
|
|
||||||
|
|
||||||
新文案使用独立的 `dsh-remote-ssh-settings` 命名空间(中英文),样式限定在 `.rsui-root` 之下,不污染其它插件。
|
|
||||||
|
|
||||||
### 安装 / 迁移
|
|
||||||
|
|
||||||
1. 从 profile 里移除旧的两个 bundle(`workspace-groups-local` 与 `@zhangfengshun/dsh-remote-ssh`)。
|
|
||||||
2. 改装本包,并完全重启 DSH。
|
|
||||||
|
|
||||||
已有数据不受影响:`~/.dsh/workspace-groups.yaml` 与 `$DSH_HOME` 下的 sidecar、`dsh-remote-ssh` 设置命名空间、`~/.dsh/remote-ssh/` 都照常工作。若以前在 remote-ssh 的 bundle 行里写过配置,现在改为嵌套写法 `config: { remoteSsh: { ... } }`(连接配置本来就存在 DSH 设置里,不受影响)。
|
|
||||||
|
|
||||||
### 验证
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm install
|
dsh plugin --profile desktop add https://git.qyhhh.top/DeepsSeekHarness/workspace-groups-remote.git
|
||||||
npm run build
|
|
||||||
npm run verify:bundle # 对构建产物做组合检查(含 vendor 完整性指纹 + 客户端真执行冒烟)
|
|
||||||
npm run verify # 全套:tsc + vitest + verify:bundle + 补丁行为测试
|
|
||||||
```
|
```
|
||||||
|
|
||||||
vendor 里的上游测试也能原地跑(需先让其依赖可解析:在仓库根执行 `ln -s ../../node_modules vendor/dsh-remote-ssh/node_modules`,再在 `vendor/dsh-remote-ssh` 里运行 `node tests/run-all.mjs`)。已知的非 Windows 环境既存失败:分组插件有 6 个 folders 测试使用 `C:\` 路径、remote-ssh 有几个套件假设 WSL / Windows 路径语义——在未合并的上游里同样失败,与合并无关。
|
Web 环境将 `desktop` 改为 `web`,安装后完全重启 DSH。
|
||||||
|
|
||||||
### 已知取舍
|
> **从旧的两个包升级?** 先移除 `workspace-groups-local` 和 `@zhangfengshun/dsh-remote-ssh`,再安装本包并重启。已有工作区、会话和设置都会保留。
|
||||||
|
|
||||||
- **加载耦合**:两半作为一个包加载,任一半导入失败,整包(含分组)都会起不来。这是「只装一个包」的代价;要隔离失败域需要宿主支持按半懒加载,目前没有这个承诺。
|
## 🧭 上手
|
||||||
- **shell 覆盖对所有安装生效**:合并包带着 remote-ssh 对 `better-sidebar` / `terminal-controller` 的 shell 覆盖,装这个包等于同时接管 profile 的终端 shell 集成(镜像终端自动连接靠的就是它)。宿主补丁引擎在未来版本里遇到覆盖目标不存在时如何处理,未验证——已列入真机清单。
|
|
||||||
- **首次连接新 SSH 主机不做指纹确认**(`accept-new`,与 VS Code Remote-SSH 相同的默认):内部通道首次连接即信任主机密钥,之后密钥变化会大声失败。终端 wrapper 已由补丁从 `no` 提升到同一 `accept-new` 口径。
|
|
||||||
|
|
||||||
### 维护
|
1. 点击侧栏标题栏的「新建分组」,再把项目拖进去。
|
||||||
|
|
||||||
vendor 代码不是 fork:更新 remote-ssh 时,把 `vendor/dsh-remote-ssh/` 换成新版上游树,跑 `npm run vendor:manifest` 重新记录其 sha256 指纹清单,再重新构建;客户端提取脚本带锚点断言,上游若改了 bundle 包裹形式会直接报错。设置页替换同样带锚点断言:上游设置小节的结构一旦变化,构建会失败而不是静默沿用旧界面。vendor 之外的本地改动:`src/client/GroupsBrowser.tsx` 把可空 ref 的判断改成显式写法(`pending !== null && ...`),因为 fork 的 `tsc` 类型步骤不接受可选链写法,语义不变;以及上文的防重复成员检查(`src/core/folders.ts`、`addRemoteFolderTo`)。宿主补丁脚本同样带锚点断言,上游改动锚点代码时会直接报错。
|
|
||||||
|
|
||||||
## 预览
|
|
||||||
|
|
||||||
<img src="screenshot.png" alt="工作区分组插件预览" width="280" />
|
|
||||||
|
|
||||||
## 已实现的功能
|
|
||||||
|
|
||||||
- **工作区分组**:按「分组 → 项目 → 会话」浏览,支持新建、重命名、删除、折叠和置顶分组。
|
|
||||||
- **拖拽整理**:把项目拖入或移出分组,并调整分组、项目的显示顺序。
|
|
||||||
- **分组外观**:设置分组颜色和图标;新增「材料与实验」图标分区,包含实验操作、材料结构、表征测试和功能器件图标。
|
|
||||||
- **一个项目多个文件夹**:为项目添加额外文件夹、选择默认根目录,会话会按工作目录归入对应文件夹。
|
|
||||||
- **本地与远程目录**:本地工作区和已注册的 SSH 远程工作区都可以创建文件夹;远程操作失败时不会误建到本地镜像。
|
|
||||||
- **会话标签栏**:打开、切换、固定、重命名、拖动排序和关闭会话标签,支持关闭其他标签及右侧标签。
|
|
||||||
- **侧栏布局优化**:默认工作区固定在底部;各行的数量、时间和操作按钮统一右对齐;外观弹窗内容可滚动。
|
|
||||||
- **搜索与保存**:保留分组层级搜索会话,分组、排序、标签和文件夹设置都会保存,刷新或重启后仍然有效。
|
|
||||||
|
|
||||||
## 安装
|
|
||||||
|
|
||||||
Desktop 环境:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
dsh plugin --profile desktop add github:newbieQQ/dsh-better-workspace-group
|
|
||||||
```
|
|
||||||
|
|
||||||
Web 环境将 `desktop` 改为 `web`。安装完成后,完全重启 DSH 或对应的 Web profile。
|
|
||||||
|
|
||||||
## 基本使用
|
|
||||||
|
|
||||||
1. 点击工作区标题栏的「新建分组」,再把项目拖进去。
|
|
||||||
2. 在项目或分组的 `⋯` 菜单中管理分组、外观和文件夹。
|
2. 在项目或分组的 `⋯` 菜单中管理分组、外观和文件夹。
|
||||||
3. 在项目的「文件夹…」弹窗中添加文件夹或选择默认根目录。
|
3. 在项目的「文件夹…」中添加文件夹或选择默认根目录。
|
||||||
|
4. 远程开发:在插件设置里添加 SSH 连接,再创建**远程工作区**。
|
||||||
|
|
||||||
「新增总目录工作区」经确认后添加独立入口。旧工作区和会话仍在原处,不会迁移会话或删除旧入口。如果总目录创建成功但注册失败,提示会列出已创建的路径;保持名称和文件夹不变重试会复用经校验的链接。
|
需要按路径或名称自动分组时,可参考 [workspace-groups.example.yaml](./workspace-groups.example.yaml) 配置 `~/.dsh/workspace-groups.yaml`;不配置也不影响手动分组。
|
||||||
|
|
||||||
解除 member 文件夹关联会保留其工作区和会话,因此该工作区可能重新独立显示,即使它是空入口。侧栏和文件夹弹窗都先让用户确认此结果。不会根据侧栏会话数自动清理:既有记录无法可靠区分插件新建的 member 和用户独立注册的工作区。删除远程记录仍是单独的明确选择,会尝试清理未共用的本地镜像与注册;聊天文件及服务器上的原目录保留。
|
## 📚 更多
|
||||||
|
|
||||||
需要按路径或名称自动分组时,可参考 [workspace-groups.example.yaml](./workspace-groups.example.yaml) 配置 `~/.dsh/workspace-groups.yaml`。不配置也不影响手动分组。
|
- [更新日志](./CHANGELOG.md)
|
||||||
|
- [自动分组示例](./workspace-groups.example.yaml)
|
||||||
|
|
||||||
## 卸载
|
## 🙏 致谢与许可
|
||||||
|
|
||||||
```sh
|
基于 [z-col/dsh-workspace-groups](https://github.com/z-col/dsh-workspace-groups)(MIT)二次开发;本包同时内置 [@zhangfengshun/dsh-remote-ssh](https://github.com/zhangfengshun) 2.4.45(MIT,© ZhangFengshun)。
|
||||||
dsh plugin --profile desktop remove workspace-groups-local
|
|
||||||
```
|
|
||||||
|
|
||||||
## 致谢与许可
|
原始作品 © 2026 zcol;本仓库修改 © 2026 newbieQQ。详见 [LICENSE](./LICENSE) 与 [NOTICE.md](./NOTICE.md)。
|
||||||
|
|
||||||
原项目由 [zcol](https://github.com/z-col) 开发并以 MIT 许可发布。本仓库在其基础上增加了材料与实验图标、底部默认工作区、统一行尾布局、远程工作区文件夹等功能。
|
|
||||||
|
|
||||||
原始作品 © 2026 zcol;本仓库修改 © 2026 newbieQQ。详见 [LICENSE](./LICENSE) 和 [NOTICE.md](./NOTICE.md)。
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "workspace-groups-remote",
|
"name": "workspace-groups-remote",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"description": "Merged DSH bundle: the workspace-groups sidebar manager (category -> project -> session grouped tree, session tab strip) plus dsh-remote-ssh (VSCode Remote-SSH-like remote development: remote workspaces, file access, integrated terminal) in one installable package.",
|
"description": "Merged DSH bundle: the workspace-groups sidebar manager (category -> project -> session grouped tree, session tab strip) plus dsh-remote-ssh (VSCode Remote-SSH-like remote development: remote workspaces, file access, integrated terminal) in one installable package.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"dsh",
|
"dsh",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue