dsh-linked-workspace 0.12.0 → 0.14.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 +21 -0
- package/README.en.md +7 -6
- package/README.md +7 -6
- package/docs/API.md +5 -2
- package/docs/VERIFY.md +32 -7
- package/lib/client.js +927 -124
- package/lib/index.js +248 -50
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.14.0 — 2026-11-14
|
|
6
|
+
|
|
7
|
+
- **Content search shows the hit**: results now list the file **and** the matching line (number + trimmed snippet, one row per hit), clicking one opens the file with the caret on that line, and Markdown files switch to the code editor for the jump. Local and remote searches share the same limits (1 MB per file, 2000 files, 8 MB, 5 s) and the same default folder exclusions (`node_modules`, `.git`, `site-packages`, `dist`, `build`, `target`, `.venv`, `.conda`, …), so a remote scan no longer crawls a conda tree; when a scan is cut short the notice names the reason (files / bytes / time / result cap) instead of a bare “too many”.
|
|
8
|
+
- **Search options**: three toggles in the search bar — `Aa` (match case), `.*` (regular expression, with the server's own “invalid regular expression” message) and a folder chip that limits the scan to the selected folder.
|
|
9
|
+
- **Keyboard navigation**: the file tree and the result list accept `↑`/`↓`/`Home`/`End`, `→` expands a folder, `←` collapses it (or jumps to the parent from a file), and `Enter` opens; `↓` from the search box drops into the results.
|
|
10
|
+
- **Transfer progress and cancel**: queued transfers report live progress (“2 sent · 2.0 MB”) by polling the new `fs.transferProgress`, and the queue dialog gained a cancel button backed by `fs.transferCancel`; a cancelled run keeps the files already landed and says so.
|
|
11
|
+
- **Batch rename**: with several entries selected the row menu offers “Batch rename selected (N)…” — numbering mode (prefix + start + padding, extension kept) or find-and-replace, with a live preview that flags empty names and duplicates before anything is renamed.
|
|
12
|
+
- **Hover tooltips with mtime**: hovering a row now appends “modified …” and the size to the path tooltip, fetched on demand and cached for 5 s.
|
|
13
|
+
- **Welcome card again**: the settings header gained a “Show the welcome card again” button.
|
|
14
|
+
- **Consistent dialogs**: the confirm dialogs use the plugin's own modal styling (blurred backdrop, rounded card) instead of the host's plain white box.
|
|
15
|
+
- **New folder on the remote side**: the remote path picker gained a “New folder” button (backed by the new `hosts.mkdir` host method), matching the local picker — type a name, press Enter or “Create”, and the picker lands inside the folder it just made. Duplicates report “remote directory already exists”, and names containing `/`, `\` or `..` are refused.
|
|
16
|
+
- **Long paths no longer push the buttons out**: the remote path line ellipsizes in place (hover for the full path), so “New folder” and “Use this directory” always stay visible.
|
|
17
|
+
- **Dropped the redundant “Open” button**: the local path field no longer needs it — Enter navigates to the typed path; the desktop “Browse…” system picker stays.
|
|
18
|
+
- **Fixed**: typing in any picker's filter or folder-name box used to crash the whole “Add workspace” dialog (the React event object was read inside a state updater). The value is now captured before the update.
|
|
19
|
+
|
|
20
|
+
## 0.13.0 — 2026-11-14
|
|
21
|
+
|
|
22
|
+
- **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.
|
|
23
|
+
- **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.
|
|
24
|
+
- **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.
|
|
25
|
+
|
|
5
26
|
## 0.12.0 — 2026-11-14
|
|
6
27
|
|
|
7
28
|
- **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.
|
package/README.en.md
CHANGED
|
@@ -30,7 +30,7 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
|
|
|
30
30
|
|
|
31
31
|
## Quick start
|
|
32
32
|
|
|
33
|
-
1. **Install** the plugin (see [Install](#install)) and restart the DSH client.
|
|
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
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”.
|
|
@@ -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
|
|
|
@@ -64,7 +64,8 @@ The plugin takes over the DSH sidebar/hero directory-selection hole; the dialog
|
|
|
64
64
|
- **Single-click opens, double-click pins**: single-click a folder to expand/collapse; single-click a file to open it in the content panel, replacing the current unpinned preview. Double-click a file to pin it so later single clicks do not replace it; double-clicking a folder only keeps it expanded.
|
|
65
65
|
- Toolbar (top right of the sidebar):
|
|
66
66
|
- **Switch file tree**: all files / changed files / all changes. The change lists come from remote and local `git status` (branch, state, staged marker; deleted entries are greyed).
|
|
67
|
-
- **Search in files**: after ≥2 characters, switch between “File name” and “Content”. Name mode uses `find` remotely and a local walk; content mode calls `fs.grep
|
|
67
|
+
- **Search in files**: after ≥2 characters, switch between “File name” and “Content”. Name mode uses `find` remotely and a local walk; content mode calls `fs.grep`, and both sides share the same limits (1 MB per file, 2000 files, 8 MB, 5 s) and skip `node_modules`, `.git`, `site-packages`, `dist`, `build`, `target`, `.venv`, `.conda` by default. Results are grouped into remote and local directories, **each row showing `path :line` plus the matched snippet**; clicking one opens the file with the caret on that line, and a truncated scan names its reason (files / bytes / time / result cap) above 200 rows. The search bar also has three toggles: `Aa` (match case), `.*` (regular expression) and a folder chip that limits the scan to the selected folder.
|
|
68
|
+
- **Keyboard**: the tree and the result list accept `↑`/`↓`/`Home`/`End`, `→` expands, `←` collapses (or jumps to the parent from a file) and `Enter` opens; `↓` in the search box drops into the results. Hovering a row appends “modified …” and the size to the path tooltip (fetched on demand, cached for 5 s).
|
|
68
69
|
- **Open options menu**: editor / system default app (downloads the remote file to a temp directory first) / copy path.
|
|
69
70
|
- **Transfer button (two-way)**: with a remote file or folder selected it transfers to the local `.remote`; with a local file or folder selected it transfers to the matching relative remote path. Transfers run through a queue, one job at a time, with status and retry on failure.
|
|
70
71
|
- **Open terminal**: the remote button sits at the top right of the remote tree and opens a system terminal via `ssh` in the current remote directory; linked workspaces also get a local button. The folder context menu adds “Open terminal here” for a subdirectory.
|
|
@@ -94,10 +95,10 @@ Appears automatically for sessions that belong to a remote workspace (and can be
|
|
|
94
95
|
|
|
95
96
|
### Transfer, comparison and conflicts
|
|
96
97
|
|
|
97
|
-
- **Drag and drop**: drag rows between the local and remote trees, or
|
|
98
|
+
- **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
99
|
- **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
100
|
- **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
|
-
- **Transfer queue**: one job at a time with queued/running/done/failed states;
|
|
101
|
+
- **Transfer queue**: one job at a time with queued/running/done/failed states and live progress (“2 sent · 2.0 MB”); the queue dialog can cancel a running job (files already landed are kept). Failed items can be retried.
|
|
101
102
|
- **Limits**: 8 MB per editor save; 150 files / 15 MB per “Transfer” or “Download to default folder”; 50 files / 64 MB each per drop-upload; mirror sync 500 files / 50 MB by default, skipping files over 20 MB.
|
|
102
103
|
|
|
103
104
|
### Model tools
|
|
@@ -193,7 +194,7 @@ Check that `dsh-better-sidebar` (≥0.24) is installed and restart the client
|
|
|
193
194
|
Install `python-docx`, `openpyxl`, `python-pptx` and `PyMuPDF`, or point `DSH_OFFICE_PYTHON` at an interpreter that has them. Markdown previews do not need Python.
|
|
194
195
|
|
|
195
196
|
**Search cannot find text inside files?**
|
|
196
|
-
The search bar matches file names by default — switch to “Content”. Content search is bounded to 1 MB per file, 2000 files, 8 MB and 5 s
|
|
197
|
+
The search bar matches file names by default — switch to “Content”. Content search is bounded to 1 MB per file, 2000 files, 8 MB and 5 s, and the notice names the reason when it stops. Remote search uses the same limits and skips `node_modules`, `.conda`, `site-packages` and friends by default — narrow the scope to a folder if you really need to look inside them.
|
|
197
198
|
|
|
198
199
|
**Sync seems to do nothing?**
|
|
199
200
|
The mirror is off by default; enable it in Settings → Linked workspaces to archive into `.remote`. Runs over 500 files / 50 MB, or files over 20 MB, are skipped; progress is shown in the settings card.
|
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
## 快速开始
|
|
32
32
|
|
|
33
|
-
1. **安装插件**(见[安装](#安装)),重启 DSH
|
|
33
|
+
1. **安装插件**(见[安装](#安装)),重启 DSH 客户端;首次打开时插件会弹出一张欢迎卡片,点「知道了」即可(之后不再出现)。
|
|
34
34
|
2. **添加工作区**:设置 → 联动工作区 →「创建联动工作区」或「创建远程工作区」,选择已有 SSH 主机;列表里没有就把主机写进 `~/.ssh/config`(或在 DSH 的 SSH Manager 里添加),然后点「刷新」。
|
|
35
35
|
3. **选目录**:联动工作区需选远端路径和本地目录;远程工作区只需选远端路径(该目录必须已存在,插件不会自动创建)。
|
|
36
36
|
4. **打开右侧栏**:会话右侧栏开始页点「联动工作区目录」(联动)或「远程工作区目录」(远程)。
|
|
@@ -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
|
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
- **单击打开,双击固定**:单击文件夹立即展开/折叠;单击文件直接在文件内容面板打开,再次单击其他文件会替换当前未固定的预览标签。双击文件可固定该标签,之后单击其他文件不会覆盖它;双击文件夹只保持展开。
|
|
65
65
|
- 工具栏(右侧栏右上角):
|
|
66
66
|
- **切换文件树**:所有文件 / 已更改的文件 / 所有更改。更改列表来自远端与本地的 `git status`(分支、状态、暂存标记;删除项置灰)。
|
|
67
|
-
- **在文件中搜索**:输入 ≥2 个字符后搜索,可在「文件名 / 内容」之间切换。文件名模式远端用 `find`、本地遍历目录;内容模式调用 `fs.grep
|
|
67
|
+
- **在文件中搜索**:输入 ≥2 个字符后搜索,可在「文件名 / 内容」之间切换。文件名模式远端用 `find`、本地遍历目录;内容模式调用 `fs.grep`,本地与远端共用一套限额(单文件 1 MB、2000 文件、8 MB、5 秒)并默认跳过 `node_modules`、`.git`、`site-packages`、`dist`、`build`、`target`、`.venv`、`.conda` 等目录。结果分「远端 / 本地」列出,**每条显示 `路径 :行号` 和命中的片段**,点击直接打开并把光标定位到该行;被截断时提示会说明原因(文件数 / 体积 / 时间 / 结果上限),超过 200 条也会提示。搜索栏还有三枚开关:`Aa` 区分大小写、`.*` 按正则匹配、文件夹 chip 把范围限定在当前选中的目录。
|
|
68
|
+
- **键盘**:目录树与结果列表支持 `↑`/`↓`/`Home`/`End`,`→` 展开、`←` 收起(文件上按 `←` 回到父目录),`Enter` 打开;搜索框里按 `↓` 直接进入结果列表。文件行悬停时提示里会显示「修改于 …」和大小(按需查询,缓存 5 秒)。
|
|
68
69
|
- **打开选项菜单**:编辑器 / 系统默认应用(把远端文件下载到临时目录后交给本机应用打开)/ 复制路径。
|
|
69
70
|
- **传输按钮(双向)**:选中远端文件/文件夹时传输到本地 `.remote`;选中本地文件/文件夹时传输到远端对应相对路径(进入传输队列,一次一个任务并显示状态,失败可重试)。
|
|
70
71
|
- **打开终端**:远程按钮位于远端树右上角,打开本机终端并用系统 `ssh` 直接进入当前远端目录;联动工作区还会显示本地按钮,直接打开本地目录。右键目录还可用「在此打开终端」在该子目录启动。
|
|
@@ -94,10 +95,10 @@
|
|
|
94
95
|
|
|
95
96
|
### 传输、对比与冲突处理
|
|
96
97
|
|
|
97
|
-
-
|
|
98
|
+
- **拖拽**:在本地树与远端树之间拖动文件即可互传;同一棵树内拖动(远端内或本地内)则是**移动**,选中多项后拖动会一起移动/传输。也可以把系统文件拖进任一树(Web 端浏览器无法读取拖入文件路径时会提示改用桌面端)。拖动时悬停在折叠目录上 700 ms 会自动展开;多选后用右键「移动所选的 N 项…」也能批量移动。
|
|
98
99
|
- **覆盖确认**:目标目录已有同名文件时,不再静默覆盖,而是弹出「取消 / 保留两者 / 覆盖」;保留两者会自动生成 `name copy.txt` 或 `name (2).txt`。工具与 API 也可用 `conflict=error|overwrite|unique` 指定策略。
|
|
99
100
|
- **本地 ⇄ 远端对比**:右键远端目录 →「与本地对比…」,按「仅本地存在 / 仅远端存在 / 大小或时间不同」分组列出;单侧最多扫描 4000 个文件、深度 12、每组展示 200 行,超限会提示。点行直接打开文件;每行可「推送到远端」或「拉取到本地」;本地缺少对应目录时会明确说明。
|
|
100
|
-
-
|
|
101
|
+
- **传输队列**:一次执行一个任务,显示排队/传输中/完成/失败,运行中会持续显示「已传 N 个 · X MB」;可以点「取消」中途停止(已经传完的文件保留)。失败项可重试。
|
|
101
102
|
- **上限**:编辑器保存单文件 8 MB;右键「传输」与「下载到默认文件夹」单次最多 150 文件 / 15 MB;拖拽导入/上传单次最多 50 个文件、单个 64 MB;镜像同步默认最多 500 文件 / 50 MB,单文件 20 MB 以上跳过。
|
|
102
103
|
|
|
103
104
|
### 模型工具
|
|
@@ -193,7 +194,7 @@ npm 包名为 `dsh-linked-workspace`,也可以从 npm 安装已发布版本(
|
|
|
193
194
|
安装 `python-docx`、`openpyxl`、`python-pptx`、`PyMuPDF`,或用 `DSH_OFFICE_PYTHON` 指向带这些库的解释器。Markdown 预览不需要 Python。
|
|
194
195
|
|
|
195
196
|
**搜索找不到正文里的内容?**
|
|
196
|
-
搜索条默认按文件名匹配,切到「内容」模式再搜;内容搜索对本地单文件限 1 MB、最多 2000 个文件、8 MB、5
|
|
197
|
+
搜索条默认按文件名匹配,切到「内容」模式再搜;内容搜索对本地单文件限 1 MB、最多 2000 个文件、8 MB、5 秒,超限会提示原因。远程搜索有同样的限额,并默认跳过 `node_modules`、`.conda`、`site-packages` 等目录——确实要搜这些目录时,请把范围限定到更具体的文件夹,或改用「文件名」模式。
|
|
197
198
|
|
|
198
199
|
**同步没有变化?**
|
|
199
200
|
镜像默认关闭;在设置 → 联动工作区里开启后才会归档到 `.remote`。超过 500 文件 / 50 MB 或单文件 20 MB 的部分会跳过,可在面板里查看同步进度。
|
package/docs/API.md
CHANGED
|
@@ -54,6 +54,7 @@ scope root, or absolute inside it.
|
|
|
54
54
|
| `hosts.list` | `{ refresh? }` | `{ hosts: HostInfo[] }` (`HostInfo` carries `authType`, `hasCredential`, `hasStoredPassword`) |
|
|
55
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) |
|
|
56
56
|
| `hosts.browse` | `{ hostId, path? }` | `{ path, parent, home, entries }` (dirs + files) |
|
|
57
|
+
| `hosts.mkdir` | `{ hostId, path?, name }` | `{ path }` (creates `name` inside `path`; defaults to the login home; `409`/`FS_EXISTS` when it already exists) |
|
|
57
58
|
| `remote_workspaces.list` | `{}` | `{ workspaces: RemoteWorkspaceInfo[] }` |
|
|
58
59
|
| `remote_workspaces.create` | `{ hostId, remotePath, name? }` | `{ workspace }` |
|
|
59
60
|
| `remote_workspaces.get` | `{ id }` | `{ workspace }` |
|
|
@@ -91,11 +92,13 @@ scope root, or absolute inside it.
|
|
|
91
92
|
| `skills.read` | `{ linkedId, name }` | `{ name, description, content, path }` |
|
|
92
93
|
| `git.status` | `{ linkedId?/remoteId?, side: 'remote'|'local' }` | `{ ok, repo, root, branch, changes, error? }` (remote workspaces only support `side: 'remote'`) |
|
|
93
94
|
| `fs.search` | `{ linkedId?/remoteId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` (matches **file names**, not contents; use `fs.grep` for contents) |
|
|
94
|
-
| `fs.grep` | `{ linkedId?/remoteId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` (searches file **contents**;
|
|
95
|
+
| `fs.grep` | `{ linkedId?/remoteId?, side, query, maxResults?, path?, ignoreCase?, regex? }` | `{ ok, query, entries: [{ path, relative, size, line, preview }], truncated, truncatedReason }` (searches file **contents**; `path` narrows the scan to a sub-folder; `ignoreCase` defaults to `true`; `regex` treats `query` as a regular expression; limits are 1 MB per file, 2000 files, 8 MB and 5 s for both sides, and `truncatedReason` is one of `files`, `bytes`, `deadline`, `results`; max 1000 rows) |
|
|
95
96
|
| `fs.compare` | `{ linkedId?, path? }` | `{ path, relative, localPath, localMissing, counts: { onlyLocal, onlyRemote, changed, same }, onlyLocal, onlyRemote, changed, truncated, remoteTruncated, localTruncated, skippedLinks }` (linked workspaces only; excludes `.git`, `node_modules`, `.local`, `.remote`; 4000 files and depth 12 **per side**, 200 rows per group; `skippedLinks` counts symlinks and non-regular files) |
|
|
96
97
|
| `fs.pullToLocal` | `{ linkedId?, path, targetDir?, conflict? }` | `{ path, relative, size, mtime }` (linked workspaces only; single file, ≤64 MB; `targetDir` must stay inside the local root; `conflict` is `error` (default), `overwrite` or `unique`) |
|
|
97
98
|
| `fs.upload` | `{ linkedId?/remoteId?, path, paths, conflict? }` | `{ side: 'remote', target, files, bytes, skipped }` (≤50 local files, 64 MB each; `conflict` is `error` (default), `overwrite` or `unique`; a missing target directory is created) |
|
|
98
|
-
| `fs.transfer` | `{ linkedId?/remoteId?, path }` | `{ files, bytes, skipped, truncated, dest }` |
|
|
99
|
+
| `fs.transfer` | `{ linkedId?/remoteId?, path, jobId? }` | `{ files, bytes, skipped, truncated, dest }` (with `jobId` the run is tracked and can be polled/cancelled) |
|
|
100
|
+
| `fs.transferProgress` | `{ jobId }` | `{ job: { id, files, bytes, skipped, state, cancelled, reason } \| null }` (`state` is `running`, `done`, `cancelled` or `failed`; jobs are dropped after 5 minutes) |
|
|
101
|
+
| `fs.transferCancel` | `{ jobId }` | `{ cancelled }` (asks the running transfer to stop; it finishes the file in flight, then reports `CANCELLED`) |
|
|
99
102
|
| `fs.download` | `{ linkedId?/remoteId?, path }` | `{ path, files, bytes, skipped, truncated }` |
|
|
100
103
|
| `fs.edit` | `{ linkedId?/remoteId?, path, app? }` | `{ localPath, size }` (opens Notepad/default app) |
|
|
101
104
|
| `fs.copy` | `{ linkedId?/remoteId?, path, targetDir? }` | `{ path, files }` |
|
package/docs/VERIFY.md
CHANGED
|
@@ -20,10 +20,12 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
20
20
|
|
|
21
21
|
1. 点左侧工作区标题栏的「+」→ 弹窗出现「本地工作区 / 联动工作区 / 远程工作区」三个页签。
|
|
22
22
|
2. **底部按钮一致**:三个页签的「创建」都应是同一种主按钮外观(不因页签切换而变灰);本地页签在没填目录时点「创建」→ 表单里出现红色提示「先选择或填写一个本地目录」,填入后提示消失。
|
|
23
|
-
3. 本地页签:浏览目录、新建文件夹、系统选择器、「使用此目录」→ DSH
|
|
24
|
-
4.
|
|
25
|
-
5.
|
|
26
|
-
6.
|
|
23
|
+
3. 本地页签:浏览目录、新建文件夹、系统选择器、「使用此目录」→ DSH 工作区创建并选中;路径输入框旁**不再有「打开」按钮**,直接回车即可进入输入的目录。
|
|
24
|
+
4. 联动/远程页签的**远程目录选择器**:底行左边的路径很长时,路径在自身位置省略显示(悬停看完整路径),右边的「+ 新建文件夹」「使用此目录」始终可见;点「新建文件夹」→ 输入名称 → 回车或「创建」→ 远端建好该目录并自动进入;重名会在选择器内提示「远程目录已存在」。
|
|
25
|
+
5. 在任一选择器的「按名称过滤…」或「文件夹名称」框里连续打字:弹窗**不能消失**,列表应按输入过滤(旧版本这里会让整个弹窗崩溃)。
|
|
26
|
+
6. 联动页签:填写主机/远端目录/本地目录 → 创建后工作区出现在左侧,行图标为链环;弹窗关闭。
|
|
27
|
+
7. 远程页签:`1. 选择 SSH 连接 / 2. 远程目录 / 3. 工作区名称`(编号连续、无本地目录步骤)→ 创建后左侧出现占位目录工作区。
|
|
28
|
+
8. 已有旧工作区若标题仍带 `⇄ `:Host 启动约 1 s 内自动去掉前缀(`linked.list` 的 `workspaceTitle` 同步更新)。
|
|
27
29
|
|
|
28
30
|
## 远程工作区(0.11.0)
|
|
29
31
|
|
|
@@ -36,6 +38,15 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
36
38
|
7. **远端目录必须已存在**:填一个不存在的路径 → 报错 `FS_NOT_FOUND`(不会自动创建)。
|
|
37
39
|
8. **标签常驻**:当前会话属于联动工作区时,设置页仍能打开远程工作区目录树(不再依赖会话 scope 才注册标签)。
|
|
38
40
|
|
|
41
|
+
## 首次运行欢迎卡片(0.13.0)
|
|
42
|
+
|
|
43
|
+
1. **首次打开会弹出**:清掉 `localStorage` 里的 `dsh-linked-workspace:welcome`(或换一个全新 profile)后刷新页面——中央出现一张卡片:标签 `DSH-LINKED-WORKSPACE`、标题「欢迎使用联动工作区插件」、一段说明、四条「做什么 + 在哪」(创建工作区 / 浏览远端文件 / 让模型读写远端代码 / 不用 SSH Manager 也能连),底部「★ 点个 Star」与「知道了」。
|
|
44
|
+
2. **三种关闭方式**:点「知道了」、按 `Esc`、点卡片外的遮罩都能关闭;关闭后 `localStorage.dsh-linked-workspace:welcome === "1"`。
|
|
45
|
+
3. **不会重复弹**:刷新页面后不再出现;把该键删掉再刷新会重新出现。
|
|
46
|
+
4. **深浅两套主题都正常**:深色下卡片底色 `rgb(44,44,46)`、行内底色 `rgb(21,21,23)`、文字浅色;浅色下卡片白底、行内白底带边框、主按钮深底反白。
|
|
47
|
+
5. **Star 按钮**:链接指向 `https://github.com/jiahui-huang1/dsh-linked-workspace`(新标签打开)。
|
|
48
|
+
6. **再次查看**:设置 → 联动工作区 顶部点「再次查看欢迎卡片」→ 设置面板关闭、欢迎卡片重新出现;再点「知道了」关闭后刷新不再自动出现。
|
|
49
|
+
|
|
39
50
|
## 侧边栏入口与可选依赖(0.11.0)
|
|
40
51
|
|
|
41
52
|
1. **菜单按工作区类型给出入口**:分别在「默认工作区(普通本地)」「联动工作区」「远程工作区」三种会话里打开右侧栏「+」新标签页菜单——本地工作区两条都不出现;联动工作区只出现「联动工作区目录」;远程工作区只出现「远程工作区目录」。
|
|
@@ -58,7 +69,7 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
58
69
|
## 工作区图标与连接状态(0.11.0)
|
|
59
70
|
|
|
60
71
|
1. **图标区分**:左侧栏工作区行、侧栏「+」菜单、目录树工作区 chip 与分组头、设置页卡片与两个创建按钮、「添加工作区」弹窗三个页签——联动工作区统一是「双链环」,远程工作区统一是「显示器 + 出链箭头」,本地工作区仍是文件夹。
|
|
61
|
-
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / 连接状态 / 目录 /
|
|
72
|
+
2. **悬停预览卡片**:把鼠标停在左侧栏工作区行上,弹出的信息卡里依次是「名称 / SSH 主机 · 连接状态 / 目录 / 创建于」——第二行把主机名与状态合在一起(形如 `RTX-PRO-6000-1 · 已连接`),联动工作区与远程工作区都有;连接正常时该行是绿色,在服务器上 `pkill -u <user> sshd` 掉线后变红并显示「连接已断开」。卡片里**不再显示会话数**,也不再出现浏览器原生 `title` 提示。
|
|
62
73
|
3. **卡片里的目录**:远程工作区的卡片只显示**远端目录**绝对路径(例如 `/shared_data_ssd1/huangjh/code`,不显示本地占位目录);联动工作区的卡片显示两行——「远端 …」与「本地 …」两个绝对路径。
|
|
63
74
|
4. **断线变红**:让主机断开 SSH(例如在服务器上执行 `pkill -u <user> sshd`,或在网络中断开)→ 左侧栏该工作区行的图标变红(`#f85149`),悬停卡片里的状态行同样变成红色的「连接已断开」。
|
|
64
75
|
5. **自动恢复**:再次访问该工作区(打开目录树 / 刷新设置页)→ 连接重建后图标恢复常规颜色,悬停卡片里的状态回到「已连接」。
|
|
@@ -120,7 +131,11 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
120
131
|
3. 展开工作区 → 目录树懒加载;文件行有按类型区分的彩色图标(.py/.ts/.json/.md/.png 等)。
|
|
121
132
|
4. **单击**文件夹立即展开/折叠;**单击**文件在中间内容面板打开;单击另一个文件会替换未固定的预览标签。**双击**文件固定标签,之后单击其他文件不会覆盖;双击文件夹保持展开。目录面板保持最右侧可见。本地文件标签不显示图标,并且可在内容面板中编辑保存。
|
|
122
133
|
5. 工具栏「切换文件树」:所有文件 / 已更改的文件 / 所有更改;远端仓库(如 nsl-wp)应列出 `git status` 修改与未跟踪文件,本地非 git 目录提示「该目录不是 Git 仓库」。
|
|
123
|
-
6.
|
|
134
|
+
6. 工具栏「在文件中搜索」:切到「内容」→ 输入 `paradis` → 结果按「远程目录/本地目录」分组,**每行给出 `路径 :行号` 和命中的片段**;点击任意一条打开文件并把光标停在该行(Markdown 会切到代码编辑器);被截断时提示写明原因(文件数 / 体积 / 时间 / 结果上限)。清空/关闭后回到原树。
|
|
135
|
+
6b. 搜索栏三枚开关:`Aa` 关掉后大小写不敏感(`ALPHA` 能命中 `alpha`),`.*` 打开后按正则匹配(输入 `(` 应提示正则无效),文件夹 chip 只扫描当前选中的目录。
|
|
136
|
+
6c. 键盘:在树里按 `↑`/`↓` 移动焦点,`→` 展开、`←` 收起(在文件上按 `←` 回到父目录),`Enter` 打开;在搜索框按 `↓` 进入结果列表,`Home`/`End` 跳到首尾。
|
|
137
|
+
6d. 悬停任一文件行:提示里路径下面多一行「修改于 …」和大小;5 秒内再次悬停不会重复请求。
|
|
138
|
+
6e. 多选 3 个文件 → 右键「批量重命名所选的 3 项…」→ 序号模式填前缀 `img-`、起始 1、位数 2,预览应是 `img-01.txt`…;点「重命名 3 项」后磁盘上文件名确实改变;把两个条目改成同名时「重命名」按钮应被禁用。
|
|
124
139
|
7. 工具栏「打开选项菜单」:编辑器 / 系统默认应用(远端文件下载到临时目录并用本机默认应用打开)/ 复制路径(剪贴板得到远端绝对路径)。
|
|
125
140
|
8. 刷新按钮:目录、git 状态与搜索重新加载。
|
|
126
141
|
9. **多标签/固定**:单击文件 A → 预览标签;单击文件 B → A 被替换为 B;双击 B → B 固定;再单击文件 C → B 保留且新增 C 标签。重复点击已打开文件聚焦原标签;关闭一个标签后其槽位可复用(最多 12 个)。
|
|
@@ -129,6 +144,7 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
129
144
|
12. **终端按钮**:远程树工具栏的终端按钮打开外部终端并自动 `cd` 到当前远程根目录;联动工作区的本地按钮打开本地终端并 `cd` 到本地目录。远程终端需使用系统 `ssh`,首次可能要求确认主机指纹/输入密码。
|
|
130
145
|
13. **自动保存**:设置 → 联动工作区 →「编辑器行为」开启自动保存 → 修改文件后停止输入约 1 秒应自动写盘、灰点消失;关闭自动保存后再修改,不应自动写盘,`Ctrl+S` 才保存。设置重载后开关状态保持。
|
|
131
146
|
14. **传输按钮**:在树中选中远端文件/文件夹(行高亮),点工具栏传输按钮 → `.remote/` 出现对应文件;右键「队列」可看到排队/传输中/完成状态。
|
|
147
|
+
14b. **进度与取消**:一次传输大量文件(例如 100 MB 级目录),队列对话框应显示「已传 N 个 · X MB」并持续刷新;传输中点「取消」→ 状态先变「正在取消…」再变「已取消(已传 N 个)」,已经落地的文件保留在目标目录。
|
|
132
148
|
15. **显示隐藏文件**:打开目录时默认显示 `.git`、`.gitignore`、`.local`/`.remote` 等隐藏项;点眼睛按钮可隐藏,再点恢复。目录面板默认开启。
|
|
133
149
|
16. **右键菜单**:文件/文件夹/根节点右击 → 传输、下载到默认文件夹、队列、打开、用记事本编辑、复制、粘贴、复制路径、重命名、删除、更改权限、新建(文件夹/文件)、属性;在远端与本地两侧各验证一次重命名/删除/新建/属性。
|
|
134
150
|
17. **运行中图标**:在该联动工作区的会话里发起一轮对话,运行期间左侧工作区的链环图标应变蓝;结束后(约 5 秒内)恢复原色。
|
|
@@ -228,6 +244,15 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
228
244
|
6. **本地缺少对应目录**:对比一个本地没有的远程子目录:对话框应提示「本地没有对应目录,远端独有的文件无法对比」。
|
|
229
245
|
7. **队列重试**:制造一次传输失败(例如目标路径是文件而非目录),在队列中点「重试」:修好原因后应成功并刷新树。
|
|
230
246
|
8. **注册工作区**:联动记录的 `workspaceId` 为空时,设置页应显示「注册为工作区」,点击后变为正常的工作区信息。
|
|
231
|
-
9.
|
|
247
|
+
9. **拖拽提示**:拖本地目录到远端、拖远端目录到本地:应分别给出「暂不支持把本地目录拖拽到远端…」「暂不支持把远程目录拖拽到本地…」(同一棵树内拖拽是移动,见下一节)。
|
|
232
248
|
10. **悬停展开**:拖拽停在折叠目录行 700 ms:该目录应自动展开。
|
|
233
249
|
11. **host-api**:`node test/host-api.mjs` 应为 28 步全部通过。
|
|
250
|
+
|
|
251
|
+
## 批量拖拽与移动(0.13.0)
|
|
252
|
+
|
|
253
|
+
1. **远端内移动**:联动工作区或远程工作区里,把远端文件拖到另一个远端目录:应提示「已移动」,文件只在目标目录出现。
|
|
254
|
+
2. **本地内移动**:联动工作区里把本地文件拖到另一个本地目录:同上,提示「已移动」。
|
|
255
|
+
3. **多选拖拽**:Ctrl/Cmd 点选 3 个文件(或 Shift 连选)后拖动其中一行:应提示「已移动 3 项」,三条都落到目标目录。
|
|
256
|
+
4. **跨侧批量**:多选本地文件拖到远端目录(或反过来):应提示「已导入 N 个文件」,逐个文件各一次请求;其中一个目标同名时会先弹冲突对话框。
|
|
257
|
+
5. **批量右键移动**:多选后用右键「移动所选的 N 项…」,选目标目录:应提示「已移动 N 项」。
|
|
258
|
+
6. **同目录/自身保护**:把文件拖到它当前所在的目录、或把目录拖进自己的子目录:应被忽略,不产生报错或递归。
|