dsh-linked-workspace 0.11.0 → 0.13.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/CHANGELOG.md +13 -0
- package/README.en.md +8 -6
- package/README.md +8 -6
- package/docs/API.md +6 -1
- package/docs/VERIFY.md +31 -3
- package/lib/client.js +553 -98
- package/lib/index.js +51 -4
- package/lib/ssh.js +154 -20
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.13.0 — 2026-11-14
|
|
6
|
+
|
|
7
|
+
- **Batch drag and move**: dragging inside one tree is now a move instead of a dead end — remote-to-remote in a linked or remote workspace, local-to-local in a linked workspace — and a multi-selection travels as one gesture in both directions (one request per entry, so a failure leaves the rest untouched and the notice reports how many landed). The row menu gained “Move selected (N)…” for the same job without dragging.
|
|
8
|
+
- **Hover card host line**: the host's workspace hover preview now shows the SSH host of the connection together with its live state, on one line right under the workspace name (`RTX-PRO-6000-1 · Connected` / `RTX-PRO-6000-1 · Connection lost`), for both linked and remote workspaces. The line is green while the connection is up and red once it drops; the previous standalone state line and the session counter are gone.
|
|
9
|
+
- **First-run welcome card**: the first time the plugin loads in a browser profile it shows one card that says what the plugin does, where to create a linked or remote workspace, where the two remote trees live, and that an SSH password can be kept on this machine — plus a “Star the repo” link. Dismissing it (button, `Esc`, or clicking the backdrop) is remembered in `localStorage`, so it never reopens; a fresh DSH profile shows it once again.
|
|
10
|
+
|
|
11
|
+
## 0.12.0 — 2026-11-14
|
|
12
|
+
|
|
13
|
+
- **Password diagnostics**: an SSH failure now shows the server's own reason next to the translated text (for example “SSH 认证失败:… All configured authentication methods failed.”), and the add-workspace dialog gained a **Check password** button that stores the secret and opens a probe connection, so a wrong password is caught before creating the workspace. Password logins also answer `keyboard-interactive` prompts with the same secret, which is what PAM-based servers often ask for.
|
|
14
|
+
- **Local SSH credentials**: hosts listed in `~/.ssh/config` without an `IdentityFile` used to require `dsh-ssh-tunnel` for a password. The “Add workspace” dialog now shows them as “Password needed” instead of disabling them, takes the password once, and stores it in the plugin's own `$DSH_HOME/linked-workspace/ssh-credentials.json` (mode `0600`, Host process only). New API `hosts.credentials` (`{ hostId, password?, passphrase?, privateKey?, clear? }`); `hosts.list` entries gained `hasStoredPassword`, and a password typed earlier is reused when the field is left empty.
|
|
15
|
+
- **Settings nav icon**: the “Linked workspaces” entry in the settings list now uses the plugin's own stacked-sheets glyph (registered through the host's `settings.section.icon` seat) instead of the default gear.
|
|
16
|
+
- **Dialog scrolling (fix)**: a wheel over the “Add workspace” dialog used to scroll the conversation behind it — the SSH host list and the dialog body never moved. The dialog now takes the gesture in the capture phase, scrolls its own scroll areas (host list first, then the body) and never lets the page behind move while it is open.
|
|
17
|
+
|
|
5
18
|
## 0.11.0 — 2026-11-13
|
|
6
19
|
|
|
7
20
|
**Breaking change**: Remote workspaces replace remote directories.
|
package/README.en.md
CHANGED
|
@@ -23,15 +23,15 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
|
|
|
23
23
|
## Requirements
|
|
24
24
|
|
|
25
25
|
- **DSH**: 0.2.1-rc.4 or newer (`engines` allows `>=0.2.0-rc.2 <0.3.0-0`).
|
|
26
|
-
- **SSH**: the host
|
|
26
|
+
- **SSH**: the host lives in `~/.ssh/config`, or in DSH's SSH Manager (`dsh-ssh-tunnel`, optional). A plain `~/.ssh/config` is enough: the plugin ships its own SSH client and pins the host key on first use into `$DSH_HOME/linked-workspace/known_hosts.json` (a changed key is refused, with instructions to delete that entry). **`dsh-ssh-tunnel` is optional**: a host in `~/.ssh/config` without an `IdentityFile` can be given a password once in the “Add workspace” dialog, and it stays on this machine (see “SSH credentials” under Configuration).
|
|
27
27
|
- **dsh-better-sidebar** (optional): `>=0.24.0`. It renders the sidebar directory pages and the file editor; without it everything else (settings page, directory pickers, agent tools) still works.
|
|
28
28
|
- **Document editing** (optional): Python 3 with `python-docx`, `openpyxl`, `python-pptx` and `PyMuPDF`; set `DSH_OFFICE_PYTHON` to choose the interpreter. Markdown needs no Python.
|
|
29
29
|
- **Development**: Node.js ≥ 20.
|
|
30
30
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
|
-
1. **Install** the plugin (see [Install](#install)) and restart the DSH client.
|
|
34
|
-
2. **Add a workspace**: Settings → Linked workspaces → “Create linked workspace” or “Create remote workspace”, then pick an existing SSH host (add it
|
|
33
|
+
1. **Install** the plugin (see [Install](#install)) and restart the DSH client; the first time it loads, a welcome card explains what it does — press “Got it” to dismiss it for good.
|
|
34
|
+
2. **Add a workspace**: Settings → Linked workspaces → “Create linked workspace” or “Create remote workspace”, then pick an existing SSH host (add it to `~/.ssh/config` or the DSH SSH Manager, then press “Refresh”, if the list is empty).
|
|
35
35
|
3. **Pick directories**: a linked workspace needs a remote path plus a local folder (empty or new); a remote workspace needs only a remote path, and that directory must already exist — the plugin never creates it.
|
|
36
36
|
4. **Open the sidebar**: on the right sidebar start page choose “Linked Workspace Directory” or “Remote Workspace Directory”.
|
|
37
37
|
5. **Edit**: single-click a file to preview it, double-click to pin the tab; `Ctrl/Cmd + S` saves.
|
|
@@ -40,7 +40,7 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
|
|
|
40
40
|
|
|
41
41
|
### Settings → Linked workspaces
|
|
42
42
|
|
|
43
|
-
- SSH hosts come from the `dsh-ssh-tunnel` SSH Manager (`~/.dsh/ssh-tunnel/hosts.json
|
|
43
|
+
- SSH hosts come from the `dsh-ssh-tunnel` SSH Manager (`~/.dsh/ssh-tunnel/hosts.json`, optional) and `~/.ssh/config`; passwords and keys from either source stay inside the Host process and are never returned to the page or the model. Without the SSH Manager, the plugin stores a password on this machine itself (see “SSH credentials” under Configuration).
|
|
44
44
|
- Remote workspace list: each card shows “remote · user@host + remote path” and the local placeholder directory, with **open workspace**, **open directory tree**, **test connection**, **rename** (renames the DSH workspace too) and **remove** (two-step confirmation; deletes the record, the placeholder directory and the DSH workspace, never remote files).
|
|
45
45
|
- Linked workspace list: local ⇄ remote paths, mirror toggle (**off by default**), background sync (archive into `.remote`, with file/byte progress and cancel), remove (optionally remove the DSH workspace and delete `.local`/`.remote`). With the mirror on, the first check runs immediately and then **every 5 minutes**: new or changed remote files are downloaded, mirror files that no longer exist remotely are deleted, unchanged files are skipped via `.local/mirror-manifest.json`, and `.git`/`node_modules`/cache directories are excluded. With the mirror off the two sides may diverge freely.
|
|
46
46
|
- A linked record without a DSH workspace shows “Register workspace” in its settings card, which registers it without recreating the record.
|
|
@@ -56,7 +56,7 @@ The plugin takes over the DSH sidebar/hero directory-selection hole; the dialog
|
|
|
56
56
|
2. **Linked workspace (local ⇄ remote)**: SSH host + remote directory + local directory + mirror toggle; the local directory becomes a DSH workspace.
|
|
57
57
|
3. **Remote workspace**: SSH host + remote directory + workspace name; the placeholder directory becomes a DSH workspace and sessions run on the server.
|
|
58
58
|
|
|
59
|
-
> Linked workspace rows no longer carry a `⇄` title prefix: a scoped stylesheet keyed on `data-row-key` swaps the host folder glyph for the workspace's own icon — two interlocking links for a linked workspace, a display with an outbound arrow for a remote workspace (normal local workspaces are untouched). When the SSH connection drops the row icon turns red, and the host's hover card gains
|
|
59
|
+
> Linked workspace rows no longer carry a `⇄` title prefix: a scoped stylesheet keyed on `data-row-key` swaps the host folder glyph for the workspace's own icon — two interlocking links for a linked workspace, a display with an outbound arrow for a remote workspace (normal local workspaces are untouched). When the SSH connection drops the row icon turns red, and the host's hover card gains one line under the name combining the SSH host with its live state (`RTX-PRO-6000-1 · Connected`, turning red with “Connection lost” once the link drops); a remote workspace shows the remote directory, a linked one shows both the remote and local directories. This is the only DOM-level adaptation of the host row; if DSH changes the row structure the selector stops matching and the original folder icon returns, with no other breakage.
|
|
60
60
|
|
|
61
61
|
### Sidebar: “Linked Workspace Directory”
|
|
62
62
|
|
|
@@ -94,7 +94,7 @@ Appears automatically for sessions that belong to a remote workspace (and can be
|
|
|
94
94
|
|
|
95
95
|
### Transfer, comparison and conflicts
|
|
96
96
|
|
|
97
|
-
- **Drag and drop**: drag rows between the local and remote trees, or
|
|
97
|
+
- **Drag and drop**: drag rows between the local and remote trees to transfer them, or drag inside one tree (remote-inside-remote, local-inside-local) to **move** them; with several rows selected the whole selection travels in one gesture. OS files can be dropped onto either tree (the web client cannot read dropped file paths and says to use the desktop app). Hovering a collapsed folder for 700 ms while dragging expands it; a multi-selection can also be moved at once with “Move selected (N)…”.
|
|
98
98
|
- **Overwrite confirmation**: dropping onto a folder that already has the name no longer overwrites silently — a dialog offers cancel / keep both / overwrite. “Keep both” produces `name copy.txt` or `name (2).txt`. The API and tools accept `conflict=error|overwrite|unique`.
|
|
99
99
|
- **Local ⇄ remote comparison**: right-click a remote folder → “Compare with local…” groups entries into only-local / only-remote / changed (size differs, or mtime differs by more than 2 s); up to 4000 files and depth 12 per side, 200 rows per group, with a truncation notice. Clicking a row opens the file; each row can push to remote or pull to local; a missing local folder is called out explicitly.
|
|
100
100
|
- **Transfer queue**: one job at a time with queued/running/done/failed states; failed items can be retried.
|
|
@@ -165,6 +165,8 @@ The npm package is `dsh-linked-workspace`; released versions can also be install
|
|
|
165
165
|
- **Python interpreter**: `DSH_OFFICE_PYTHON` for Office/PDF operations.
|
|
166
166
|
- **Terminal**: `DSH_LINKED_WORKSPACE_NO_TERMINAL=1` keeps “Open terminal” from launching a real window (used in tests).
|
|
167
167
|
- **SSH**: aliases from `~/.ssh/config` appear in the host list; host fingerprints are stored in the plugin data directory.
|
|
168
|
+
- **SSH credentials**: there are three sources — `IdentityFile` in `~/.ssh/config` (plus the SSH agent), the `dsh-ssh-tunnel` SSH Manager when installed, and the plugin's own `$DSH_HOME/linked-workspace/ssh-credentials.json`. A host with no key shows “Password needed” in the “Add workspace” dialog: pick it, type the password once, then “Create”. The password is written only to that file on this machine (mode `0600`) and read only by the Host process; it is never returned to the page or the model. Later workspaces can leave the field empty to reuse it. **Check password** probes a connection first and reports either “Password works” or the server's own reason (e.g. `All configured authentication methods failed.`); `hosts.credentials` with `clear: true` removes the secret.
|
|
169
|
+
- **A new feature reports `unknown method` after upgrading**: the Host process is still running older code (the page hot-reloads, the Host does not). Quit DSH completely and start it again.
|
|
168
170
|
|
|
169
171
|
## Upgrading and versions
|
|
170
172
|
|
package/README.md
CHANGED
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
## 环境要求
|
|
24
24
|
|
|
25
25
|
- **DSH**:0.2.1-rc.4 或更高(`engines` 允许 `>=0.2.0-rc.2 <0.3.0-0`)。
|
|
26
|
-
- **SSH
|
|
26
|
+
- **SSH**:主机写在 `~/.ssh/config`,或加入 DSH 的 SSH Manager(`dsh-ssh-tunnel`,可选)。裸 `~/.ssh/config` 也够用:插件自带 SSH 客户端,首次连接**自动信任并记录**主机指纹到 `$DSH_HOME/linked-workspace/known_hosts.json`,指纹变化时拒绝连接并提示删除对应条目。**不安装 `dsh-ssh-tunnel` 也能用**:没有 `IdentityFile` 的主机可在这个插件的「添加工作区」弹窗里填一次密码,密码保存在本机(见「配置 → SSH 凭据」)。
|
|
27
27
|
- **dsh-better-sidebar**(可选):`>=0.24.0`。装上才有右侧栏目录页与文件编辑页;缺少时其余功能(设置页、目录选择、模型工具)照常可用。
|
|
28
28
|
- **文档编辑**(可选):Python 3 及 `python-docx`、`openpyxl`、`python-pptx`、`PyMuPDF`;可用 `DSH_OFFICE_PYTHON` 指定解释器。Markdown 不需要 Python。
|
|
29
29
|
- **开发**:Node.js ≥ 20。
|
|
30
30
|
|
|
31
31
|
## 快速开始
|
|
32
32
|
|
|
33
|
-
1. **安装插件**(见[安装](#安装)),重启 DSH
|
|
34
|
-
2. **添加工作区**:设置 → 联动工作区 →「创建联动工作区」或「创建远程工作区」,选择已有 SSH
|
|
33
|
+
1. **安装插件**(见[安装](#安装)),重启 DSH 客户端;首次打开时插件会弹出一张欢迎卡片,点「知道了」即可(之后不再出现)。
|
|
34
|
+
2. **添加工作区**:设置 → 联动工作区 →「创建联动工作区」或「创建远程工作区」,选择已有 SSH 主机;列表里没有就把主机写进 `~/.ssh/config`(或在 DSH 的 SSH Manager 里添加),然后点「刷新」。
|
|
35
35
|
3. **选目录**:联动工作区需选远端路径和本地目录;远程工作区只需选远端路径(该目录必须已存在,插件不会自动创建)。
|
|
36
36
|
4. **打开右侧栏**:会话右侧栏开始页点「联动工作区目录」(联动)或「远程工作区目录」(远程)。
|
|
37
37
|
5. **开始编辑**:单击文件打开预览,双击固定标签;`Ctrl/Cmd + S` 保存。
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
### 连接与设置(设置 → 联动工作区)
|
|
42
42
|
|
|
43
|
-
- SSH 主机来自 `dsh-ssh-tunnel` 的 SSH Manager(`~/.dsh/ssh-tunnel/hosts.json
|
|
43
|
+
- SSH 主机来自 `dsh-ssh-tunnel` 的 SSH Manager(`~/.dsh/ssh-tunnel/hosts.json`,可选),也支持 `~/.ssh/config`;两者的密码/私钥只在 Host 进程内使用,永不返回给页面或模型。没有安装 SSH Manager 时,插件会自己在本机保存密码(见「配置 → SSH 凭据」)。
|
|
44
44
|
- **联动工作区**列表:本地 ⇄ 远端路径、镜像开关(**默认关闭**)、后台同步(归档到 `.remote`,显示文件数/体积进度,可取消)、移除(可选同时移除 DSH 工作区、删除 `.local`/`.remote`)。开启镜像后首次立即检查,之后**每 5 分钟**自动比较远端与 `.remote`:下载新增/变更文件、删除远端已不存在的镜像文件、跳过未变更文件(`.local/mirror-manifest.json`),并排除 `.git`/`node_modules`/缓存目录;关闭镜像时允许两侧存在版本和文件差异。
|
|
45
45
|
- **远程工作区**列表:每张卡片显示「远端 · 用户名@主机 + 远端路径」和「本地占位目录」,提供**打开工作区**(切到该 DSH 工作区)、**打开目录树**、**测试连接**、**重命名**(同步改名 DSH 工作区)、**移除远程工作区**(两步确认;同时删除占位目录和 DSH workspace 注册,不动远端文件)。
|
|
46
46
|
- 联动记录若没有对应的 DSH 工作区,设置卡会显示「注册为工作区」,点击即可补注册,无需删除重建。
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
2. **联动工作区(本地 ⇄ 远端)**:SSH 主机 + 远端目录 + 本地目录 + 镜像开关,创建后本地目录成为 DSH 工作区。
|
|
57
57
|
3. **远程工作区**:SSH 主机 + 远端目录 + 工作区名称,创建后占位目录成为 DSH 工作区,会话直接跑在远端。
|
|
58
58
|
|
|
59
|
-
> 左侧工作区行不再带 `⇄` 标题前缀:插件用一份按 `data-row-key` 定位的样式表,把宿主文件夹图标换成工作区自己的图标——联动工作区是**双链环**,远程工作区是**显示器 + 出链箭头**,普通本地工作区不受影响。SSH
|
|
59
|
+
> 左侧工作区行不再带 `⇄` 标题前缀:插件用一份按 `data-row-key` 定位的样式表,把宿主文件夹图标换成工作区自己的图标——联动工作区是**双链环**,远程工作区是**显示器 + 出链箭头**,普通本地工作区不受影响。SSH 连接断开时该行的图标会变红;把鼠标停在行上,宿主那张悬停信息卡里名字下面会多出一行「SSH 主机 · 连接状态」(形如 `RTX-PRO-6000-1 · 已连接`,掉线后变红并显示「连接已断开」);远程工作区显示远端目录、联动工作区同时显示远端与本地目录。这是对宿主行结构的唯一 DOM 级适配;如果 DSH 以后更改行结构,选择器会自然失配并回退到原来的文件夹图标,不破坏其他功能。
|
|
60
60
|
|
|
61
61
|
### 右侧栏「联动工作区目录」
|
|
62
62
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
|
|
95
95
|
### 传输、对比与冲突处理
|
|
96
96
|
|
|
97
|
-
-
|
|
97
|
+
- **拖拽**:在本地树与远端树之间拖动文件即可互传;同一棵树内拖动(远端内或本地内)则是**移动**,选中多项后拖动会一起移动/传输。也可以把系统文件拖进任一树(Web 端浏览器无法读取拖入文件路径时会提示改用桌面端)。拖动时悬停在折叠目录上 700 ms 会自动展开;多选后用右键「移动所选的 N 项…」也能批量移动。
|
|
98
98
|
- **覆盖确认**:目标目录已有同名文件时,不再静默覆盖,而是弹出「取消 / 保留两者 / 覆盖」;保留两者会自动生成 `name copy.txt` 或 `name (2).txt`。工具与 API 也可用 `conflict=error|overwrite|unique` 指定策略。
|
|
99
99
|
- **本地 ⇄ 远端对比**:右键远端目录 →「与本地对比…」,按「仅本地存在 / 仅远端存在 / 大小或时间不同」分组列出;单侧最多扫描 4000 个文件、深度 12、每组展示 200 行,超限会提示。点行直接打开文件;每行可「推送到远端」或「拉取到本地」;本地缺少对应目录时会明确说明。
|
|
100
100
|
- **传输队列**:一次执行一个任务,显示排队/传输中/完成/失败;失败项可重试。
|
|
@@ -165,6 +165,8 @@ npm 包名为 `dsh-linked-workspace`,也可以从 npm 安装已发布版本(
|
|
|
165
165
|
- **Python 解释器**:`DSH_OFFICE_PYTHON` 指定用于 Office/PDF 的 Python。
|
|
166
166
|
- **终端**:`DSH_LINKED_WORKSPACE_NO_TERMINAL=1` 关闭「打开终端」的实际启动(测试环境用)。
|
|
167
167
|
- **SSH 配置**:`~/.ssh/config` 中的别名会出现在主机列表;主机指纹保存在插件数据目录。
|
|
168
|
+
- **SSH 凭据**:主机列表的凭据来源有三处——`~/.ssh/config` 的 `IdentityFile`(含 SSH agent)、`dsh-ssh-tunnel` 的 SSH Manager(若已安装),以及插件自己的 `$DSH_HOME/linked-workspace/ssh-credentials.json`。没有私钥的主机在「添加工作区」弹窗里显示「需要密码」,选它、填一次密码再点「创建」即可:密码只写在本机这个文件里(权限 `0600`),只由 Host 进程读取,不会返回给页面或模型;之后再建工作区留空即沿用已存密码。填完可点「**验证密码**」先探一条连接,成功显示「密码可用」,失败直接给出服务器原话(例如 `All configured authentication methods failed.`)。用 `hosts.credentials` 的 `clear: true` 可以删除。
|
|
169
|
+
- **升级后某个新功能报 `unknown method`**:说明 Host 进程还在跑旧代码(页面会热更新、Host 不会)。完全退出 DSH 再启动即可。
|
|
168
170
|
|
|
169
171
|
## 升级与版本
|
|
170
172
|
|
package/docs/API.md
CHANGED
|
@@ -51,7 +51,8 @@ scope root, or absolute inside it.
|
|
|
51
51
|
|
|
52
52
|
| method | params | data |
|
|
53
53
|
| --- | --- | --- |
|
|
54
|
-
| `hosts.list` | `{ refresh? }` | `{ hosts: HostInfo[] }` |
|
|
54
|
+
| `hosts.list` | `{ refresh? }` | `{ hosts: HostInfo[] }` (`HostInfo` carries `authType`, `hasCredential`, `hasStoredPassword`) |
|
|
55
|
+
| `hosts.credentials` | `{ hostId, password?, passphrase?, privateKey?, clear? }` | `{ hostId, authType, hasCredential, hasStoredPassword }` (stores the secret in the plugin's own `ssh-credentials.json`; `clear: true` deletes it) |
|
|
55
56
|
| `hosts.browse` | `{ hostId, path? }` | `{ path, parent, home, entries }` (dirs + files) |
|
|
56
57
|
| `remote_workspaces.list` | `{}` | `{ workspaces: RemoteWorkspaceInfo[] }` |
|
|
57
58
|
| `remote_workspaces.create` | `{ hostId, remotePath, name? }` | `{ workspace }` |
|
|
@@ -125,6 +126,10 @@ Under `$DSH_HOME/linked-workspace/`:
|
|
|
125
126
|
- `remote-workspaces.json` — remote workspaces (no credentials).
|
|
126
127
|
- `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave }`.
|
|
127
128
|
- `known_hosts.json` — trust-on-first-use host key fingerprints.
|
|
129
|
+
- `ssh-credentials.json` — `{ version, byHostId: { <hostId>: { password?, privateKey?, passphrase? } } }`,
|
|
130
|
+
written by `hosts.credentials` with mode `0600`. Hosts listed in `~/.ssh/config`
|
|
131
|
+
without an `IdentityFile` can be paired with a password here, so the plugin does
|
|
132
|
+
not need `dsh-ssh-tunnel` for password logins.
|
|
128
133
|
- `remote-placeholders/<uuid>/` — placeholder directories for remote workspaces.
|
|
129
134
|
- Local linked directories also hold `.local/linked.json` (same binding without
|
|
130
135
|
secrets) and the optional `.remote/` mirror.
|
package/docs/VERIFY.md
CHANGED
|
@@ -5,7 +5,7 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
5
5
|
## 设置 → 联动工作区
|
|
6
6
|
|
|
7
7
|
1. 左下角「账号菜单」→ 设置 →「联动工作区」。
|
|
8
|
-
2. 页面:标题「联动&远程工作区」、编辑器主题卡片(10
|
|
8
|
+
2. 页面:标题「联动&远程工作区」、编辑器主题卡片(10 套,点击立即切换,编辑器配色跟随)、联动工作区组、**远程工作区组**;左侧导航里的本项图标是层叠纸张(不是齿轮)。
|
|
9
9
|
3. 创建远程工作区:选 `RTX-PRO-6000-1`,路径 `/shared_data_ssd1/huangjh/code` → 卡片出现(`[远程] [已连接]`、远端路径、本地占位目录);「测试连接」显示「连接正常」。
|
|
10
10
|
4. 添加联动工作区:
|
|
11
11
|
- SSH 连接 + 远端目录(浏览),本地目录(浏览/新建文件夹/系统选择器),镜像可选,名称可选;
|
|
@@ -36,6 +36,14 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
36
36
|
7. **远端目录必须已存在**:填一个不存在的路径 → 报错 `FS_NOT_FOUND`(不会自动创建)。
|
|
37
37
|
8. **标签常驻**:当前会话属于联动工作区时,设置页仍能打开远程工作区目录树(不再依赖会话 scope 才注册标签)。
|
|
38
38
|
|
|
39
|
+
## 首次运行欢迎卡片(0.13.0)
|
|
40
|
+
|
|
41
|
+
1. **首次打开会弹出**:清掉 `localStorage` 里的 `dsh-linked-workspace:welcome`(或换一个全新 profile)后刷新页面——中央出现一张卡片:标签 `DSH-LINKED-WORKSPACE`、标题「欢迎使用联动工作区插件」、一段说明、四条「做什么 + 在哪」(创建工作区 / 浏览远端文件 / 让模型读写远端代码 / 不用 SSH Manager 也能连),底部「★ 点个 Star」与「知道了」。
|
|
42
|
+
2. **三种关闭方式**:点「知道了」、按 `Esc`、点卡片外的遮罩都能关闭;关闭后 `localStorage.dsh-linked-workspace:welcome === "1"`。
|
|
43
|
+
3. **不会重复弹**:刷新页面后不再出现;把该键删掉再刷新会重新出现。
|
|
44
|
+
4. **深浅两套主题都正常**:深色下卡片底色 `rgb(44,44,46)`、行内底色 `rgb(21,21,23)`、文字浅色;浅色下卡片白底、行内白底带边框、主按钮深底反白。
|
|
45
|
+
5. **Star 按钮**:链接指向 `https://github.com/jiahui-huang1/dsh-linked-workspace`(新标签打开)。
|
|
46
|
+
|
|
39
47
|
## 侧边栏入口与可选依赖(0.11.0)
|
|
40
48
|
|
|
41
49
|
1. **菜单按工作区类型给出入口**:分别在「默认工作区(普通本地)」「联动工作区」「远程工作区」三种会话里打开右侧栏「+」新标签页菜单——本地工作区两条都不出现;联动工作区只出现「联动工作区目录」;远程工作区只出现「远程工作区目录」。
|
|
@@ -44,10 +52,21 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
44
52
|
4. **没有 dsh-better-sidebar 时仍能运行**:停用 `dsh-better-sidebar` 后重启客户端——插件仍加载(设置 → 联动工作区 可正常打开与创建/移除工作区)、「添加工作区」弹窗可用、会话里 `linked_workspace` 工具可用;控制台不再出现因缺少 `betterSidebar` 服务而抛出的错误,右侧栏也不出现本插件的目录页。
|
|
45
53
|
5. **插件显示名**:插件市场列表中本插件显示为「联动与远程工作区」(英文 `Linked & Remote Workspaces`)。
|
|
46
54
|
|
|
55
|
+
## 本机 SSH 凭据(0.12.0)
|
|
56
|
+
|
|
57
|
+
1. **没有私钥的主机不再置灰**:在 `~/.ssh/config` 里写一个没有 `IdentityFile` 的 Host(例如 `Host demo` / `HostName 10.9.9.9` / `User dev`),重启后「添加工作区」弹窗里该主机可点选,右侧 chip 显示「需要密码」,主机列表下方出现「SSH 密码」输入框与「密码只保存在本机…不需要安装 SSH Manager 插件」的提示。
|
|
58
|
+
2. **保存后立即生效**:填入任意密码点「创建」(远端目录不可达时创建会失败,但凭据已写入)——该主机 chip 变回 `~/.ssh/config`,hint 变「已保存密码。想更换就重新输入,留空则继续使用原密码。」;`$DSH_HOME/linked-workspace/ssh-credentials.json` 出现 `{"version":1,"byHostId":{"sshconfig:demo":{"password":"…"}}}`,权限 `0600`。
|
|
59
|
+
2b. **验证密码按钮**:填一个错误密码点「验证密码」→ 输入框下方出现红字「验证失败:SSH 认证失败,请检查主机凭据:… All configured authentication methods failed.」;填对后显示绿色「密码可用,可以继续创建。」。
|
|
60
|
+
3. **主机状态跟着变**:`hosts.list` 里该主机 `authType` 从 `agent` 变 `password`、`hasCredential` 与 `hasStoredPassword` 均为 `true`;再连会进入真实网络(错误是连接层面的 `SSH_CONNECT`,而不是「没有密码」)。
|
|
61
|
+
4. **清除**:`hosts.credentials` 传 `{ hostId, clear: true }` → 返回 `authType: 'agent'`、`hasCredential: false`,文件里的条目被删掉,弹窗里又显示「需要密码」。
|
|
62
|
+
5. **不装 dsh-ssh-tunnel 也照常**:没有 SSH Manager 时上述流程全部可用;`identityFile` 与 agent 的主机行为不变,仍显示 `~/.ssh/config`。
|
|
63
|
+
6. **不影响已有的密钥主机**:`~/.ssh/config` 里带 `IdentityFile` 的主机 `authType` 仍是 `privateKey`、`hasCredential` 仍为 `true`。
|
|
64
|
+
7. **弹窗内滚轮只滚弹窗**:主机多到出现滚动条时(≥6 台),把鼠标放在 SSH 主机列表上滚动滚轮 → 列表先滚;到底后继续滚 → 表单滚;全程背后会话区域不滚动。鼠标放到弹窗遮罩上滚动也一样,背后页面不动。
|
|
65
|
+
|
|
47
66
|
## 工作区图标与连接状态(0.11.0)
|
|
48
67
|
|
|
49
68
|
1. **图标区分**:左侧栏工作区行、侧栏「+」菜单、目录树工作区 chip 与分组头、设置页卡片与两个创建按钮、「添加工作区」弹窗三个页签——联动工作区统一是「双链环」,远程工作区统一是「显示器 + 出链箭头」,本地工作区仍是文件夹。
|
|
50
|
-
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / 连接状态 / 目录 /
|
|
69
|
+
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / SSH 主机 · 连接状态 / 目录 / 创建于」——第二行把主机名与状态合在一起(形如 `RTX-PRO-6000-1 · 已连接`),联动工作区与远程工作区都有;连接正常时该行是绿色,在服务器上 `pkill -u <user> sshd` 掉线后变红并显示「连接已断开」。卡片里**不再显示会话数**,也不再出现浏览器原生 `title` 提示。
|
|
51
70
|
3. **卡片里的目录**:远程工作区的卡片只显示**远端目录**绝对路径(例如 `/shared_data_ssd1/huangjh/code`,不显示本地占位目录);联动工作区的卡片显示两行——「远端 …」与「本地 …」两个绝对路径。
|
|
52
71
|
4. **断线变红**:让主机断开 SSH(例如在服务器上执行 `pkill -u <user> sshd`,或在网络中断开)→ 左侧栏该工作区行的图标变红(`#f85149`),悬停卡片里的状态行同样变成红色的「连接已断开」。
|
|
53
72
|
5. **自动恢复**:再次访问该工作区(打开目录树 / 刷新设置页)→ 连接重建后图标恢复常规颜色,悬停卡片里的状态回到「已连接」。
|
|
@@ -217,6 +236,15 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
217
236
|
6. **本地缺少对应目录**:对比一个本地没有的远程子目录:对话框应提示「本地没有对应目录,远端独有的文件无法对比」。
|
|
218
237
|
7. **队列重试**:制造一次传输失败(例如目标路径是文件而非目录),在队列中点「重试」:修好原因后应成功并刷新树。
|
|
219
238
|
8. **注册工作区**:联动记录的 `workspaceId` 为空时,设置页应显示「注册为工作区」,点击后变为正常的工作区信息。
|
|
220
|
-
9.
|
|
239
|
+
9. **拖拽提示**:拖本地目录到远端、拖远端目录到本地:应分别给出「暂不支持把本地目录拖拽到远端…」「暂不支持把远程目录拖拽到本地…」(同一棵树内拖拽是移动,见下一节)。
|
|
221
240
|
10. **悬停展开**:拖拽停在折叠目录行 700 ms:该目录应自动展开。
|
|
222
241
|
11. **host-api**:`node test/host-api.mjs` 应为 28 步全部通过。
|
|
242
|
+
|
|
243
|
+
## 批量拖拽与移动(0.13.0)
|
|
244
|
+
|
|
245
|
+
1. **远端内移动**:联动工作区或远程工作区里,把远端文件拖到另一个远端目录:应提示「已移动」,文件只在目标目录出现。
|
|
246
|
+
2. **本地内移动**:联动工作区里把本地文件拖到另一个本地目录:同上,提示「已移动」。
|
|
247
|
+
3. **多选拖拽**:Ctrl/Cmd 点选 3 个文件(或 Shift 连选)后拖动其中一行:应提示「已移动 3 项」,三条都落到目标目录。
|
|
248
|
+
4. **跨侧批量**:多选本地文件拖到远端目录(或反过来):应提示「已导入 N 个文件」,逐个文件各一次请求;其中一个目标同名时会先弹冲突对话框。
|
|
249
|
+
5. **批量右键移动**:多选后用右键「移动所选的 N 项…」,选目标目录:应提示「已移动 N 项」。
|
|
250
|
+
6. **同目录/自身保护**:把文件拖到它当前所在的目录、或把目录拖进自己的子目录:应被忽略,不产生报错或递归。
|