Introduction¶
In DSH (DeepSeek Harness)’s plugin-based architecture, the integration between the sidebar and SSH remote sessions typically needs to be handled separately. The dsh-sidebar-remote plugin aggregates dsh-better-sidebar and @dsh-ssh/dsh-ssh, providing a single installable solution. It addresses the need to execute remote workspace file operations, terminal, and Git on the remote side while keeping the local workspace sidebar’s original behavior.
Plugin Introduction¶
dsh-sidebar-remote is a DSH Web aggregation plugin. It is maintained by zijun-T. Its core value lies in offloading SSH remote workspace functionality (files, preview, transfer, terminal, Git) entirely to remote execution while maintaining local sidebar consistency through the plugin mechanism.
Core Features¶
The plugin provides the following capabilities:
* File tree / browsing: via SFTP readdir and stat probes.
* Read / edit / save: via Sftp.readText, applyLiteralEdit, and writeFileAtomic.
* Upload / download: uses Sftp.createWriteStream / createReadStream, with automatic cleanup on failure.
* Preview: provided through the /sidebar/remote/html/<sid>/<path> route.
* Terminal: implemented via SshConn.shell PTY, with a 30-second reconnect grace period.
* Git: executed remotely via git -C <cwd> --no-pager -c color.ui=false.
Installation and Configuration¶
The plugin is installed via the dsh plugin command. After installation, cordis.patch.yml automatically mounts the aggregation plugin.
- Install from a local path:
dsh plugin --profile web add /path/to/remote-sidebar-plugin
- Install from a tarball (recommended for cross-machine deployment):
First, pack it on the source machine:
npm pack
Then install it on the target machine:
dsh plugin --profile web add ./dsh-sidebar-remote-0.2.1.tgz
- Install from NPM:
dsh plugin --profile web add dsh-sidebar-remote
Remove the plugin:
dsh plugin --profile web remove dsh-sidebar-remote
Dependency Requirements¶
The following environment is required to run this plugin:
* DSH: 0.1.1-rc.2
* Cordis: ^4.0.1
* Node: >=22
* Upstream plugins: dsh-better-sidebar (0.17.1), @dsh-ssh/dsh-ssh (0.1.3)
Usage and Updates¶
Behavior after installation:
The plugin provides no additional UI and has no standalone entry point. After installation, the sidebar automatically distinguishes between local and remote sessions. Local sessions do not establish an SSH connection and retain the original dsh-better-sidebar behavior.
Update considerations:
1. After updating, you must restart the dsh web process (the Host side does not support hot reloading).
2. The browser side must be hard-refreshed (Ctrl+Shift+R) to avoid reusing the old client bundle.
Update command:
# 使用 pnpm 更新 git 依赖
cd ~/.dsh/profiles/web && pnpm update dsh-sidebar-remote
Prompt Path Rewriting (0.2.1+)¶
The remote session cwd is originally a placeholder in the model prompt’s sandbox:policy. The plugin rewrites it back to the actual remote path during assembly.
- Primary path rewriting: registered through
deepseek-harness-zh_pro’sregisterAssembleRewriter(runs after translation). - Fallback rewriting: an
agent/pre-steplistener performs the same replacement ondecision.messages. - Mapping construction: built by
remoteCwdMapOf(), based on the array of active sessions returned byctx.sessions.list().
Verification method: In the context injection of remote session conversations, sandbox:policy displays the actual path, and Host logs output rewriter: replaced "<placeholder>" → "<actual path>".
Cross-Machine Deployment¶
When mounting, the client fetches the authoritative placeholder root from GET /sidebar/remote/root, so a single bundle can serve any deployment.
Configuration migration:
Migrating ~/.dsh/settings.yaml is sufficient to carry over host settings and sidebar preferences. Note that private keys and known_hosts are not migrated automatically; manually copy ~/.ssh/* to the new device or rebuild them through a TOFU conversation.
Verification¶
The plugin includes automated verification scripts, which can run some tests without network access or a remote host.
npm install
npm run typecheck
npm test # 102 tests / 14 suites
npm run build
npm pack --dry-run
Real-device end-to-end verification:
DSH_ORIGIN=http://127.0.0.1:3080 \
DSH_HOST_ID=<settings.yaml 里的主机 id> \
DSH_REMOTE_PATH=/path/on/remote \
DSH_EXPECT_ENTRY=<该目录下必然存在的名字> \
npm run verify:live # 14 项断言