dsh-linked-workspace 0.10.0 → 0.11.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 +24 -0
- package/README.en.md +164 -162
- package/README.md +148 -173
- package/docs/API.md +47 -36
- package/docs/VERIFY.md +53 -17
- package/lib/client.js +945 -340
- package/lib/index.js +455 -246
- package/lib/ssh.js +20 -4
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
English · [简体中文](CHANGELOG.zh.md)
|
|
4
|
+
|
|
5
|
+
## 0.11.0 — 2026-11-13
|
|
6
|
+
|
|
7
|
+
**Breaking change**: Remote workspaces replace remote directories.
|
|
8
|
+
|
|
9
|
+
- **Remote workspaces (feature)**: sessions run directly in a remote directory without requiring a local copy. The Host creates a placeholder directory for DSH workspace registration, sessions use the `linked_workspace` tool (or `fs.*` APIs with `remoteId`), and local Skills stay accessible. The old read-only "remote directory" mode is removed.
|
|
10
|
+
- **Settings UI (feature)**: the settings “Connections” page is now “Linked & remote workspaces” (“Linked workspaces” in the settings nav) with a **Remote workspaces** group — create (host + remote directory + name), open workspace, open directory tree, test connection, rename inline, and remove behind a two-step confirmation.
|
|
11
|
+
- **Sidebar (feature)**: a dedicated **Remote workspace directory** tab shows the remote tree without the local pane; files open read-only in the editor. Both tree tabs (linked and remote) register eagerly, so a remote tree opens from settings even while the current session belongs to a linked workspace.
|
|
12
|
+
- **Add workspace flow (feature)**: the sidebar “Add workspace” dialog gains a third tab, “Remote workspace”, with steps *SSH connection → remote directory → workspace name*.
|
|
13
|
+
- **API changes**: `workspaces.*` methods removed, replaced by `remote_workspaces.*` (list/create/get/update/remove/test). `requireScope` now accepts `linkedId` or `remoteId` (not `workspaceId`). All existing `fs.*` methods work with both linked and remote workspaces. `linked_workspace` resolves remote workspaces by id, placeholder path or name, and reports `kind: "remote"` from `info`.
|
|
14
|
+
- **Data persistence**: `remote-workspaces.json` registry (including the SSH host snapshot for display), placeholder directories under `remote-placeholders/<uuid>/`.
|
|
15
|
+
- **Fixes**: removing a remote workspace now really deletes its placeholder directory (the code called an unimported `rm`), the host-snapshot refresh no longer calls a non-existent `LinkedStore.updateSnapshot`, and `terminal.open` no longer reads the removed remote-directory scope.
|
|
16
|
+
- **Smaller fixes**: a directory-tree tab opened from the start page lists every linked/remote workspace when the current session belongs to none of them (it used to show an empty pane), the tree empty state names workspaces instead of “remote directories”, and “Open directory tree” now closes the settings dialog the way “Open workspace” does. In the add-workspace dialog the local “Create” button no longer starts out disabled (it looked greyed out next to the linked/remote ones); clicking it without a folder now explains what is missing instead of doing nothing.
|
|
17
|
+
- **Workspace icons (feature)**: linked workspaces now use a two-link glyph and remote workspaces a display-with-arrow glyph everywhere the plugin renders them — the sidebar workspace row, the sidebar “+” menu, the directory-tree chips and headers, the settings cards and create buttons, and the “Add workspace” dialog tabs.
|
|
18
|
+
- **Connection state (feature)**: the sidebar row icon belongs to the plugin, so a dropped SSH connection paints it red (`data-lw-disconnected` + a `#f85149` mask). Hovering the sidebar row reports the state in the host's own hover preview (see below); the settings card, the tree chip and the tree header keep it in their tooltip. The Host now reports a lost connection itself: `RemoteHost` gained an `onLost` hook, `HostPool.noteConnectionLost` stores `{ state: "error", reason: "lost" }`, and the next successful connect clears it.
|
|
19
|
+
- **Naming**: the settings nav entry is “Linked workspaces” (was “Connections”) and the page title is “Linked & remote workspaces”; the “Add workspace” tab is plain “Remote workspace”.
|
|
20
|
+
- **Hover preview**: the workspace hover card is rendered by the host, so the plugin decorates it after it appears — the connection state becomes one line (“已连接” / “连接已断开” / “未连接”), a remote workspace shows its remote directory instead of the local placeholder, and a linked workspace lists both the remote and the local directory. The row `title` tooltip is gone so the two no longer overlap, and the card's “copy path” label always matches the path it shows.
|
|
21
|
+
- **Dark theme**: primary buttons take their label colour from `--dsw-alias-bg-base` (pure black `#000` in the dark theme) instead of a hard-coded `#fff`, so they are no longer white-on-white; the checked switch thumb follows the theme too.
|
|
22
|
+
- **Sidebar entries (change)**: the “+” new-tab menu lists only the directory page that matches the session's workspace kind — a linked workspace session offers “Linked Workspace Directory”, a remote workspace session offers “Remote Workspace Directory”, and a plain local workspace offers neither. The entry is hidden through the descriptor's `hidden` flag rather than unregistered, so “Open directory tree” in Settings → Linked workspaces still opens any of them, and opening one from a start tab falls back to listing every workspace of that kind.
|
|
23
|
+
- **Optional companion (change)**: `dsh-better-sidebar` is no longer part of the client injection list; it is resolved at runtime instead. Without it the plugin still loads and keeps the settings page, the directory pickers and the `linked_workspace` tools — it simply registers no sidebar pages. Every lookup goes through a `sidebarService()` helper that tolerates a missing service.
|
|
24
|
+
- **Plugin name (change)**: the plugin is listed as “Linked & Remote Workspaces” (Chinese “联动与远程工作区”) instead of “Remote Workspaces & Links”.
|
|
25
|
+
- Tests: 63 unit tests pass; `test/host-api.mjs` covers `remote_workspaces.*` end to end.
|
|
26
|
+
|
|
3
27
|
## 0.10.0 — 2026-11-12
|
|
4
28
|
|
|
5
29
|
Fourth review round: transfer safety, content search, document find and comparison actions.
|
package/README.en.md
CHANGED
|
@@ -2,238 +2,240 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](README.md)
|
|
4
4
|
|
|
5
|
-
Turn existing SSH
|
|
5
|
+
Turn an existing SSH connection into a **linked workspace** or a **remote workspace** inside DeepSeek Harness: browse, edit and transfer remote files without syncing the code locally, and without installing any DSH component on the server.
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
7
|
+
- **Linked workspace**: pair a **local directory** with a **remote directory**. The local directory becomes a real DSH workspace; sessions run locally and read or edit remote files through the `linked_workspace` tool. The sidebar shows both trees and supports two-way transfer, comparison and drag-and-drop.
|
|
8
|
+
- **Remote workspace**: sessions run directly in the remote directory, so code, logs and `.dsh/` state all live on the server while only a placeholder directory stays local (it registers the DSH workspace). Local Skills and plugins still work; the model reads and writes remote files through the `linked_workspace` tool (or `fs.*` with `remoteId`).
|
|
9
9
|
|
|
10
|
-
>
|
|
10
|
+
> Targets DSH 0.2.1-rc.4. `dsh-better-sidebar` (v0.24+) is **optional**: with it you get the sidebar directory pages and the file editor; without it the plugin still loads and the settings page, the directory pickers and the `linked_workspace` tools keep working — only the sidebar pages are skipped.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Two modes
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
| | Linked workspace | Remote workspace |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| Purpose | Local ⇄ remote paired editing | Sessions that run entirely on the server |
|
|
17
|
+
| Local directory needed | Yes (registered as a DSH workspace) | No (only a placeholder directory) |
|
|
18
|
+
| Writable | Yes (editor, tools, transfer, delete…) | Yes (editor, tools; no local copy) |
|
|
19
|
+
| Sidebar entry | “Linked Workspace Directory” (two trees) | “Remote Workspace Directory” (remote tree only) |
|
|
20
|
+
| Model tools | `linked_workspace`, `linked_skills` | `linked_workspace` (remote scope), `linked_skills` |
|
|
21
|
+
| Typical use | Editing remote training code from a local setup | Training runs, long jobs, keeping everything off the laptop |
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
- Remote-directory list: add (host + remote folder browser), test, open, remove.
|
|
18
|
-
- Linked-workspace list: local ⇄ remote paths, mirror switch (**off by default**), background sync (archive into `.remote`, show file count/size progress, cancellable), remove (optionally remove the DSH workspace and delete `.local`/`.remote`). With mirroring enabled, the first check runs immediately, then **every 5 minutes**: download new/changed files, remove mirror files that no longer exist remotely, skip unchanged files (`.local/mirror-manifest.json`), and exclude `.git`/`node_modules`/cache folders. With mirroring off, both sides may differ freely.
|
|
19
|
-
- **Editor themes**: appearance modes **System / Light / Dark** (default System, following DSH); nine theme families (GitHub, Solarized, One, Dracula, Monokai, Nord, VS Code, Xcode, Catppuccin), each with light and dark variants on one card. The preview follows the selected mode.
|
|
20
|
-
- Remote-directory and linked-workspace creation share one form.
|
|
21
|
-
- File-open behavior (editor / system default app / copy path) is selected from the sidebar toolbar and persisted.
|
|
22
|
-
- The Settings → Connections page has **Create linked workspace** and **Add remote directory** actions; the old “Open sidebar” button is gone.
|
|
23
|
+
## Requirements
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
- **DSH**: 0.2.1-rc.4 or newer (`engines` allows `>=0.2.0-rc.2 <0.3.0-0`).
|
|
26
|
+
- **SSH**: the host must be configured in DSH's SSH Manager or `~/.ssh/config`; the first connection needs host-key confirmation in the “SSH Tunnel” tab.
|
|
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
|
+
- **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
|
+
- **Development**: Node.js ≥ 20.
|
|
25
30
|
|
|
26
|
-
|
|
31
|
+
## Quick start
|
|
27
32
|
|
|
28
|
-
1. **
|
|
29
|
-
2. **
|
|
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 in the DSH SSH Manager first if the list is empty).
|
|
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
|
+
4. **Open the sidebar**: on the right sidebar start page choose “Linked Workspace Directory” or “Remote Workspace Directory”.
|
|
37
|
+
5. **Edit**: single-click a file to preview it, double-click to pin the tab; `Ctrl/Cmd + S` saves.
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
## Features
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
### Settings → Linked workspaces
|
|
34
42
|
|
|
35
|
-
-
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
-
|
|
39
|
-
- **
|
|
40
|
-
-
|
|
41
|
-
-
|
|
43
|
+
- SSH hosts come from the `dsh-ssh-tunnel` SSH Manager (`~/.dsh/ssh-tunnel/hosts.json`) and `~/.ssh/config`; passwords and keys stay inside the Host process and are never returned to the page or the model.
|
|
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
|
+
- 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
|
+
- A linked record without a DSH workspace shows “Register workspace” in its settings card, which registers it without recreating the record.
|
|
47
|
+
- **Editor theme**: display mode **System / Light / Dark** (default System, following the DSH theme); nine theme families (GitHub, Solarized, One, Dracula, Monokai, Nord, VS Code, Xcode, Catppuccin), each card previewing its light and dark variant.
|
|
48
|
+
- A single form serves “Create linked workspace” and “Create remote workspace”, reachable from both entry points.
|
|
49
|
+
- The file open mode (editor / system app / copy path) is switched from the sidebar toolbar and persisted.
|
|
42
50
|
|
|
43
|
-
###
|
|
51
|
+
### “Add workspace” on the left
|
|
44
52
|
|
|
45
|
-
|
|
46
|
-
- **Remote directories**: available in any workspace session once at least one remote directory is configured. Browsing and files are **read-only**; editing, transfers, rename/delete and other mutations are disabled.
|
|
47
|
-
- Both entries are opened from the right-sidebar start page. Non-linked sessions do not show the linked-workspace entry.
|
|
53
|
+
The plugin takes over the DSH sidebar/hero directory-selection hole; the dialog offers three modes:
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
1. **Local workspace**: type or browse a local directory (drive letters C:/D:/E: on Windows), enter a name, create a normal DSH workspace.
|
|
56
|
+
2. **Linked workspace (local ⇄ remote)**: SSH host + remote directory + local directory + mirror toggle; the local directory becomes a DSH workspace.
|
|
57
|
+
3. **Remote workspace**: SSH host + remote directory + workspace name; the placeholder directory becomes a DSH workspace and sessions run on the server.
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
- **Single click opens, double click pins**: clicking a folder expands/collapses it immediately; clicking a file opens it in the content panel, and clicking another file replaces the current unpinned preview tab. Double-click a file to pin its tab so later single clicks do not replace it; double-clicking a folder only keeps it expanded.
|
|
53
|
-
- **Layout**: conversation → content panel (internal file tabs) → directory panel. The content panel shows “Open a file / Select a file from the workspace directory tree” when nothing is open. A toolbar button shows/hides the directory panel.
|
|
54
|
-
- Toolbar:
|
|
55
|
-
- **Tree switch**: all files / changed files / all changes (git status from remote and local sides).
|
|
56
|
-
- **Search in files**: at least two characters; remote uses `find`, local walks the tree. Results are grouped by remote/local.
|
|
57
|
-
- **Open options menu**: editor / system default app / copy path.
|
|
58
|
-
- **Open terminal**: the remote button in the remote tree toolbar opens the system terminal and SSHes into the current remote directory; linked workspaces also show a local button that opens a terminal in the local directory. The remote terminal uses the system `ssh` client, so it may ask for a password or host-key confirmation.
|
|
59
|
-
- **Transfer**: bidirectional. Select a remote file/folder to copy it into the local `.remote/` folder; select a local file/folder to copy it to the corresponding relative remote path. Jobs run one at a time through a queue.
|
|
60
|
-
- **Show/hide hidden files**: applies to both trees.
|
|
61
|
-
- **Refresh**: reload roots, git status and search.
|
|
62
|
-
- File-type icons for JS/TS/Python/JSON/Markdown/Shell/YAML/images/archives/config files, etc.
|
|
63
|
-
- Editor: line numbers, syntax highlighting (layered rendering), theme colors, `Ctrl/Cmd+S` save, conflict prompt (reload/force save), read-only protection for binary and >2 MB files, UTF-8/LF/CRLF/line-count status bar. The embedded content panel hides the path/save header; unsaved changes show a gray dot in the file tab. Read-only tabs render the file content but cannot be edited or saved.
|
|
64
|
-
- **Image, CSV and HTML preview**: PNG/JPG/GIF/WebP/BMP/ICO/AVIF/SVG render directly in the content panel (up to 24 MB) with toolbar zoom, `Ctrl/Cmd + wheel` zoom, fit-to-window and 1:1 actual-size controls. CSV/TSV opens as a table by default with a Table/Source toggle; the source view remains editable and saveable. Tables are capped at 1000 rows and 80 columns. HTML/HTM files render in a sandboxed iframe with scripts disabled.
|
|
65
|
-
- **Shortcuts**: `Ctrl/Cmd+S` saves the current file; `Ctrl/Cmd+W` closes the current tab (with a save/discard/cancel prompt when dirty); `Ctrl+Tab` / `Shift+Ctrl+Tab` cycles tabs; `Ctrl/Cmd+B` toggles the directory panel; `Ctrl/Cmd+Shift+F` opens file search.
|
|
66
|
-
- **Auto save**: enable it under Settings → Connections → Editor behavior. It saves about one second after you stop typing. When off, use `Ctrl+S`. Closing a dirty file always asks first instead of discarding silently.
|
|
67
|
-
- Multiple files can be open at once (up to 12 slots). A single click opens a preview tab and replaces the current unpinned preview; double-click pins the tab; clicking the same file focuses its existing tab. Local files use the same internal editor and can be edited and saved.
|
|
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 a connection-state line (connected / not connected / connection lost), with the remote directory shown for a remote workspace and both the remote and local directories for a linked one. 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.
|
|
68
60
|
|
|
69
|
-
###
|
|
61
|
+
### Sidebar: “Linked Workspace Directory”
|
|
70
62
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
63
|
+
- Fixed on the far right of the sidebar: **remote tree on top, local tree below**, both rooted at “All files”; the plugin's `.local`/`.remote` internal folders are hidden from the local tree.
|
|
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
|
+
- Toolbar (top right of the sidebar):
|
|
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` (bounded local scan, `grep -rIl` remotely). Results are grouped into remote and local directories, with a truncation notice above 200 rows.
|
|
68
|
+
- **Open options menu**: editor / system default app (downloads the remote file to a temp directory first) / copy path.
|
|
69
|
+
- **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
|
+
- **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.
|
|
71
|
+
- **Show/hide hidden files**: applies to both trees; hidden entries are shown by default when a directory opens (including `.local`/`.remote`).
|
|
72
|
+
- **Refresh**: re-fetches the directory, git status and search; expanded directories refresh silently every 15 seconds and pause while the page is hidden.
|
|
73
|
+
- Coloured file-type icons (JS/TS/Python/JSON/Markdown/Shell/YAML/images/archives/config files…).
|
|
74
|
+
- **Tabs and editor**: up to 12 tabs, local and remote files share the same editor; line numbers, syntax highlighting (overlay), theme colours, `Ctrl/Cmd+S`, conflict prompt (reload / force save), read-only protection for binary and >2 MB files; the status bar shows encoding, line endings, line count and file size.
|
|
75
|
+
- **Find and replace**: `Ctrl/Cmd + F` opens an in-editor bar with a case-sensitive toggle, previous/next, a match counter, replace and replace all. Above 5000 matches the counter shows `5000+` while replace-all still edits the whole document; `Esc` closes it from the replace field too. The Markdown document panel has its own read-only find (`Ctrl+F`, counter, next/previous).
|
|
76
|
+
- **Image, CSV and HTML previews**: PNG/JPG/GIF/WebP/BMP/ICO/AVIF/SVG render in the content panel (up to 24 MB) with zoom buttons, `Ctrl/Cmd + wheel`, fit-to-window and 1:1; CSV/TSV open as a table with a Table/Source toggle (the source view stays editable), capped at 1000 rows × 80 columns. HTML/HTM render in a sandboxed iframe with scripts disabled; Markdown previews strip scripts, event attributes and dangerous links.
|
|
77
|
+
- **Shortcuts**: `Ctrl/Cmd+S` save, `Ctrl/Cmd+W` close tab (prompting when dirty), `Ctrl+Tab` / `Shift+Ctrl+Tab` cycle tabs, `Ctrl/Cmd+B` toggle the directory panel, `Ctrl/Cmd+Shift+F` file search.
|
|
78
|
+
- **Auto save**: Settings → Linked workspaces → “Editor behaviour”; saves about one second after typing stops. With it off, use `Ctrl/Cmd+S`; unsaved changes trigger a confirmation before the page unloads.
|
|
73
79
|
|
|
74
|
-
### Context menu (
|
|
80
|
+
### Context menu (file/folder/root)
|
|
75
81
|
|
|
76
|
-
Transfer (download to `.remote`
|
|
82
|
+
Transfer (download to `.remote`), download to the default folder, queue, open, edit with Notepad, copy, paste, copy path, **Move to…** (only within the same local or remote tree), rename, delete, change permissions, new (folder/file), properties. Folders also offer “Open terminal here”, and remote folders in a linked workspace offer “Compare with local…” when a local counterpart exists.
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
Selecting several rows (`Ctrl/Cmd`-click toggles, `Shift`-click selects a range) adds “Transfer selected (N)” and “Delete selected (N)” at the top of the menu; deletion asks for confirmation and aggregates per-item errors (e.g. a file deleted outside the app reports “path does not exist” while the rest are removed).
|
|
79
85
|
|
|
80
|
-
|
|
81
|
-
<local>/
|
|
82
|
-
.local/ # created lazily (mirror manifest when needed)
|
|
83
|
-
mirror-manifest.json
|
|
84
|
-
.remote/ # optional: remote mirror archive
|
|
85
|
-
```
|
|
86
|
+
### Sidebar: “Remote Workspace Directory”
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
Appears automatically for sessions that belong to a remote workspace (and can be opened any time from the settings card):
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
- A **single remote tree** with no local pane; it is rooted at “All files” and the header shows `user@host · Remote`.
|
|
91
|
+
- Files open **read-only** in the built-in editor (encoding, line endings, line count and size are still shown) and are never written back locally.
|
|
92
|
+
- Context menu, search (name / content), hidden-file toggle and the 15-second refresh throttle match the remote tree of a linked workspace; transfer, two-way comparison and local-side actions are unavailable in this mode.
|
|
93
|
+
- Both directory tabs (linked and remote) register eagerly, so a remote tree can be opened from settings even while the current session belongs to a linked workspace.
|
|
90
94
|
|
|
91
|
-
|
|
95
|
+
### Transfer, comparison and conflicts
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
- **Drag and drop**: drag rows between the local and remote trees, or drop OS files 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; dragging inside the same tree suggests “Move to…” instead.
|
|
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
|
+
- **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; failed items can be retried.
|
|
101
|
+
- **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.
|
|
94
102
|
|
|
95
|
-
|
|
103
|
+
### Model tools
|
|
96
104
|
|
|
97
|
-
|
|
105
|
+
| Tool | Purpose |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `linked_workspace` | `list`, `info`, `list_dir`, `read`, `write`, `replace`, `stat`, `mkdir`, `rename`, `delete`, `sync`; paths are relative to the remote root, writes are atomic, `if_modified_since` provides optimistic concurrency. Works for both linked and remote workspaces (`sync` only applies to a linked workspace with the mirror on) |
|
|
108
|
+
| `linked_skills` | `list` / `read` local skills (`~/.dsh/skills`, `~/.agents/skills`, `<local>/.dsh/skills`, `<local>/.agents/skills`) |
|
|
98
109
|
|
|
99
|
-
|
|
100
|
-
dsh plugin --profile web add dsh-linked-workspace
|
|
101
|
-
```
|
|
110
|
+
The workspace resolves automatically when the session cwd falls inside a linked workspace or a remote workspace placeholder; use the `workspace` argument (id, local/placeholder path or name) across workspaces. The remote server only needs SSH — no plugin or Python installation.
|
|
102
111
|
|
|
103
|
-
|
|
112
|
+
### Running icon / local skills
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
- While a linked workspace has a running session, its link icon turns **blue** (refreshed about every 5 seconds).
|
|
115
|
+
- Linked sessions run in the **local directory**, so skills installed locally can be used directly; nothing has to be installed remotely, and the system prompt says so.
|
|
116
|
+
|
|
117
|
+
### Linked workspace layout
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
<local>/
|
|
121
|
+
.local/ # created on demand (mirror manifest, etc.)
|
|
122
|
+
mirror-manifest.json
|
|
123
|
+
.remote/ # optional: mirrored remote files (written on read/save, full sync on demand)
|
|
107
124
|
```
|
|
108
125
|
|
|
109
|
-
|
|
126
|
+
## Screenshots
|
|
127
|
+
|
|
128
|
+
Settings → “Linked workspaces”: the upper half lists **linked workspaces** (local folder ⇄ remote folder), the lower half lists **remote workspaces** (the session runs inside the remote folder). Each card shows the connection state; linked workspaces also have the mirror switch and the sync button. The host name and the local placeholder path are blurred in this shot.
|
|
110
129
|
|
|
111
|
-
|
|
112
|
-
2. Or use the workspace “Add workspace” button and choose the linked-workspace tab.
|
|
130
|
+

|
|
113
131
|
|
|
114
|
-
|
|
132
|
+
Click “Add workspace” next to the workspace title on the left: the dialog has three tabs (local workspace / linked workspace / remote workspace). Pick “Linked workspace (local ⇄ remote)”, choose an SSH connection, enter the remote folder, pick the local folder, then decide on mirroring and type a name; press “Create”.
|
|
115
133
|
|
|
116
|
-
|
|
134
|
+

|
|
117
135
|
|
|
118
|
-
|
|
136
|
+
The “Linked workspace directory” tab: the remote tree on top, the local tree below; files open from either side.
|
|
119
137
|
|
|
120
|
-
|
|
138
|
+

|
|
121
139
|
|
|
122
|
-
|
|
140
|
+
Clicking a file opens it in a new editor tab — remote files are read and written directly, with no sync step first.
|
|
123
141
|
|
|
124
|
-
|
|
142
|
+

|
|
125
143
|
|
|
126
|
-
|
|
127
|
-
- **Transfer and drag fixes**: single-file transfers create missing parent directories (previously `writeFileAtomic … No such file`); same-tree drops point at “Move to…”; dropping a folder shows a direction-specific notice; hovering a folder for 700 ms while dragging expands it.
|
|
128
|
-
- **Content search**: `fs.grep` searches file contents — local scans are bounded to 1 MB per file, 2000 files, 8 MB and 5 s; the remote side runs `grep -rIl … | head`. The search bar switches between “File name” and “Content”; `fs.search` remains a filename search (now documented, placeholder corrected).
|
|
129
|
-
- **Document find**: the Markdown document pane supports `Ctrl/Cmd + F` with a counter, next/previous and Escape; it is read-only (replace stays in the text editor).
|
|
130
|
-
- **Compare actions**: rows can be pushed to the remote side or pulled to the local side; a missing local folder and per-side truncation are explained; opening a row closes the dialog; the local path separator is inferred instead of hardcoded.
|
|
131
|
-
- **Queue retry**: failed transfer-queue items gain “Retry”.
|
|
132
|
-
- **Workspace registration**: when a link has no `workspaceId`, settings offers “Register workspace” (`linked.update` with `ensureWorkspace`).
|
|
133
|
-
- **Smaller fixes**: the find counter is announced (`aria-live`); Escape closes the find bar from the replace field; the editor status bar no longer shows a pointless `Ctrl+S` keycap.
|
|
134
|
-
- Tests: 63 unit tests pass; `test/host-api.mjs` passes 28 steps.
|
|
135
|
-
### 0.9.0
|
|
144
|
+
## Install
|
|
136
145
|
|
|
137
|
-
|
|
146
|
+
Install the local folder into the current DSH profile:
|
|
138
147
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- **Local/remote comparison**: `fs.compare` reports only-local / only-remote / changed entries (size differs or mtime differs by more than 2 s), capped at 4000 files, depth 12 and 200 rows per group with a truncation flag; clicking a row opens it.
|
|
143
|
-
- **Multi-select and batch actions**: Ctrl/Cmd-click toggles, Shift-click extends; the context menu offers “Transfer selected (N)” and “Delete selected (N)” with confirmation, and per-item errors are aggregated.
|
|
144
|
-
- **Drag and drop**: drag rows between the two trees (remote files via `fs.pullToLocal`, local files via `fs.upload`) and drop OS files onto either tree (`fs.upload` / `local.import`; up to 50 files, 64 MB each). Clear notices cover browsers that hide file paths and remote folders dropped onto the local tree.
|
|
145
|
-
- **Refresh throttling**: each directory refreshes at most every 15 seconds and not at all while the page is hidden (measured 18–19 s), instead of re-listing on every 4-second tick.
|
|
146
|
-
- **Unsaved-changes guard**: a dirty editor registers `beforeunload`, so reloading or closing the window asks for confirmation.
|
|
147
|
-
- **Refresh keeps loaded rows**: a silent refresh merges the first page with the rows already loaded instead of truncating back to 500 (or 5000); a 5500-entry directory stayed at 5522 rendered rows.
|
|
148
|
-
- **Search truncation**: more than 200 matches now shows “showing the first 200 matches” instead of dropping the flag.
|
|
149
|
-
- **Load-more and counter fixes**: “Load more (0 left)” disappears when everything is loaded; the find counter reports `5000+` when the limit is hit.
|
|
150
|
-
- Review note: two earlier findings (no context menu in the sidebar tree, hidden-file toggle not refreshing) could not be reproduced and were not changed.
|
|
148
|
+
```bash
|
|
149
|
+
dsh plugin --profile "$DSH_PROFILE" add "file:$PWD/dsh-linked-workspace"
|
|
150
|
+
```
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
You can also use `plugin_manager`'s `install_bundle` with the absolute path to this folder. Then **restart the DSH desktop app** (new Host plugins load at process start; session records are kept).
|
|
153
153
|
|
|
154
|
-
|
|
154
|
+
Two entry points afterwards:
|
|
155
155
|
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
- With hidden files toggled, “Load more” uses the true server offset: entries are neither duplicated nor skipped, and the “N left” label is computed from that offset.
|
|
159
|
-
- `fs.list` gained a 5-second listing cache: paging reads the directory once, and any write, mkdir, rename, move, delete, copy or transfer invalidates it.
|
|
160
|
-
- A directory copy that fails midway removes the partial copy and reports `FS_INCOMPLETE`; `FS_TOO_LARGE` is now reserved for real size limits.
|
|
161
|
-
- Concurrent first connects are keyed by host *and* address, so an address change cannot hand the old connection to the new request, and replaced connections are released.
|
|
162
|
-
- The right-sidebar tree source de-duplicates in-flight loads instead of issuing the same request twice.
|
|
163
|
-
- Directory pickers render at most 500 entries and suggest typing the path; PDF export stops after 999 name suffixes with an explicit error instead of looping forever.
|
|
164
|
-
- Tests: two self-inconsistent assertions in `test/host-api.mjs` were fixed (a leftover folder made a later create return 409, and an existing name was expected to return 400); all 28 steps now pass.
|
|
156
|
+
1. Bottom-left account menu → Settings → “Linked workspaces”.
|
|
157
|
+
2. Or “Add workspace” next to the workspace title on the left, then the “Linked workspace (local ⇄ remote)” or “Remote workspace” tab.
|
|
165
158
|
|
|
166
|
-
|
|
159
|
+
The npm package is `dsh-linked-workspace`; released versions can also be installed from npm (plugin marketplaces read the npm latest version).
|
|
167
160
|
|
|
168
|
-
|
|
161
|
+
## Configuration
|
|
169
162
|
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
- `
|
|
174
|
-
-
|
|
175
|
-
- Directory listings are paged (500 by default, 5000 max, with `total`/`hasMore`) and both trees render a “Load more” row, so a 20,000-entry folder no longer freezes the UI.
|
|
176
|
-
- Mirror sync marks a job truncated at the depth limit instead of reporting success with files missing.
|
|
177
|
-
- Accessibility: `:focus-visible` rings, `treeitem`/`aria-level`/`aria-expanded` semantics, `←`/`→` collapse and expand, and an add-workspace dialog that focuses its first field, traps Tab and closes on Escape.
|
|
178
|
-
- Excel previews report `totalRow`/`totalCol`/`truncated` and note when the grid shows only the first 200 rows × 40 columns or the first 20 worksheets.
|
|
179
|
-
- The client build fails when a `src/parts/*` file is missing; the dead `linked.update` branch is gone; `HostPool` reuses one in-flight connection per host.
|
|
163
|
+
- **Settings → Linked workspaces**: editor theme and display mode, file open mode, auto save, mirror toggle, manual sync and removal options.
|
|
164
|
+
- **Data directory**: `$DSH_HOME/linked-workspace` (remote workspace records, linked records, settings); override with `DSH_LINKED_WORKSPACE_HOME`.
|
|
165
|
+
- **Python interpreter**: `DSH_OFFICE_PYTHON` for Office/PDF operations.
|
|
166
|
+
- **Terminal**: `DSH_LINKED_WORKSPACE_NO_TERMINAL=1` keeps “Open terminal” from launching a real window (used in tests).
|
|
167
|
+
- **SSH**: aliases from `~/.ssh/config` appear in the host list; host fingerprints are stored in the plugin data directory.
|
|
180
168
|
|
|
181
|
-
|
|
169
|
+
## Upgrading and versions
|
|
182
170
|
|
|
183
|
-
|
|
171
|
+
- Version history lives only in [CHANGELOG.md](CHANGELOG.md) (English) and [CHANGELOG.zh.md](CHANGELOG.zh.md) (简体中文).
|
|
172
|
+
- **Upgrading from 0.2.x**: the plugin was renamed to `dsh-linked-workspace` in 0.3.0. On first start it migrates `$DSH_HOME/remote-workspace` to `$DSH_HOME/linked-workspace` (remote directories, linked workspaces, theme settings and trusted host keys are preserved); uninstall `dsh-remote-workspace` afterwards.
|
|
173
|
+
- From 0.11.0 the tab id `dsh-remote-workspace` belongs to the new **Remote Workspace Directory** tab; only the old *file* tab alias (`dsh-remote-workspace:file`) is kept so previously opened file tabs are restored. Tree tabs opened before the upgrade close and are replaced by “Linked Workspace Directory”.
|
|
174
|
+
- If the UI does not change after an upgrade: the desktop app caches the client bundle — restart the client (or reload the page in the web UI).
|
|
184
175
|
|
|
185
|
-
|
|
176
|
+
## Security
|
|
186
177
|
|
|
187
|
-
|
|
178
|
+
- Credentials exist only inside the Host process; the API returns host names, addresses and workspace paths only.
|
|
179
|
+
- Host keys use trust-on-first-use: the SHA256 is recorded on first connect and any change is rejected.
|
|
180
|
+
- Remote workspaces and direct file APIs are confined to the configured remote root; linked-workspace tools are confined to the remote root, and local writes to the local root.
|
|
181
|
+
- Single-file saves are capped at 8 MB; mirror sync runs in the background (500 files / 50 MB by default, skipping oversized files), excludes `.git`/`node_modules`/caches, uses a 30 s per-file timeout and never blocks an HTTP request. “Transfer” and “Download to default folder” handle at most 150 files / 15 MB per run and report partial transfers.
|
|
182
|
+
- The page HTTP API accepts loopback same-origin requests only (remote deployments fall back to the DSH `connection` service's Host/Origin authentication).
|
|
183
|
+
- Previews do not execute scripts: HTML uses a `sandbox=""` iframe; Markdown/document previews strip scripts, inline styles, event attributes and `javascript:`/`vbscript:` links, keeping safe links and image `data:` URLs.
|
|
188
184
|
|
|
189
|
-
|
|
185
|
+
## FAQ
|
|
190
186
|
|
|
191
|
-
|
|
187
|
+
**No “Linked Workspace Directory” / “Remote Workspace Directory” entry in the sidebar?**
|
|
188
|
+
Check that `dsh-better-sidebar` (≥0.24) is installed and restart the client — those two pages are rendered by it. Once it is there, the “+” new-tab menu offers the entries that match the session's workspace kind: a linked workspace session lists “Linked Workspace Directory”, a remote workspace session lists “Remote Workspace Directory”, and a plain local workspace lists neither (both pages stay registered, so “Open directory tree” in Settings → Linked workspaces always works).
|
|
192
189
|
|
|
193
|
-
|
|
190
|
+
**Preview says “Python 3 and document libraries are required”?**
|
|
191
|
+
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
192
|
|
|
195
|
-
|
|
193
|
+
**Search cannot find text inside files?**
|
|
194
|
+
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 locally, with a truncation notice.
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
**Sync seems to do nothing?**
|
|
197
|
+
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.
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- dsh-plugin.org (DSH Plugin Hub) periodically scans public repositories with the `dsh-plugin` topic and their npm packages; new versions refresh automatically after publication.
|
|
202
|
-
- Before releasing, check the package with `npm run build && npm pack --dry-run`.
|
|
199
|
+
**Drag and drop does nothing?**
|
|
200
|
+
Web browsers do not expose dropped file paths; the notice tells you to use the desktop app. Inside the same tree, use “Move to…” instead.
|
|
203
201
|
|
|
204
|
-
|
|
202
|
+
**Shortcut conflicts in the web UI?**
|
|
203
|
+
`Ctrl+W` and `Ctrl+Tab` are taken by the browser; use the DSH desktop app for those shortcuts.
|
|
205
204
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
- Direct remote directories are read-only and confined to their configured root; linked-workspace tool operations are confined to the remote root.
|
|
209
|
-
- Single-file saves are capped at 8 MB. Mirroring runs in the background with defaults of at most 500 files / 50 MB per pass; oversized files are skipped. `.git`, `node_modules` and caches are excluded; single-file reads time out after 30 s. A manual transfer/download handles at most 150 files / 15 MB per run and reports when the limit is hit.
|
|
210
|
-
- The HTTP API only accepts loopback, same-origin requests. For remote deployments it falls back to DSH `connection` host/origin authentication.
|
|
205
|
+
**Changed the code but the UI is unchanged?**
|
|
206
|
+
Run `npm run build` to regenerate `lib/client.js`, then restart the DSH client; Host changes require a process restart.
|
|
211
207
|
|
|
212
208
|
## Architecture and development
|
|
213
209
|
|
|
214
210
|
```
|
|
215
|
-
Client (browser)
|
|
216
|
-
Settings /
|
|
217
|
-
|
|
211
|
+
Client (browser) Host (DSH process)
|
|
212
|
+
Settings → Linked workspaces / sidebar trees / directory dialogs → POST /dsh-linked-workspace/api
|
|
213
|
+
theme + highlight + file icons (src/parts/*) workspace registry + linked registry + SSH pool
|
|
218
214
|
```
|
|
219
215
|
|
|
220
|
-
- `lib/index.js` — Host API, connection pool, linked workspaces, `linked_workspace` tool, prompt section.
|
|
221
|
-
- `lib/ssh.js` — SSH/SFTP, remote exec, host discovery, TOFU fingerprints.
|
|
222
|
-
- `lib/git.js` — remote/local git status (porcelain) and filename search.
|
|
223
|
-
- `lib/linked.js` — linked persistence, `.local`/`.remote` layout, mirror
|
|
216
|
+
- `lib/index.js` — Host API, connection pool, linked workspaces, the `linked_workspace` tool, prompt section.
|
|
217
|
+
- `lib/ssh.js` — SSH/SFTP, remote command execution (`exec`), host discovery, TOFU fingerprints.
|
|
218
|
+
- `lib/git.js` — remote/local `git status` (porcelain parsing) and filename search.
|
|
219
|
+
- `lib/linked.js` — linked workspace persistence, `.local`/`.remote` layout, mirror read/write.
|
|
224
220
|
- `src/client.js` + `src/parts/*` → `scripts/build-client.mjs` → `lib/client.js` (single browser bundle).
|
|
225
221
|
- `docs/API.md` — API contract; `docs/VERIFY.md` — manual test checklist.
|
|
226
222
|
|
|
223
|
+
```bash
|
|
224
|
+
npm run build # regenerate lib/client.js
|
|
225
|
+
npm test # 63 unit tests + client bundle smoke check
|
|
226
|
+
node --check lib/index.js lib/ssh.js lib/linked.js src/client.js
|
|
227
|
+
node test/host-api.mjs # full Host API against a real SSH host (28 steps)
|
|
228
|
+
node test/ssh-smoke.mjs # real SSH transfer smoke test (optional)
|
|
227
229
|
```
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
230
|
+
|
|
231
|
+
On Windows, run `test/host-api.mjs` with DSH's bundled Electron Node (system Node 24.13 crashes when removing directories with CJK names).
|
|
232
|
+
|
|
233
|
+
## Publishing and marketplaces
|
|
234
|
+
|
|
235
|
+
- The npm package is `dsh-linked-workspace`; release a new version by bumping `package.json` and pushing a `v*` tag. `.github/workflows/release.yml` then runs `npm publish --access public` (requires the `NPM_TOKEN` repository secret).
|
|
236
|
+
- awesome-dsh-plugin (the DSH community marketplace) reads the npm latest version and repository metadata; upgrades are picked up automatically once listed. `market/awesome-dsh-plugin-entry.yml` is kept ready to submit.
|
|
237
|
+
- dsh-plugin.org (DSH Plugin Hub) periodically scans public repositories tagged `dsh-plugin` and reads the npm package; new versions appear without re-registering.
|
|
238
|
+
- Before publishing, run `npm run build && npm pack --dry-run` locally to inspect the package.
|
|
237
239
|
|
|
238
240
|
## License
|
|
239
241
|
|