dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
MobaXterm-style SSH/SFTP tool plugin for DeepSeek Harness (DSH): saved connection profiles, persistent multiplexed sessions, remote command execution, SFTP file transfer, and a web GUI console with file browser + live xterm terminal.
DeepSeek Harness (DSH) 的 SSH/SFTP 工具插件,提供类似 MobaXterm 的远程主机接入能力:连接配置管理、持久会话复用、远程命令执行、文件上传/下载/读写,以及 Web GUI 里的远程操作窗口(文件浏览器 + 实时终端)。适用于接入 Linux 主机,例如阿里云 ECS。
插件加载后,会话标题栏顶部的标签行(与「轨迹」同一排)会出现 「🖥️ SSH 远程控制」 标签。点击后像浏览器切换标签页一样,主区域整体切换到 SSH 远程控制台:
aliyun);新建终端使用当前选择的连接。ssh_connections action=add/remove 的变更也会在数秒内自动同步到下拉框。实现:host 侧在 webServer 注册 /plugins/dsh-tool-ssh/* 端点(loopback + Origin 围栏);client 侧是 client.js 模块,注册为 conversation.view 会话视图(与 trajectory 同 slot);终端输出经 SSE 流式推送,宿主为每个会话保留有界回放缓冲;xterm.js/addon-canvas.js/xterm.css 由插件自身的 /assets 路由提供。
限宽列处理:dsh web 的会话内容区默认被
--dsh-chat-content-width: 748px限宽并居中。插件在浏览器端注入页面级<style>,用[data-phase]:has([data-dsh-ssh-view])作用域把该变量与max-width覆盖为全宽——仅在 SSH 视图激活时生效,切回对话/轨迹即自动恢复,不影响聊天观感;样式在插件卸载时移除。
| 工具 | 作用 |
|---|---|
ssh_connections | 管理已保存的连接配置(list/add/update/remove),存在 $DSH_HOME/dsh-tool-ssh/connections.json |
ssh_connect | 打开持久 SSH 会话(用已保存的配置,或内联 host/user/密码/密钥) |
ssh_exec | 在远程主机执行命令,返回 stdout/stderr/退出码;无会话时按已存配置自动连接 |
ssh_read | 通过 SFTP 读取远程文本文件 |
ssh_write | 通过 SFTP 写入远程文本文件 |
ssh_list | 列出远程目录(类型/权限/大小/修改时间) |
ssh_upload | 本地上传 → 远程(SFTP fastPut) |
ssh_download | 远程下载 → 本地(SFTP fastGet) |
ssh_disconnect | 关闭会话 |
ssh_sessions | 列出当前打开的会话 |
ssh_connect 后,后续 ssh_exec / SFTP 工具共用同一条连接(多路复用),类似 MobaXterm 的会话标签页。connection 时,可以是已保存的配置名,也可以是 ssh_connect 指定的 sessionId;如果对应会话未打开但存在同名配置,会自动连接。$DSH_HOME/dsh-tool-ssh/connections.json(默认),请自行保证本机安全;推荐使用密钥认证。# 方式一:从 GitHub 安装(发布后)
dsh plugin --profile web add git+https://github.com/hoshinoick811/dsh-tool-ssh.git
# 方式二:本地开发(从插件目录的上级执行)
dsh plugin --profile web add file:F:/new project/dsh-tool-ssh
# 装完重启 web profile(dsh web / 重启 GUI),工具即出现在模型目录
安装后 dsh plugin 会自动把声明了 dsh.bundle.patch 的依赖加入 profile 的
dsh.profile.bundles 层;插件行通过包内 cordis.patch.yml 的 insert 挂载到 profile 根组合,工具全局注册。
1. ssh_connections action=add name=aliyun host=192.0.2.1 username=root privateKeyPath=C:\keys\aliyun.pem
2. ssh_exec connection=aliyun command="systemctl status nginx"
3. ssh_read connection=aliyun remotePath=/etc/nginx/nginx.conf
4. ssh_write connection=aliyun remotePath=/etc/nginx/conf.d/app.conf content="server { listen 80; ... }"
5. ssh_upload connection=aliyun localPath=./dist/index.html remotePath=/var/www/app/index.html
6. ssh_download connection=aliyun remotePath=/var/log/nginx/error.log
7. ssh_disconnect connection=aliyun
lib/ssh-core.js — 会话管理器(ssh2 封装),可独立于 DSH 测试。test/smoke.mjs — 针对公开测试服务器 test.rebex.net(demo/password,端口 2222)的核心逻辑冒烟测试:cd dsh-tool-ssh
npm install
node test/smoke.mjs