dsh-ssh-file 0.0.0-stage → 1.2.2
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/LICENSE +21 -0
- package/README.md +73 -2
- package/cordis.patch.yml +4 -0
- package/icon.svg +7 -0
- package/lib/client.js +1364 -0
- package/lib/descriptors.js +63 -0
- package/lib/index.js +1235 -0
- package/lib/remote.js +9 -0
- package/lib/schemas.js +130 -0
- package/lib/typert.js +81 -0
- package/locale/en.json +4 -0
- package/locale/zh.json +4 -0
- package/package.json +77 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-remote-workspace contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-ssh-file
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
远程工作区插件 for DeepSeek Harness (DSH) — 把任意 DSH 工作区锚定到远程服务器的目录上,让 Agent 直接读写远程文件、执行远程命令。
|
|
4
|
+
|
|
5
|
+
**完全独立,不依赖 dsh-ssh-ops。** 自含 SSH/SFTP 引擎(ssh2)、服务器与凭据管理、可视化远程目录浏览、远程工作区绑定,以及一组 `remote_*` Agent 工具。
|
|
6
|
+
|
|
7
|
+
[中文说明](#中文说明) · [English](#english)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 中文说明
|
|
12
|
+
|
|
13
|
+
### 功能
|
|
14
|
+
|
|
15
|
+
- **本地 / 远程工作区选择** — 侧栏「+」添加工作区、以及聊天输入框上方的工作区选择器,都会出现「本地文件夹 / 远程 SSH 目录」双选项
|
|
16
|
+
- **服务器管理** — 插件内置服务器管理界面:保存多台服务器(主机/端口/用户名/密码或私钥),凭据存入 DSH 官方凭据服务,不落明文
|
|
17
|
+
- **可视化远程目录浏览** — 连接后像本地一样浏览远程目录(面包屑、主目录/根目录、绝对路径跳转)
|
|
18
|
+
- **一键绑定** — 选中远程目录后,自动创建本地镜像工作区(锚点文件夹)、注册为 DSH 工作区、打开新会话,并把工作区绑定到远程目录;侧栏标题带 🌐 标识
|
|
19
|
+
- **Agent 远程工具**(注册为 DSH 工具,Agent 自动可用):
|
|
20
|
+
- `remote_list` — 列远程目录
|
|
21
|
+
- `remote_read` — 读远程文件(256KB 上限 + 截断标记)
|
|
22
|
+
- `remote_write` — 写远程文件
|
|
23
|
+
- `remote_mkdir` — 创建远程目录(mkdir -p 语义)
|
|
24
|
+
- `remote_exec` — 执行远程命令(stdout/stderr/退出码,64KB/流上限,超时控制)
|
|
25
|
+
- `remote_bindings` — 列出当前所有绑定
|
|
26
|
+
- **自动感知** — 绑定的工作区内,Agent 每轮对话都会被告知当前绑定的服务器与远程根目录,自动使用 remote_* 工具;本地镜像文件夹只是锚点,不含远程文件副本,无同步、无卡顿
|
|
27
|
+
- **远程文件面板(v1.1.0)** — 右侧边栏新增「🌐 远程文件」标签页:浏览远程目录树、点击文件在线预览、编辑并保存回远程主机(绑定会话无需离开 DSH)
|
|
28
|
+
- **远程终端(v1.1.0)** — 绑定远程的工作区里,点「新建终端」直接打开远程主机的 SSH shell,并自动 cd 到绑定的远程目录(或会话子目录);未绑定的会话终端行为完全不变(本地)
|
|
29
|
+
- **安全** — 密码/私钥通过 DSH 凭据服务存储;远程路径越界防护(所有操作锁定在绑定的远程根目录内)
|
|
30
|
+
|
|
31
|
+
### 使用
|
|
32
|
+
|
|
33
|
+
1. 侧栏「+」(或聊天框上方的工作区选择器)→ 选「🌐 远程 SSH 目录」
|
|
34
|
+
2. 首次使用点「管理服务器…」添加服务器
|
|
35
|
+
3. 点击服务器连接 → 浏览远程目录 → 选中目标目录 → 「使用此目录」
|
|
36
|
+
4. 新会话里直接让 Agent 操作远程文件/执行远程命令
|
|
37
|
+
|
|
38
|
+
### 安装
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
# 从 npm
|
|
42
|
+
dsh plugin install dsh-ssh-file
|
|
43
|
+
# 或从 GitHub Release / 仓库地址安装(见市场条目)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
也可以在 DSH 内:设置 → 插件 → 插件市场 搜索 `remote workspace`。
|
|
47
|
+
|
|
48
|
+
### 隐私与安全
|
|
49
|
+
|
|
50
|
+
- 凭据仅保存在本机 DSH 凭据库
|
|
51
|
+
- 所有远程操作限定在绑定的远程根目录内,路径逃逸会被拒绝
|
|
52
|
+
- 插件不收集、不上传任何数据
|
|
53
|
+
|
|
54
|
+
## English
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
|
|
58
|
+
- **Local / remote workspace choice** — both the sidebar "+" add-workspace flow and the composer workspace picker offer "Local folder / Remote SSH directory"
|
|
59
|
+
- **Server manager** — save multiple SSH servers (host/port/user/password/key); secrets live in the DSH credentials service, never in plaintext
|
|
60
|
+
- **Visual remote directory browser** — breadcrumbs, home/root shortcuts, absolute-path jump
|
|
61
|
+
- **One-click bind** — picking a remote directory creates a local anchor workspace, registers it with DSH, opens a new session, and binds it to the remote path (sidebar title gets a 🌐 marker)
|
|
62
|
+
- **Agent tools** — `remote_list`, `remote_read` (256 KB cap + truncation flag), `remote_write`, `remote_mkdir`, `remote_exec` (64 KB/stream cap, timeout, exit code), `remote_bindings`
|
|
63
|
+
- **Automatic awareness** — sessions in a bound workspace are told which server and remote root they target, so the agent uses the remote tools without being told twice; the local anchor folder holds no copy of remote files — no syncing, no lag
|
|
64
|
+
- **Remote files panel (v1.1.0)** — a "🌐 Remote Files" tab in the right sidebar: browse the remote tree, click a file to preview it, edit and save back to the server without leaving DSH
|
|
65
|
+
- **Remote terminal (v1.1.0)** — in a bound workspace, "New terminal" opens an SSH shell on the remote host, automatically `cd`-ed into the bound remote directory (or the session's subdirectory); unbound sessions keep the local terminal unchanged
|
|
66
|
+
- **Safety** — path-escape protection locks every operation inside the bound remote root
|
|
67
|
+
|
|
68
|
+
### Privacy
|
|
69
|
+
|
|
70
|
+
Credentials stay in the local DSH credential store. The plugin collects nothing.
|
|
71
|
+
|
|
72
|
+
### License
|
|
73
|
+
|
|
74
|
+
MIT
|
package/cordis.patch.yml
ADDED
package/icon.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
|
|
2
|
+
<rect x="3" y="6" width="26" height="20" rx="4" fill="none" stroke="currentColor" stroke-width="2"/>
|
|
3
|
+
<path d="M3 12h26" stroke="currentColor" stroke-width="2"/>
|
|
4
|
+
<circle cx="8" cy="9" r="1.4" fill="currentColor"/>
|
|
5
|
+
<circle cx="12.5" cy="9" r="1.4" fill="currentColor"/>
|
|
6
|
+
<path d="M11 18l4 4 6-7" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
</svg>
|