dsh-waypoint
wooyang2018/dsh-waypoint
SSH 远程开发如本地会话:注册主机后自动安装远端 DSH,侧栏映射远程工作区和会话,以同一隧道连接终端、文件和开发服务。
安装
dsh plugin --profile web add github:wooyang2018/dsh-waypointREADME
dsh-waypoint
English | Chinese
SSH remote development that behaves like a local session.
Add an SSH host once. The plugin provisions the remote DSH runtime itself, mirrors its workspaces and sessions into the local sidebar, and opens a remote session in the ordinary Conversation UI — the same transcript, composer, tool cards, stop control, and session list as a local session.

Local DSH Remote host
┌────────────────────────────────────────┐ ┌──────────────────────────────────┐
│ normal sidebar + Conversation UI │ │ dsh web (installed by plugin) │
│ local mirror Session + Agent façade │ │ dsh-waypoint-agent │
│ host registry / auto provisioning │ │ workspace/session write │
│ direct key or local key proxy │ │ remote tools + model calls │
│ authenticated /api route │ │ │
└────────────────────────────────────────┘ └──────────────────────────────────┘
Supported environment
This plugin is developed for the official DSH Desktop application. Supported DSH versions:
| Component | Version |
|---|---|
| DSH Desktop / official client | 0.2.2-rc.5 (tested) |
| Plugin | 1.2.1 |
| Remote DSH runtime | 0.2.2-rc.5 (tested; new installs follow the local DSH version) |
| Remote Node.js | 22.19+ (one-click nvm + latest LTS install from the host card) |
| Remote OS | Linux or macOS |
Only the official Desktop client is a verified GUI target. Other DSH GUI plugins, community forks,
modified clients, non-DSH GUIs, and other DSH versions have not been tested: the package's
dependency range is intentionally permissive for installation, but it is not a compatibility or support
guarantee. New remote installs follow the local DSH runtime version by default and can be pinned with
remoteDshVersion.
What works now
Everything below works against a real SSH host, with no client fork:
- Plugin-owned remote provisioning over SSH, including the local development build
(
scripts/dev/install-local.mjs) - Host registry, discovery, SSH tunnel, health, reconnect
- Remote workspaces appear as normal local workspaces
- Remote sessions appear in the normal sidebar, and open in the normal Conversation UI
- Localized UI follows the DSH language (zh / en)
- Prompts, stop, transcripts, tool cards, usage
- Per-host model key source (local proxy or remote direct)
- Remote model catalog, offered in the model menu for mirrored Sessions
- Restart the remote DSH without reinstalling (a
systemdunit; anohupdeployment uses Reinstall) - Open the remote DSH Web UI through the tunnel
- Remote file tree and file previews, agent-backed over the SSH tunnel
- Remote workspace search from the native file panel, by name or workspace-relative path
- Remote terminal per Session — local Sessions keep the local PTY, remote Sessions use the remote agent's PTY over the SSH tunnel
- Remote dev servers in the right-sidebar browser, through loopback port forwards (see below)
- Agent tools for host/workspace/session operations, switchable off by group
- Approval prompts bridged into the local UI
ask_user_questioncards bridged into the local UI too, so a remote agent that needs a decision does not stall waiting for an answer that only ever appeared in the remote Web UI
Remote file and terminal operations require the agent-backed API. If the connected remote agent is older, file/terminal actions fail with a Reinstall instruction instead of opening extra SSH connections.
Requirements
Local: official DSH Desktop or DSH Web with the
same core version, plus ssh with key or ssh-agent auth.
Remote: Linux or macOS with an SSH server. Node.js 22.19+ is
discovered through the account's own shell, so PATH, nvm, Volta, fnm, Bun, asdf, mise, Nix, and
Homebrew all answer. Provisioning does not install a runtime on its own: picking a version is your
decision, and a second one on the machine is how two runtimes end up fighting over one command. A
missing or too-old Node.js stops the install with a message naming what it found. When you want the
plugin to do it, the host's ⋯ menu offers Install remote Node.js: one click, which checks the host
first, installs nvm and the latest LTS (nvm install --lts) only if it is needed, never touches a shell
startup file, and reports the outcome as a line on the card. Windows remotes are not supported.
The remote terminal runs inside the agent process: @lydell/node-pty forks the shell, and the package
ships prebuilt binaries for Linux (x64/arm64, glibc) and macOS, so New terminal needs neither
python3 nor a compiler on the remote host. Nothing else depends on it: a host whose platform has no
prebuilt binary still installs, connects, and serves sessions, prompts, files, and transcripts — only
New terminal fails, with a message naming the platform. The terminal opens only inside a registered
workspace or a Session's working directory, starts the login shell (or a well-known POSIX shell), and
closes after 30 minutes without input (override with the agent's terminalIdleTimeoutMs; each open,
refusal, exit, and close is logged with its pid and path).
pnpm and @deepseek-ai/dsh are installed globally, into the prefix npm prefix -g reports, so the
dsh the plugin starts and the dsh you type yourself are the same file and the same version. Override
the prefix with remoteGlobalPrefix when npm's answer is not the one you want; there is no fallback
location, because a silently relocated dsh is exactly the divergence this removes. If that prefix is
not on your login shell's PATH, the install log prints the one export PATH=… line to add — the
installer never edits your shell startup files. A prefix npm cannot write fails the install with npm's
own error instead of installing somewhere else; note that npm writes <prefix>/lib/node_modules and
<prefix>/bin, so a machine can have one writable and not the other, which is what the installer's
doctor subcommand is for (node packages/installer/lib/cli.js doctor --target <host>).
If the remote host needs a proxy, set remoteInstallProxy to a URL that is reachable from the remote
host, for example http://127.0.0.1:17890 when a port forward serves the proxy there. The installer
exports HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and npm_config_* for the bootstrap. When the option
is empty, it uses the account's actual login shell (bash, zsh, fish, and other common shells) and its
login/interactive startup files to read HTTPS_PROXY/HTTP_PROXY. The same proxy is written into the
remote systemd unit (or inherited by the nohup process), so remote model requests use it as well, not
just the installer.
Install
From the DSH plugin page
Open Plugins → Add plugin and enter:
dsh-waypoint
The package is published on npm; DSH installs the bundle from the registry. The package includes the remote agent asset, so there is nothing else to install. Restart DSH when the plugin page asks for it; Settings → Remote development then appears.
If npmjs.com still resolves an older latest tag for a newly published release, install the exact
current version instead:
dsh-waypoint@1.2.1
From a source checkout
For development, clone the repository and run the installer:
cd /path/to/dsh-waypoint
pnpm install
pnpm -r build
node scripts/dev/install-local.mjs
The script builds the workspace, creates a single plugin tarball, and installs it — into the desktop
profile by default:
node scripts/dev/install-local.mjs # desktop profile
node scripts/dev/install-local.mjs --profile web
Two things it does that a hand install does not: it stages the tarball under the profile's own DSH home
so removing the checkout cannot break the installed plugin, and it runs the CLI's own runCli (with the
in-process permission the reserved desktop profile requires) so bundle registration and the profile
lock behave exactly as in the running app. A running DSH holds plugin files open, so quit it before
installing, then reopen it to load the new bundles. A broken record left by an earlier install is
cleared with --repair. docs/development.md has the detail.
Use
- In Settings → Remote development, the panel lists the hosts it found in
~/.ssh/config. Click Connect on the alias you want; the plugin registers it and connects. - On first use the plugin discovers or installs the remote agent, starts remote
dsh web, and opens the loopback tunnel. It also applies a model key source: with the default seed it copies the resolved model key into the remote environment. The card shows Installing → Connecting → Connected and the row reads Remote direct; switch Model source to Local proxy on the card if you would rather keep the key here. - In the sidebar Workspaces header, click +. The create dialog takes a name, a destination (This computer or a connected Remote devices entry), and a source folder — pick it with Browse… — then Create workspace. With no connected host the list offers Connect a remote host…, which opens Settings → Remote development.
- The create flow opens a remote Session, creates a local mirror, and opens it in the ordinary Conversation UI. The workspace row's New session action uses the same remote path.
- Type in the usual composer. The remote DSH runs the turn; the local transcript updates live. Tool calls, usage, stop, and multi-turn follow-ups behave like a local session.
- The Workspace files and New terminal panels follow the selected Session: local Sessions use the local machine, remote mirror Sessions use the remote workspace.
The Settings page is host and workspace management. The conversation is not a popup.
Model credentials
The choice is per host. Each host card has a Model source switch with two values (Local proxy / Remote direct), and the collapsed row states the live result as Local proxy, Remote direct, or Remote default:
- Local proxy — keeps the key on this machine. The remote DSH gets
DEEPSEEK_BASE_URL=http://127.0.0.1:47821and a per-host placeholder key; the SSH tunnel adds-R 127.0.0.1:47821:127.0.0.1:<local-proxy-port>; the local proxy validates that token, injects the real key and forwards tocredentialProxyUpstream. It also publishes this machine's provider list, so a mirrored Session can pick any model this machine can run. - Remote direct — the resolved local key is copied into the remote
dsh webenvironment (the systemd unit or thenohupenvironment) withDEEPSEEK_BASE_URL=https://api.deepseek.com/anthropic. The remote host calls DeepSeek directly.
Switching a host's source restarts its remote DSH, so the switch asks for confirmation on the card
before it applies. The profile-wide credentialProxy setting is only the seed for hosts that never
chose: false seeds remote direct, true seeds local proxy. A host that has chosen keeps its
choice.
If no local key resolves, the plugin still provisions and connects; configure the remote DSH's own credentials. The row then reads Remote default, meaning the plugin supplied no key and the remote host uses its own. docs/operations.md has the operator steps and docs/model-credentials.md the mechanism.
Agent tools
| Tool | Purpose |
|---|---|
remote_hosts_list | Hosts, phases, remote facts |
remote_host_add | Add an SSH host and start provisioning |
remote_host_connect | Connect/reconnect/refresh |
remote_host_provision | Force reinstall/restart and reconnect |
remote_host_restart | Restart the remote DSH service without reinstalling |
remote_host_auto_provision | Turn automatic install/update of a host on or off |
remote_workspace_add | Register a remote directory |
remote_workspaces_list | List remote workspaces |
remote_session_create | Create a remote session |
remote_sessions_list | List remote sessions |
remote_session_prompt | Send a prompt |
remote_session_snapshot | Read a transcript page |
remote_session_cancel | Cancel the active turn |
remote_host_add, remote_host_connect, remote_host_provision, remote_host_restart, and
remote_host_auto_provision ask for approval before they run. The first four may open an SSH
connection, and in direct-key mode provisioning copies the local model key into the remote service
environment; remote_host_auto_provision writes nothing itself, but it decides whether every later
connect may reinstall that host, so approving it approves a standing change in what this plugin does
to a machine. remote_host_restart requires the installer-owned systemd user unit; a nohup
deployment uses Reinstall remote agent or a manual restart instead.
The whole family is optional per group. Settings → Remote development → Agent tools lists the
tools and offers one switch each for hosts (6), workspaces (2) and sessions (5); every group is on by
default. A group switched off is omitted from the next model request in this profile, so it costs no
context (all thirteen are about 1.5k tokens), and an open conversation shows DSH's own "tools
updated" note as the set changes. Mirrored Sessions, the Settings page and host operations do not
depend on the tools. Workspace and session tools take a hostId; turning the host group off leaves
them usable only with a hostId already present in the conversation, and the card says so.
There is deliberately no tool for publishing a port. A forward only makes sense for the machine holding the SSH connection, which is the one drawing the browser, so it is initiated by a click rather than by an agent.
Previewing a remote dev server
The right-sidebar browser renders pages on your machine, so http://localhost:5173 typed into it
looks for a server here, not on the remote host. In a Session mirrored from a remote host, clicking a
loopback address in the transcript is all it takes: the plugin publishes that port on local loopback
and opens the page in the Browser tab beside the conversation.
Recognized addresses are 127.0.0.1, localhost, [::1], and 0.0.0.0, with an explicit port, as
http://… or as a bare localhost:5173. A link to a non-loopback host is left alone — the remote end
of every forward is the literal 127.0.0.1, so a 192.168.x.x address cannot be served.
The same port number is preferred, so a dev server's own absolute links keep working. When that number is already taken here, an ephemeral port is used and the host's row in Settings warns that absolute URLs naming the original port will break — serve relative paths or set the dev server's base/origin. HMR works because the forward carries raw TCP, WebSocket included.
Published ports live in memory only. They survive neither a DSH restart nor a host reconnect, and they do not accumulate rows you have to clean up: the next click republishes. The host's expanded row in Settings lists what is currently published. docs/port-forwarding.md explains the mechanism and the bounds.
Removing a local remote workspace
Removing a mirrored workspace from the local sidebar pauses its local synchronization. The remote workspace, files, running sessions, and local cached history are retained. Catalog refreshes, reconnection, and plugin restarts do not add the row back.
To resume, use Add workspace, select the same remote device and directory, and add it again. The plugin restores the existing local history and catches up from the remote log (within the configured snapshot window). Creating a session from a removed workspace requires this explicit add first; discovering it in the remote catalog alone does not resume synchronization.
The Settings page tells you when a row is in that state: Settings → Remote development lists each
remote registration with a state dot — Synced, Removed here, or Pending — and a ⋯ menu
offering New session, Rename, Copy path and Delete (a removed row offers Restore
mirror and Copy path instead). A manual Sync to this machine reports what a pass added and
what it skipped, and leaves that report under the button. The session counts are two icons beside the
path — the ones mirrored here and the ones the host archived — never folded into one total.
docs/workspaces.md has the mechanism.
Security
- SSH is the transport; tunnels bind
127.0.0.1only. - Host keys default to TOFU (
accept-new); useyeswith a preparedknown_hostsfor strict checks. - The remote agent is loopback-only and bearer-authenticated. That token is equivalent to shell access on
the remote account: the agent allocates terminals, runs Git, executes forwarded commands
(
/commands/executeruns a command line through the remote command registry), admits attachment bytes, and reads any file the account can read. Prompts can make the remote DSH use its own tools under the remote sandbox and approval policy. - A remote terminal is admitted only inside a registered workspace or a Session's working directory,
and an explicit shell must be the login shell or a well-known POSIX shell. Each open, refusal, exit,
and close is logged with the pid, cwd, and shell; a terminal nobody types into closes after the
agent's
terminalIdleTimeoutMs(30 minutes by default). - In the default direct mode, the resolved model key is written to the remote systemd/nohup
environment. Use this only on a trusted remote account; the systemd unit is written with mode 0600.
Set
credentialProxy: trueto keep the key local and proxy model traffic through the reverse SSH tunnel. Proxy requests require a per-host token, so unrelated local users on the remote host cannot reuse the tunneled credential endpoint. - Browser requests use DSH Connection's authenticated
/apiFetch route. Tokens/credentials are stored in0600files and never returned to the browser. - File-tree, preview, directory-picker, and terminal traffic use the remote agent API inside the authenticated SSH tunnel; no additional SSH connection is opened per file or terminal operation.
- Only connect trusted remote accounts; the remote DSH has that account's privileges.
Configuration
The common settings, as a profile override:
- id: dsh-waypoint
config:
autoProvision: true
remoteDshHome: ~/.dsh
# npm globals (pnpm and @deepseek-ai/dsh) go into this prefix; empty asks `npm prefix -g`.
remoteGlobalPrefix: ''
# remoteDshVersion: 0.2.2-rc.5 # pin a remote DSH version; omit to follow the local DSH version
remotePnpmVersion: 11.21.0
# Remote-visible proxy for npm and DSH downloads. Empty means inspect the remote login shell.
remoteInstallProxy: ''
remoteStart: systemd # systemd | nohup | none
# Direct key mode (default): copy the resolved key to the remote service env.
credentialProxy: false
remoteModelBaseUrl: https://api.deepseek.com/anthropic
credentialProxyUpstream: https://api.deepseek.com/anthropic
mirrorSessions: true
mirrorPollMs: 1500
mirrorMaxEvents: 2000
mirrorRemoteCatalog: true
portForwarding: true
docs/operations.md lists every key with its default — including the reconnect and timeout knobs, the
install proxy bypass list, mirrorLocalProviders/mirrorProviderIds, and the remote agent's own
questionTimeoutMs, approvalTimeoutMs and terminalIdleTimeoutMs. The schema in
packages/local-plugin/src/config.ts is the authority.
Known limits
- The complete remote DSH browser UI is a diagnostic surface, not the primary flow. The remote agent
keeps
dsh-api-remotesenabled so that surface keeps booting, and its approval bridge registers withprependso mirrored approvals still reach the native local UI; use the host card's Open remote Web UI action when you need the remote browser (for example to install remote plugins). - The local workspace anchor is a metadata handle. File listing, preview, and terminal are routed to the remote workspace; remote diffs and some advanced file actions still use the native session's own tool results.
- A DSH release that renames a method the file adapter replaces turns that routing off; Settings →
Remote development then reports
fileRouting/workingDirectoryRoutingas bypassed instead of showing an unexplained empty tree. - A remote session longer than
mirrorMaxEventsis mirrored from the first complete turn in the available tail; older history stays in the remote session. Increase the limit to mirror further back, or open the session on the remote host to read the rest. - An attachment sent from a mirrored session crosses the tunnel inline and is capped at about 9 MB per file. Larger files need to be placed in the remote workspace and referenced by path. Attachments a remote user sends are copied into the local attachment store when the mirror replays them; if the remote object has since been pruned, a file card still shows its name and size while an image renders as a placeholder.
- In the Desktop application a picked non-image file becomes an
@pathreference rather than an upload, so a mirrored session receives text naming a file only your machine has. The plugin resolves such a reference against the local filesystem and forwards the file itself; when it cannot (a missing path, a directory, an oversized file, or a remote agent too old to accept one) it reports that instead of sending a path the remote cannot open.dsh webis unaffected: there every picked file is uploaded directly. - A forwarded dev-server port is published at
http://127.0.0.1:<port>/; the sidebar browser's iframe policy (X-Frame-Options, mixed content) still applies, so a host that refuses to be embedded needs its own header change or a normal browser tab. When the local port differs from the remote one, pages whose absolute URLs name the remote port will not resolve. - Windows remotes and relay/NAT traversal are not supported.
Troubleshooting
| Symptom | Action |
|---|---|
| Installing never finishes / Still waiting for remote DSH Web… | Check ssh -o BatchMode=yes my-host true. Provisioning detects Node.js through your shell and never installs one itself, so a missing or too-old Node.js ends the install with an explicit message. Use ⋯ → Install remote Node.js, then Reinstall remote agent |
| A model call fails right after switching Model source | The switch restarts the remote DSH; wait for Connected. A 404 from the proxy means credentialProxyUpstream must be https://api.deepseek.com/anthropic |
| Native session has no reply | Check the host row's Local proxy / Remote direct / Remote default state; configure remote credentials or switch to the local proxy |
| Remote terminal opens a local shell | Expected for local Sessions; remote Sessions use Remote · <dir> terminals. If a mirrored Session gets a local shell, an agent older than the terminal contract is connected — reinstall it |
| The host stops reconnecting after a remote restart | Automatic reconnects are bounded by provisionRetryLimit (default 3). Click Connect, or raise the limit on a host you expect to restart |
| Remote workspace not in the sidebar | Settings → Remote development shows the row's state: Removed here → ⋯ → Restore mirror; Pending → Sync to this machine |
| Remote agent port jumps around or the host keeps disconnecting | Two dsh web processes are writing the same agent.json. Run one per DSH_HOME; doctor reports dsh_web_processes. docs/operations.md has the cleanup order that does not wedge the host |
dsh not found in your own shell after installing | The install log printed the export PATH=… line to add to your shell startup. The installer does not edit those files itself |
Remote logs: journalctl --user -u dsh-waypoint-agent -f or $DSH_HOME/waypoint-agent/web.log. The full
symptom table — npm prefix, profile lock, runtime missing, Node.js install, port forwarding, question
bridge — is in docs/operations.md.
Verify
pnpm verify
The suite covers protocol/SSE/cursor/write contracts, installer rendering, proxy forwarding, the mirror state machine, and the client bundle. The real-host layers — the end-to-end runs and the acceptance harness — never run in CI: docs/testing.md describes what each one proves and docs/acceptance.md how a host is certified before a scenario may run.
Relationship to upstream
dsh-waypoint started as a fork of Golden-Pigeon/dsh-remote.
The changes below were offered back upstream, the offer was declined, and the work continues here as
an independent project under its own name. Both are MIT licensed, the original authors keep their
attribution in LICENSE and THIRD_PARTY_NOTICES.md, and the
repository history — including every upstream commit — is preserved unchanged.
Because the rename also changes the identity DSH persists, the two are separate installs and neither reads the other's state:
Upstream dsh-remote | This project | |
|---|---|---|
| Bundle | dsh-remote-local-plugin | dsh-waypoint |
| Remote agent | @goldenpigeon/dsh-remote-agent | dsh-waypoint-agent |
| Host registry | $DSH_HOME/remote | $DSH_HOME/waypoint |
| Agent state (remote) | $DSH_HOME/remote-agent | $DSH_HOME/waypoint-agent |
Nothing is migrated automatically. If you are switching over, remove the old bundle
(dsh plugin --profile <p> remove dsh-remote-local-plugin) so two Settings sections cannot appear,
then follow docs/operations.md
for moving the host registry and cleaning up the old dsh-remote-agent.service on the remote host.
Documentation
- How a remote workspace works — the map of the mechanism, and the entry point to the pages on connection, workspaces, the session mirror, files/terminals, ports and model paths
- Connecting to a remote host — discovery, the bootstrap boundary, the tunnel, keep-up, and restart versus reinstall
- The mirrored Session — seeding, the façade Agent, prompts, the upward event
flow, approvals, questions, archive, compaction, rename, and the host-answered
/menu - Files and terminals — how file listing, search, Git, the
@menu and the PTY reach the remote machine - Wire protocol
- Host routing for mirrored paths — why a remote path does not name
a host, how ambiguity is refused instead of guessed, and what
spawn git ENOENTactually means - Design records — the two pages kept because nothing else records their reasoning: the
remote catalogs for mirrored Sessions (1.1.4) and
@file references (1.2.0). These pages are written in Chinese; the code, comments and every other document stay English - Operations guide
- Development
- Testing
- Acceptance runs — certifying a real host before a run, and why an environment failure must not be reported as a product failure
- Adapting to a new DSH release
- Releasing
- Security policy
- Contributing
- Changelog
- Third-party notices
Packages
| Package | Role |
|---|---|
@dsh-waypoint/protocol | Wire types, surface metadata, cursor, SSE, typed client |
dsh-waypoint | Provisioning, tunnel, proxy, native session mirror, tools, Settings |
dsh-waypoint-agent | Remote host plugin for workspaces, sessions, prompts, SSE |
@dsh-waypoint/installer | Bootstrap library/CLI used by the plugin |
License
MIT. See LICENSE.