Foreword

DeepSeek Harness (DSH) extends its capabilities through a plugin system. dsh-workspace-enhancement is a DSH plugin maintained by DobyChao. Its core value is to manage local workspaces and remote (SSH) workspaces together within a single session. It addresses the problem of frequently switching context between the local file system and multiple remote servers in development or operations scenarios.

Core Features

The plugin primarily provides the following capabilities:

  1. Remote Workspace Management
    Using the ssh2 library, it runs bash, file operations, PTY terminals, and directory browsing over a single SSH connection (supports multi-hop bastion hosts). Existing tools that use ctx.subprocess or ctx.fs can run remotely without code changes.

  2. Multi-Workspace Sessions
    Within a main session, additional local or remote directories can be attached via the “⊕ Workspace” button. These directories exist as a declared list and support mounting, unmounting, and labeling. The model can perceive this context and operate on it directly.

  3. Workspace Addition Flow
    The plugin provides a connection sidebar (including saved machines, ~/.ssh/config aliases, and local paths) and a directory browser (supporting breadcrumb navigation, native selectors, and creating new folders). In remote mode, clicking “Connect and Open” creates a session.

  4. Machine Settings
    The plugin includes a built-in machine settings page, supporting CRUD operations for machines, connection testing, setting the current machine, and forgetting host keys. It also supports system keychain passwords and TOFU (Trust on First Use) host key management.

  5. Session Awareness
    The sidebar displays remote markers, a tri-state online indicator, and reconnection functionality. Session prompts explicitly inform the model whether it is currently in a remote or attached workspace context.

  6. Cross-Server Execution
    Provides the sw_exec(server, command) tool to run commands on registered, named machines.

  7. Remote Approval Gating
    Optional feature (disabled by default). Gating can be configured per machine. Before executing any shell-style remote command or opening a remote terminal, the system prompts the user. If the user selects “human”, it asks each time; if “ai” is selected, it automatically grants short-lived read-only whitelisted commands (such as pwd, ls, git status) and asks for the remaining commands.

  8. Model Tools
    Tools callable by the model include sw_status (view current session status), sw_connect (connect a registered machine), and sw_exec.

  9. Runtime Localization
    UI text, tool descriptions, error messages, and routing errors follow the language option on the settings page (zh/en), defaulting to the browser language.

Installation and Enablement

Before installation, ensure that the DSH pnpm supply chain is used to allow native build scripts (such as ssh2 and node-pty) to run.

# 使用 npm 安装
dsh plugin --profile web add dsh-workspace-enhancement

# 从源码安装(需先运行 npm run build)
dsh plugin --profile web add <this-repo-path>

Typical Usage

After installation, the model can use the following tools and interaction patterns:

  • Cross-Server Execution: The model sends commands to registered machines via sw_exec(server, command).
  • Status Query: Use sw_status to check the current session connection status.
  • Connect Machine: Use sw_connect to attach a registered machine to the current session.
  • Attach Directory: The user clicks the “⊕ Workspace” button in the session header to manually mount additional local or remote directories.

Notes

  1. No Remote Dependencies: DSH does not need to be installed on remote servers. The model orchestrates locally, commands are executed remotely, and results are returned to the context.
  2. Version Compatibility: The host and plugin versions must remain consistent. The plugin has explicit compatibility requirements for different DSH versions; refer to the compatibility documentation in the GitHub repository.
  3. Approval Gating Defaults: Remote approval gating is disabled by default, and manual confirmation is required before each sensitive operation.

Summary

dsh-workspace-enhancement provides DSH with structured SSH remote execution and file system proxy capabilities, while solving context fragmentation through the multi-workspace mechanism. It is suitable for developers who need to manage local codebases and multiple remote servers simultaneously.

GitHub Repository: https://github.com/DobyChao/dsh-workspace-enhancement