dsh-over-ssh 0.2.2 → 0.2.4

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.
Files changed (34) hide show
  1. package/README.md +82 -4
  2. package/agents/agent-manifest.json +7 -7
  3. package/agents/linux-amd64/dsh-over-ssh-agent +0 -0
  4. package/agents/linux-arm64/dsh-over-ssh-agent +0 -0
  5. package/cordis.patch.yml +10 -12
  6. package/lib/client.js +161 -60
  7. package/lib/file-references.js +136 -13
  8. package/lib/fs.js +2 -1
  9. package/lib/index.js +1245 -165
  10. package/lib/types/src/config.d.ts +44 -0
  11. package/lib/types/src/host/app/backend.d.ts +31 -0
  12. package/lib/types/src/host/app/routed-fs.d.ts +238 -0
  13. package/lib/types/src/host/app/session-admin/session-admin-contract.d.ts +17 -0
  14. package/lib/types/src/host/app/transport/transport-service.d.ts +66 -11
  15. package/lib/types/src/host/domain/capability.d.ts +6 -0
  16. package/lib/types/src/host/domain/roots/route-table.d.ts +101 -0
  17. package/lib/types/src/host/domain/session/session-admin.d.ts +8 -0
  18. package/lib/types/src/host/infra/backend/poll-watch.d.ts +119 -0
  19. package/lib/types/src/host/infra/backend/remote-backend.d.ts +297 -0
  20. package/lib/types/src/host/infra/cache/budget.d.ts +68 -0
  21. package/lib/types/src/host/infra/cache/versioned.d.ts +98 -0
  22. package/lib/types/src/host/infra/transport/ssh/askpass.d.ts +132 -0
  23. package/lib/types/src/host/infra/transport/transport.d.ts +48 -0
  24. package/lib/types/src/host/integration/agent/askpass-registry.d.ts +65 -0
  25. package/lib/types/src/host/integration/fs/remote-index.d.ts +183 -0
  26. package/lib/types/src/host/integration/roots/remote-home.d.ts +68 -0
  27. package/lib/types/src/host/integration/roots/root-registry.d.ts +148 -0
  28. package/lib/types/src/index.d.ts +7 -0
  29. package/lib/types/src/local-bridge.d.ts +4 -4
  30. package/lib/types/src/wiring/connections.d.ts +261 -0
  31. package/lib/types/src/wiring/install-memo.d.ts +31 -0
  32. package/package.json +1 -5
  33. package/lib/local-bridge-refs.js +0 -16
  34. package/lib/types/src/local-bridge-refs.d.ts +0 -25
package/README.md CHANGED
@@ -19,6 +19,12 @@ npm i && npm run build
19
19
  dsh plugin --profile web add /绝对路径/dsh-over-ssh
20
20
  ```
21
21
 
22
+ > **GUI 安装提示**:pnpm 会问是否允许安装脚本,列表里是 `ssh2` 与 `cpu-features`:允许后重试即可。
23
+ > 它们是 `ssh2` 传输的可选原生加速,拒绝会让 pnpm 中止本次安装(插件源码本身没有安装脚本)。
24
+ >
25
+ > 0.2.2 及更早在运行中的页面上启用插件时出现过 `2 entries did not activate`(`workingDirectory` /
26
+ > `fileReferences` 链);0.2.3 删掉了那条私有域克隆链(审计 0134),不再需要为它重启。
27
+
22
28
  **远端终端**要额外配一次 `terminalController.Config.shell`——`Config.shell` 是静态单值,连哪台只能由 wrapper 运行时决定:
23
29
 
24
30
  | 装法 | 指向 |
@@ -35,6 +41,78 @@ shell:
35
41
 
36
42
  不配也能用,只是 Web 终端永远开在本地(远程文件、远端执行、`@` 补全不受影响)。
37
43
 
44
+ ## 0.2.4 更新
45
+
46
+ > 下面这些内容相对 npm 上的 **0.2.3** 一起生效。
47
+
48
+ ### 传输与内存
49
+
50
+ - transport lanes(审计 0164):interactive/bulk/compute 分 lane(`limits.transportLanes`,失败回退 interactive);job/LSP 按会话、watch 按会话(agentless 时连接级)使用 stateful lane(`limits.statefulLanes` 默认 8);transfer stat 走 bulk;Go 在飞窗口从 8 提到 16;proc/LSP/index 按会话公平配额(含后来者预留名额)。
51
+ - P6 读/解析分离:读协程只读原始帧,zstd 解压、JSON 解析与 blob 解压移出读协程;原始帧队列有界,慢盘/大 blob 不再阻塞同连接其它会话。
52
+ - 修复 P6 读错误被 `readBlob` 消费后主循环永久阻塞;大帧解析后把 parser 缓冲降回 64 KiB;`#pollListings` 快照表加 64 条上限;并发上传的 stdin drain 监听器合并。
53
+ - 修复重连 discard 期间 `releaseSession` 被忽略导致已删除会话 lane 复活;selector 抛错泄漏 lane 槽;watch 按会话分 lane 后会话删除会回收 `watch:<session>`。
54
+ - 修复浏览后端 dispose 拒绝产生未处理拒绝;`#sendCancel` 写失败遗留 pending 槽。
55
+
56
+ ### 会话作用域与「添加目录」
57
+
58
+ - 会话根按 `sessions` + `workspaces` 双重作用域过滤;带 `scopedForSession` 时,客户端仍按当前 workspace 过滤未限定行,dev 热修。
59
+ - 工作区路径比较容忍尾斜杠与 Windows 大小写差异;真正切换会话/工作区时清空旧 roots,并复位卡片的 `open`/`browsing`。
60
+ - 会话作用域修复覆盖:切会话/工作区不再显示上一条会话的目录;同 workspace 的两个会话按 session 隔离;fork 继承仍可见。
61
+
62
+ ### Agent / 子进程
63
+
64
+ - 修复取消排队请求不生效:`sessionTable.Cancel` 摘除等待队列与 blob 队列,`dispatchMu` 覆盖出队+launch 与取消。
65
+ - 修复子进程启动失败泄漏 fd:interactive `proc.start` 的 stdin,`rg`/`git status`/`git ls-files` 的 stdout,LSP stdout。
66
+ - 修复 JSON 编码尺寸估算漏算 HTML 转义(`<`/`>`/`&`/U+2028/U+2029),避免含 `<` 的大输出被误判装得下而超帧。
67
+
68
+ ### 数据正确性与工具
69
+
70
+ - `remote_read_many`:一次往返读多个文件(1..16,默认每文件 256 KiB),非 UTF-8 给 `binary`/`dataBase64` 与渲染警告;修复批量读总量上限与二进制截断一致。
71
+ - `remote_project_summary`:一次往返给 git 状态、顶层结构、包清单、README 头与 test/build/lint 建议。
72
+ - `remote_apply_patch`:一次往返多文件补丁,先全量校验,默认失败回滚。
73
+ - `remote_exec` / `remote_job`:非 UTF-8 输出附带 base64 精确字节与渲染警告;`remote_job` 不再丢 exactBytes。
74
+ - 协议 v3 zstd 跨帧压缩;`remote_grep` 支持 `offset`/`total`/`nextOffset` 分页;Tier 2 批量读走代理 `fs.readMany`。
75
+ - LSP:`server` 支持带空格路径的引号切分、`lsp.read` 每轮 256 KiB、跨块多字节字符按 `exactBytes` 解析;卡片的初始焦点与 Tab 集合跳过不可见控件。
76
+ - 文件引用补全:单来源失败只降级该来源;Windows 反斜杠路径参与排序;符号链接按目录处理,根内展开、根外只列链接;同根并发走查共享。
77
+ - 端口转发:`net.probe` 远端预检,关闭端口在 start 阶段稳定失败;IPv6 `[::1]` 归一;旧代理没有 `net.probe` 时跳过预检继续。
78
+ - 回收站与锁:父子还原、锁心跳、缺 `entryId` 行可见不可操作、已删连接编辑不再提交。
79
+ - 会话管理页:修正短 id、工作区目录内联、行内回收站按钮、已选计数。
80
+
81
+ ### 其它修复
82
+
83
+ - `remote_read_many`、`remote_exec`、`remote_job` 的二进制/截断/渲染一致性问题(审计 0160–0162)。
84
+ - `writeFile` 非 Uint8Array 参数本地立即拒绝;`repo.summary` 只读普通文件;`patchMany` 超大文件先判大小;`fs.readMany` 先校验再起协程。
85
+ - 主菜单/渲染修复:项目概览补顶层/清单/README、分页提示按 Tier 分档、`remote_grep` 真正分页、zstd 小帧只压缩一次。
86
+
87
+ ### 其它
88
+
89
+ - 组合层仍为 6 个条目;本地写入围栏由平台沙箱执行。
90
+ - 其余行为不变。
91
+
92
+ ## 0.2.3 更新
93
+
94
+ > 下面这些内容相对 npm 上的 **0.2.2** 一起生效。
95
+
96
+ - **热启用不再失败**:移除私有域里对平台 `@deepseek-ai/dsh-file-reference-local` 的克隆与 `localFileReferences` 桥:
97
+ 根作用域的 `file-references` 本来就自己实现本地有界走查,那份克隆没有消费者。效果是启用插件时
98
+ 不再出现 `2 entries did not activate`(`workingDirectory` / `fileReferences` 等待链),热启用可以直接
99
+ 完成,不必为它完整重启。
100
+ - 组合层因此只剩 6 个条目(原 8 个):私有域只保留 `fs-sandbox` 克隆 + `localFs` 桥,本地写入围栏仍由
101
+ 平台沙箱执行。
102
+ - 文件引用补全复查(审计 0135):单个远端来源失败只降级该来源,不再让整个 `@` 补全失败;缓存命中后
103
+ 的取消仍按取消处理;Windows 本地根的反斜杠路径参与文件名/深度排序;符号链接目录按目录处理,只有
104
+ 指向根内的链接会被展开(根外链接只列链接本身,不把工作区外的文件带进 `@`),并带环检测与 Windows
105
+ 忽略目录大小写处理;打字快于一次走查时,同根并发调用共享一次树枚举、不再重复扫树(探针:6 次击键
106
+ = 1 次走查)。
107
+ - LSP 复查(审计 0136):`remote_lsp` 的 `server` 支持带空格的路径(引号切分,`"/opt/my tools/server" --stdio`,
108
+ 未闭合引号明确报错);宿主 `lsp.read` 每轮只取 256 KiB,不再吃满代理 2 MiB 默认块;客户端卡片的初始
109
+ 焦点与 Tab 集合跳过不可见控件。
110
+ - 回收站与锁(审计 0137):索引记录父子关系,**还原父会话会连带还原子会话**(失败留在垃圾并回报);
111
+ 会话/回收站锁加心跳,跨设备大目录 copy 超过 60 s 也不会被当成陈旧锁抢走;缺 `entryId` 的回收站条目
112
+ 现在可见但不可操作并说明原因;连接被删除后编辑对话框不再提交请求。
113
+ - 构建:删掉的宿主入口产物会被清理,不再随包发出(0.2.3 首次打包曾多带一个 `local-bridge-refs.js`)。
114
+ - 其余行为不变;远端 `@`、本地 `@`、文件工具、会话面板均未改动。
115
+
38
116
  ## 0.2.2 更新
39
117
 
40
118
  - 「添加目录」按会话作用域显示与删除,fork 子会话继承父会话的目录且立即可见。
@@ -54,11 +132,11 @@ shell:
54
132
 
55
133
  | 平台 | 字节 | sha256 |
56
134
  |---|---|---|
57
- | linux-amd64 | 4,944,032 | `d45237ef1bfec1955fb5e6a2391bd651ffeaffb89e781e1c518e9e9836eec974` |
58
- | linux-arm64 | 4,653,216 | `237a3cc9f5ae57f752f62eee4f8a57bd8c4684fd4d3fa6ab5851115baa844ccd` |
135
+ | linux-amd64 | 5,591,200 | `c1b5e1ffcc9c7fd26e21140090dafec28f90a50fd3c5a3edb315d0165f84dc40` |
136
+ | linux-arm64 | 5,243,040 | `524e8752ba5a63ac006d50f132f6286afa2ccfe55ed217d286e4ada361deea71` |
59
137
 
60
- - 代理版本:`0.2.2-e019f2d`
61
- - 源码提交:`e019f2d`(Go 仓 `dsh-over-ssh-agent` 的这个提交)
138
+ - 代理版本:`0.2.4-a7e77fb`
139
+ - 源码提交:`a7e77fb`(Go 仓 `dsh-over-ssh-agent` 的这个提交)
62
140
  - 清单原文:包内 `agents/agent-manifest.json`
63
141
  - 核对:`sha256sum agents/<平台>/dsh-over-ssh-agent` 与上表比对;按上面的提交检出 Go 仓后
64
142
  `scripts/check.sh` 可重建同样的产物。
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "version": 1,
3
- "generatedAt": "2026-11-06T16:15:01.747Z",
4
- "agentVersion": "0.2.2-e019f2d",
5
- "sourceCommit": "e019f2d",
3
+ "generatedAt": "2026-11-08T16:23:50.384Z",
4
+ "agentVersion": "0.2.4-a7e77fb",
5
+ "sourceCommit": "a7e77fb",
6
6
  "artifacts": [
7
7
  {
8
8
  "platform": "linux-amd64",
9
9
  "path": "linux-amd64/dsh-over-ssh-agent",
10
- "sha256": "d45237ef1bfec1955fb5e6a2391bd651ffeaffb89e781e1c518e9e9836eec974",
11
- "bytes": 4944032
10
+ "sha256": "c1b5e1ffcc9c7fd26e21140090dafec28f90a50fd3c5a3edb315d0165f84dc40",
11
+ "bytes": 5591200
12
12
  },
13
13
  {
14
14
  "platform": "linux-arm64",
15
15
  "path": "linux-arm64/dsh-over-ssh-agent",
16
- "sha256": "237a3cc9f5ae57f752f62eee4f8a57bd8c4684fd4d3fa6ab5851115baa844ccd",
17
- "bytes": 4653216
16
+ "sha256": "524e8752ba5a63ac006d50f132f6286afa2ccfe55ed217d286e4ada361deea71",
17
+ "bytes": 5243040
18
18
  }
19
19
  ]
20
20
  }
package/cordis.patch.yml CHANGED
@@ -12,10 +12,14 @@
12
12
  # ctx.fs ← dsh-over-ssh/fs(多根路由)
13
13
  # ctx.fileReferences ← dsh-over-ssh/file-references(多根 @ 补全)
14
14
  #
15
- # 私有域(isolate: fs / fileReferences):
15
+ # 私有域(isolate: fs):
16
16
  # ctx.fs ← @deepseek-ai/dsh-fs-sandbox(**原版**,继续服务本地路径)
17
- # ctx.fileReferences ← @deepseek-ai/dsh-file-reference-local(**原版**)
18
- # 两个 bridge 把域内实例以 localFs / localFileReferences 暴露给根作用域。
17
+ # 一个 bridge 把域内实例以 localFs 暴露给根作用域。
18
+ #
19
+ # 文件引用**不再克隆平台实现**:根作用域的 dsh-over-ssh/file-references 自己实现了本地有界走查
20
+ # (见 integration/fs/file-reference-provider.ts),平台侧的 localFileReferences 没有任何消费者。
21
+ # 2026-11-07 审计 0134 删掉了那条克隆链:它让私有域多等一个 workingDirectory 服务,而 DSH 热启用
22
+ # 时这个依赖会短暂缺失,表现为「启用失败:2 entries did not activate」。
19
23
  #
20
24
  # 为什么是「接管」而不是「共存」:`ctx.fs` 是 Cordis 单例服务,同一隔离作用域只能有一个提供方,
21
25
  # 再注册第二个会抛 `service "fs" has been registered`。`isolate` 让原版实现能在私有域里继续跑,
@@ -24,8 +28,9 @@
24
28
  # 已实测的前提(cordis 0.2.1-rc.2):域内 `fs` 解析到域内实例;根 `fs` 不受影响;可以同时存在多个域;
25
29
  # 根作用域的消费者能注入到域内 bridge 暴露出来的 `localFs`。任何一条不成立这套组合都不成立。
26
30
  #
27
- # 这两组行必须**同时**生效或同时不生效:只禁用核心行而不启用本插件的行,会让 `ctx.fs` /
28
- # `ctx.fileReferences` 无人提供,所有文件能力一起失效。
31
+ # `ctx.fs` 与 `ctx.fileReferences` 两级都要有提供方:核心 fs-sandbox / file-reference-local 被本包
32
+ # 禁用后,根作用域由 dsh-over-ssh/fs 与 dsh-over-ssh/file-references 接管;本地路径的写入围栏由私有域
33
+ # 里那份原版 fs-sandbox 经 localFs 桥接执行。
29
34
  #
30
35
  # 还原:禁用整个 bundle。不要只删其中一行。
31
36
  #
@@ -57,19 +62,12 @@
57
62
  group: true
58
63
  isolate:
59
64
  fs: true
60
- fileReferences: true
61
65
  config:
62
66
  - id: 远程工作区-平台沙箱副本
63
67
  name: '@deepseek-ai/dsh-fs-sandbox'
64
- - id: 远程工作区-平台文件引用副本
65
- name: '@deepseek-ai/dsh-file-reference-local'
66
- # 两个 bridge 分开:file-reference-local 依赖 workingDirectory(在下游),不能和 fs 挤在同一行。
67
68
  - id: 远程工作区-桥接fs
68
69
  name: dsh-over-ssh/local-bridge
69
70
  inject: [fs]
70
- - id: 远程工作区-桥接文件引用
71
- name: dsh-over-ssh/local-bridge-refs
72
- inject: [fileReferences]
73
71
 
74
72
  # 根作用域的提供方。两个入口都是「路由型」:本地路径与远端路径由同一套表分发。
75
73
  - id: 远程工作区-路由fs