dsh-linked-workspace 0.8.3 → 0.9.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 +17 -0
- package/README.en.md +17 -0
- package/README.md +17 -0
- package/docs/API.md +6 -2
- package/docs/VERIFY.md +14 -0
- package/lib/client.js +576 -28
- package/lib/index.js +254 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0 — 2026-11-12
|
|
4
|
+
|
|
5
|
+
Third review round: in-editor editing, local/remote comparison and drag-and-drop, plus refresh behaviour.
|
|
6
|
+
|
|
7
|
+
- **Find and replace (feature)**: `Ctrl/Cmd + F` opens an in-editor 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+` when more exist; replace-all still edits the whole document (6000 replacements verified).
|
|
8
|
+
- **Terminal in a directory (feature)**: the tree context menu gains “Open terminal here” for folders. `terminal.open` accepts an optional `path`, validated to stay inside the linked workspace, and starts the shell in that directory (verified with a real `ssh -t … "cd <dir> && exec bash -l"` process).
|
|
9
|
+
- **Filter in the path pickers (feature)**: the local and remote directory pickers filter already-loaded entries while typing, with an empty-state hint.
|
|
10
|
+
- **Local/remote comparison (feature)**: `fs.compare` compares a remote directory with its local counterpart and returns 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 `truncated` flag. The dialog lists the three groups; clicking a row opens it.
|
|
11
|
+
- **Multi-select and batch actions (feature)**: Ctrl/Cmd-click toggles a row, Shift-click extends the selection; the context menu offers “Transfer selected (N)” and “Delete selected (N)” with a confirmation dialog, and per-item errors are aggregated (a file deleted outside the app reports “path does not exist” while the others are removed).
|
|
12
|
+
- **Drag and drop (feature)**: drag rows between the local and remote trees (a remote file is copied through `fs.pullToLocal`, a local file through `fs.upload`), and drop OS files onto either tree (`fs.upload` / `local.import`; up to 50 files, 64 MB each). If the browser hides file paths, or a remote folder is dropped onto the local tree, a notice explains the limitation instead of failing silently.
|
|
13
|
+
- **Refresh throttling**: the 4-second tick now refreshes each directory at most every 15 seconds and pauses while the page is hidden (measured intervals 18–19 s), so a large tree no longer re-lists on every tick.
|
|
14
|
+
- **Unsaved-changes guard**: a dirty editor registers `beforeunload`, so reloading or closing the window asks for confirmation.
|
|
15
|
+
- **Refresh keeps loaded rows**: a silent refresh merges the first page with already-loaded rows instead of truncating back to 500 (or 5000); a 5500-entry directory stayed at 5522 rendered rows across refresh cycles.
|
|
16
|
+
- **Search truncation**: results over the 200-row cap now show “showing the first 200 matches” instead of dropping the flag.
|
|
17
|
+
- **Load-more and counter fixes**: “Load more (0 left)” disappears once everything is loaded; the find counter reports `5000+` instead of pretending the document has exactly 5000 matches.
|
|
18
|
+
- Review note: two previously reported issues (no context menu in the right-sidebar tree, hidden-file toggle not refreshing expanded folders) were re-tested and could not be reproduced; neither was changed.
|
|
19
|
+
|
|
3
20
|
## 0.8.3 — 2026-11-11
|
|
4
21
|
|
|
5
22
|
Second review round: follow-ups to the 0.8.2 paging and preview work.
|
package/README.en.md
CHANGED
|
@@ -119,6 +119,23 @@ Old “Remote directories” tabs are restored after refresh through hidden lega
|
|
|
119
119
|
|
|
120
120
|
See [CHANGELOG.md](CHANGELOG.md) for the full version history.
|
|
121
121
|
|
|
122
|
+
### 0.9.0
|
|
123
|
+
|
|
124
|
+
In-editor find/replace, local↔remote comparison, multi-select and drag-and-drop, plus refresh fixes (third review round):
|
|
125
|
+
|
|
126
|
+
- **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).
|
|
127
|
+
- **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).
|
|
128
|
+
- **Picker filtering**: the local and remote directory pickers filter already-loaded entries as you type, with an empty-state hint.
|
|
129
|
+
- **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.
|
|
130
|
+
- **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.
|
|
131
|
+
- **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.
|
|
132
|
+
- **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.
|
|
133
|
+
- **Unsaved-changes guard**: a dirty editor registers `beforeunload`, so reloading or closing the window asks for confirmation.
|
|
134
|
+
- **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.
|
|
135
|
+
- **Search truncation**: more than 200 matches now shows “showing the first 200 matches” instead of dropping the flag.
|
|
136
|
+
- **Load-more and counter fixes**: “Load more (0 left)” disappears when everything is loaded; the find counter reports `5000+` when the limit is hit.
|
|
137
|
+
- 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.
|
|
138
|
+
|
|
122
139
|
### 0.8.3
|
|
123
140
|
|
|
124
141
|
Follow-up fixes to the 0.8.2 paging and preview work (second review round):
|
package/README.md
CHANGED
|
@@ -114,6 +114,23 @@ dsh plugin --profile "$DSH_PROFILE" add "file:$PWD/dsh-linked-workspace"
|
|
|
114
114
|
|
|
115
115
|
已打开的旧右侧栏「远程目录」标签页会在刷新后自动恢复(插件保留了两个隐藏的旧 tab 类型别名),标签标题也会自动改成「联动工作区目录」,新开的标签使用新的 `dsh-linked-workspace` 类型。
|
|
116
116
|
|
|
117
|
+
### 0.9.0 变化
|
|
118
|
+
|
|
119
|
+
编辑器内查找替换、本地⇄远端对比、多选与拖拽,以及刷新行为修复(第三轮评审):
|
|
120
|
+
|
|
121
|
+
- **编辑器查找/替换**:`Ctrl/Cmd + F` 打开查找条,支持区分大小写、上一个/下一个、命中计数、替换与全部替换;命中超过 5000 处时计数显示 `5000+`,全部替换仍作用于全文(实测 6000 处全部替换)。
|
|
122
|
+
- **在目录处打开终端**:目录右键菜单新增「在此打开终端」;`terminal.open` 支持 `path` 参数(校验必须在该联动工作区内),直接在该目录启动 shell(实测为 `ssh -t … "cd <目录> && exec bash -l"`)。
|
|
123
|
+
- **路径选择器过滤**:本地/远端目录选择器支持输入过滤已加载条目,无匹配时给出提示。
|
|
124
|
+
- **本地与远端对比**:新增 `fs.compare`,返回「仅本地 / 仅远端 / 大小或时间不同(mtime 差 >2 秒)」三组,单次最多 4000 个文件、深度 12、每组最多 200 行并带 `truncated` 标记;对话框按组列出,点行可直接打开。
|
|
125
|
+
- **树多选与批量操作**:Ctrl/Cmd 点击切换选中、Shift 点击追加;右键菜单出现「传输所选的 N 项」「删除所选的 N 项」并弹确认框,逐项失败会聚合提示(外部已删除的文件会报「路径不存在」,其余照常删除)。
|
|
126
|
+
- **拖拽**:可在本地/远端两棵树之间拖动文件(远端文件走 `fs.pullToLocal`,本地文件走 `fs.upload`),也可把系统文件拖进任一树(`fs.upload` / `local.import`,最多 50 个、单个 64 MB)。浏览器不暴露文件路径、或把远端目录拖到本地树时会给出明确提示,不再静默失败。
|
|
127
|
+
- **刷新节流**:4 秒定时器改为每个目录最多 15 秒刷新一次,页面隐藏时暂停(实测间隔 18–19 秒),大目录不再每个 tick 都重列。
|
|
128
|
+
- **未保存拦截**:有未保存改动时注册 `beforeunload`,刷新/关闭窗口会弹确认。
|
|
129
|
+
- **刷新保留已加载行**:静默刷新把第一页与已加载行合并,不再截回 500(或 5000);5500 项目录在多个刷新周期后仍保持 5522 行。
|
|
130
|
+
- **搜索截断提示**:超过 200 条时显示「结果过多,仅显示前 200 条」。
|
|
131
|
+
- **加载更多与计数修正**:全部加载后「加载更多(剩余 0 项)」不再残留;查找计数满 5000 时显示 `5000+`,不再假装全文只有 5000 处。
|
|
132
|
+
- 复核说明:上一轮报告的两项(右侧栏树无右键菜单、切换隐藏文件后不刷新)复测未能复现,本轮未改动。
|
|
133
|
+
|
|
117
134
|
### 0.8.3 变化
|
|
118
135
|
|
|
119
136
|
针对 0.8.2 分页与预览的后续修复(第二轮评审):
|
package/docs/API.md
CHANGED
|
@@ -81,14 +81,17 @@ relative to the scope root, or absolute inside it.
|
|
|
81
81
|
| `linked.syncCancel` | `{ id }` | `{ cancelled: boolean }` |
|
|
82
82
|
| `local.list` | `{ path, limit?, offset? }` | `{ path, entries: [{ name, path, type, size, mtime }], total, offset, limit, hasMore }` |
|
|
83
83
|
| `local.openExternal` | `{ path }` | `{ opened, path }` |
|
|
84
|
-
| `terminal.open` | `{ workspaceId?/linkedId?, side: 'remote'\|'local' }` | `{ opened, side, path, host? }` |
|
|
84
|
+
| `terminal.open` | `{ workspaceId?/linkedId?, side: 'remote'\|'local', path? }` | `{ opened, side, path, host? }` (`path` must stay inside the linked workspace) |
|
|
85
85
|
| `fs.openExternal` | `{ workspaceId?/linkedId?, path }` | `{ opened, localPath, size }` |
|
|
86
86
|
| `localWorkspace.create` | `{ path, name? }` | `{ workspaceId, title, path }` |
|
|
87
87
|
| `session.info` | `{ sessionId }` | `{ sessionId, cwd, running }` |
|
|
88
88
|
| `skills.list` | `{ linkedId }` | `{ localPath, skills: [{ name, description, whenToUse, path, source }] }` |
|
|
89
89
|
| `skills.read` | `{ linkedId, name }` | `{ name, description, content, path }` |
|
|
90
90
|
| `git.status` | `{ workspaceId?/linkedId?, side: 'remote'|'local' }` | `{ ok, repo, root, branch, changes, error? }` |
|
|
91
|
-
| `fs.search` | `{ workspaceId?/linkedId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` |
|
|
91
|
+
| `fs.search` | `{ workspaceId?/linkedId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` (matches file names, not contents) |
|
|
92
|
+
| `fs.compare` | `{ workspaceId?/linkedId?, path? }` | `{ path, relative, localPath, localMissing, counts: { onlyLocal, onlyRemote, changed, same }, onlyLocal, onlyRemote, changed, truncated }` (linked workspaces only; excludes `.git`, `node_modules`, `.local`, `.remote`; max 4000 files, depth 12, 200 rows per group) |
|
|
93
|
+
| `fs.pullToLocal` | `{ workspaceId?/linkedId?, path, targetDir? }` | `{ path, relative, size, mtime }` (single file, ≤64 MB; `targetDir` must stay inside the local root) |
|
|
94
|
+
| `fs.upload` | `{ workspaceId?/linkedId?, path, paths }` | `{ side: 'remote', target, files, bytes, skipped }` (≤50 local files, 64 MB each) |
|
|
92
95
|
| `fs.transfer` | `{ workspaceId?/linkedId?, path }` | `{ files, bytes, skipped, truncated, dest }` |
|
|
93
96
|
| `fs.download` | `{ workspaceId?/linkedId?, path }` | `{ path, files, bytes, skipped, truncated }` |
|
|
94
97
|
| `fs.edit` | `{ workspaceId?/linkedId?, path, app? }` | `{ localPath, size }` (opens Notepad/default app) |
|
|
@@ -98,6 +101,7 @@ relative to the scope root, or absolute inside it.
|
|
|
98
101
|
| `local.media` | `{ path }` | `{ path, size, mtime, mime, base64 }` (max 24 MB) |
|
|
99
102
|
| `local.write` | `{ path, content, expectedMtime? }` | `{ path, size, mtime }` |
|
|
100
103
|
| `local.stat` | `{ path }` | `{ path, type, size, mtime, mode }` |
|
|
104
|
+
| `local.import` | `{ dir, paths }` | `{ dir, copied, skipped }` (copies OS files into `dir`, ≤50 files, 64 MB each) |
|
|
101
105
|
| `local.rename` | `{ from, to }` | `{ path }` |
|
|
102
106
|
| `local.move` | `{ path, targetDir?, root? }` | `{ path, type }` (same local tree; collision → 409) |
|
|
103
107
|
| `local.delete` | `{ path, root? }` | `{}` (recursive) |
|
package/docs/VERIFY.md
CHANGED
|
@@ -156,3 +156,17 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
|
|
|
156
156
|
6. **复制失败清理(开发核验)**:复制一个内含 >64 MB 文件的目录:应报错且目标目录不留半成品(可用 `git status` 之外的目录列表确认)。
|
|
157
157
|
7. **导出 PDF 上限(开发核验)**:同目录放 999 个同名 `<name>.pdf` 后再次导出同名的 Markdown:应提示「同名 PDF 过多,请先清理目录中的旧导出」,不进入无限循环。
|
|
158
158
|
8. **host-api 套件**:在有 SSH 主机与 DSH 运行时 Node 的机器上跑 `node test/host-api.mjs`(本机系统 Node 24.13 删除中日韩字符目录会崩溃,用 DSH 自带 Electron Node 执行):应为 28 步全部通过。
|
|
159
|
+
|
|
160
|
+
## 编辑、对比与拖拽(0.9.0)
|
|
161
|
+
|
|
162
|
+
1. **查找/替换**:打开一个含 6000 处 `beta` 的文本文件,`Ctrl/Cmd + F` 输入 `beta`:计数应显示 `第 1 / 5000+ 个`;把替换框填成 `gamma` 点「全部替换」,正文应替换全部 6000 处(不只是 5000 处),保存后文件内容一致。
|
|
163
|
+
2. **在此打开终端**:右键远端子目录 →「在此打开终端」:应弹提示「已打开终端」,并出现一个 `ssh -t … "cd <该目录> && exec bash -l"` 的终端窗口(开发核验:`Get-Process ssh | Select-Object CommandLine`)。
|
|
164
|
+
3. **本地与远端对比**:让远端目录只多一个文件、本地只多一个文件、同名的两个文件大小不同;右键远端目录 →「与本地对比…」:三组计数应为 1/1/1,点某一行可直接打开对应文件。
|
|
165
|
+
4. **多选与批量删除**:Ctrl+点击选中 3 个文件后,先在外部删掉其中 1 个,再「删除所选的 3 项」并确认:其余 2 个应删除成功,提示汇总出现「路径不存在」。
|
|
166
|
+
5. **拖拽(浏览器分支)**:从系统文件管理器把文件拖到树行:Web 端应提示「当前浏览器无法读取被拖入文件的路径,请在 DSH 桌面窗口中拖拽」,不产生半成品文件。
|
|
167
|
+
6. **拖拽(桌面分支)**:在 DSH 桌面窗口把文件拖到本地/远端目录行:应提示「已导入 1 个文件」,文件出现在目标目录且大小一致。
|
|
168
|
+
7. **刷新节流**:展开一个 >500 项的目录,用开发者工具记录 `local.list` 请求:相邻刷新间隔应 ≥15 秒(实测 18–19 秒),切到后台标签页后不再刷新。
|
|
169
|
+
8. **未保存拦截**:修改文件但不保存,刷新页面:浏览器应弹出离开确认;取消后编辑内容仍在。
|
|
170
|
+
9. **分页按钮**:把 >500 项的目录加载到底:`.rw-load-more` 按钮应消失,不再显示「剩余 0 项」。
|
|
171
|
+
10. **搜索截断**:在目录中放 250 个文件名含 `needle` 的文件后搜索:结果顶部应提示「结果过多,仅显示前 200 条;请输入更精确的关键词」。
|
|
172
|
+
11. **注意**:搜索按**文件名**匹配(不是内容),界面占位符「在文件中搜索…」为既有文案问题,已列入下一轮缺陷候选。
|