dsh-remote 1.6.0 → 1.6.1

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/README.en.md CHANGED
@@ -18,7 +18,7 @@ Use the normal layout or choose the optional **three-column IDE layout** to view
18
18
 
19
19
  <img src="https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-ide.png" alt="DSH remote IDE with file tree, native code editor and agent conversation" width="1200"/>
20
20
 
21
- [1.6.0 release notes](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.0.md): a read-only remote commit graph, an IDE-button visibility preference, and a large batch of robustness fixes across search, sync, self-update and forwarding.
21
+ [1.6.1 release notes](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.1.md): the `rw_dsh_install` probe never actually ran and recorded its path on the wrong machine; `@` completion treated SSH connect/auth failures as unreadable paths.
22
22
 
23
23
  ## Install
24
24
 
package/README.md CHANGED
@@ -26,7 +26,7 @@ dsh plugin --profile web add dsh-remote
26
26
 
27
27
  安装或升级后,重启 DSH Web 并刷新页面。自动更新状态在设置 → 远程工作区 → 插件偏好中查看。
28
28
 
29
- [1.6.0 更新说明](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.0.md):远程提交图、IDE 按钮可见性偏好,以及搜索/同步/自更新/转发等一大批健壮性修复。
29
+ [1.6.1 更新说明](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.1.md):修复 `rw_dsh_install` 探针从未真正运行、安装路径记到错误机器,以及 `@` 补全把 SSH 连接/认证失败当成路径错误。
30
30
 
31
31
  ## 3 步开始
32
32
 
package/lib/client.js CHANGED
@@ -27,7 +27,7 @@ window.__ModuleLoader__.load({
27
27
 
28
28
  const React = require('react')
29
29
  const name = 'dsh-remote'
30
- const CLIENT_VERSION = '1.6.0'
30
+ const CLIENT_VERSION = '1.6.1'
31
31
 
32
32
  // ── optional host primitives ────────────────────────────────────────────
33
33
  // Issue #74: a remote session's .md link must open over SFTP, NOT via the
@@ -148,16 +148,34 @@ const PER_PATH_ERROR_CODES = new Set([
148
148
  'ENOENT', 'ENOTDIR', 'EACCES', 'EPERM',
149
149
  ])
150
150
 
151
+ /**
152
+ * Wording that describes the TRANSPORT — a broken pool/connection, an SSH
153
+ * authentication or host-key failure, a timeout — rather than one path. These
154
+ * win over any per-path wording the same message happens to carry, which is
155
+ * the trap `Permission denied (publickey)` sets: it is the OpenSSH backend's
156
+ * CONNECT failure (`lib/openssh.js` wraps it as `ssh failed (exit 255): …`),
157
+ * not an unreadable directory. Classifying it per-path would answer that
158
+ * keystroke empty, never open the breaker, and make every keystroke pay a
159
+ * fresh connect attempt — the exact stall the breaker exists to prevent.
160
+ */
161
+ const TRANSPORT_MESSAGE = /ssh (?:sftp )?failed|sftp session|timed out|econnrefused|econnreset|econnaborted|enotfound|epipe|broken pipe|connection|disconnected|socket|handshake|kex|host key|publickey|privatekey|no such identity|identity file|load key|authentication|agent refused|please try again|not connected|channel closed/i
162
+
163
+ /** Wording that describes ONE path (main.js's `listDir` re-wraps SFTP errors
164
+ * as `browse failed: <message>` without a code, so the message is the only
165
+ * signal left). */
166
+ const PER_PATH_MESSAGE = /no such file|no such path|not found|does not exist|permission denied|access denied|enoent|enotdir|eacces|eperm/i
167
+
151
168
  /**
152
169
  * Whether a `readDir` failure describes THIS directory (missing or
153
170
  * unreadable) rather than the whole transport. A per-path failure answers one
154
171
  * query empty — the same degradation scan() applies to an unreadable subtree —
155
172
  * instead of surfacing to the overlay's breaker, which would exile every LEGAL
156
173
  * query to the local mirror for failureCooldownMs. Transport failures (a broken
157
- * pool or connection: `ssh sftp failed: …`, `ECONNREFUSED`, handshake
158
- * timeouts, a generic SFTP `Failure`) match neither branch and keep throwing.
159
- * main.js's `listDir` re-wraps SFTP errors as `browse failed: <message>`
160
- * without a code, so the per-path wording is matched as well.
174
+ * pool or connection, an authentication/host-key rejection, a timeout) keep
175
+ * throwing so the breaker opens. main.js's `listDir` re-wraps SFTP errors as
176
+ * `browse failed: <message>` without a code, so the wording is matched too —
177
+ * and the transport wording is checked FIRST, because the two overlap on
178
+ * `Permission denied`.
161
179
  *
162
180
  * @param {unknown} err
163
181
  * @returns {boolean}
@@ -165,14 +183,8 @@ const PER_PATH_ERROR_CODES = new Set([
165
183
  function isPerPathError(err) {
166
184
  if (err && typeof err === 'object' && PER_PATH_ERROR_CODES.has(err.code)) return true
167
185
  const msg = String((err && err.message) || err)
168
- // Transport markers win over per-path wording: an OpenSSH handshake failure
169
- // reaches here as "sftp session to <dest> timed out: Permission denied
170
- // (publickey)" — classifying THAT per-path would make every keystroke pay a
171
- // full connect timeout without ever tripping the breaker, the exact stall
172
- // the breaker exists to prevent. Any transport-shaped message is the
173
- // transport's failure, whatever else it also says.
174
- if (/ssh sftp failed|sftp session|timed out|econnrefused|econnreset|econnaborted|enotfound|connection|handshake|host key|not connected|channel closed/i.test(msg)) return false
175
- return /no such file|no such path|not found|does not exist|permission denied|access denied|enoent|enotdir|eacces|eperm/i.test(msg)
186
+ if (TRANSPORT_MESSAGE.test(msg)) return false
187
+ return PER_PATH_MESSAGE.test(msg)
176
188
  }
177
189
 
178
190
  /**
package/lib/main.js CHANGED
@@ -780,10 +780,12 @@ export async function apply(ctx, config) {
780
780
  const persistWebAttachCommand = (machine, command) => {
781
781
  try {
782
782
  const i = machineIndex(machine.id)
783
- if (i < 0) return
783
+ if (i < 0) return false
784
784
  machines[i] = { ...machines[i], webAttachCommand: String(command || '') }
785
785
  saveMachines(machines, store.currentId, false)
786
+ return true
786
787
  } catch { /* a failed persist only costs a re-deploy next time */ }
788
+ return false
787
789
  }
788
790
 
789
791
  /** The machine the pool is currently bound to: an ephemeral tool connection
@@ -3240,6 +3242,103 @@ export async function apply(ctx, config) {
3240
3242
  }),
3241
3243
 
3242
3244
 
3245
+ defineTool({
3246
+ name: 'rw_dsh_install',
3247
+ description:
3248
+ 'Install (or locate) the DeepSeek Harness CLI on the remote machine, without any AI involvement. Probes `dsh` first: if it is already on PATH, reports its path and version (optionally records it as the machine\'s webAttachCommand). If missing, installs it with the package manager the remote already has: npm/pnpm global when available, otherwise the official installer script (`curl -fsSL https://… | sh` on POSIX). After a successful install the absolute dsh path is persisted as the machine\'s webAttachCommand so the remote Web UI can be opened. Read-only probe when `probeOnly: true`. Use rw_connect first so the machine is active; installation is idempotent (re-running is a no-op when dsh is already present).',
3249
+ parameters: {
3250
+ probeOnly: { type: 'boolean', description: 'Only probe whether dsh is installed (path + version); never install (default false)' },
3251
+ recordPath: { type: 'boolean', description: 'Persist the discovered/installed absolute dsh path as this machine\'s webAttachCommand (default true)' },
3252
+ },
3253
+ output: textOut,
3254
+ async execute(args, exec) {
3255
+ const b = requireBinding(exec, 'rw_dsh_install')
3256
+ const record = args.recordPath !== false
3257
+ const probeOnly = !!args.probeOnly
3258
+ // One POSIX probe, NEWLINE-joined. Joining these lines with '; ' turned
3259
+ // the loop into `for ...; do;`, a syntax error in every shell, so the
3260
+ // probe exited 2 before its first test and this tool reported "not
3261
+ // installed" on hosts that had dsh — and re-ran an installer over a
3262
+ // working install. `report` prints the absolute path + version and
3263
+ // exits; the npm/pnpm prefix fallbacks cover a global bin that is not
3264
+ // on this non-login shell's PATH (nvm, a custom prefix), which is the
3265
+ // case where `command -v dsh` alone cannot name a usable
3266
+ // webAttachCommand.
3267
+ const probeScript = [
3268
+ 'report() { echo "FOUND:$1"; "$1" --version 2>/dev/null | head -1; exit 0; }',
3269
+ 'if command -v dsh >/dev/null 2>&1; then report "$(command -v dsh)"; fi',
3270
+ 'for p in "$HOME/.dsh/bin/dsh" "$HOME/.local/bin/dsh" "/usr/local/bin/dsh" "/opt/homebrew/bin/dsh"; do',
3271
+ ' if [ -x "$p" ]; then report "$p"; fi',
3272
+ 'done',
3273
+ 'if command -v npm >/dev/null 2>&1; then',
3274
+ ' d="$(npm prefix -g 2>/dev/null)"',
3275
+ ' for p in "$d/bin/dsh" "$d/dsh"; do if [ -x "$p" ]; then report "$p"; fi; done',
3276
+ 'fi',
3277
+ 'if command -v pnpm >/dev/null 2>&1; then',
3278
+ ' d="$(pnpm bin -g 2>/dev/null)"',
3279
+ ' if [ -x "$d/dsh" ]; then report "$d/dsh"; fi',
3280
+ 'fi',
3281
+ 'exit 1',
3282
+ ].join('\n')
3283
+ /** Locate dsh: `{ path, version }` or null. Shared by the pre-install
3284
+ * probe and the post-install one, so both report the same facts. */
3285
+ const probeDsh = async () => {
3286
+ const probe = await b.pool.exec(probeScript, { timeoutMs: Math.min(config.commandTimeoutMs, 15000) })
3287
+ const found = /^FOUND:(.+)$/m.exec(String(probe.stdout || ''))
3288
+ if (probe.code !== 0 || !found) return null
3289
+ const version = String(probe.stdout || '').split('\n')
3290
+ .map((line) => line.trim())
3291
+ .filter((line) => line && !line.startsWith('FOUND:'))
3292
+ .pop() || 'unknown'
3293
+ return { path: found[1].trim(), version }
3294
+ }
3295
+ /** Persist on the machine THIS SESSION is bound to, never the active
3296
+ * one: with two saved machines, store.currentId can point at B while
3297
+ * the session (and the pool we just ran on) belongs to A. */
3298
+ const recordOnSessionMachine = (pathFound) => {
3299
+ const machine = record ? machineRecordFor(b) : null
3300
+ return !!machine && persistWebAttachCommand(machine, pathFound)
3301
+ }
3302
+
3303
+ const located = await probeDsh()
3304
+ if (located) {
3305
+ const recorded = recordOnSessionMachine(located.path)
3306
+ return { text: `dsh is already installed: ${located.path} (version ${located.version}).${recorded ? ' Recorded as this machine\'s webAttachCommand.' : ''}` }
3307
+ }
3308
+ if (probeOnly) return { text: 'dsh is NOT installed on this remote (not on PATH and no common install location found). Run rw_dsh_install without probeOnly to install it.' }
3309
+
3310
+ // Choose the install path by what the remote already has. Each command
3311
+ // INSTALLS only: appending `&& dsh --version` made a successful install
3312
+ // report failure whenever the fresh global bin was not on PATH yet.
3313
+ const pm = await b.pool.exec('command -v npm; command -v pnpm; command -v node; command -v curl; command -v wget', { timeoutMs: Math.min(config.commandTimeoutMs, 15000) })
3314
+ const hasNpm = /\/npm\b/.test(pm.stdout), hasPnpm = /\/pnpm\b/.test(pm.stdout), hasNode = /\/node\b/.test(pm.stdout), hasCurl = /\/curl\b/.test(pm.stdout), hasWget = /\/wget\b/.test(pm.stdout)
3315
+ let installScript
3316
+ if (hasNpm) {
3317
+ installScript = 'npm install -g @deepseek-ai/dsh'
3318
+ } else if (hasPnpm) {
3319
+ installScript = 'pnpm add -g @deepseek-ai/dsh'
3320
+ } else if (hasNode && (hasCurl || hasWget)) {
3321
+ const fetcher = hasCurl ? 'curl -fsSL' : 'wget -qO-'
3322
+ installScript = `${fetcher} https://get.dsh.dev/install.sh | sh`
3323
+ } else {
3324
+ throw new Error('rw_dsh_install: no npm, pnpm, or node+curl/wget on the remote — install Node.js first (or use your package manager to install @deepseek-ai/dsh)')
3325
+ }
3326
+ const install = await b.pool.exec(installScript, { timeoutMs: Math.min(config.commandTimeoutMs || 120000, 120000) })
3327
+ if (install.code !== 0) {
3328
+ throw new Error(`rw_dsh_install failed (exit ${install.code}): ${String(install.stderr || install.stdout || '').trim().slice(0, 400)}`)
3329
+ }
3330
+ // Re-probe instead of trusting the installer's own output: the absolute
3331
+ // path is what webAttachCommand must carry, and a fresh global bin is
3332
+ // often outside this shell's PATH.
3333
+ const installed = await probeDsh()
3334
+ if (!installed) {
3335
+ return { text: `dsh was installed (${installScript}) but no binary could be located afterwards — it is probably outside this shell's PATH. Add npm/pnpm's global bin to the remote PATH, then run rw_dsh_install with probeOnly: true to record it.` }
3336
+ }
3337
+ const recorded = recordOnSessionMachine(installed.path)
3338
+ return { text: `dsh installed successfully: ${installed.path} (version ${installed.version}).${recorded ? ' Recorded as this machine\'s webAttachCommand — you can now open the remote Web UI.' : ''}` }
3339
+ },
3340
+ }),
3341
+
3243
3342
  defineTool({
3244
3343
  name: 'rw_forward',
3245
3344
  description:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-remote",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "SSH remote workspaces for DeepSeek Harness: parallel projects across hosts, remote file browsing and editing, recursive search, terminals, Git diffs, and workspace-bound Agent tools to edit, build and test remotely. Optional IDE layout.",
5
5
  "license": "MIT",
6
6
  "author": "flymysql <flyphp@outlook.com>",
@@ -103,6 +103,6 @@
103
103
  "test:coverage": "node scripts/coverage-union.mjs",
104
104
  "test:coverage:gate": "node scripts/coverage-union.mjs --gate 70 --file-gate 60"
105
105
  },
106
- "readme": "[English](https://github.com/flymysql/dsh-remote/blob/main/README.en.md) · **中文**\n\n# dsh-remote\n\n[![npm version](https://img.shields.io/npm/v/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![downloads](https://img.shields.io/npm/dw/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![downloads](https://img.shields.io/npm/dm/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![license](https://img.shields.io/github/license/flymysql/dsh-remote)](https://github.com/flymysql/dsh-remote/blob/main/LICENSE)\n[![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-7a3ef3)](https://github.com/topics/dsh-plugin)\n\n由 [@flymysql](https://github.com/flymysql) 维护 · [主页](https://flymysql.github.io/dsh-remote/) · [用量统计](https://flymysql.github.io/dsh-remote/stats/) · [博客](https://gitpull.cn) · [讨论区](https://github.com/flymysql/dsh-remote/discussions) · [Issue](https://github.com/flymysql/dsh-remote/issues) · [English](https://github.com/flymysql/dsh-remote/blob/main/README.en.md)\n\n![dsh-remote —— 远程项目,完整上下文](https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workspace-overview.png)\n\n在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 中,把 SSH 主机变成日常开发工作区:管理多主机项目,浏览和编辑远程文件、递归搜索文件与内容、使用终端、查看 Git 差异、建立本地/反向端口隧道;让 Agent 在所属远程工作区中读写文件、执行命令、构建和测试。多个工作区可独立并行。\n\n可按习惯使用普通布局,或切换 **IDE 三栏布局**,并排查看远程文件、编辑器与原生 Agent 会话;切换时保留任务和未保存编辑。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-ide.png\" alt=\"DSH 远程工作区 IDE 模式:远程文件树、代码编辑器和原生 Agent 会话三栏\" width=\"1200\"/>\n\n## 安装\n\n```bash\ndsh plugin --profile web add dsh-remote\n```\n\n安装或升级后,重启 DSH Web 并刷新页面。自动更新状态在设置 → 远程工作区 → 插件偏好中查看。\n\n[1.6.0 更新说明](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.0.md):远程提交图、IDE 按钮可见性偏好,以及搜索/同步/自更新/转发等一大批健壮性修复。\n\n## 3 步开始\n\n1. **配置主机**:设置 → 远程工作区,编辑 SSH 配置或保存主机凭据;直接写在 `~/.ssh/config` 里的 Host 会出现在主机列表中,点该行的「…」菜单 →「编辑」即可保存成机器并填写登录密码(保存前后入口都是同一个「…」菜单)。打开设置会自动检查连通性,无需手动“连接”。\n2. **创建工作区**:添加工作区 → 远程,选择主机与目录。每个工作区独立绑定主机,设置页不选目录或“当前远程机”。\n3. **开始开发**:打开工作区文件或切换 IDE 模式,文件打开即可编辑并显示语法高亮,在远端搜索、运行命令并与 Agent 协作。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workspace-picker-browse.png\" alt=\"选择远程目录:固定路径与确认栏,目录列表占据弹窗主要区域\" width=\"720\"/>\n\n## 本地工作区也能用\n\n打开普通本地项目后,点击 **IDE 模式** 或 **工作区文件**,即可使用同一套文件树、高亮编辑、递归搜索、Git 差异与本地终端。无需配置 SSH;Agent 继续使用宿主原生文件和命令工具,多个本地、远程项目可并行工作。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-local.png\" alt=\"本地工作区:文件搜索、高亮编辑和原生 Agent 会话,Agent 已实际完成本地构建\" width=\"1200\"/>\n\n## 日常开发\n\n### 搜索远端文件与内容\n\n文件、目录和内容递归搜索,无需先展开目录或同步镜像。默认界面只显示搜索范围与进度摘要;按需展开搜索选项、扫描详情,支持大小写、忽略项、停止与重试。点击结果进入目录或文件对应行。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-search-results.png\" alt=\"简洁远程搜索:名称搜索结果包含嵌套目录与文件\" width=\"675\"/>\n\n### 查看远端 Git 改动\n\n分别查看工作区和已暂存 diff,筛选文件,点击改动行定位源码。面板只读,不提交或修改暂存区。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-git.png\" alt=\"远端 Git 工作区与已暂存改动、文件列表和源码 diff\" width=\"675\"/>\n\n### 在远端运行终端\n\n终端进入当前会话的远程目录;像素鱼欢迎图后接真实 SSH shell。已保存凭据可自动应答,支持多终端并行。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-terminal.png\" alt=\"DSH 远程终端:像素鱼欢迎图与实际 SSH 命令输出\" width=\"1000\"/>\n\n### 端口转发(SSH 隧道)\n\n谁要发起访问,就在谁那边开监听口:监听口开在本机是本地转发(`ssh -L`),开在远端是远程转发(`ssh -R`)。可同时运行多条;添加转发时可以选择「主机」,每条转发只属于一台机器——给还没连接的主机也能先存下转发,连上后再启动。每条转发都可以点「编辑」调整方向、端口、目标或所属主机,运行中的会先停止、保存后按新配置重新启动。每行能直接勾选「自动重连」——只恢复上次运行中的转发,且按机器隔离,反向转发首次勾选会提示远端监听风险。\n\n从旧版本升级:旧版没有 `lastActive` 的「自动重连」配置会暂停,行上显示「需重新确认」;重新勾选后才会参与自动恢复(反向转发需重新确认远端监听)。\n\n<img src=\"docs/shots/port-forwards.png\" alt=\"端口转发面板:本地/反向方向、自动重连勾选框与添加转发表单\" width=\"900\"/>\n\n### 与 Agent 一起修改和构建\n\n工具卡展示已应用改动、实际退出码和构建输出,编译诊断可跳转源码。编辑器保存会检测远端冲突、保留 CRLF,并保护保存期间继续输入的内容。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-applied-diff.png\" alt=\"Agent 远程编辑成功后的已应用 diff、路径与增删行数\" width=\"485\"/>\n\n## 兼容与边界\n\n- 主要面向 **DSH Web 0.2.x**;0.2.2 需要 **Node.js ≥24.9**。旧版宿主回退、Desktop/TUI 与 Agent diff 差异见[兼容说明](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.zh.md#dsh-版本兼容性)。\n- 文件栏直接访问远端;镜像按需同步。草稿在当前页面内存,崩溃或强制退出仍可能丢失。\n- 不提供远端语言服务、扩展宿主或调试器。Agent 使用配置的 SSH 身份执行命令,请只配置可信主机。\n\n## 文档与社区\n\n[完整工具与配置参考](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.zh.md) · [排障](https://github.com/flymysql/dsh-remote/blob/main/docs/troubleshooting.md) · [自更新修复](https://github.com/flymysql/dsh-remote/blob/main/docs/self-heal.md) · [升级指南](https://github.com/flymysql/dsh-remote/blob/main/docs/migration-1.0.md) · [更新记录](https://github.com/flymysql/dsh-remote/blob/main/CHANGELOG.md)\n\n[主页](https://flymysql.github.io/dsh-remote/) · [讨论区](https://github.com/flymysql/dsh-remote/discussions) · [反馈问题](https://github.com/flymysql/dsh-remote/issues) · [贡献指南](https://github.com/flymysql/dsh-remote/blob/main/CONTRIBUTING.md) · [贡献者与致谢](#贡献者与致谢)\n\n由 [@flymysql](https://github.com/flymysql) 与社区共同维护 · [MIT](https://github.com/flymysql/dsh-remote/blob/main/LICENSE)\n\n### 贡献者与致谢\n\n感谢每一位让这个项目更好的朋友(头像可点进主页;按提交数排序,机器人不计):\n\n<p align=\"left\">\n <a href=\"https://github.com/flymysql\"><img src=\"https://avatars.githubusercontent.com/u/37113068?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@flymysql\" title=\"@flymysql\" /></a>\n <a href=\"https://github.com/baiseraku\"><img src=\"https://avatars.githubusercontent.com/u/139727690?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@baiseraku\" title=\"@baiseraku\" /></a>\n <a href=\"https://github.com/glzhangzhi\"><img src=\"https://avatars.githubusercontent.com/u/36995275?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@glzhangzhi\" title=\"@glzhangzhi\" /></a>\n <a href=\"https://github.com/hjwsm1989\"><img src=\"https://avatars.githubusercontent.com/u/1067541?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@hjwsm1989\" title=\"@hjwsm1989\" /></a>\n <a href=\"https://github.com/j10ha0\"><img src=\"https://avatars.githubusercontent.com/u/72346906?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@j10ha0\" title=\"@j10ha0\" /></a>\n <a href=\"https://github.com/FoolishWiser\"><img src=\"https://avatars.githubusercontent.com/u/104308087?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@FoolishWiser\" title=\"@FoolishWiser\" /></a>\n <a href=\"https://github.com/kakaa-nju\"><img src=\"https://avatars.githubusercontent.com/u/79886619?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@kakaa-nju\" title=\"@kakaa-nju\" /></a>\n <a href=\"https://github.com/4FMTWRV\"><img src=\"https://avatars.githubusercontent.com/u/190457700?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@4FMTWRV\" title=\"@4FMTWRV\" /></a>\n <a href=\"https://github.com/dahaipeng\"><img src=\"https://avatars.githubusercontent.com/u/25660610?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@dahaipeng\" title=\"@dahaipeng\" /></a>\n <a href=\"https://github.com/davidlin2k\"><img src=\"https://avatars.githubusercontent.com/u/17074619?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@davidlin2k\" title=\"@davidlin2k\" /></a>\n <a href=\"https://github.com/FlintyLemming\"><img src=\"https://avatars.githubusercontent.com/u/19165511?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@FlintyLemming\" title=\"@FlintyLemming\" /></a>\n <a href=\"https://github.com/GDWhisper\"><img src=\"https://avatars.githubusercontent.com/u/129148123?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@GDWhisper\" title=\"@GDWhisper\" /></a>\n <a href=\"https://github.com/YiHui-Liu\"><img src=\"https://avatars.githubusercontent.com/u/30190271?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@YiHui-Liu\" title=\"@YiHui-Liu\" /></a>\n <a href=\"https://github.com/Minggle\"><img src=\"https://avatars.githubusercontent.com/u/35053182?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@Minggle\" title=\"@Minggle\" /></a>\n <a href=\"https://github.com/nekomona\"><img src=\"https://avatars.githubusercontent.com/u/25474483?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@nekomona\" title=\"@nekomona\" /></a>\n <a href=\"https://github.com/shis23\"><img src=\"https://avatars.githubusercontent.com/u/189869650?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@shis23\" title=\"@shis23\" /></a>\n</p>\n\n<details>\n<summary>贡献记录与早期贡献者</summary>\n\n近期的亮点贡献(欢迎随时加入这个名单):\n\n| 贡献者 | 做了什么 |\n| --- | --- |\n| [@baiseraku](https://github.com/baiseraku) | 整个 dsh-tui 适配层([#92](https://github.com/flymysql/dsh-remote/pull/92))+ 底栏机器名修正([#98](https://github.com/flymysql/dsh-remote/pull/98)) |\n| [@hjwsm1989](https://github.com/hjwsm1989) | 远程 .md 渲染连环两道:memo 守卫([#102](https://github.com/flymysql/dsh-remote/pull/102))+ labels 契约([#107](https://github.com/flymysql/dsh-remote/pull/107)) |\n| [@shis23](https://github.com/shis23) | rw_sync 路径映射纠偏 + SFTP 超时韧性([#105](https://github.com/flymysql/dsh-remote/pull/105)) |\n| [@davidlin2k](https://github.com/davidlin2k) | 无凭据机器走用户自有 ssh([#100](https://github.com/flymysql/dsh-remote/pull/100)) |\n| [@GDWhisper](https://github.com/GDWhisper) | 目录补全逐字符重连修复([#42](https://github.com/flymysql/dsh-remote/pull/42),issue #41) |\n| [@glzhangzhi](https://github.com/glzhangzhi) | 多远端会话的连接池隔离(issue #25 的主体修复) |\n\n早期已合并 PR 的贡献者(考古名单):\n\n\n\n[@dahaipeng](https://github.com/dahaipeng) (#31) ·\n[@YiHui-Liu](https://github.com/YiHui-Liu) (#28) ·\n[@nekomona](https://github.com/nekomona) (#24) ·\n[@zhz1667](https://github.com/zhz1667) (#43) ·\n[FoolishWiser](https://github.com/FoolishWiser) (#17) ·\n[@jace1cch](https://github.com/jace1cch) (#16) ·\n[@Minggle](https://github.com/Minggle) (#10) ·\n[4FMTWRV](https://github.com/4FMTWRV) (#6) ·\n[glzhangzhi](https://github.com/glzhangzhi)(per-session SSH 连接池修复)\n\n> 名单随版本更新;头像墙之外的每一份 issue 报告、复现步骤、根因线索同样珍贵——\n> 本仓库近半修复的起点都是一条写清楚的 issue。\n\n</details>\n",
106
+ "readme": "[English](https://github.com/flymysql/dsh-remote/blob/main/README.en.md) · **中文**\n\n# dsh-remote\n\n[![npm version](https://img.shields.io/npm/v/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![downloads](https://img.shields.io/npm/dw/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![downloads](https://img.shields.io/npm/dm/dsh-remote)](https://www.npmjs.com/package/dsh-remote)\n[![license](https://img.shields.io/github/license/flymysql/dsh-remote)](https://github.com/flymysql/dsh-remote/blob/main/LICENSE)\n[![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-7a3ef3)](https://github.com/topics/dsh-plugin)\n\n由 [@flymysql](https://github.com/flymysql) 维护 · [主页](https://flymysql.github.io/dsh-remote/) · [用量统计](https://flymysql.github.io/dsh-remote/stats/) · [博客](https://gitpull.cn) · [讨论区](https://github.com/flymysql/dsh-remote/discussions) · [Issue](https://github.com/flymysql/dsh-remote/issues) · [English](https://github.com/flymysql/dsh-remote/blob/main/README.en.md)\n\n![dsh-remote —— 远程项目,完整上下文](https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workspace-overview.png)\n\n在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 中,把 SSH 主机变成日常开发工作区:管理多主机项目,浏览和编辑远程文件、递归搜索文件与内容、使用终端、查看 Git 差异、建立本地/反向端口隧道;让 Agent 在所属远程工作区中读写文件、执行命令、构建和测试。多个工作区可独立并行。\n\n可按习惯使用普通布局,或切换 **IDE 三栏布局**,并排查看远程文件、编辑器与原生 Agent 会话;切换时保留任务和未保存编辑。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-ide.png\" alt=\"DSH 远程工作区 IDE 模式:远程文件树、代码编辑器和原生 Agent 会话三栏\" width=\"1200\"/>\n\n## 安装\n\n```bash\ndsh plugin --profile web add dsh-remote\n```\n\n安装或升级后,重启 DSH Web 并刷新页面。自动更新状态在设置 → 远程工作区 → 插件偏好中查看。\n\n[1.6.1 更新说明](https://github.com/flymysql/dsh-remote/blob/main/docs/release/1.6.1.md):修复 `rw_dsh_install` 探针从未真正运行、安装路径记到错误机器,以及 `@` 补全把 SSH 连接/认证失败当成路径错误。\n\n## 3 步开始\n\n1. **配置主机**:设置 → 远程工作区,编辑 SSH 配置或保存主机凭据;直接写在 `~/.ssh/config` 里的 Host 会出现在主机列表中,点该行的「…」菜单 →「编辑」即可保存成机器并填写登录密码(保存前后入口都是同一个「…」菜单)。打开设置会自动检查连通性,无需手动“连接”。\n2. **创建工作区**:添加工作区 → 远程,选择主机与目录。每个工作区独立绑定主机,设置页不选目录或“当前远程机”。\n3. **开始开发**:打开工作区文件或切换 IDE 模式,文件打开即可编辑并显示语法高亮,在远端搜索、运行命令并与 Agent 协作。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workspace-picker-browse.png\" alt=\"选择远程目录:固定路径与确认栏,目录列表占据弹窗主要区域\" width=\"720\"/>\n\n## 本地工作区也能用\n\n打开普通本地项目后,点击 **IDE 模式** 或 **工作区文件**,即可使用同一套文件树、高亮编辑、递归搜索、Git 差异与本地终端。无需配置 SSH;Agent 继续使用宿主原生文件和命令工具,多个本地、远程项目可并行工作。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-local.png\" alt=\"本地工作区:文件搜索、高亮编辑和原生 Agent 会话,Agent 已实际完成本地构建\" width=\"1200\"/>\n\n## 日常开发\n\n### 搜索远端文件与内容\n\n文件、目录和内容递归搜索,无需先展开目录或同步镜像。默认界面只显示搜索范围与进度摘要;按需展开搜索选项、扫描详情,支持大小写、忽略项、停止与重试。点击结果进入目录或文件对应行。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-search-results.png\" alt=\"简洁远程搜索:名称搜索结果包含嵌套目录与文件\" width=\"675\"/>\n\n### 查看远端 Git 改动\n\n分别查看工作区和已暂存 diff,筛选文件,点击改动行定位源码。面板只读,不提交或修改暂存区。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-git.png\" alt=\"远端 Git 工作区与已暂存改动、文件列表和源码 diff\" width=\"675\"/>\n\n### 在远端运行终端\n\n终端进入当前会话的远程目录;像素鱼欢迎图后接真实 SSH shell。已保存凭据可自动应答,支持多终端并行。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-terminal.png\" alt=\"DSH 远程终端:像素鱼欢迎图与实际 SSH 命令输出\" width=\"1000\"/>\n\n### 端口转发(SSH 隧道)\n\n谁要发起访问,就在谁那边开监听口:监听口开在本机是本地转发(`ssh -L`),开在远端是远程转发(`ssh -R`)。可同时运行多条;添加转发时可以选择「主机」,每条转发只属于一台机器——给还没连接的主机也能先存下转发,连上后再启动。每条转发都可以点「编辑」调整方向、端口、目标或所属主机,运行中的会先停止、保存后按新配置重新启动。每行能直接勾选「自动重连」——只恢复上次运行中的转发,且按机器隔离,反向转发首次勾选会提示远端监听风险。\n\n从旧版本升级:旧版没有 `lastActive` 的「自动重连」配置会暂停,行上显示「需重新确认」;重新勾选后才会参与自动恢复(反向转发需重新确认远端监听)。\n\n<img src=\"docs/shots/port-forwards.png\" alt=\"端口转发面板:本地/反向方向、自动重连勾选框与添加转发表单\" width=\"900\"/>\n\n### 与 Agent 一起修改和构建\n\n工具卡展示已应用改动、实际退出码和构建输出,编译诊断可跳转源码。编辑器保存会检测远端冲突、保留 CRLF,并保护保存期间继续输入的内容。\n\n<img src=\"https://raw.githubusercontent.com/flymysql/dsh-remote/main/docs/shots/workbench-applied-diff.png\" alt=\"Agent 远程编辑成功后的已应用 diff、路径与增删行数\" width=\"485\"/>\n\n## 兼容与边界\n\n- 主要面向 **DSH Web 0.2.x**;0.2.2 需要 **Node.js ≥24.9**。旧版宿主回退、Desktop/TUI 与 Agent diff 差异见[兼容说明](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.zh.md#dsh-版本兼容性)。\n- 文件栏直接访问远端;镜像按需同步。草稿在当前页面内存,崩溃或强制退出仍可能丢失。\n- 不提供远端语言服务、扩展宿主或调试器。Agent 使用配置的 SSH 身份执行命令,请只配置可信主机。\n\n## 文档与社区\n\n[完整工具与配置参考](https://github.com/flymysql/dsh-remote/blob/main/docs/reference.zh.md) · [排障](https://github.com/flymysql/dsh-remote/blob/main/docs/troubleshooting.md) · [自更新修复](https://github.com/flymysql/dsh-remote/blob/main/docs/self-heal.md) · [升级指南](https://github.com/flymysql/dsh-remote/blob/main/docs/migration-1.0.md) · [更新记录](https://github.com/flymysql/dsh-remote/blob/main/CHANGELOG.md)\n\n[主页](https://flymysql.github.io/dsh-remote/) · [讨论区](https://github.com/flymysql/dsh-remote/discussions) · [反馈问题](https://github.com/flymysql/dsh-remote/issues) · [贡献指南](https://github.com/flymysql/dsh-remote/blob/main/CONTRIBUTING.md) · [贡献者与致谢](#贡献者与致谢)\n\n由 [@flymysql](https://github.com/flymysql) 与社区共同维护 · [MIT](https://github.com/flymysql/dsh-remote/blob/main/LICENSE)\n\n### 贡献者与致谢\n\n感谢每一位让这个项目更好的朋友(头像可点进主页;按提交数排序,机器人不计):\n\n<p align=\"left\">\n <a href=\"https://github.com/flymysql\"><img src=\"https://avatars.githubusercontent.com/u/37113068?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@flymysql\" title=\"@flymysql\" /></a>\n <a href=\"https://github.com/baiseraku\"><img src=\"https://avatars.githubusercontent.com/u/139727690?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@baiseraku\" title=\"@baiseraku\" /></a>\n <a href=\"https://github.com/glzhangzhi\"><img src=\"https://avatars.githubusercontent.com/u/36995275?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@glzhangzhi\" title=\"@glzhangzhi\" /></a>\n <a href=\"https://github.com/hjwsm1989\"><img src=\"https://avatars.githubusercontent.com/u/1067541?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@hjwsm1989\" title=\"@hjwsm1989\" /></a>\n <a href=\"https://github.com/j10ha0\"><img src=\"https://avatars.githubusercontent.com/u/72346906?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@j10ha0\" title=\"@j10ha0\" /></a>\n <a href=\"https://github.com/FoolishWiser\"><img src=\"https://avatars.githubusercontent.com/u/104308087?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@FoolishWiser\" title=\"@FoolishWiser\" /></a>\n <a href=\"https://github.com/kakaa-nju\"><img src=\"https://avatars.githubusercontent.com/u/79886619?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@kakaa-nju\" title=\"@kakaa-nju\" /></a>\n <a href=\"https://github.com/4FMTWRV\"><img src=\"https://avatars.githubusercontent.com/u/190457700?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@4FMTWRV\" title=\"@4FMTWRV\" /></a>\n <a href=\"https://github.com/dahaipeng\"><img src=\"https://avatars.githubusercontent.com/u/25660610?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@dahaipeng\" title=\"@dahaipeng\" /></a>\n <a href=\"https://github.com/davidlin2k\"><img src=\"https://avatars.githubusercontent.com/u/17074619?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@davidlin2k\" title=\"@davidlin2k\" /></a>\n <a href=\"https://github.com/FlintyLemming\"><img src=\"https://avatars.githubusercontent.com/u/19165511?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@FlintyLemming\" title=\"@FlintyLemming\" /></a>\n <a href=\"https://github.com/GDWhisper\"><img src=\"https://avatars.githubusercontent.com/u/129148123?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@GDWhisper\" title=\"@GDWhisper\" /></a>\n <a href=\"https://github.com/YiHui-Liu\"><img src=\"https://avatars.githubusercontent.com/u/30190271?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@YiHui-Liu\" title=\"@YiHui-Liu\" /></a>\n <a href=\"https://github.com/Minggle\"><img src=\"https://avatars.githubusercontent.com/u/35053182?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@Minggle\" title=\"@Minggle\" /></a>\n <a href=\"https://github.com/nekomona\"><img src=\"https://avatars.githubusercontent.com/u/25474483?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@nekomona\" title=\"@nekomona\" /></a>\n <a href=\"https://github.com/shis23\"><img src=\"https://avatars.githubusercontent.com/u/189869650?s=80&v=4\" width=\"40\" height=\"40\" alt=\"@shis23\" title=\"@shis23\" /></a>\n</p>\n\n<details>\n<summary>贡献记录与早期贡献者</summary>\n\n近期的亮点贡献(欢迎随时加入这个名单):\n\n| 贡献者 | 做了什么 |\n| --- | --- |\n| [@baiseraku](https://github.com/baiseraku) | 整个 dsh-tui 适配层([#92](https://github.com/flymysql/dsh-remote/pull/92))+ 底栏机器名修正([#98](https://github.com/flymysql/dsh-remote/pull/98)) |\n| [@hjwsm1989](https://github.com/hjwsm1989) | 远程 .md 渲染连环两道:memo 守卫([#102](https://github.com/flymysql/dsh-remote/pull/102))+ labels 契约([#107](https://github.com/flymysql/dsh-remote/pull/107)) |\n| [@shis23](https://github.com/shis23) | rw_sync 路径映射纠偏 + SFTP 超时韧性([#105](https://github.com/flymysql/dsh-remote/pull/105)) |\n| [@davidlin2k](https://github.com/davidlin2k) | 无凭据机器走用户自有 ssh([#100](https://github.com/flymysql/dsh-remote/pull/100)) |\n| [@GDWhisper](https://github.com/GDWhisper) | 目录补全逐字符重连修复([#42](https://github.com/flymysql/dsh-remote/pull/42),issue #41) |\n| [@glzhangzhi](https://github.com/glzhangzhi) | 多远端会话的连接池隔离(issue #25 的主体修复) |\n\n早期已合并 PR 的贡献者(考古名单):\n\n\n\n[@dahaipeng](https://github.com/dahaipeng) (#31) ·\n[@YiHui-Liu](https://github.com/YiHui-Liu) (#28) ·\n[@nekomona](https://github.com/nekomona) (#24) ·\n[@zhz1667](https://github.com/zhz1667) (#43) ·\n[FoolishWiser](https://github.com/FoolishWiser) (#17) ·\n[@jace1cch](https://github.com/jace1cch) (#16) ·\n[@Minggle](https://github.com/Minggle) (#10) ·\n[4FMTWRV](https://github.com/4FMTWRV) (#6) ·\n[glzhangzhi](https://github.com/glzhangzhi)(per-session SSH 连接池修复)\n\n> 名单随版本更新;头像墙之外的每一份 issue 报告、复现步骤、根因线索同样珍贵——\n> 本仓库近半修复的起点都是一条写清楚的 issue。\n\n</details>\n",
107
107
  "readmeFilename": "README.md"
108
108
  }