dsh-remote 0.4.4 → 0.5.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/README.md +87 -85
- package/README.zh.md +88 -83
- package/lib/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
1
|
-
# dsh-remote
|
|
2
|
-
|
|
3
|
-
Remote-work assistant for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
The harness Web UI intentionally binds `127.0.0.1` (the CLI rejects `--host 0.0.0.0` for safety). This plugin goes the other way: **you connect out** to
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
1
|
+
# dsh-remote
|
|
2
|
+
|
|
3
|
+
**Remote-work assistant for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH).**
|
|
4
|
+
|
|
5
|
+
Manage several SSH machines, then pick a **remote workspace** (or a **local** one) and let the agent operate right there without leaving the harness — listing files, reading code, running builds & commands over the remote host, and keeping that remote directory mirrored into a real local workspace object.
|
|
6
|
+
|
|
7
|
+
The harness Web UI intentionally binds `127.0.0.1` (the CLI rejects `--host 0.0.0.0` for safety). This plugin goes the other way: **you connect out** to the machines you maintain, pick a workspace, and work in it through the normal DSH workspace + agent fs flows — no changes to `dsh-workspace` or the harness core.
|
|
8
|
+
|
|
9
|
+
## Screen previews
|
|
10
|
+
|
|
11
|
+
Settings → **远程工作区** — a multi-machine SSH registry (add / edit / delete / set-current, password stored locally):
|
|
12
|
+
|
|
13
|
+
<img src="./docs/ui-settings.svg" alt="dsh-remote settings — multi-machine registry" width="720"/>
|
|
14
|
+
|
|
15
|
+
The native **"Add workspace" / "Select workspace"** flow — one dialog, two tabs (本地 local / 远程 remote):
|
|
16
|
+
|
|
17
|
+
<img src="./docs/ui-picker.svg" alt="dsh-remote workspace picker — 本机 (native OS folder) + 远程 (machine → directory)" width="720"/>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Features
|
|
22
|
+
|
|
23
|
+
- **Multi-machine SSH** — save any number of hosts (`host`/`port`/`user` + **private key** or **password**). Passwords are stored locally and never shown back in the UI. Switch with one click in Settings.
|
|
24
|
+
- **Two-tab workspace picker** (fills the native "Add workspace" flow):
|
|
25
|
+
- **本机 / Local** — opens the **native OS folder chooser** over the host, or lets you type a local path → adopted directly as a normal DSH local workspace (local workspaces fully coexist).
|
|
26
|
+
- **远程 / Remote** — pick a **machine**, then browse its directories (or type a path) 🡺 on confirm it creates a **real local mirror** (`~/.dsh/remote-workspaces/<host>/<base>-<hash>`) that passes `fs.realpath` → the harness adopts it as a real workspace while dsh-remote keeps it synced over SFTP.
|
|
27
|
+
- **Bidirectional SFTP sync** — `rw_sync` (remote → mirror) and `rw_push` (mirror → remote) round-trip your local-mirror edits back to the machine.
|
|
28
|
+
- **Model tools** — `rw_info`, `rw_connect`, `rw_pick_workspace`, `rw_list_dir`, `rw_read_file`, `rw_exec`, `rw_sync`, `rw_push`.
|
|
29
|
+
- The active `user@host:/path` is injected into every system prompt so the agent knows its working root.
|
|
30
|
+
- **No official `dsh-workspace` core is modified** — everything is delivered as a normal plugin (directory-flow holes filled by the client half at `priority -100`).
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
dsh plugin add dsh-remote # add the bundle
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
(or `npm install dsh-remote` + add `- id: dsh-remote / name: dsh-remote` in `cordis.patch.yml`).
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
1. **Add a machine** — Settings → 远程工作区 → add host/port/user + key or password → (optional) set it current.
|
|
43
|
+
2. **Open a workspace** — click **Add workspace** in the sidebar / conversation:
|
|
44
|
+
- **本机** → system folder chooser (or type a local path) → local workspace.
|
|
45
|
+
- **远程** → choose the machine → browse to a remote directory (or type `/path`) → "设为远程工作区" ⇒ a local mirror workspace is created and adopted.
|
|
46
|
+
3. **Work with the agent** — treat it like any workspace:
|
|
47
|
+
- `rw_list_dir(path?)`/`rw_read_file` — inspect remote files
|
|
48
|
+
- `rw_exec(command)` — run remote shell commands
|
|
49
|
+
- `rw_sync` / `rw_push` — pull/push the local mirror to and from the remote
|
|
50
|
+
|
|
51
|
+
## CLI defaults (optional)
|
|
52
|
+
|
|
53
|
+
Provide a default machine in `cordis.patch.yml`:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
- id: dsh-remote
|
|
57
|
+
name: dsh-remote
|
|
58
|
+
config:
|
|
59
|
+
host: 10.0.0.8
|
|
60
|
+
port: 22
|
|
61
|
+
username: dev
|
|
62
|
+
privateKeyPath: C:/Users/you/.ssh/id_rsa
|
|
63
|
+
# or password: '…'
|
|
64
|
+
workspace: /home/dev/project
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If `host` is empty the plugin starts disconnected and you configure machines in the UI.
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
| Key | Type | Default | Meaning |
|
|
72
|
+
| --- | --- | --- | --- |
|
|
73
|
+
| `host` | string | `''` | default SSH host (else start disconnected) |
|
|
74
|
+
| `port` | int | `22` | default SSH port |
|
|
75
|
+
| `username` | string | `''` | default SSH user |
|
|
76
|
+
| `password` | string | `''` | default SSH password (non-empty overrides key) |
|
|
77
|
+
| `privateKeyPath` | string | `''` | private key path (`~/.ssh/id_rsa` when empty) |
|
|
78
|
+
| `workspace` | string | `''` | default remote workspace path |
|
|
79
|
+
| `commandTimeoutMs` | int | 20000 | per remote command timeout |
|
|
80
|
+
| `connectTimeoutMs` | int | 15000 | SSH connect timeout |
|
|
81
|
+
|
|
82
|
+
## Safety
|
|
83
|
+
|
|
84
|
+
Giving the plugin a machine's credentials lets the agent run **shell commands as your user** on that host. Only add machines you trust. Passwords are saved on the local machine file; treat it as sensitive (you may lock file ACLs).
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
86
88
|
MIT
|
package/README.zh.md
CHANGED
|
@@ -1,84 +1,89 @@
|
|
|
1
|
-
# dsh-remote
|
|
2
|
-
|
|
3
|
-
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
DSH Web 界面刻意只监听 `127.0.0.1
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
| `
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
1
|
+
# dsh-remote
|
|
2
|
+
|
|
3
|
+
**为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)打造的远程工作助手。**
|
|
4
|
+
|
|
5
|
+
维护多台 SSH 机器,然后在「选择工作区」时选一个**远程工作区**(或**本地工作区**),Agent 就能在不离开 harness 的情况下直接操作——列文件、读代码、在远程主机上跑构建/命令,并把远程目录镜像成一个真实的本地工作区对象。
|
|
6
|
+
|
|
7
|
+
DSH 的 Web 界面刻意只监听 `127.0.0.1`(CLI 为安全拒绝 `--host 0.0.0.0`)。本插件反过来:**由你主动连出**到你维护的机器,选一个工作区,然后通过 DSH 原生的工作区 + 文件流来工作——**不改动 `dsh-workspace` 核心**。
|
|
8
|
+
|
|
9
|
+
## 界面预览
|
|
10
|
+
|
|
11
|
+
设置 → **远程工作区** —— 多机 SSH 列表(增/删/改/设为当前,密码本地保存、不回显):
|
|
12
|
+
|
|
13
|
+
<img src="./docs/ui-settings.svg" alt="dsh-remote 设置页 — 多机列表" width="720"/>
|
|
14
|
+
|
|
15
|
+
原生 **「Add workspace / 选择工作区」** 流程 —— 一个对话框两个 tab(本地+远程):
|
|
16
|
+
|
|
17
|
+
<img src="./docs/ui-picker.svg" alt="dsh-remote 工作区选择 — 本机系统文件夹 + 远程(选机器→列目录)" width="720"/>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 功能
|
|
22
|
+
|
|
23
|
+
- **多机 SSH** —— 可存任意多台主机(host/port/user + **私钥**或**密码**)。密码只存在本地,界面不回显;在设置里一键切当前机。
|
|
24
|
+
- **双 tab 工作区选择器**(填充原生「Add workspace」流程):
|
|
25
|
+
- **本机** —— 走 **host 端原生系统文件夹对话框**选本地目录(或直接输入本地路径)→ 直接成为普通 DSH 本地工作区(与本地工作区共存)。
|
|
26
|
+
- **远程** —— 先**选机器**,再浏览其目录(或输入路径)🡺 确定后会创建**真实本地镜像**(`~/.dsh/remote-workspaces/<host>/<basename>-<hash>`,`fs.realpath` 通过)→ harness 把它当真实工作区收养,同时 dsh-remote 通过 SFTP 保持同步。
|
|
27
|
+
- **双向 SFTP 同步** —— `rw_sync`(远程→镜像)、`rw_push`(镜像→远程),本地镜像改动可回传机器。
|
|
28
|
+
- **模型工具** —— `rw_info`、`rw_connect`、`rw_pick_workspace`、`rw_list_dir`、`rw_read_file`、`rw_exec`、`rw_sync`、`rw_push`。
|
|
29
|
+
- 当前 `user@host:/path` 会注入每次系统提示,让 Agent 明确自己的工作根。
|
|
30
|
+
- **不改任何 `dsh-workspace` 官方代码** —— 全部作为普通插件实现(client 半以 `priority -100` 填充 directory-flow holes)。
|
|
31
|
+
|
|
32
|
+
## 安装
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
dsh plugin add dsh-remote # 添加 bundle
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
(或 `npm install dsh-remote`,再在 `cordis.patch.yml` 加 `- id: dsh-remote / name: dsh-remote`。)
|
|
39
|
+
|
|
40
|
+
## 快速上手
|
|
41
|
+
|
|
42
|
+
1. **加一台机器** —— 设置 → 远程工作区 → 填 host/port/user + 密码或 key →(可选)设为当前。
|
|
43
|
+
2. **选工作区** —— 点侧边栏/会话的 **Add workspace**:
|
|
44
|
+
- **本机** → 系统文件夹选择(或输入本地路径)→ 本地工作区。
|
|
45
|
+
- **远程** → 选机器 → 浏览到远程目录(或输入 `/path`)→ 「设为远程工作区」⇒ 创建并收养一个本地镜像工作区。
|
|
46
|
+
3. **让 Agent 工作** —— 把它当普通工作区用:
|
|
47
|
+
- `rw_list_dir(path?)` / `rw_read_file` —— 查看远程文件
|
|
48
|
+
- `rw_exec(command)` —— 在远程执行命令
|
|
49
|
+
- `rw_sync` / `rw_push` —— 拉取/推送本地镜像 <-> 远程
|
|
50
|
+
|
|
51
|
+
## 可选:CLI 默认机
|
|
52
|
+
|
|
53
|
+
可在 `cordis.patch.yml` 提供默认机:
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
- id: dsh-remote
|
|
57
|
+
name: dsh-remote
|
|
58
|
+
config:
|
|
59
|
+
host: 10.0.0.8
|
|
60
|
+
port: 22
|
|
61
|
+
username: dev
|
|
62
|
+
privateKeyPath: C:/Users/you/.ssh/id_rsa
|
|
63
|
+
# 或用密码登录:
|
|
64
|
+
# password: '…'
|
|
65
|
+
workspace: /home/dev/project
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
若 `host` 为空,插件启动时处于断开状态,在 UI 里配置机器即可。
|
|
69
|
+
|
|
70
|
+
## 配置
|
|
71
|
+
|
|
72
|
+
| 键 | 类型 | 默认 | 说明 |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| `host` | string | `''` | 默认 SSH 主机(空=断开) |
|
|
75
|
+
| `port` | int | `22` | 默认 SSH 端口 |
|
|
76
|
+
| `username` | string | `''` | 默认 SSH 用户 |
|
|
77
|
+
| `password` | string | `''` | 默认 SSH 密码(非空覆盖 key) |
|
|
78
|
+
| `privateKeyPath` | string | `''` | 私钥路径(空=`~/.ssh/id_rsa`) |
|
|
79
|
+
| `workspace` | string | `''` | 默认远程工作区路径 |
|
|
80
|
+
| `commandTimeoutMs` | int | 20000 | 单条远程命令超时 |
|
|
81
|
+
| `connectTimeoutMs` | int | 15000 | SSH 连接超时 |
|
|
82
|
+
|
|
83
|
+
## 安全提醒
|
|
84
|
+
|
|
85
|
+
把机器凭据交给插件,等于允许 Agent 以你的用户身份在主机上执行 **shell 命令**。只添加你可信的机器。密码保存在本机文件里,请当作敏感数据处理(可收紧文件 ACL)。
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
84
89
|
MIT
|
package/lib/index.js
CHANGED
|
@@ -834,7 +834,10 @@ export async function apply(ctx, config) {
|
|
|
834
834
|
if (!dp || typeof dp.capability !== 'function') return sendJson(res, 400, { ok: false, error: '本地目录选择器服务不可用(缺少 DSH directory-picker backend)' })
|
|
835
835
|
const cap = await Promise.resolve(dp.capability())
|
|
836
836
|
if (!cap || cap.kind !== 'native' || typeof cap.pick !== 'function') return sendJson(res, 400, { ok: false, error: '本地目录选择器不可用(当前为非原生/浏览后端,请在输入框手动填本地路径)' })
|
|
837
|
-
const
|
|
837
|
+
const pickAbort = new AbortController()
|
|
838
|
+
const signal = pickAbort.signal || null
|
|
839
|
+
const picked = await Promise.resolve(cap.pick(signal))
|
|
840
|
+
pickAbort.abort()
|
|
838
841
|
if (!picked || typeof picked !== 'string') return sendJson(res, 200, { ok: true, cancelled: true })
|
|
839
842
|
return sendJson(res, 200, { ok: true, path: picked })
|
|
840
843
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Remote-work assistant for DeepSeek Harness: connect SSH (password or key), pick a remote workspace, operate on it with rw_pick_workspace / rw_list_dir / rw_read_file / rw_exec / rw_sync tools, and mirror it to a real local directory (SFTP) so the DSH native workspace can adopt it.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|