@zhangfengshun/dsh-remote-ssh 2.4.11 → 2.4.12

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
@@ -2,6 +2,11 @@
2
2
 
3
3
  本文件的版本号与 `package.json` 的 `version` 保持一致。每个版本对应一个 Cordis Package 快照(`pkg-N`)。
4
4
 
5
+ ## [2.4.12] — 公开产物脱敏(无功能改动)
6
+ ### 变更
7
+ - **移除文档、代码注释与测试夹具中的真实标识**:此前 CHANGELOG / README / 代码注释 / issue 回复里出现了真实的项目名、HPC 主机名、内网 IP、真实远程路径与镜像目录 ID。现已全部替换为通用占位符(`proj-a` / `my-project` / `project-b`、`~/proj`、`hpc-a.example.com`、`192.0.2.10`(TEST-NET-1 文档网段)、`wmirror1`…、`solver`),并在 `MAINTENANCE.md` 写入硬规则:**公开产物一律用占位符**,发布前跑一次私有标识扫描。README 七夕段落里刻意保留的署名不受影响。
8
+ - **本版不含任何功能改动**:与 2.4.11 的代码逐字相同,仅为让 npm 上的 `latest` 产物不再包含上述标识(2.4.11 的 tarball 因 npm 撤回策略限制无法删除,见 `MAINTENANCE.md`)。
9
+
5
10
  ## [2.4.11] — `fs.search` 返回契约对齐 better-sidebar:补上 `matches`(issue #13)
6
11
  ### 修复
7
12
  - **「文件」页签的「按文件名搜索」不再崩掉整块页签**(感谢 @Linhaojing 的契约考古与最小复现):better-sidebar 客户端契约是 `{ matches: string[], truncated }`(其注释原文:*matches are cwd-relative '/'-separated paths*,自 v0.13.0 引入搜索框起未变),并在渲染阶段直接读 `results.matches.length` / `results.matches.map(rel => …)`;而本插件的 `fs.search` 拦截只返回 `{ entries: [{path,isDir}], truncated }`,于是 `undefined.length` 抛 TypeError 被 `RenderBoundary` 兜住 → 整个页签变成错误条、搜索框与文件树一起消失。因为拦截是**无条件**的(不区分远程/本地会话),**本地工作区同样复现**,与 better-sidebar 版本无关。
@@ -9,14 +14,14 @@
9
14
  - 本地分支:`matches` 由 `toPosixRelative(sessionCwd, entry.path)` 从绝对路径裁剪而来(Windows 盘符路径大小写不敏感、POSIX 保持大小写敏感、前缀相近的非子路径不误裁、非 ASCII 安全);
10
15
  - **附带修复远程分支的路径 bug**:`remoteGlob` 的 `files` 是 `find` 以命令行起点拼出的**远端绝对路径**,此前却用 `join(mirrorBase, f)` 拼成了畸形镜像路径(如 `<镜像根>/home/user/proj/src/a.jl`),远程搜索结果的路径本来就是错的;现在 `remoteGlob` 新增 `opts.relative`(`-printf '%P\n'`)取相对路径,`entries` 再据此拼镜像绝对路径(`remote_ssh_glob` 工具仍走默认的 `%p`,行为不变)。
11
16
  - README 兼容性表中原先笼统的 `fs.tree/read/write/search(4 端点契约)` 一行,已改为显式写明 `fs.search` 的 `{ matches, truncated }` 契约。
12
- - **远程工作区的搜索不再一直「加载中…」**(同 issue 的实测跟进:崩溃修好后,在真实 OpenFOAM 工作区里搜索变成永久 loading)。旧命令有两个致命点:① `… | sort | head -n 500` 里的 `sort` 会缓冲**全部** `find` 输出后才吐第一行,`head` 的提前短路完全失效;② 没有深度/时间约束,而 `find` 是深度优先——巨型子目录(`processor*` / 数据目录)会吃光预算,连顶层文件都轮不到。实测该工作区:**旧命令 5 分钟零输出**(还占住池化 SSH 会话,把文件树/读写一起拖住)。现在:
17
+ - **远程工作区的搜索不再一直「加载中…」**(同 issue 的实测跟进:崩溃修好后,在真实的大型远程项目工作区里搜索变成永久 loading)。旧命令有两个致命点:① `… | sort | head -n 500` 里的 `sort` 会缓冲**全部** `find` 输出后才吐第一行,`head` 的提前短路完全失效;② 没有深度/时间约束,而 `find` 是深度优先——巨型子目录(`processor*` / 数据目录)会吃光预算,连顶层文件都轮不到。实测该工作区:**旧命令 5 分钟零输出**(还占住池化 SSH 会话,把文件树/读写一起拖住)。现在:
13
18
  - **浅层优先 + 有结果即返回**:第一趟 `-maxdepth 3`(3s 预算,实测冷 0.68s / 热 0.11s)——**只要有命中就立刻返回**,深挖转**后台预热缓存**(同一 query 的后续请求会拿到更全的结果);只有浅层**一无所获**时才同步等深挖趟(`-maxdepth 8`,5s 预算,实测会吃满)。此前条件是「浅层命中 < 200 就同步深挖」,而文件名片段极少命中 200 个 → 几乎每次查询都要多等一趟 ≤5s 的深挖(用户实测反馈「有点慢」),现已消除;两趟结果合并去重后本地排序(不再需要远端 `sort`)。实测同一工作区:**浅层 0.96s 返回 43 条命中**(旧命令 5 分钟 0 条);
14
19
  - **遍历前剪噪声目录**:`REMOTE_SEARCH_SKIP_DIRS` = 本插件索引排除表 ∪ 上游 `SEARCH_SKIP_DIRS`(`.git` / `node_modules` / `dist` / `.next` / `.pnpm-store` / `.turbo` / …);
15
20
  - **远端墙钟预算**:`timeout`(macOS 回退 `gtimeout`,都没有则退回无预算版本由 SSH 层兜底)到点杀掉 `find`,并把**已收集到的部分结果**照常返回 + `truncated: true`——宁可给部分结果,也不让 UI 无限转圈;
16
21
  - **命中上限 200**(与上游 `DEFAULT_MAX_MATCHES` 一致)、**SSH 层 15s 超时**(不再占用池化会话 120s)、**同 query 30s 短缓存 + 并发合并**(连打键盘不会堆起一串 `find`),缓存挂 `cacheEpoch`(写/exec 后自动失效)。
17
- - **`@文件名` 在某些远程项目里完全没有候选**(用户实测反馈:同一台机器上 DFS-Dev 正常、另一个项目全空;而单独输入 `@` 正常——因为 `@` 走目录列举、模糊查询走索引)。根因:索引在 git 仓库里首选 `git ls-files --cached --others --exclude-standard`,而 `--others` 需要**遍历整棵工作树**枚举未跟踪文件,在巨型项目上根本跑不完(实测该目录 **10s 被超时杀掉、零输出**;`git ls-files --cached` 反而只要 0.085s 且为 0 条——仓库里没有任何已跟踪文件)→ 20s 构建预算内拿不到条目 → 索引为空。现在三级降级,每级都有墙钟预算:
22
+ - **`@文件名` 在某些远程项目里完全没有候选**(用户实测反馈:同一台机器上两个远程项目对照:一个正常、另一个全空;而单独输入 `@` 正常——因为 `@` 走目录列举、模糊查询走索引)。根因:索引在 git 仓库里首选 `git ls-files --cached --others --exclude-standard`,而 `--others` 需要**遍历整棵工作树**枚举未跟踪文件,在巨型项目上根本跑不完(实测该目录 **10s 被超时杀掉、零输出**;`git ls-files --cached` 反而只要 0.085s 且为 0 条——仓库里没有任何已跟踪文件)→ 20s 构建预算内拿不到条目 → 索引为空。现在三级降级,每级都有墙钟预算:
18
23
  - ① 完整 git(6s)→ ② 仅索引 git(3s,恒定快)→ ③ 有界 `find`(`maxdepth 3` + 5s;原为 `maxdepth 5` 且无预算,实测该目录 5 层遍历 >180s 都跑不完);
19
- - 实测同一项目:新命令 **921 条 / 6.68s**(其中 916 条含 `kOmega`、`node_modules` 零残留),三级合计 ≤14s < 20s 构建预算;
24
+ - 实测同一项目:新命令 **921 条 / 6.68s**(其中 916 条含 `solver`、`node_modules` 零残留),三级合计 ≤14s < 20s 构建预算;
20
25
  - **另外加了即时兜底**:模糊查询在索引尚未就绪(大仓库要 6.7s 才建好,而单次查询只等 900ms)时,**不再直接返回空列表**,而是用与侧栏搜索同一套有界 find(剪噪声 + 无 `sort` + `maxdepth 3` + 5s 预算,实测 **0.65s**)立刻给出候选;索引建好后自动切换到更全的索引结果。
21
26
 
22
27
  ### 测试
@@ -37,7 +42,7 @@
37
42
 
38
43
  ## [2.4.9] — 「添加工作区」目录选择器支持新建目录(issue #11)
39
44
  ### 新增
40
- - **「添加工作区」弹窗的目录选择器新增「新建目录」**(感谢 @Linhaojing 的定位与接线建议):此前本地 / 远程两个 tab 都只有「打开 / 上级 / 选择此目录」,要把**尚不存在**的目录加为工作区(例如远端起新项目 `~/lhj/new-project`)必须先跳出 DSH 用别的终端 `mkdir`。现在底部操作区多一个「📁 新建目录」按钮:点开输入行 → 填名字(回车即提交)→ 在当前 `path` 下创建 → **自动进入新目录**,紧接着点「选择此目录」即可成为工作区,全程不离开 DSH(对齐 VSCode「新建文件夹」的交互预期)。
45
+ - **「添加工作区」弹窗的目录选择器新增「新建目录」**(感谢 @Linhaojing 的定位与接线建议):此前本地 / 远程两个 tab 都只有「打开 / 上级 / 选择此目录」,要把**尚不存在**的目录加为工作区(例如远端起新项目 `~/work/new-project`)必须先跳出 DSH 用别的终端 `mkdir`。现在底部操作区多一个「📁 新建目录」按钮:点开输入行 → 填名字(回车即提交)→ 在当前 `path` 下创建 → **自动进入新目录**,紧接着点「选择此目录」即可成为工作区,全程不离开 DSH(对齐 VSCode「新建文件夹」的交互预期)。
41
46
  - **两个 tab 都支持**:远程走既有 `api("mkdir")`(`mkdir -p` + 缓存失效,与远程资源管理器的「新建目录」同一条已验证链路);本地新增宿主 API `mkdirLocal`(`fs.mkdir(recursive)`),补齐此前本地侧完全没有入口的缺口;
42
47
  - **名字校验**:只接受单个路径段——空名、`.`、`..`、含 `/` 或 `\` 一律拦截并给出中英文提示(避免「在 path 下新建」变成任意位置写入);
43
48
  - **路径拼接**:`joinChild()` 沿用基路径的分隔符(POSIX `/`、Windows `\`,含 `C:\` 根与 `~` 前缀),不改变远端路径语义;
@@ -72,7 +77,7 @@
72
77
 
73
78
  ## [2.4.6] — 「文件」页签树根显示远程目录名(issue #9)
74
79
  ### 修复
75
- - **树根标签不再显示本地镜像目录 ID**(感谢 @Linhaojing 的链路定位):better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename,于是显示成 `wmu3sxe24jpvg` 之类的镜像目录名。这条链路**不经过任何 `fs.*` 路由**,且 Host 侧 `session.cwd` 虽已返回 `root` 字段但客户端只消费 `cwd`(`api.sessionCwd(...).then(r => setFetchedCwd(r.cwd))`,另有 `useSessionCwd` 直接读客户端会话列表的 `cwd`),因此只能在渲染层替换文本。现由客户端取 `listWorkspaces` 的 `mirrorPath`/`remotePath` 建立「镜像 basename → 远程 basename」映射,把树根那一行换成**远程目录名**(如 `IB_Robot`),并给该行加 `title` 显示完整远程路径(如 `~/lhj/IB_Robot`)。
80
+ - **树根标签不再显示本地镜像目录 ID**(感谢 @Linhaojing 的链路定位):better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename,于是显示成 `wmirror3` 之类的镜像目录名。这条链路**不经过任何 `fs.*` 路由**,且 Host 侧 `session.cwd` 虽已返回 `root` 字段但客户端只消费 `cwd`(`api.sessionCwd(...).then(r => setFetchedCwd(r.cwd))`,另有 `useSessionCwd` 直接读客户端会话列表的 `cwd`),因此只能在渲染层替换文本。现由客户端取 `listWorkspaces` 的 `mirrorPath`/`remotePath` 建立「镜像 basename → 远程 basename」映射,把树根那一行换成**远程目录名**(如 `my-project`),并给该行加 `title` 显示完整远程路径(如 `~/work/my-project`)。
76
81
  - **定位不依赖构建期哈希类名**:根行是树里唯一带内联 `padding-left:6px` 的行,仅当该行内纯文本节点恰好等于某远程工作区的镜像 basename 时才替换——同名子条目、本地工作区、无根行标志(上游改版)时一律保守不动;
77
82
  - **同步替换 + 幂等自愈**:与设置导航图标同样在 MutationObserver 回调(微任务、绘制前)内完成,不会先闪一下镜像 ID;React 重渲染还原文本时由 1s 复检与 30s 工作区轮询恢复。
78
83
 
@@ -206,7 +211,7 @@
206
211
 
207
212
  ## [2.2.0] — 远程命令连接复用(实测 ≈15× 提速)+ 协议/安全加固
208
213
  ### 性能
209
- - **`remote_ssh_exec` 走持久会话池**:不再每次调用做完整 SSH 握手。真实 HPC(ssh.cn-zhongwei-1.paracloud.com,2222 端口)实测:一次性连接单命令平均 **1292ms**,连接复用后单命令平均 **84.3ms**,**约 15.3× 提速**;`stdin` 参数经 heredoc 走同一条复用通道。
214
+ - **`remote_ssh_exec` 走持久会话池**:不再每次调用做完整 SSH 握手。真实 HPC(ssh.hpc-a.example.com,2222 端口)实测:一次性连接单命令平均 **1292ms**,连接复用后单命令平均 **84.3ms**,**约 15.3× 提速**;`stdin` 参数经 heredoc 走同一条复用通道。
210
215
  - **stderr/stdout 分离语义保留**:stderr 重定向到远端临时文件、退出码哨兵后 cat 回传并以第二个哨兵收尾(双哨兵协议)。
211
216
  - **读路径保持轻量**:`ls`/`cat`/`grep`/`glob` 继续走 `2>&1` 合并协议,热路径避开子 shell 与临时文件开销。
212
217
  - **大文件读取先 stat**:超过 4MB 只读前 4MB(`head -c` 截断并标记 truncated),不再让持久会话缓冲无限增长。
@@ -241,11 +246,11 @@
241
246
 
242
247
  ## [2.1.4] — 修复远程工作区标题卡在镜像目录名
243
248
  ### 修复
244
- - `workspaceRegistry.create` 只对新建记录应用 title,旧工作区(早期版本未传 title)标题卡在镜像目录名(如 `wmt3tev5cdfge`)。创建时显式 `setTitle`,并新增启动自愈 `healWorkspaceTitles`(仅在标题等于镜像目录 basename 时修复,不覆盖用户自定义标题)。
249
+ - `workspaceRegistry.create` 只对新建记录应用 title,旧工作区(早期版本未传 title)标题卡在镜像目录名(如 `wmirror1`)。创建时显式 `setTitle`,并新增启动自愈 `healWorkspaceTitles`(仅在标题等于镜像目录 basename 时修复,不覆盖用户自定义标题)。
245
250
 
246
251
  ## [2.1.3] — 远程工作区标题默认取远程路径最后一段
247
252
  ### 改进
248
- - 创建远程工作区时的默认标题改为远程路径最后一段目录名(如 `~/run/zfs/codex/DSH_Test → DSH_Test`),取不到有效段时回退为 `连接名:远程路径`;原生工作区标题带 🌐 前缀。
253
+ - 创建远程工作区时的默认标题改为远程路径最后一段目录名(如 `~/proj/DSH_Test → DSH_Test`),取不到有效段时回退为 `连接名:远程路径`;原生工作区标题带 🌐 前缀。
249
254
 
250
255
  ## [2.1.2] — 修复 ssh config RemoteForward 端口占用导致连接失败
251
256
  ### 修复
package/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
  **一条命令安装**(无需 token、API Key 或额外配置):
47
47
 
48
48
  ```bash
49
- dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@2.4.11
49
+ dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@2.4.12
50
50
  ```
51
51
 
52
52
  安装后**重启 DSH**。`@zhangfengshun/dsh-remote-ssh` 必须在 bundles 列表中排在 `dsh-better-sidebar` **之后**。
@@ -198,13 +198,13 @@ dsh plugin --profile <name> remove @zhangfengshun/dsh-remote-ssh
198
198
  | 侧边栏文件页签显示「这类内容还没有可用的查看方式。」 | `dsh-better-sidebar` 主机半边未加载:0.18.1 / 0.19.0 / 0.19.1 在 DSH Desktop 上会因 `SessionLogOffset` 运行时导入失败——降到 0.18.0 或使用修复版(上游 PR [#641](https://github.com/omdsh-dev/DSH-better-sidebar/pull/641)) |
199
199
  | 内置「终端」页签连不上 | 终端为 `ssh -tt` 交互式通道,**仅支持密钥认证**;密码认证的连接会回退为本地 shell 并打印一行提示(避免把本地 shell 误认为已连上远程),密码认证请改用「文件」页签与模型工具 |
200
200
  | 终端落在远程 `$HOME` 而不是工作区目录 | 2.4.5 起已修复(wrapper 会 `cd` 到工作区 `remotePath`,目录不存在时回退 `$HOME`);若仍停在 `$HOME`,确认 2.4.5 已装入并重启 DSH |
201
- | 「文件」页签树根显示镜像目录 ID(如 `wmu3sxe24jpvg`) | 2.4.6 起已修复:树根改为显示**远程目录名**(如 `IB_Robot`),悬停可见完整远程路径;该标签不经过 `fs.*` 路由,由客户端渲染层替换 |
201
+ | 「文件」页签树根显示镜像目录 ID(如 `wmirror3`) | 2.4.6 起已修复:树根改为显示**远程目录名**(如 `my-project`),悬停可见完整远程路径;该标签不经过 `fs.*` 路由,由客户端渲染层替换 |
202
202
  | `@` 补全只搜到镜像里那几个文件 | 2.4.7 起已修复:远程工作区会话的 `@` 补全改列远端文件(索引缓存 60s + 900ms 查询预算);若仍只有镜像文件,确认 2.4.7 已装入并重启 DSH |
203
203
  | 大仓里 `@` 搜不到真实文件(如根目录 `AGENTS.md`、`src/**`) | 2.4.8 起已修复:此前排除目录发生在截断之后,`node_modules/` 这类目录会吃光索引配额;现在排除由远端 `grep`/`-prune` 在截断前完成,并会在索引达上限时打 warn 提示 |
204
204
  | 想加的远程目录还不存在,「添加工作区」里没法创建 | 2.4.9 起「目录选择器」底部有「📁 新建目录」(本地 / 远程 tab 均有):输入名字即可就地创建并自动进入 |
205
205
  | 从局域网 / 另一台设备访问时插件文件能力全部报 403 | 2.4.10 起已修复:信任判定改用宿主 `ctx.webRuntime.trustedHosts`(与 `/api` 网关同源)。把访问地址加进 DSH 信任列表即可:启动时加 `--trusted-host <host[:port]>`(或经配对设备访问);未配置时行为与之前一致(仅本机 loopback) |
206
206
  | 「文件」页签的「按文件名搜索」一输入就报 `Cannot read properties of undefined (reading 'length')` | 2.4.11 起已修复:`fs.search` 拦截此前只返回 `entries`,而 better-sidebar 客户端契约是 `{ matches, truncated }`;现在补上 `matches`(cwd 相对、`/` 分隔,与上游自带实现一致)并保留 `entries` |
207
- | 远程工作区里「按文件名搜索」一直转圈(大工作区) | 2.4.11 起已修复:改为浅层优先(`-maxdepth 3`,实测冷 0.68s / 热 0.11s)且**有命中就立即返回**(深挖转后台预热缓存,浅层零命中才同步等深挖 `-maxdepth 8`),遍历前剪噪声目录、去掉会阻塞短路的 `sort`,并加远端墙钟预算——到点返回**已收集的部分结果**并标记不完整。实测某 OpenFOAM 工作区:旧实现 5 分钟零输出 → 现在 **0.96s 返回 43 条** |
207
+ | 远程工作区里「按文件名搜索」一直转圈(大工作区) | 2.4.11 起已修复:改为浅层优先(`-maxdepth 3`,实测冷 0.68s / 热 0.11s)且**有命中就立即返回**(深挖转后台预热缓存,浅层零命中才同步等深挖 `-maxdepth 8`),遍历前剪噪声目录、去掉会阻塞短路的 `sort`,并加远端墙钟预算——到点返回**已收集的部分结果**并标记不完整。实测某大型远程项目工作区:旧实现 5 分钟零输出 → 现在 **0.96s 返回 43 条** |
208
208
  | 远程会话里 `@文件名` 没有候选,但单独输入 `@` 有 | 2.4.11 起已修复:模糊查询依赖索引,而索引首选 `git ls-files --cached --others`(`--others` 要遍历整棵工作树,巨型项目上跑不完 → 索引为空)。现在三级降级(完整 git 6s → 仅索引 git 3s → 有界 `find` `maxdepth 3` + 5s),并在索引未就绪时用有界 find 即时兜底(实测 0.65s),不再出现「全空」 |
209
209
  | 安装时提示 `minimumReleaseAge` 或「No matching version」(刚发布) | npm 供应链新鲜度策略,等 1–5 分钟后重试即可 |
210
210
  | 命令卡住不返回 | 默认 120s 超时后自动丢弃会话;长时任务用 `timeoutMs: 0`,随时可用 `remote_ssh_kill` 强杀 |
package/README_EN.md CHANGED
@@ -46,7 +46,7 @@ A **DSH** plugin like **VSCode Remote-SSH**: connect to remote HPC / servers via
46
46
  **One command** (no token, API key or extra configuration needed):
47
47
 
48
48
  ```bash
49
- dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@2.4.11
49
+ dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@2.4.12
50
50
  ```
51
51
 
52
52
  **Restart DSH** after installation. `@zhangfengshun/dsh-remote-ssh` must come **after** `dsh-better-sidebar` in the bundles list.
@@ -198,13 +198,13 @@ The plugin never patches DSH sources or injects into the profile dependency tree
198
198
  | Sidebar Files tab says "Nothing here can view this kind of content yet." | `dsh-better-sidebar` host half failed to load: 0.18.1 / 0.19.0 / 0.19.1 hit the `SessionLogOffset` runtime import on DSH Desktop — downgrade to 0.18.0 or use a fixed build (upstream PR [#641](https://github.com/omdsh-dev/DSH-better-sidebar/pull/641)) |
199
199
  | Built-in Terminal tab cannot connect | The terminal is an `ssh -tt` interactive channel and supports **key auth only**; password-auth profiles fall back to a local shell and now print a one-line notice (so a local shell is not mistaken for a remote one) — use the Files tab and the model tools for password auth |
200
200
  | Terminal opens in the remote `$HOME` instead of the workspace directory | Fixed in 2.4.5 (the wrapper `cd`s into the workspace `remotePath`, falling back to `$HOME` when it no longer exists); if it still starts in `$HOME`, make sure 2.4.5 is installed and DSH restarted |
201
- | Files tab tree root shows the mirror directory id (e.g. `wmu3sxe24jpvg`) | Fixed in 2.4.6: the root row now shows the **remote directory name** (e.g. `IB_Robot`) with the full remote path on hover; that label never passes through the `fs.*` routes, so the client renders the replacement |
201
+ | Files tab tree root shows the mirror directory id (e.g. `wmirror3`) | Fixed in 2.4.6: the root row now shows the **remote directory name** (e.g. `my-project`) with the full remote path on hover; that label never passes through the `fs.*` routes, so the client renders the replacement |
202
202
  | `@` completion only finds the few files in the mirror | Fixed in 2.4.7: in a remote-workspace session `@` now lists remote files (60s index cache + 900ms query budget); if only mirror files show up, make sure 2.4.7 is installed and DSH restarted |
203
203
  | In a large repo `@` cannot find real files (e.g. root `AGENTS.md`, `src/**`) | Fixed in 2.4.8: exclusion used to run *after* truncation, so a `node_modules/` tree could exhaust the index quota; exclusion now happens remotely (`grep`/`-prune`) before truncation, and hitting the cap logs a warning |
204
204
  | The remote directory you want does not exist yet and "Add Workspace" cannot create it | Fixed in 2.4.9: the directory picker has a "📁 New folder" button (both tabs) — type a name to create it in place and enter it automatically |
205
205
  | Accessing from the LAN / another device makes every file capability return 403 | Fixed in 2.4.10: the trust fence now reads the host's `ctx.webRuntime.trustedHosts` (same source as the `/api` gateway). Add the address to the DSH trust list — start with `--trusted-host <host[:port]>`, or access through your paired remote-access setup; with nothing configured the behaviour is unchanged (loopback only) |
206
206
  | The Files tab's "search by file name" crashes with `Cannot read properties of undefined (reading 'length')` | Fixed in 2.4.11: the `fs.search` interception returned only `entries`, while better-sidebar's client contract is `{ matches, truncated }`; it now provides `matches` (cwd-relative, `/`-separated, matching upstream's own implementation) and keeps `entries` |
207
- | "Search by file name" spins forever in a remote workspace (large trees) | Fixed in 2.4.11: shallow-first (`-maxdepth 3`, measured 0.68s cold / 0.11s warm) **returning as soon as anything matches** (the deeper pass becomes a background cache warm-up and only runs synchronously when the shallow pass finds nothing), noise directories pruned before traversal, the short-circuit-blocking `sort` removed, and a remote wall-clock budget that returns the **partial results collected so far** and flags them as incomplete. Measured on an OpenFOAM workspace: 5 minutes with zero output before → **43 matches in 0.96s** now |
207
+ | "Search by file name" spins forever in a remote workspace (large trees) | Fixed in 2.4.11: shallow-first (`-maxdepth 3`, measured 0.68s cold / 0.11s warm) **returning as soon as anything matches** (the deeper pass becomes a background cache warm-up and only runs synchronously when the shallow pass finds nothing), noise directories pruned before traversal, the short-circuit-blocking `sort` removed, and a remote wall-clock budget that returns the **partial results collected so far** and flags them as incomplete. Measured on an 大型项目 workspace: 5 minutes with zero output before → **43 matches in 0.96s** now |
208
208
  | In a remote session `@filename` shows no candidates, while a bare `@` works | Fixed in 2.4.11: fuzzy queries rely on the index, and the index preferred `git ls-files --cached --others` (`--others` must walk the whole working tree and never finishes on huge projects → empty index). It now degrades in three budgeted steps (full git 6s → index-only git 3s → bounded `find` `maxdepth 3` + 5s) and falls back to a bounded `find` (measured 0.65s) whenever the index is not ready yet, so candidates are never empty |
209
209
  | Install fails with `minimumReleaseAge` or "No matching version" right after a release | npm supply-chain freshness policy — retry after 1–5 minutes |
210
210
  | A command hangs forever | The 120s timeout discards the pooled session automatically; use `timeoutMs: 0` for long jobs and `remote_ssh_kill` at any time |
package/lib/client.js CHANGED
@@ -1333,7 +1333,7 @@ window.__ModuleLoader__.load({
1333
1333
 
1334
1334
  // ---- 文件树根标签:显示远程目录名,而不是本地镜像目录 ID(issue #9)----
1335
1335
  // better-sidebar「文件」页签的树根标签取自会话 cwd(= 本地镜像路径)的 basename,
1336
- // 于是显示成镜像目录 ID(如 wmu3sxe24jpvg)。这条链路不经过任何 fs.* 路由,
1336
+ // 于是显示成镜像目录 ID(如 wmirror3)。这条链路不经过任何 fs.* 路由,
1337
1337
  // 而 Host 侧 session.cwd 虽然已返回 root 字段,客户端只消费 cwd
1338
1338
  // (client-registry 的 api.sessionCwd(...).then(r => setFetchedCwd(r.cwd)),
1339
1339
  // 另有 useSessionCwd 直接读客户端会话列表的 cwd),因此只能在渲染层替换文本。
package/lib/index.js CHANGED
@@ -889,7 +889,7 @@ async function remoteGrep(runner, p, pattern, path, opts) {
889
889
  * - `relative`:用 `-printf '%P\n'` 输出**相对起始目录**的路径(issue #13:侧栏文件名搜索
890
890
  * 要 cwd 相对路径;默认仍输出 find 原样的绝对路径,供 remote_ssh_glob 工具使用)。
891
891
  * - `sorted !== false`:管道里加 `sort`。搜索路径必须关掉它 —— `sort` 会缓冲**全部** find
892
- * 输出后才吐第一行,使 `head` 的提前短路完全失效(issue #13 实测:一个 OpenFOAM 工作区
892
+ * 输出后才吐第一行,使 `head` 的提前短路完全失效(issue #13 实测:一个大型远程项目工作区
893
893
  * 5 分钟都跑不完,UI 一直「加载中…」,还占住池化会话阻塞其他操作)。
894
894
  * - `pruneNoise`:遍历前剪掉 REMOTE_SEARCH_SKIP_DIRS。
895
895
  * - `maxDepth`:`-maxdepth N`(浅层优先搜索用;不设则全深度)。
@@ -945,7 +945,7 @@ function spawnOne(subprocess, argv, stdio, cwd) {
945
945
  return subprocess.spawn({ argv: argv, cwd: cwd || process.cwd(), stdio: stdio, graceMs: 60000 });
946
946
  }
947
947
 
948
- /** 侧栏文件名搜索的预算与缓存(issue #13 实测:一个 OpenFOAM 工作区 `find` 5 分钟都跑不完,
948
+ /** 侧栏文件名搜索的预算与缓存(issue #13 实测:一个大型远程项目工作区 `find` 5 分钟都跑不完,
949
949
  * UI 一直「加载中…」,而且池化 SSH 会话被这条命令占住,其他操作一起卡)。
950
950
  *
951
951
  * 实测该工作区:顶层仅 12 个条目、命中集中在 depth 1–3(0.02–0.42s),depth 4 起耗时跳到 3s+
@@ -1832,7 +1832,7 @@ function apply(ctx, config) {
1832
1832
  if (!p) return { ok: false, error: "未找到连接配置" };
1833
1833
  if (!a.remotePath) return { ok: false, error: "remotePath 为必填项" };
1834
1834
  const wsId = "w" + Date.now().toString(36) + Math.random().toString(36).slice(2, 6);
1835
- // 默认标题取远程路径最后一段目录名(如 ~/run/zfs/codex/DSH_Test → DSH_Test);
1835
+ // 默认标题取远程路径最后一段目录名(如 ~/proj/DSH_Test → DSH_Test);
1836
1836
  // 取不到有效段(如 ~/ 或 /)时回退为 连接名:远程路径。
1837
1837
  const lastSeg = String(a.remotePath).replace(/\/+$/, "").split("/").pop();
1838
1838
  const title = a.title || (lastSeg && lastSeg !== "~" ? lastSeg : (p.name + ":" + a.remotePath));
@@ -1863,7 +1863,7 @@ function apply(ctx, config) {
1863
1863
  const native = await workspaceRegistry.create(mirrorDir, wsTitle);
1864
1864
  workspaceId = native.id;
1865
1865
  // workspaceRegistry.create 仅首次创建时应用 title;已存在的旧工作区
1866
- // (早期版本未传 title,标题卡在镜像目录名,如 wmt3tev5cdfge)会被直接
1866
+ // (早期版本未传 title,标题卡在镜像目录名,如 wmirror1)会被直接
1867
1867
  // 返回而不更新。这里显式 setTitle,保证标题始终是远程路径最后一段目录名。
1868
1868
  if (native && typeof native.setTitle === "function" && native.title !== wsTitle) {
1869
1869
  await native.setTitle(wsTitle);
@@ -2518,7 +2518,7 @@ function apply(ctx, config) {
2518
2518
  })();
2519
2519
 
2520
2520
  // ---- 启动自愈:把既有远程工作区的原生标题统一为「远程路径最后一段」----
2521
- // 早期版本 create 工作区时未传 title,DSH 用镜像目录 basename(wsId,如 wmt3tev5cdfge
2521
+ // 早期版本 create 工作区时未传 title,DSH 用镜像目录 basename(wsId,如 wmirror1
2522
2522
  // 作标题;workspaceRegistry.create 只对新建记录应用 title,旧记录会被原样返回。
2523
2523
  // 2.3.2 起标题不再带 🌐 前缀(图标由客户端地球角标文件夹 SVG 承担),自愈同时剥掉
2524
2524
  // 旧版遗留的 🌐 前缀。仅在标题等于已知旧形态时修复,不覆盖用户自定义标题。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhangfengshun/dsh-remote-ssh",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "DSH web plugin: VSCode Remote-SSH-like remote development (SSH to supercomputers/servers, remote workspace, file explorer, integrated terminal), integrated with dsh-better-sidebar and DSH settings.",
5
5
  "keywords": [
6
6
  "dsh",