dsh-linked-workspace 0.10.0 → 0.12.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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ English · [简体中文](CHANGELOG.zh.md)
4
+
5
+ ## 0.12.0 — 2026-11-14
6
+
7
+ - **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.
8
+ - **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.
9
+ - **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.
10
+ - **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.
11
+
12
+ ## 0.11.0 — 2026-11-13
13
+
14
+ **Breaking change**: Remote workspaces replace remote directories.
15
+
16
+ - **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.
17
+ - **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.
18
+ - **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.
19
+ - **Add workspace flow (feature)**: the sidebar “Add workspace” dialog gains a third tab, “Remote workspace”, with steps *SSH connection → remote directory → workspace name*.
20
+ - **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`.
21
+ - **Data persistence**: `remote-workspaces.json` registry (including the SSH host snapshot for display), placeholder directories under `remote-placeholders/<uuid>/`.
22
+ - **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.
23
+ - **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.
24
+ - **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.
25
+ - **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.
26
+ - **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”.
27
+ - **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.
28
+ - **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.
29
+ - **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.
30
+ - **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.
31
+ - **Plugin name (change)**: the plugin is listed as “Linked & Remote Workspaces” (Chinese “联动与远程工作区”) instead of “Remote Workspaces & Links”.
32
+ - Tests: 63 unit tests pass; `test/host-api.mjs` covers `remote_workspaces.*` end to end.
33
+
3
34
  ## 0.10.0 — 2026-11-12
4
35
 
5
36
  Fourth review round: transfer safety, content search, document find and comparison actions.
package/README.en.md CHANGED
@@ -2,238 +2,242 @@
2
2
 
3
3
  English · [简体中文](README.md)
4
4
 
5
- Turn existing SSH connections into **remote directories** or **linked workspaces** in DeepSeek Harness:
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
- - **Remote directory**: Settings → Connections → Add remote directory. Pick a host and a remote folder, then browse and read its files from the right sidebar. Remote-directory views are **read-only**.
8
- - **Linked workspace**: Add a workspace (or Settings → Connections → Create linked workspace) to pair a **local folder** with a **remote folder**. The local folder becomes a real DSH workspace; sessions in it read and edit remote files through the `linked_workspace` tool. The remote host only needs SSH, not a DSH plugin. The right sidebar shows both trees: remote on top, local below.
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
- > Built for DSH 0.2.1-rc.4. Sidebar pages require `dsh-better-sidebar` (v0.24+). Without it the plugin still loads (Settings works), but sidebar entries are unavailable.
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
- ## Features
12
+ ## Two modes
13
13
 
14
- ### Connections and settings (Settings → Connections)
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
- - SSH hosts come from the `dsh-ssh-tunnel` SSH Manager (`~/.dsh/ssh-tunnel/hosts.json`) and from `~/.ssh/config`. Passwords and private keys stay inside the Host process and are never returned to the page or the model.
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
- ### Add workspace
25
+ - **DSH**: 0.2.1-rc.4 or newer (`engines` allows `>=0.2.0-rc.2 <0.3.0-0`).
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
+ - **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
- The plugin takes over the directory-selection hole used by the DSH sidebar and empty-session hero. The dialog has two tabs:
31
+ ## Quick start
27
32
 
28
- 1. **Local workspace**: enter or browse for a local directory (C:/D:/E: drive chips on Windows), set a workspace name, then create a normal DSH workspace.
29
- 2. **Linked workspace**: SSH host + remote folder + local folder + optional mirror. Creating it also registers the local folder as a DSH workspace. The local directory is **not** pre-populated with `.local`/`.remote`; those are created lazily when mirroring or transfers need them.
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 to `~/.ssh/config` or the DSH SSH Manager, then press “Refresh”, 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
- ### Document editing
39
+ ## Features
32
40
 
33
- The content panel now edits **Markdown / PDF / DOCX / XLSX / PPTX** files on both local and remote sides:
41
+ ### Settings → Linked workspaces
34
42
 
35
- - **Markdown**: raw editing, rendered preview, export to PDF.
36
- - **DOCX**: edit paragraph and table text; paragraph styles are kept, complex inline formatting may be simplified.
37
- - **XLSX**: switch sheets and edit a cell grid; untouched formulas and styles are preserved.
38
- - **PPTX**: navigate slides and edit text frames.
39
- - **PDF**: page navigation, rotate/delete pages, and title/author metadata; pages are rendered by PyMuPDF.
40
- - Create blank documents from the directory context menu by using one of these extensions.
41
- - Office/PDF operations need Python 3 with `python-docx`, `openpyxl`, `python-pptx` and `PyMuPDF`; Markdown does not. Set `DSH_OFFICE_PYTHON` to choose an interpreter.
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
+ - 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
- ### Right-sidebar entries
51
+ ### “Add workspace” on the left
44
52
 
45
- - **Linked workspace directory**: appears only in sessions of a linked workspace, and opens the linked workspace bound to that session. Remote and local files are editable.
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
- ### Right-sidebar linked-workspace directory
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
- - The directory is a fixed panel at the far right of the sidebar: **remote tree on top, local tree below**, both rooted at “All files”. Plugin internals (`.local`/`.remote`) are hidden by default but can be shown with the hidden-files toggle.
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
- ### Running indicator and local skills
61
+ ### Sidebar: “Linked Workspace Directory”
70
62
 
71
- - When a linked workspace has a running session, its link icon turns **blue** in the left workspace list (polled about every 5 seconds).
72
- - Linked sessions run in the **local directory**, so local skills (`~/.dsh/skills`, `~/.agents/skills`, `<local>/.dsh/skills`, `<local>/.agents/skills`) are available without installing them on the remote host. The model can use `linked_skills` to `list`/`read` them, and the system prompt explains this.
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 (files, folders, roots)
80
+ ### Context menu (file/folder/root)
75
81
 
76
- Transfer (download to `.remote` / upload 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. Remote operations use SFTP; local operations use the local filesystem. The transfer queue runs one job at a time.
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
- ### Linked-workspace layout
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
- The remote side is not modified by mirroring. The `linked_workspace` tool supports `list`, `info`, `list_dir`, `read`, `write`, `replace`, `stat`, `mkdir`, `rename`, `delete`, and `sync` (start a background mirror job). `path` is relative to the remote root (or an absolute path inside it). Writes are atomic and support `if_modified_since` optimistic concurrency. The workspace is resolved from the session cwd; use the `workspace` parameter to target another linked workspace.
88
+ Appears automatically for sessions that belong to a remote workspace (and can be opened any time from the settings card):
88
89
 
89
- ## Screenshots
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
- [![Settings → Connections](https://github.com/jiahui-huang1/dsh-linked-workspace/raw/main/docs/screenshots/settings-connections.png)](https://github.com/jiahui-huang1/dsh-linked-workspace/blob/main/docs/screenshots/settings-connections.png)
95
+ ### Transfer, comparison and conflicts
92
96
 
93
- [![Linked workspace directory: remote on top, local below](https://github.com/jiahui-huang1/dsh-linked-workspace/raw/main/docs/screenshots/linked-directories.png)](https://github.com/jiahui-huang1/dsh-linked-workspace/blob/main/docs/screenshots/linked-directories.png)
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
- [![Open a file in the content panel](https://github.com/jiahui-huang1/dsh-linked-workspace/raw/main/docs/screenshots/file-editor.png)](https://github.com/jiahui-huang1/dsh-linked-workspace/blob/main/docs/screenshots/file-editor.png)
103
+ ### Model tools
96
104
 
97
- ## Installation
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
- ```bash
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
- Install from source (development):
112
+ ### Running icon / local skills
104
113
 
105
- ```bash
106
- dsh plugin --profile "$DSH_PROFILE" add "file:$PWD/dsh-linked-workspace"
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
- Or use `plugin_manager` → `install_bundle` with the absolute path of this directory. Restart the DSH desktop app after installing (new Host plugins load at process start; session history is preserved). Then:
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
- 1. Account menu → Settings → **Connections**;
112
- 2. Or use the workspace “Add workspace” button and choose the linked-workspace tab.
130
+ ![Settings → Linked workspaces](docs/screenshots/settings-connections.png)
113
131
 
114
- ## Upgrading from 0.2.x
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
- Since 0.3.0 the plugin is named `dsh-linked-workspace`. On first start after installing the new package, the old `$DSH_HOME/remote-workspace` data directory is migrated to `$DSH_HOME/linked-workspace` (remote directories, linked workspaces, theme settings and known host fingerprints are preserved). The old `dsh-remote-workspace` package can then be uninstalled.
134
+ ![Add workspace: the linked workspace tab](docs/screenshots/add-workspace-modal.png)
117
135
 
118
- Old “Remote directories” tabs are restored after refresh through hidden legacy tab-type aliases; their titles are updated to “Linked workspace directory”, while new tabs use the new type.
136
+ The “Linked workspace directory” tab: the remote tree on top, the local tree below; files open from either side.
119
137
 
120
- See [CHANGELOG.md](CHANGELOG.md) for the full version history.
138
+ ![Linked workspace directory: remote above, local below](docs/screenshots/linked-directories.png)
121
139
 
122
- ### 0.10.0
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
- Transfer safety, content search, document find and comparison actions (fourth review round):
142
+ ![Clicking a file opens the remote editor in a new tab](docs/screenshots/file-editor.png)
125
143
 
126
- - **No silent overwrite**: dropping a file onto a folder that already has that name now asks first — cancel, keep both or overwrite. `fs.pullToLocal` and `fs.upload` accept `conflict=error|overwrite|unique`; unique names go through `uniqueLocalPath` / `remoteUniqueTarget` (verified by overwriting `REMOTE-OVER` with `LOCAL-OVER`, and by producing `same copy.txt` and `overwrite (2).txt`).
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
- In-editor find/replace, local↔remote comparison, multi-select and drag-and-drop, plus refresh fixes (third review round):
146
+ Install the local folder into the current DSH profile:
138
147
 
139
- - **Find and replace**: `Ctrl/Cmd + F` opens a find bar with a case-sensitive toggle, previous/next, a match counter, replace and replace all. Matching stops at 5000 hits and the counter shows `5000+`; replace-all still edits the whole document (6000 replacements verified).
140
- - **Open a terminal in a directory**: the folder context menu offers “Open terminal here”; `terminal.open` accepts a validated `path` and starts the shell there (verified as a real `ssh -t … "cd <dir> && exec bash -l"` process).
141
- - **Picker filtering**: the local and remote directory pickers filter already-loaded entries as you type, with an empty-state hint.
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
- ### 0.8.3
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
- Follow-up fixes to the 0.8.2 paging and preview work (second review round):
154
+ Two entry points afterwards:
155
155
 
156
- - Document previews now also drop inline `style` attributes, so a `position:fixed` overlay can no longer cover the whole app and impersonate a login page (click-jacking/phishing surface).
157
- - Tree refreshes (the local tree every 4 s) re-request only the entries already loaded, so “Load more” results are no longer reset to the first page.
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
- ### 0.8.2
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
- Security, data-integrity and large-directory fixes from the three-day review round:
161
+ ## Configuration
169
162
 
170
- - The document-preview sanitizer normalizes control characters, whitespace and zero-width characters before checking a URL scheme, so `jav\tascript:`, `vbscript:`, `file:` and `data:text/html` links no longer run in the GUI; only `http(s)`, `mailto`, `tel`, relative URLs and bitmap `data:image` sources are kept.
171
- - Windows junctions can no longer escape the `.remote` containment check (`realpathSync.native`); linked `.local`/`.remote` entries are removed as links, never followed.
172
- - Copying a remote file over 64 MB, or reading one incompletely, now fails loudly instead of writing a truncated copy; the read tool no longer mirrors truncated payloads.
173
- - `local.read` reads only the requested head instead of loading the whole file into memory.
174
- - The `linked_workspace` `delete` action removes non-empty directories recursively.
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.
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.
180
170
 
181
- ### 0.7.0
171
+ ## Upgrading and versions
182
172
 
183
- Single-click tree navigation with preview tabs and double-click pinning, remote/local terminal buttons with `cd`, VSCode-like shortcuts, unsaved-close prompts, and an auto-save switch under Settings → Connections.
173
+ - Version history lives only in [CHANGELOG.md](CHANGELOG.md) (English) and [CHANGELOG.zh.md](CHANGELOG.zh.md) (简体中文).
174
+ - **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.
175
+ - 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”.
176
+ - 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
177
 
185
- ### 0.6.2
178
+ ## Security
186
179
 
187
- Fix Windows GBK JSON transport errors for Markdown characters such as the superscript minus; PDF pages now load lazily and the source PDF is cached, avoiding long loading hangs on large files.
180
+ - Credentials exist only inside the Host process; the API returns host names, addresses and workspace paths only.
181
+ - Host keys use trust-on-first-use: the SHA256 is recorded on first connect and any change is rejected.
182
+ - 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.
183
+ - 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.
184
+ - The page HTTP API accepts loopback same-origin requests only (remote deployments fall back to the DSH `connection` service's Host/Origin authentication).
185
+ - 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
186
 
189
- ### 0.6.1
187
+ ## FAQ
190
188
 
191
- Fix the linked-workspace directory tab and start-page entry disappearing in a new blank linked-workspace session by consulting the client session store for cwd and workspaceId first.
189
+ **No “Linked Workspace Directory” / “Remote Workspace Directory” entry in the sidebar?**
190
+ 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
191
 
193
- ### 0.5.13
192
+ **Preview says “Python 3 and document libraries are required”?**
193
+ 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
194
 
195
- The directory panel divider is draggable (double-click resets to 300 px; width persists). The local tree refreshes silently every 4 seconds and on window focus, so new local subdirectories appear without a manual refresh.
195
+ **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 locally, with a truncation notice.
196
197
 
197
- ## Releases and marketplace updates
198
+ **Sync seems to do nothing?**
199
+ 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
200
 
199
- - The npm package is `dsh-linked-workspace`. To release, bump `package.json` and push a `v*` tag; `.github/workflows/release.yml` runs `npm publish --access public` (set an `NPM_TOKEN` repository secret).
200
- - awesome-dsh-plugin (the DSH community market) reads the npm latest version and repository metadata, so published upgrades appear automatically without resubmitting the entry. A ready-to-submit entry is kept at `market/awesome-dsh-plugin-entry.yml`.
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`.
201
+ **Drag and drop does nothing?**
202
+ 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
203
 
204
- ## Security
204
+ **Shortcut conflicts in the web UI?**
205
+ `Ctrl+W` and `Ctrl+Tab` are taken by the browser; use the DSH desktop app for those shortcuts.
205
206
 
206
- - Credentials live only in the Host process; the API returns only host names, addresses and workspace paths.
207
- - Host-key TOFU: the SHA256 fingerprint is recorded on first connection and connections are refused if it changes.
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.
207
+ **Changed the code but the UI is unchanged?**
208
+ Run `npm run build` to regenerate `lib/client.js`, then restart the DSH client; Host changes require a process restart.
211
209
 
212
210
  ## Architecture and development
213
211
 
214
212
  ```
215
- Client (browser) Host (DSH process)
216
- Settings / right-sidebar workbench → POST /dsh-linked-workspace/api
217
- themes + highlighting + file icons workspace registry + linked registry + SSH pool
213
+ Client (browser) Host (DSH process)
214
+ Settings → Linked workspaces / sidebar trees / directory dialogs → POST /dsh-linked-workspace/api
215
+ theme + highlight + file icons (src/parts/*) workspace registry + linked registry + SSH pool
218
216
  ```
219
217
 
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 I/O.
218
+ - `lib/index.js` — Host API, connection pool, linked workspaces, the `linked_workspace` tool, prompt section.
219
+ - `lib/ssh.js` — SSH/SFTP, remote command execution (`exec`), host discovery, TOFU fingerprints.
220
+ - `lib/git.js` — remote/local `git status` (porcelain parsing) and filename search.
221
+ - `lib/linked.js` — linked workspace persistence, `.local`/`.remote` layout, mirror read/write.
224
222
  - `src/client.js` + `src/parts/*` → `scripts/build-client.mjs` → `lib/client.js` (single browser bundle).
225
223
  - `docs/API.md` — API contract; `docs/VERIFY.md` — manual test checklist.
226
224
 
225
+ ```bash
226
+ npm run build # regenerate lib/client.js
227
+ npm test # 63 unit tests + client bundle smoke check
228
+ node --check lib/index.js lib/ssh.js lib/linked.js src/client.js
229
+ node test/host-api.mjs # full Host API against a real SSH host (28 steps)
230
+ node test/ssh-smoke.mjs # real SSH transfer smoke test (optional)
227
231
  ```
228
- node scripts/build-client.mjs # rebuild lib/client.js
229
- node --check lib/index.js lib/ssh.js lib/linked.js
230
- node test/linked.test.mjs # linked filesystem unit tests (node --test)
231
- node test/parts.test.mjs # theme/highlight/icon unit tests
232
- node test/client-smoke.mjs # client bundle registration smoke test
233
- node test/git.test.mjs # git status/search (includes a real SSH read-only check)
234
- node test/ssh-smoke.mjs # real SSH transfer smoke test
235
- node test/host-api.mjs # full Host API over real SSH (24 steps)
236
- ```
232
+
233
+ On Windows, run `test/host-api.mjs` with DSH's bundled Electron Node (system Node 24.13 crashes when removing directories with CJK names).
234
+
235
+ ## Publishing and marketplaces
236
+
237
+ - 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).
238
+ - 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.
239
+ - dsh-plugin.org (DSH Plugin Hub) periodically scans public repositories tagged `dsh-plugin` and reads the npm package; new versions appear without re-registering.
240
+ - Before publishing, run `npm run build && npm pack --dry-run` locally to inspect the package.
237
241
 
238
242
  ## License
239
243