rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:xwamt/at-terminal-dsh
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness (DSH) 原生 SSH 终端、SFTP 远程文件工作区与 Agent 直连运维套件。
Native SSH terminal, SFTP remote file workspace, and direct Agent ops suite for DeepSeek Harness.
Release 0.3.1 (2026-11-11) — DSH 0.2.2-rc.1 compatibility and reliability release: hardened npm packaging and engines, SFTP
edit_filewith stale-version protection, optional multi-fileapply_patch, native context menus/file actions, SFTP tree + preview split layout, and idle-disconnect cleanup that releases the terminal's SFTP and agent SFTP connections. Full notes: docs/releases/0.3.1.md.
This project is an independent architecture adaptation of the open-source project AT Terminal (at-terminal), specifically re-engineered for DeepSeek Harness (DSH).
While retaining the mature SSH terminal session engine, SFTP protocol pipeline, and security policy core from upstream, this repository completely decouples from VS Code-specific shells and redundant dependencies. It is built natively on DSH's Cordis plugin microkernel architecture, providing minimal resource overhead and direct Agent invocation.
[!TIP] Looking for the VS Code / Cursor version?
If you are using VS Code, Cursor, or compatible AI IDEs, please visit the upstream repository:
🔗 GitHub Repository: https://github.com/xwamt/At-Terminal
(Offers both the Base variant and the MCP variant backed by the AT Series Hub).
ctx.tools) — 18 by default, plus the opt-in apply_patch: SSH servers, remote commands (including background jobs and job control), terminal context, 10 SFTP operations, hardware metrics, agent execution status and the monitor HUD. Every tool validates its arguments and answers with an actionable message instead of a raw JavaScript error.exec.signal for real-time cancellation when an agent task is aborted.ctx.approval workflow and provides formatted output.render rich outputs.run_in_background returns a job id the model can collect with the host's job_output and stop with job_kill (the plugin's at_terminal_job_* pair appears only in compositions without those host tools); a result too large to inline is written to a file and returned as a spillPath to read in slices, instead of flooding the transcript.at_terminal_sftp_write_file accepts a host-side localPath, so the host reads and streams a local file to the remote instead of routing it through the model context (a 7.3 MB binary uploads in ~0.5 s with a byte-identical sha256).jumpHostId support for tunneling into private networks through jump hosts.HostKeyVerifier fingerprint checks.none): Strict confirmation required for every command and file modification.policy, recommended): Evaluated by @at-series/command-policy. Safe queries (uptime, df -h) run smoothly; sensitive/destructive commands trigger approvals; unauthorized escalations are blocked.full): Auto-approves commands for automated pipelines (destructive warnings still active).backgroundConnectionAllowed): Allows agents to spin up headless background SSH/SFTP sessions when no terminal tab is active.⚠️ Destructive command warning: this command appears destructive! badges and risk summaries for commands like rm -rf or disk formatting./etc).sshManager.idleDisconnectMinutes (default 60, 0 disables) with no terminal input or output, the SSH terminal closes and every SFTP connection attached to it — including the agent's pooled SFTP session — is released. The timer measures terminal traffic, not operating-system idle time.⌘C / ⌘V / ⌘F on macOS, Ctrl+C / Ctrl+V / Ctrl+F on Windows and Linux.Ctrl+C stays a shell interrupt instead of becoming "copy"; the DSH shortcut registry binds primary, so new-tab and page switches map the same way.type: "ssh" backend to dsh's own ctx.terminals, so the six built-in terminal_* tools drive a remote shell: terminal_open({ type: "ssh", name: "payment01" }), then terminal_send / terminal_read, and cd survives between calls.name is the server selector (server id first, then label; an ambiguous label is refused rather than guessed), because the official tool takes no serverId.cordis:group + isolate: { terminals: true }, so a profile without it is byte-for-byte unaffected, and the right-sidebar terminal (a different subsystem) keeps its own registry.SHA256: fingerprints you can compare against ssh-keygen -lf (and "forget" per server).--dsw-* tokens so they track the light/dark theme.You can directly install the plugin using DeepSeek Harness's CLI:
# Install under default/current profile
dsh plugin add github:xwamt/at-terminal-dsh
# Or install explicitly to desktop profile
dsh plugin --profile desktop add github:xwamt/at-terminal-dsh
# Or install explicitly to web profile
dsh plugin --profile web add github:xwamt/at-terminal-dsh
Note: Harness will automatically clone the repository, read the dsh.bundle manifest from package.json, and insert the cordis.patch.yml layer into your profile.
/path/to/at-terminal-dsh/dshThis plugin is officially listed in awesome-dsh-plugin / dsh-market:
at-terminal-dsh.The terminal_* family is a separate package (@at-series/dsh-at-terminal-ssh),
because it changes the composition rather than adding to this one. Installing this plugin does not
install it — that is deliberate: it would put six more tools in every user's tool table, and tools
cost prompt tokens on every request.
Two ways to add it:
From the panel (no terminal needed). Settings → Plugins → AT Terminal → 持久终端(可选) renders one row: Install when the package is missing, 启用 / 停用 once it is there, and the number of running components when it is active. The install pulls the exact version that pairs with the running plugin, from npm.
By hand. Same two commands as any other bundle:
npm install --save-exact @at-series/dsh-at-terminal-ssh # or:
dsh plugin --profile desktop add @at-series/dsh-at-terminal-ssh
then add it to your profile's dsh.profile.bundles (the plugin manager writes that entry when it
does the install; a manual npm install needs it added yourself).
It requires this package (@at-series/dsh-at-terminal) at the same minor version — the bundle
references its SSH backend by subpath (@at-series/dsh-at-terminal/terminal-backend), so the
backend lives in one place instead of being copied. It borrows this plugin's server list, stored
credentials and SSH layer; it has none of its own, and terminal_open says so if you disable AT
Terminal afterwards.
Verify it took: Settings → Plugins → @at-series/dsh-at-terminal-ssh should list three running
components (dsh-terminal → …/terminal-backend → dsh-tool-terminal). Turning it off is the same
switch: those three rows move together, which is why the capability is a bundle and not three
independently toggled rows.
| Tool Name | Category | Description |
|---|---|---|
at_terminal_ping |
Probe | Report readiness, capabilities, and the effective settings; reaches no remote host |
at_terminal_list_ssh_servers |
Assets | List configured SSH hosts, connection status, and trust level |
at_terminal_get_terminal_context |
Context | Get the focused, connected, and known terminal sessions |
at_terminal_run_remote_command |
Execution | Run a non-interactive command under the server's trust level and the command policy |
at_terminal_sftp_list_directory |
SFTP | List a remote directory with pagination (offset / maxEntries) |
at_terminal_sftp_stat_path |
SFTP | Inspect type, size, permissions, and modification time |
at_terminal_sftp_read_file |
SFTP | Read bounded UTF-8 text with offset and maxBytes |
at_terminal_sftp_edit_file |
SFTP | Edit remote UTF-8 text by replacing one literal string; it must match exactly once unless replaceAll: true. Preserves the file's CRLF/LF style and refuses binary or >2 MiB files. Pass expectedSize / expectedModifiedAt from a prior read to refuse a stale overwrite |
at_terminal_sftp_apply_patch |
SFTP | Optional, disabled by default (enableApplyPatch): apply one Codex-style patch across multiple remote UTF-8 files. Preflights the whole patch before writing anything, then commits in order and stops at the first failure; returns per-operation status. Remote patches do not enter DSH Review |
at_terminal_sftp_write_file |
SFTP | Write UTF-8 text after write authorization; existing files need overwrite: true. localPath names a file on the machine running the Host instead of passing content — the Host reads and streams it, so a binary or a large file never enters the model's context. An upload always asks, even at full trust |
at_terminal_sftp_create_file |
SFTP | Create a remote file, optionally with initial content |
at_terminal_sftp_create_directory |
SFTP | Create a remote directory after write authorization |
at_terminal_sftp_rename |
SFTP | Move or rename a path; source and destination both need write authorization |
at_terminal_sftp_delete |
SFTP | Delete a single file. Directories are refused — use at_terminal_run_remote_command with an explicit rm for one; the user always confirms |
at_terminal_open_monitor |
UI | Open the monitor — mode: "hud" (default) floats it, mode: "tab" puts it in the right sidebar; answers opened: false, reason: "no-client" when no panel is connected |
at_terminal_get_hardware_metrics |
Metrics | Read CPU, memory, disk, network, and top processes for an SSH server |
at_terminal_get_agent_execution_status |
Audit | Report the live action, recent audits (with source: file \| memory), and active transfers |
at_terminal_job_output |
Fallback job reader, registered only when the host's job_output is not visible. Reads what a background command has printed since the last read, with wait to block until it settles or the budget expires. Each call consumes what it returns |
|
at_terminal_job_kill |
Fallback job stopper, registered only when the host's job_kill is not visible. Stops a background command: SIGTERM to the remote process group, then up to a second proving it is gone, so a reported kill means the process ended |
本项目脱胎于开源项目 AT Terminal (at-terminal),是专为 DeepSeek Harness (DSH) 设计的独立架构适配版本。
在保留原项目出色的 SSH 终端会话、SFTP 文件引擎及安全策略内核的基础上,本项目彻底解耦并剥离了 VS Code 专属外壳与无用依赖,深度拥抱 DSH 的 Cordis 插件微内核体系,实现了极简的资源开销与更丝滑的 Agent 直连体验。
[!TIP] 需要 VS Code / Cursor 版本的插件?
如果您是在 VS Code、Cursor 或其他兼容 IDE 中寻找 SSH 终端管理或 MCP 工具扩展,请前往原项目仓库获取:
🔗 GitHub 仓库:https://github.com/xwamt/At-Terminal
该仓库提供面向 VS Code 的基础版(Base)及通过跨进程 MCP Hub 桥接的增强版(MCP Variant)。
传统的 AI IDE 往往依赖独立的 stdio/HTTP MCP Server 进程进行中转,存在进程通信开销大、状态同步复杂、生命周期脱节的问题。
ctx.tools)中注册最多 19 个直连工具(默认 18 个,另加可选的 apply_patch),覆盖 SSH 服务器、远程命令(含后台作业与作业控制)、终端上下文、10 个 SFTP 操作、硬件指标、Agent 执行状态与监控面板,DSH Agent 可零延迟直接调用。每个工具都会校验参数并返回可操作的错误信息,而不是裸的 JavaScript 异常。ctx.inject(['skills']) 注册三个运行期技能(巡检 / 远端编辑 / 故障记录),工具规则集中在一个提示词段里,工具定义体积比逐条描述小 45%。serverId 会直接报错并列出候选(打错机器的写入会返回看起来成功的 exitCode: 0);读类工具仍跟随活动终端,但结果里带 resolvedBy 与 candidates,事后能查「这次打到哪台、怎么定的」。at_terminal_run_remote_command 支持 run_in_background,命令不再占住一轮对话;标准 preset 下模型用宿主的 job_output / job_kill 取回与停止(只有在没有宿主 job 工具的组装里才会出现插件自带的 at_terminal_job_* fallback)。单个结果过大时写入溢出文件并返回 spillPath,按偏移分片读取,避免灌爆上下文。at_terminal_sftp_write_file 新增宿主侧 localPath——由宿主进程读本机文件并流式上传,7.3 MB 二进制约 470 ms 完成、远端 sha256 与本地逐字节一致,且零模型上下文开销。exec.signal,当用户在 DSH 界面点击停止生成或取消任务时,远端 SSH 命令与传输流立即被精确中断。ctx.approval 交互机制。output.render 格式化呈现,在 DSH 对话流中输出清晰美观的状态块与日志。jumpHostId)。ProxyJump 或 SSH config。HostKeyVerifier 指纹核对,防范中间人劫持风险。每台服务器均可配置精细的 Agent 访问权限模型,平衡自动化效率与系统安全:
none / Untrusted):对 Agent 保持最高警戒,任何命令执行与文件写入均强行拦截,必须由用户弹窗手动确认。policy / Policy-based,推荐):接入内置的 @at-series/command-policy 策略引擎。常规无害的查询命令(如 uptime、df -h、cat、free 等)依据策略规则放行;修改配置或危险命令触发审批;高危提权命令直接拦截。full / Trusted):命令免弹窗直接放行(破坏性命令仍保留危险保护机制),适用于测试沙盒或自动化高频运维场景。backgroundConnectionAllowed。在调用工具时,插件会向 DSH 界面触发不同安全级别的确认与警告弹窗:
| 场景 | 弹窗展示形态 | 触发条件与防护目的 |
|---|---|---|
| 标准操作确认 | 标题:Remote command requires confirmation展示:服务器标签、目标 IP、执行命令文本 |
处于 none 信任级别,或处于 policy 级别且命中需要人工复核的常规修改命令。 |
| 破坏性命令警告 | 标题带醒目标识:⚠️ Destructive command warning: this command appears destructive!附带详细的 Risk Summaries 风险分析清单 |
Agent 意图执行可能造成系统崩溃、数据丢失的高危命令(如 rm -rf、mkfs、格式化分区、清空系统目录等),强制醒目提示用户核验参数。 |
| 敏感远程写二次确认 | 标题:⚠️ Sensitive remote write warning展示:目标敏感文件路径与修改意图 |
针对敏感配置文件(如 /etc/、系统服务 unit 等)的 SFTP 覆盖或修改操作,防止误改关键系统环境。 |
@xterm/xterm 5.5 及 WebGL 插件,在 DSH 客户端界面流畅渲染海量日志与高频输出。sshManager.idleDisconnectMinutes(默认 60 分钟,0 关闭)无终端输入/输出后,SSH 终端关闭,跟随该终端的 SFTP 树与 Agent SFTP 连接(包括池化会话)一并释放;计时口径是终端流量,不是操作系统空闲时间。⌘⇧M 都只把胶囊显示出来(此前关掉再开也会弹成展开态);只有 at_terminal_open_monitor 这种明确要看窗口的入口才展开。at_terminal_open_monitor 的 mode: "hud" 浮窗、mode: "tab" 落到右侧栏页签(页签自带目标服务器,不会被「最近连接的那台」顶掉)。--dsw-* token,跟随明暗主题,文案中英双字典。SHA256: 指纹(与 ssh-keygen -lf 同形可直接比对),可按服务器「忘记」;跳板机或被删服务器的残留密钥会写明原因,而不是给一个按下去没反应的按钮。⌘C / ⌘V / ⌘F,Windows 与 Linux 为 Ctrl+C / Ctrl+V / Ctrl+F。Ctrl+C 仍是 SIGINT;⌘V 走浏览器原生 paste 事件,无需额外的剪贴板读权限。primary 语义绑定,macOS 自动为 Command、其他平台为 Control。@at-series/dsh-at-terminal-ssh 后,模型可用 terminal_open({type:'ssh', name:'<服务器 id 或名称>'}) 开一个会话,terminal_send / terminal_read / terminal_close 连续操作——适合需要保持 cd、REPL、长任务的场景。at_terminal_run_remote_command 做不到这件事,它每条命令一条通道。ctx.terminals:给 DSH 内置的六个 terminal_* 工具接一个 type: "ssh" 后端,而不是另写一套终端工具——工具的返回形状、截断、wait 语义都跟着宿主走,宿主升级我们也跟着走。name 就是服务器选择器:官方工具没有 serverId 参数,所以按「id 优先、名称其次」匹配,同名两台直接报错并列出两个 id(不替使用者挑一台)。cordis:group + isolate: { terminals: true },不装它的 profile 完全不受影响,装上也不会和右侧栏终端(另一套子系统)抢同一个注册表。inferred_idle;terminal_signal 直接拒绝(ssh2 无 pty 信号通道,改用 Ctrl+C 或关闭会话)。npm install --save-exact @at-series/dsh-at-terminal-ssh。装主插件不会自动带上它——那会给每个用户的工具表平白加 6 个工具,而工具是要按请求付 prompt token 的。执行构建后,将在 dsh/ 目录中生成供 DSH 运行的完整 bundle 产物:
dsh/host.bundle.js:宿主端核心 Bundle(汇聚 SSH 会话管理器、SFTP 协议引擎、安全策略评估器等);dsh/client.js:DSH 前端界面 Bundle(侧边栏 Tab 视图、面板与样式),首屏只取这一份;dsh/client.xterm.js:按需加载的终端渲染 chunk(xterm 及其 addon,约 600 KB),首次打开终端面板才拉取;dsh/policy-assets/:安全策略规则库与白名单资产包;cordis.patch.yml:DSH 插件规范清单与 Cordis 注入补丁。# 1. 编译构建宿主与客户端 Bundle
npm run build
# 2. 执行 DSH 官方规范契约校验 (12 项自动化合规规则全部检查)
npm run verify:dsh
# 3. 执行仓库内核隔离校验 (4 项:src/core 自封闭 / 零 vscode / 零 @deepseek-ai 导入 / 组合根调 setPlatform)
npm run verify:kernel
# 4. 运行全量自动化测试套件 (vitest;文件与用例数会随改动增长,故不在此写死)
npm run test
# 5. 执行 TypeScript 静态类型检查 (零报错)
npm run typecheck
# 6. 校验/更新 vendored 依赖 (@deepseek-ai/schemastery 等)
npm run vendor:dsh
# 7. 发布两个包(默认只做配对检查 + 跑四道门禁并打印计划,加 --publish 才真发)
npm run release
npm run release -- --publish --tag
发布为什么是一个命令:本仓库发的是两个 npm 包(插件 + 可选组合包)。组合包按 subpath 引用插件的
terminal-backend,所以两者版本必须同步——只发插件不算发版。release脚本会先校验 「版本一致 + peer 范围接受该版本」,不一致直接拒绝;已在 registry 上的版本会跳过,重复跑是安全的。
[!IMPORTANT] 三种安装方式:
方式一:通过 DSH 命令行一键添加(最推荐,任意设备通用)
# 默认/当前配置下安装 dsh plugin add github:xwamt/at-terminal-dsh # 或指定 desktop 桌面配置文件安装 dsh plugin --profile desktop add github:xwamt/at-terminal-dsh # 或指定 web 配置文件安装 dsh plugin --profile web add github:xwamt/at-terminal-dsh说明:Harness 会自动拉取 GitHub 仓库,读取
package.json中的dsh.bundle清单并自动将cordis.patch.yml注入到当前 Profile 中。方式二:桌面端本地目录加载(适合本机开发与即时生效)
- 打开 DeepSeek Harness 客户端;
- 进入 设置 -> 插件管理 -> 安装本地插件 / 导入本地包;
- 填写本机的 Bundle 绝对路径:
/path/to/at-terminal-dsh/dsh- 安装完成后彻底重启 DSH 即可生效。
方式三:通过 dsh-market 社区插件市场一键安装
本插件已提交至官方插件索引 awesome-dsh-plugin (PR #7178):
- 在 DeepSeek Harness 中打开
dsh-market插件市场;- 在 Remote(远程与运维) 分类下搜索
at-terminal-dsh;- 点击 安装 按钮即可一键完成装载与自动配置。
项目根目录的 skills/ 文件夹中收录了深度适配的技能集。这些技能文件完全脱胎于 DeepSeek Harness 官方的「创造模式」(preset id = cordis)规范:
skills/
├── dsh-creator-skills/ # DSH 创造模式全局指引与架构全景入口
├── cordis-plugin-development/ # Cordis 插件生命周期、UI 装饰与右侧面板开发规范
├── editing-cordis-compositions/ # Preset 编排、Agent 预设配置与分层 patch 机制
├── cordis-composition-reference/ # Loader YAML 方言参考与 Harness 内部核心模块清单
├── agent-experience/ # 面向 AI Agent 的工具 Schema 设计与调用体验规范
└── writing-ops-documents/ # 规范化中文运维记录、巡检排障与 RCA 报告编写技能
跨 Agent 复用价值:如果在 Claude Code、Codex、Cursor Agent、Antigravity 等其他 Agent 环境中开发任何 DSH 系列插件或扩展,可直接将本目录挂载给 Agent,作为编写 Cordis 插件与设计 Agent 直连工具的权威规范。
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。