dsh-linked-workspace 0.24.1 → 0.25.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 +28 -0
- package/README.en.md +13 -7
- package/README.md +13 -7
- package/docs/API.md +3 -2
- package/docs/VERIFY.md +39 -1
- package/lib/client.js +635 -81
- package/lib/index.js +141 -32
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.25.0 — 2026-11-23
|
|
6
|
+
|
|
7
|
+
- Three more theme families — **Tokyo Night**, **Gruvbox** and **Ayu** — bring the grid to twelve. Every card now previews both halves of the pair (light band on top, dark underneath) with the palette's keyword/string/function colours, so a family is recognisable without switching the app mode first. It lists four colour dots per band — keyword, string, function name and comment.
|
|
8
|
+
- The plugin now has its **own settings tab** (`联动工作区设置`, opened from the gear in the directory toolbar or the "+" menu). The DSH settings dialog only exists in the desktop shell, so the web build could never reach themes, remote exec, SSH trust, extra roots or port forwarding — now it can.
|
|
9
|
+
- Settings page polish: the mode cards share one height and mark the active choice in the brand colour, the section headings line up with their count chips, and the theme grid reports how many families are available.
|
|
10
|
+
- The **auto push** block on each workspace card is tidier: the title and the switch share one row with the state sentence underneath, the divider sits the same distance from its neighbours as the rest of the card, and the labels finally have a style of their own (that class had been referenced but never defined, so they rendered larger and darker than everything around them).
|
|
11
|
+
- The known-host-keys list is folded by default, like the workspace allow-list: one line says how many keys are remembered, and the expand button reveals the fingerprints.
|
|
12
|
+
- Long context menus no longer spill past the bottom of the window: the menu is measured after it renders and flips above the cursor when there is more room up there, otherwise it shrinks and scrolls inside itself. The last items ("Permissions", "Properties") used to be unreachable on a short window.
|
|
13
|
+
- **Port-forward tunnels survive a restart.** The definitions live in `forwards.json`, the listener is re-bound when the Host starts (a taken port moves the tunnel instead of losing it), and only the Stop button removes an entry. A page refresh never affected them; a Host restart used to close them.
|
|
14
|
+
- **Push to the remote** now lives on the local tree (the plan reads the local directory); the remote tree no longer offers it.
|
|
15
|
+
- The preview pane keeps its reading position too: the scroll offset is restored
|
|
16
|
+
after the rendered Markdown comes back, not only in the editing view.
|
|
17
|
+
- The directory panel now survives switching sessions: the open file tabs, the
|
|
18
|
+
active tab and both trees (expansion plus already listed entries) are kept per
|
|
19
|
+
session, so coming back to a workspace no longer looks like a fresh panel.
|
|
20
|
+
- Markdown files now open in **preview** in both workspace kinds; the toolbar
|
|
21
|
+
button switches to editing, and the chosen mode plus the reading position
|
|
22
|
+
survive switching to another file and coming back. Word, Excel, PDF and
|
|
23
|
+
PowerPoint panes remember their page, sheet and slide the same way.
|
|
24
|
+
- `@@` in the composer opens the picker on the **remote** workspace's files and
|
|
25
|
+
folders; a single `@` keeps the stock local menu.
|
|
26
|
+
- `@`/`@@` followed by an address (absolute, `~/…` or workspace relative) offers
|
|
27
|
+
that exact path, and picking it inserts a real reference chip that the model
|
|
28
|
+
receives as a path.
|
|
29
|
+
- The context menu copies addresses: **Copy relative address** gives the path
|
|
30
|
+
relative to the workspace root (the local root in the left tree, the remote
|
|
31
|
+
root in the right one), **Copy absolute address** gives the full path.
|
|
32
|
+
|
|
5
33
|
## 0.24.1 — 2026-11-22
|
|
6
34
|
|
|
7
35
|
- Fix: every directory pane showed "the plugin host is still running older code" right after a full DSH restart. 0.24.0 raised the revision the Client expects to 9 but left `API_REVISION` in the Host at 8, so the two halves disagreed on a process that was perfectly up to date.
|
package/README.en.md
CHANGED
|
@@ -44,7 +44,8 @@ Turn an existing SSH connection into a **linked workspace** or a **remote worksp
|
|
|
44
44
|
- Remote workspace list: each card shows “remote · user@host + remote path” and the local placeholder directory, with **open workspace**, **open directory tree**, **test connection**, **rename** (renames the DSH workspace too) and **remove** (two-step confirmation; deletes the record, the placeholder directory and the DSH workspace, never remote files).
|
|
45
45
|
- Linked workspace list: local ⇄ remote paths, mirror toggle (**off by default**), background sync (archive into `.remote`, with file/byte progress and cancel), remove (optionally remove the DSH workspace and delete `.local`/`.remote`). With the mirror on, the first check runs immediately and then **every 5 minutes**: new or changed remote files are downloaded, mirror files that no longer exist remotely are deleted, unchanged files are skipped via `.local/mirror-manifest.json`, and `.git`/`node_modules`/cache directories are excluded. With the mirror off the two sides may diverge freely.
|
|
46
46
|
- A linked record without a DSH workspace shows “Register workspace” in its settings card, which registers it without recreating the record.
|
|
47
|
-
- **Editor theme**: display mode **System / Light / Dark** (default System, following the DSH theme);
|
|
47
|
+
- **Editor theme**: display mode **System / Light / Dark** (default System, following the DSH theme); twelve theme families (GitHub, Solarized, One, Dracula, Monokai, Nord, VS Code, Xcode, Catppuccin, Tokyo Night, Gruvbox, Ayu), each card stacking the light variant above the dark one.
|
|
48
|
+
- **Settings tab**: besides the desktop Settings dialog, the plugin registers its own “Linked workspace settings” tab (gear in the directory toolbar, or the “+” menu), so every switch is reachable from the browser too.
|
|
48
49
|
- A single form serves “Create linked workspace” and “Create remote workspace”, reachable from both entry points.
|
|
49
50
|
- The file open mode (editor / system app / copy path) is switched from the sidebar toolbar and persisted.
|
|
50
51
|
|
|
@@ -87,7 +88,9 @@ hover it for the total size and the used percentage.
|
|
|
87
88
|
|
|
88
89
|
### Context menu (file/folder/root)
|
|
89
90
|
|
|
90
|
-
Transfer (download to `.remote`), download to the default folder, queue, open,
|
|
91
|
+
Transfer (download to `.remote`), download to the default folder, queue, open, open a copy in Notepad (edits are not written back), copy, paste, **Copy absolute address**, **Copy relative address**, **Move to…** (only within the same local or remote tree), rename, delete, change permissions, new (folder/file), properties. Remote rows also offer “Copy ssh command”, rows of a linked workspace's local tree offer “Push to the remote”, folders offer “Open terminal here”, and remote folders in a linked workspace offer “Compare with local…” when a local counterpart exists.
|
|
92
|
+
|
|
93
|
+
**Copy absolute address** gives the full path; **Copy relative address** gives it relative to the workspace root (the local root on the left tree, the remote root on the right) — both paste straight into a terminal or an editor.
|
|
91
94
|
|
|
92
95
|
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).
|
|
93
96
|
|
|
@@ -98,7 +101,7 @@ Appears automatically for sessions that belong to a remote workspace (and can be
|
|
|
98
101
|
- A **single remote tree** with no local pane; it is rooted at “All files” and the header shows `user@host · Remote`.
|
|
99
102
|
- Files are **editable in the built-in editor and saved straight back to the host** (Ctrl/Cmd+S, autosave, save-conflict prompt, find & replace and jump-to-match all behave like the linked workspace). Read-only protection still follows each file: binaries, files over 2 MB and truncated reads show “Read-only” and reject typing.
|
|
100
103
|
- Markdown, Word, Excel, PowerPoint and PDF documents open in their own panes and save back to the host as well.
|
|
101
|
-
- The context menu, search (name / content, including case, regex and “search this folder only”), hidden-file toggle and the 15-second refresh throttle match the linked workspace's remote tree: open,
|
|
104
|
+
- The context menu, search (name / content, including case, regex and “search this folder only”), hidden-file toggle and the 15-second refresh throttle match the linked workspace's remote tree: open, open a copy in Notepad, copy / paste, copy absolute address, copy relative address, copy ssh command, move to…, rename, delete, change permissions, open terminal here, new file / folder, properties, download, plus the batch “delete selected”, “move selected” and “rename selected”.
|
|
102
105
|
- Only the four features that need a local directory stay linked-only: **transfer to the local mirror, the transfer queue, two-way comparison, and the local terminal / local pane** (in a remote workspace the transfer button is disabled and its tooltip reads “Transfer needs a linked workspace (remote → local)”).
|
|
103
106
|
- 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.
|
|
104
107
|
|
|
@@ -122,7 +125,7 @@ The workspace resolves automatically when the session cwd falls inside a linked
|
|
|
122
125
|
### Documents, tunnels and paths outside the workspace (0.23.0)
|
|
123
126
|
|
|
124
127
|
- Models can read the **text of PDF / Word / Excel / PowerPoint** files directly (`read_doc`) instead of installing a parser.
|
|
125
|
-
- When TensorBoard or Jupyter runs remotely, map it onto a local `127.0.0.1` port under Settings → Linked workspaces → **Port forwards** and open the URL in a browser
|
|
128
|
+
- When TensorBoard or Jupyter runs remotely, map it onto a local `127.0.0.1` port under Settings → Linked workspaces → **Port forwards** and open the URL in a browser. A tunnel is a **standing arrangement**: the definition is written to `forwards.json`, so a page refresh, an app restart or a Host restart re-binds it automatically (picking and remembering a new local port if the old one is taken); only “Stop” removes it.
|
|
126
129
|
- To touch a shared drive outside the workspace, add the prefix under Settings → Linked workspaces → **Extra roots** first; only then can the model use `read_outside` / `write_outside` / `list_outside`, and every access lands in `outside-audit.jsonl`.
|
|
127
130
|
- `sync_status` reports progress and counters while a mirror sync runs.
|
|
128
131
|
|
|
@@ -139,9 +142,12 @@ Every attempt — including refused ones — appends a line to `$DSH_HOME/linked
|
|
|
139
142
|
### @ references and finer search (0.18.0)
|
|
140
143
|
|
|
141
144
|
- The `references` action (backed by `fs.references`) matches **path names** case-insensitively with the best match first (exact name → prefix → substring) and directories flagged `dir`, so the model can turn a file name you mention into a real remote path.
|
|
142
|
-
-
|
|
145
|
+
- `@` in the composer still opens DSH's own menu (local files, folders, conversations). The plugin adds its own candidate groups to that menu:
|
|
146
|
+
- typing **`@@`** lists files and folders of the current workspace's **remote tree** (group “Remote references”); picking one inserts a real reference chip, and the model receives that remote path;
|
|
147
|
+
- `@` followed by an address (absolute path, `~/…`, or a workspace-relative path containing `/`) resolves that address and offers **the address itself** (group “Address link”), so picking it links the file or folder — in both linked and remote workspaces.
|
|
148
|
+
- The context menu still copies addresses: **Copy relative address** / **Copy absolute address** give the path itself, without an `@` prefix.
|
|
143
149
|
- Content search gained two switches — “search usually ignored folders” (`node_modules`/`.venv`/`dist` included, `.git` always out) and “file names only” — plus a “Stop” button that cancels a running sweep; the scan stats (“Scanned N files · X”) appear above the results.
|
|
144
|
-
- Known limitation:
|
|
150
|
+
- Known limitation: candidates come from the plugin's `fs.references` (name matching, at most 30 rows), so the menu lists “remote paths found by name” rather than the whole tree; browse and click in the sidebar tree for that.
|
|
145
151
|
|
|
146
152
|
### Running icon / local skills
|
|
147
153
|
|
|
@@ -200,7 +206,7 @@ The npm package is `dsh-linked-workspace`; released versions can also be install
|
|
|
200
206
|
|
|
201
207
|
## Configuration
|
|
202
208
|
|
|
203
|
-
- **Settings → Linked workspaces**: editor theme and display mode, file open mode, auto save, mirror toggle, manual sync and removal options.
|
|
209
|
+
- **Settings → Linked workspaces**: editor theme and display mode, file open mode, auto save, mirror toggle, manual sync and removal options; below that come remote exec (switch, host allow-list and the per-workspace second layer, folded by default), SSH trust and encoding (including the folded known-host-key list), extra roots, and port forwards. The same page opens in the browser as its own sidebar tab.
|
|
204
210
|
- **Data directory**: `$DSH_HOME/linked-workspace` (remote workspace records, linked records, settings); override with `DSH_LINKED_WORKSPACE_HOME`.
|
|
205
211
|
- **Python interpreter**: `DSH_OFFICE_PYTHON` for Office/PDF operations.
|
|
206
212
|
- **Terminal**: `DSH_LINKED_WORKSPACE_NO_TERMINAL=1` keeps “Open terminal” from launching a real window (used in tests).
|
package/README.md
CHANGED
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
- **联动工作区**列表:本地 ⇄ 远端路径、镜像开关(**默认关闭**)、后台同步(归档到 `.remote`,显示文件数/体积进度,可取消)、移除(可选同时移除 DSH 工作区、删除 `.local`/`.remote`)。开启镜像后首次立即检查,之后**每 5 分钟**自动比较远端与 `.remote`:下载新增/变更文件、删除远端已不存在的镜像文件、跳过未变更文件(`.local/mirror-manifest.json`),并排除 `.git`/`node_modules`/缓存目录;关闭镜像时允许两侧存在版本和文件差异。
|
|
45
45
|
- **远程工作区**列表:每张卡片显示「远端 · 用户名@主机 + 远端路径」和「本地占位目录」,提供**打开工作区**(切到该 DSH 工作区)、**打开目录树**、**测试连接**、**重命名**(同步改名 DSH 工作区)、**移除远程工作区**(两步确认;同时删除占位目录和 DSH workspace 注册,不动远端文件)。
|
|
46
46
|
- 联动记录若没有对应的 DSH 工作区,设置卡会显示「注册为工作区」,点击即可补注册,无需删除重建。
|
|
47
|
-
- **编辑器主题**:显示模式分 **系统 / 浅色 / 深色**(默认系统:跟随 DSH 当前主题);指定主题为 **
|
|
47
|
+
- **编辑器主题**:显示模式分 **系统 / 浅色 / 深色**(默认系统:跟随 DSH 当前主题);指定主题为 **12 张卡片**(GitHub、Solarized、One、Dracula、Monokai、Nord、VS Code、Xcode、Catppuccin、Tokyo Night、Gruvbox、Ayu),每张卡上下两条色带同时预览这一套的浅色与深色版本。
|
|
48
|
+
- **设置标签页**:除了桌面端「设置 → 联动工作区」,插件还在右侧栏注册了「联动工作区设置」标签(目录工具栏的齿轮按钮或「+」菜单打开),浏览器里也能改全部设置。
|
|
48
49
|
- 添加联动工作区 / 添加远程工作区共用同一个表单,可在两处入口使用。
|
|
49
50
|
- 文件打开方式(编辑器 / 系统默认应用 / 复制路径)由右侧栏工具栏的「打开选项菜单」切换并持久化。
|
|
50
51
|
|
|
@@ -86,7 +87,9 @@
|
|
|
86
87
|
|
|
87
88
|
### 右键菜单(文件/文件夹/根节点)
|
|
88
89
|
|
|
89
|
-
传输(下载到 `.remote
|
|
90
|
+
传输(下载到 `.remote`)、下载到默认文件夹、队列、打开、用记事本打开副本(不回写)、复制、粘贴、**复制绝对地址**、**复制相对地址**、**移动到…**(只允许移动到同一棵本地树或同一棵远程树内的目录)、重命名、删除、更改权限、新建(文件夹/文件)、属性;远端目录行另有「复制 ssh 命令」,联动工作区本地树的行另有「推送到远端」,目录还提供「在此打开终端」,联动工作区的远端目录在本地存在对应路径时提供「与本地对比…」。
|
|
91
|
+
|
|
92
|
+
**复制绝对地址**给完整路径,**复制相对地址**给相对工作区根目录的路径(左树相对本地根、右树相对远端根)——粘到终端或编辑器里都是能直接用的地址。
|
|
90
93
|
|
|
91
94
|
选中多个文件(`Ctrl/Cmd` 点击切换、`Shift` 点击按区间选择)后,菜单顶部出现「传输所选的 N 项」「删除所选的 N 项」;删除会先弹确认,逐项失败会聚合提示(例如外部已删掉的文件报「路径不存在」,其余照常删除)。
|
|
92
95
|
|
|
@@ -97,7 +100,7 @@
|
|
|
97
100
|
- 只有**一棵远端树**,不显示本地分栏;根节点同样是「所有文件」,标题栏显示 `用户名@主机 · 远程`。
|
|
98
101
|
- 文件可在内部编辑器里**直接编辑并保存回远端**(`Ctrl/Cmd+S`、自动保存、保存冲突提示、查找替换、按命中行跳转都与联动工作区一致);只读保护仍按文件本身生效:二进制文件、超过 2 MB 或读取被截断时显示「只读」且不可输入。
|
|
99
102
|
- Markdown、Word、Excel、PowerPoint、PDF 等文档走各自的文档面板打开,编辑后同样保存回远端。
|
|
100
|
-
- 右键菜单、搜索(文件名 / 内容,含大小写、正则、限定当前目录)、隐藏文件开关、刷新节流(15
|
|
103
|
+
- 右键菜单、搜索(文件名 / 内容,含大小写、正则、限定当前目录)、隐藏文件开关、刷新节流(15 秒)与联动工作区的远端树完全一致:打开、用记事本打开副本、复制 / 粘贴、复制绝对地址、复制相对地址、复制 ssh 命令、移动到…、重命名、删除、更改权限、在此打开终端、新建文件 / 文件夹、属性、下载,以及批量的「删除所选」「移动所选」「批量重命名所选」。
|
|
101
104
|
- 只有依赖本地目录的四项仍然只对联动工作区开放:**传输到本地镜像、传输队列、与本地目录对比、本地终端 / 本地分栏**(远程工作区里传输按钮为禁用态,悬停提示「传输只在联动工作区可用(远端 → 本地)」)。
|
|
102
105
|
- 两个目录标签(联动 / 远程)都常驻注册,因此当前会话属于联动工作区时也能从设置页打开远程工作区目录树。
|
|
103
106
|
|
|
@@ -121,7 +124,7 @@
|
|
|
121
124
|
### 读文档、开隧道、访问工作区外(0.23.0)
|
|
122
125
|
|
|
123
126
|
- 模型可以直接读 **PDF / Word / Excel / PowerPoint 的文字**(`read_doc`),不用再自己装解析库。
|
|
124
|
-
- 远端跑着 TensorBoard、Jupyter 时,可以在 设置 → 联动工作区 → **端口转发** 里把它映射到本机 `127.0.0.1` 的端口,点 URL
|
|
127
|
+
- 远端跑着 TensorBoard、Jupyter 时,可以在 设置 → 联动工作区 → **端口转发** 里把它映射到本机 `127.0.0.1` 的端口,点 URL 就能在浏览器打开。隧道是**常驻的**:定义写进 `forwards.json`,刷新页面、重启应用或重启 Host 都会自动重新监听(原来的本机端口被占用时会换一个并记下来),只有点「停止」才会移除。
|
|
125
128
|
- 需要碰工作区之外的共享盘时,先在 设置 → 联动工作区 → **额外根目录** 里加前缀,模型才能用 `read_outside` / `write_outside` / `list_outside` 访问,而且每次访问都会记进 `outside-audit.jsonl`。
|
|
126
129
|
- 镜像同步进行中可以用 `sync_status` 看进度与计数。
|
|
127
130
|
|
|
@@ -139,9 +142,12 @@
|
|
|
139
142
|
### @ 引用与更细的搜索(0.18.0)
|
|
140
143
|
|
|
141
144
|
- `references` 动作(对应 `fs.references`)按**路径名**做大小写不敏感匹配,最佳匹配排在最前(完全同名 → 前缀 → 包含),目录带 `dir` 标记;模型可以用它把你口头提到的文件名解析成远端真实路径。
|
|
142
|
-
-
|
|
145
|
+
- 输入框里的 **`@`** 仍然是 DSH 原有的菜单(本地文件、文件夹、对话);插件往这个菜单里又加了一组自己的候选:
|
|
146
|
+
- 打 **`@@`** 会列出**当前工作区远端树**的文件与文件夹(分节标题「远程引用」),选中后插入一个真正的引用 chip,模型收到的是该远端路径;
|
|
147
|
+
- `@` 后面直接跟地址(绝对路径、`~/…`、或含 `/` 的工作区相对路径)时,会检测该地址并给出**这个地址本身**(分节标题「地址链接」),选中即建立链接——远程工作区与联动工作区都适用。
|
|
148
|
+
- 右键仍然是取地址:**复制相对地址** / **复制绝对地址** 给出的是路径本身,不带 `@` 前缀。
|
|
143
149
|
- 内容搜索多了两枚开关:「包含通常忽略的目录」(`node_modules`/`.venv`/`dist` 也会搜,`.git` 始终排除)、「只列文件名」;搜索中可以点「停止」中途取消,结果上方会显示「扫描 N 个文件 · X」。
|
|
144
|
-
-
|
|
150
|
+
- 已知限制:候选来源是插件的 `fs.references`(按路径名匹配、最多 30 条),所以它列的是「按名字找到的远端路径」,不是整棵树的浏览器;要逐层浏览请用右侧栏目录树。
|
|
145
151
|
|
|
146
152
|
### 运行中图标 / 本地技能
|
|
147
153
|
|
|
@@ -200,7 +206,7 @@ npm 包名为 `dsh-linked-workspace`,也可以从 npm 安装已发布版本(
|
|
|
200
206
|
|
|
201
207
|
## 配置
|
|
202
208
|
|
|
203
|
-
- **设置 →
|
|
209
|
+
- **设置 → 联动工作区**:编辑器主题与显示模式、文件打开方式、自动保存、镜像开关、手动同步与移除选项;下方依次是远端命令执行(开关 + 主机白名单 + 按工作区第二层,默认折叠)、SSH 信任与编码(含默认折叠的已知主机密钥清单)、额外根目录、端口转发。
|
|
204
210
|
- **数据目录**:`$DSH_HOME/linked-workspace`(远程工作区、联动记录、设置);可用 `DSH_LINKED_WORKSPACE_HOME` 覆盖。
|
|
205
211
|
- **Python 解释器**:`DSH_OFFICE_PYTHON` 指定用于 Office/PDF 的 Python。
|
|
206
212
|
- **终端**:`DSH_LINKED_WORKSPACE_NO_TERMINAL=1` 关闭「打开终端」的实际启动(测试环境用)。
|
package/docs/API.md
CHANGED
|
@@ -62,8 +62,8 @@ scope root, or absolute inside it.
|
|
|
62
62
|
| `fs.readOutside` | `{ linkedId?, remoteId?, path, maxBytes? }` | `{ path, size, mtime, binary, truncated, content }` (only under an `extraRoots` prefix; audited) |
|
|
63
63
|
| `fs.writeOutside` | `{ linkedId?, remoteId?, path, content, ifModifiedSince? }` | `{ path, size, mtime, created }` (8 MB limit; only under an `extraRoots` prefix; audited) |
|
|
64
64
|
| `fs.listOutside` | `{ linkedId?, remoteId?, path }` | `{ path, entries }` (only under an `extraRoots` prefix; audited) |
|
|
65
|
-
| `hosts.forward` | `{ hostId, remotePort, remoteHost?, localPort? }` | `{ forward: { id, hostId, hostName, remoteHost, remotePort, localPort, startedAt, url } }` (localhost TCP tunnel; reuses an identical one) |
|
|
66
|
-
| `hosts.forwards` | `{}` | `{ forwards: [...] }` |
|
|
65
|
+
| `hosts.forward` | `{ hostId, remotePort, remoteHost?, localPort? }` | `{ forward: { id, hostId, hostName, remoteHost, remotePort, localPort, startedAt, url } }` (localhost TCP tunnel; reuses an identical one; the definition is written to `forwards.json`, so a restarted Host re-binds the same port) |
|
|
66
|
+
| `hosts.forwards` | `{}` | `{ forwards: [...] }` — a tunnel that could not get its port back after a restart is listed with `localPort: 0`, `url: ""` and an `error`; Stop removes it |
|
|
67
67
|
| `hosts.unforward` | `{ id }` | `{ removed }` |
|
|
68
68
|
| `hosts.reconnect` | `{ hostId }` | `{ hostId, state, reason?, message?, latencyMs?, checkedAt? }` (drops the pooled socket and dials again; returns the resulting status instead of throwing, so the UI can show the reason) |
|
|
69
69
|
| `hosts.mkdir` | `{ hostId, path?, name }` | `{ path }` (creates `name` inside `path`; defaults to the login home; `409`/`FS_EXISTS` when it already exists) |
|
|
@@ -147,6 +147,7 @@ Under `$DSH_HOME/linked-workspace/`:
|
|
|
147
147
|
|
|
148
148
|
- `linked.json` — linked workspaces (no credentials).
|
|
149
149
|
- `remote-workspaces.json` — remote workspaces (no credentials).
|
|
150
|
+
- `forwards.json` — `{ version, forwards: [{ id, hostId, hostName, remoteHost, remotePort, localPort, startedAt }] }`. Since 0.25.0 the tunnels opened from 设置 → 端口转发 are standing arrangements: the listener is re-bound on start (with a new local port if the old one is taken, and the record updated), and only `hosts.unforward` removes an entry.
|
|
150
151
|
- `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell, hostKeyPolicy, outputEncoding, extraRoots }`. The four `autoPush*` keys are still accepted so an old file loads unchanged, but since 0.24.0 auto push is configured per workspace (`linked.json` → each record's `autoPush`), and those keys no longer drive any watcher.
|
|
151
152
|
- `linked.json` — every record carries `autoPush: { enabled, debounceMs, include[], exclude[] }` (`debounceMs` clamped to 300–60000, default 1500). `linked.list` returns it, `linked.update { id, autoPush }` writes it, and the Host starts/stops one `fs.watch` per enabled workspace.
|
|
152
153
|
The exec keys are off unless you turn them on: `execEnabled` defaults to
|
package/docs/VERIFY.md
CHANGED
|
@@ -9,6 +9,8 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
9
9
|
3. 切回 tofu 再刷新:连接恢复,密钥重新出现在列表里。
|
|
10
10
|
4. 把输出编码切到 gbk,用 `hosts.exec` 让中文 Windows 远端输出中文,应正常显示;切回 utf8 应变成乱码(说明不是被强行转码)。
|
|
11
11
|
|
|
12
|
+
5. 「已知主机密钥」默认收起、只显示条数;点「展开」列出指纹与「忘记」按钮,点「收起」回到一行。(0.25.0)
|
|
13
|
+
|
|
12
14
|
## 本地改动推回远端(0.19.0)
|
|
13
15
|
|
|
14
16
|
1. 在联动工作区的**本地**目录里改一个文件、新建一个文件,然后点目录栏的同步按钮:差异预览里能看到「新增 1 · 修改 1」,并列出这两个文件。
|
|
@@ -39,7 +41,8 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
39
41
|
3. 开关打开但主机白名单为空 → `403 EXEC_HOST_NOT_ALLOWED`;把该主机加进白名单 → `echo hi; pwd` 返回 `exitCode: 0`、`stdout` 含 `hi`、`cwd` 等于工作区远端根。
|
|
40
42
|
4. 工作区白名单填一个不相干的值 → `403 EXEC_WORKSPACE_NOT_ALLOWED`;留空表示不限制。
|
|
41
43
|
5. `command: ''` → `400 BAD_REQUEST`;`cwd: '../..'` → `400 BAD_REQUEST`;`timeoutMs: 1000` 配 `sleep 5` → `504 EXEC_TIMEOUT`。
|
|
42
|
-
6. 审计:每次尝试(含被拒绝)都往
|
|
44
|
+
6. 审计:每次尝试(含被拒绝)都往 `
|
|
45
|
+
DSH_HOME/linked-workspace/exec-audit.jsonl` 追加一行 JSON,含 `auditId`、`hostId`、`command`、成功时的 `exitCode`/`durationMs`/`stdoutHead`、失败时的 `refusal`/`message`;文件超过 5 MB 时轮转为 `exec-audit.jsonl.1`;设置页「打开审计日志」用系统默认应用打开它。
|
|
43
46
|
7. 模型侧:在联动/远程工作区的会话里让它「用 linked_workspace 的 exec 动作跑 uname -a」→ 工具卡片返回退出码与输出;开关关闭时模型会收到 `EXEC_DISABLED` 与开启指引。
|
|
44
47
|
8. 旧 Host:`meta.info` 的 `apiRevision` < 3 时目录树顶部出现「DSH 的插件进程仍在运行旧版代码」横幅。
|
|
45
48
|
|
|
@@ -355,3 +358,38 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
355
358
|
4. **跨侧批量**:多选本地文件拖到远端目录(或反过来):应提示「已导入 N 个文件」,逐个文件各一次请求;其中一个目标同名时会先弹冲突对话框。
|
|
356
359
|
5. **批量右键移动**:多选后用右键「移动所选的 N 项…」,选目标目录:应提示「已移动 N 项」。
|
|
357
360
|
6. **同目录/自身保护**:把文件拖到它当前所在的目录、或把目录拖进自己的子目录:应被忽略,不产生报错或递归。
|
|
361
|
+
|
|
362
|
+
## 阅读模式与 @ 引用(0.25.0)
|
|
363
|
+
|
|
364
|
+
1. 打开任一联动工作区或远程工作区里的 `.md`:默认是**预览**,工具栏显示「编辑」。
|
|
365
|
+
2. 点「编辑」进入编辑,向下滚动一段,切到另一个文件再切回来:仍是编辑模式,且滚动位置没有跳回顶部。
|
|
366
|
+
3. 再点回「预览」,切走再切回:仍是预览,阅读位置保留。
|
|
367
|
+
4. 打开 `.xlsx` / `.pptx` / `.pdf`,切到第 2 个工作表 / 幻灯片 / 页面,切走再切回:仍停在原处。
|
|
368
|
+
5. 在输入框里输入 `@@`:菜单出现「远程工作区」分组,列出远端文件与文件夹;选中一个后变成引用 chip。
|
|
369
|
+
6. 输入 `@` 再输入 `README.md` 之类的名字:菜单仍是原有的本地文件/文件夹/对话,没有被远程条目污染。
|
|
370
|
+
7. 输入 `@@/shared_data_ssd1/huangjh` 或 `@code/projects_wpf`:菜单出现「按地址链接」分组,选中该地址即插入引用。
|
|
371
|
+
8. 右键任一文件或文件夹:
|
|
372
|
+
- 「复制绝对地址」→ 得到完整路径(远端形如 `/shared_data_ssd1/huangjh/code/a.txt`,本地形如 `D:\…\a.txt`);
|
|
373
|
+
- 「复制相对地址」→ 左树得到相对**本地根**的路径(如 `code/a.txt`),右树得到相对**远端根**的路径;
|
|
374
|
+
- 提示条会显示实际复制的内容,两者都不带 `@`。
|
|
375
|
+
|
|
376
|
+
9. 预览模式下把 Markdown 滚到中间,切到另一个文件再切回:仍是预览,且停在原处。
|
|
377
|
+
10. 在一个工作区里打开几个文件标签、展开两棵树的几个目录,切到另一个工作区的会话再切回:
|
|
378
|
+
标签页与树的展开状态都还在,目录树不会重新从根加载。
|
|
379
|
+
|
|
380
|
+
11. 本地树右键一个文件或目录:有「推送到远端」;远端树右键同一项:没有这一项。
|
|
381
|
+
12. 端口转发开一条隧道(例如远端 TensorBoard 的 `127.0.0.1:6006` → 本机 16006),浏览器能打开;随后**完全退出并重启 DSH**,再进设置:这条隧道仍在列表里、端口没变、点「打开」还能用(0.25.0)。
|
|
382
|
+
13. 上一步之后点「停止」→ 重启 DSH,列表里不再出现该隧道(0.25.0:停止会删掉 `forwards.json` 里的记录,只有它会删)。
|
|
383
|
+
|
|
384
|
+
## 主题与设置页(0.25.0)
|
|
385
|
+
|
|
386
|
+
1. 打开「设置 → 联动工作区」(桌面端)或在浏览器里打开「联动工作区设置」标签(目录工具栏的齿轮按钮 / 「+」菜单):两者应显示同一份页面,`详细` 内容一致。
|
|
387
|
+
2. 「指定主题」标题右侧显示 `12`,网格里应有 GitHub、Solarized、One Dark / Light、Dracula、Monokai、Nord、VS Code Dark+ / Light+、Xcode Light / Dark、Catppuccin Latte / Mocha、**Tokyo Night**、**Gruvbox**、**Ayu** 共 12 张卡片;每张卡片上半是浅色条、下半是深色条,右侧四个色点分别是关键字/字符串/函数名/注释色;当前选中的那张右上角有 ✓。
|
|
388
|
+
3. 点 Tokyo Night / Gruvbox / Ayu 各一次:应提示「主题已保存」,编辑器(打开任意远端文件)配色随之改变;刷新页面后仍是选中的那一套。
|
|
389
|
+
4. 浏览器(`http://127.0.0.1:<port>/?token=…`)里点目录工具栏的齿轮:应打开「联动工作区设置」标签并完整渲染整页(含工作区卡片、端口转发表单),不再提示找不到设置入口。
|
|
390
|
+
5. 设置标签页与桌面端设置对话框同时改动同一项(例如显示模式)后,另一边刷新一次应看到相同结果。
|
|
391
|
+
|
|
392
|
+
## 右键菜单(0.25.0)
|
|
393
|
+
|
|
394
|
+
1. 在高度吃紧的窗口里右键靠下的行(例如窗口 800px 高时右键第 18 行):菜单整体上翻到光标上方、最下面的「更改权限」「属性」都点得到;若上下空间都不够,菜单自身出现滚动条而不是被窗口裁掉。
|
|
395
|
+
|