dsh-remote-local-plugin 0.0.0-stage → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +85 -2
- package/assets/dsh-remote-agent-0.2.1.tgz +0 -0
- package/cordis.patch.yml +50 -0
- package/lib/client.js +1511 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +4565 -0
- package/lib/types/config.d.ts +94 -0
- package/lib/types/credentials/proxy.d.ts +40 -0
- package/lib/types/errors.d.ts +23 -0
- package/lib/types/host-api/contract.d.ts +217 -0
- package/lib/types/host-api/handler.d.ts +15 -0
- package/lib/types/host-api/terminal.d.ts +15 -0
- package/lib/types/hosts/id.d.ts +16 -0
- package/lib/types/hosts/store.d.ts +34 -0
- package/lib/types/hosts/types.d.ts +85 -0
- package/lib/types/index.d.ts +19 -0
- package/lib/types/mirror/service.d.ts +87 -0
- package/lib/types/mirror/test-visibility.d.ts +23 -0
- package/lib/types/remote/directory.d.ts +19 -0
- package/lib/types/remote/files.d.ts +14 -0
- package/lib/types/remote/local-directory.d.ts +11 -0
- package/lib/types/remote/provisioner.d.ts +32 -0
- package/lib/types/remote/terminal.d.ts +55 -0
- package/lib/types/rpc/contract.d.ts +114 -0
- package/lib/types/rpc/handler.d.ts +12 -0
- package/lib/types/service.d.ts +92 -0
- package/lib/types/ssh/probe.d.ts +33 -0
- package/lib/types/ssh/target.d.ts +24 -0
- package/lib/types/ssh/tunnel.d.ts +50 -0
- package/lib/types/tools.d.ts +19 -0
- package/node_modules/dsh-remote-terminal-controller/README.md +9 -0
- package/node_modules/dsh-remote-terminal-controller/cordis.patch.yml +8 -0
- package/node_modules/dsh-remote-terminal-controller/lib/client.js +1367 -0
- package/node_modules/dsh-remote-terminal-controller/lib/client.js.map +7 -0
- package/node_modules/dsh-remote-terminal-controller/lib/index.js +3 -0
- package/node_modules/dsh-remote-terminal-controller/package.json +59 -0
- package/package.json +146 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-remote contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-remote-local-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Remote development that appears as ordinary local sessions.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
- Durable host registry at `$DSH_HOME/remote/hosts.json` (mode `0600`).
|
|
8
|
+
- SSH discovery of the remote agent's private state file.
|
|
9
|
+
- **Plugin-owned provisioning**: uploads the bundled `dsh-remote-agent` tarball, installs pnpm/DSH
|
|
10
|
+
when missing, starts remote `dsh web`, waits for it, and connects. No separate installer command.
|
|
11
|
+
- One loopback SSH tunnel per host, health checks, exponential backoff, manual reconnect.
|
|
12
|
+
- Default direct key mode: the resolved local key is copied into the remote service environment.
|
|
13
|
+
- Optional reverse SSH forward and **local model credential proxy** for key-local deployments.
|
|
14
|
+
- **Native session mirror**: remote workspaces/sessions become local workspaces and Sessions in the
|
|
15
|
+
ordinary sidebar. A small custom Agent façade routes prompts and cancellation to the remote agent
|
|
16
|
+
while the normal Conversation UI renders the mirrored events.
|
|
17
|
+
- `+ 新会话` creates the remote session, creates its local mirror, and opens it through
|
|
18
|
+
`uiWorkspace.openSession` — not a popup.
|
|
19
|
+
- Sidebar **+** menu to create a workspace locally (native flow) or on a connected remote host.
|
|
20
|
+
- SSH-backed remote workspace file listing/preview.
|
|
21
|
+
- Automatic remote Node.js discovery/install (nvm, Volta, fnm, Bun, asdf, mise, Nix, Homebrew, login shell; verified Node tarball fallback).
|
|
22
|
+
- Chinese / English client copy follows the DSH locale service.
|
|
23
|
+
- Remote SSH PTY terminals for mirror Sessions; local Sessions keep the local terminal.
|
|
24
|
+
- Remote approval questions bridged into the normal local approval UI.
|
|
25
|
+
- Model tools for every operation.
|
|
26
|
+
- Authenticated host API at `/api/dsh-remote` through DSH Connection's Fetch route.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
### From the DSH plugin page
|
|
31
|
+
|
|
32
|
+
After the npm package is published, use **Plugins → Add plugin** and enter:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
dsh-remote-local-plugin
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The package bundles the remote agent asset and the terminal-controller fork. Restart DSH after the
|
|
39
|
+
plugin page asks for it.
|
|
40
|
+
|
|
41
|
+
### From a source checkout
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
cd ../..
|
|
45
|
+
./scripts/install-local.sh # desktop profile
|
|
46
|
+
./scripts/install-local.sh --profile web
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The installer creates one tarball containing the terminal-controller fork; restart DSH after it
|
|
50
|
+
finishes.
|
|
51
|
+
|
|
52
|
+
## Use
|
|
53
|
+
|
|
54
|
+
1. **Settings → 远程开发**
|
|
55
|
+
2. Enter an SSH target (`my-host`) and click **保存并连接**.
|
|
56
|
+
3. Wait for `已连接` (first use installs the remote side).
|
|
57
|
+
4. Use **Workspaces +** to create a workspace; local folders use the native picker, remote folders
|
|
58
|
+
use the SSH browser.
|
|
59
|
+
5. Create a session from the workspace row or Settings. The mirrored session opens in the normal
|
|
60
|
+
Conversation UI.
|
|
61
|
+
6. Continue prompting. **Workspace files** and **New terminal** follow the selected Session.
|
|
62
|
+
|
|
63
|
+
## Boundaries
|
|
64
|
+
|
|
65
|
+
- The remote browser UI is intentionally not exposed by default; the remote API-remotes carrier is
|
|
66
|
+
disabled so approvals reach the native local UI.
|
|
67
|
+
- Sessions over `mirrorMaxEvents` are not mirrored.
|
|
68
|
+
- On plugin restart, old mirrors are archived and recreated.
|
|
69
|
+
|
|
70
|
+
## Tools
|
|
71
|
+
|
|
72
|
+
`remote_hosts_list`, `remote_host_add`, `remote_host_connect`, `remote_host_provision`,
|
|
73
|
+
`remote_workspace_add`, `remote_workspaces_list`, `remote_session_create`, `remote_sessions_list`,
|
|
74
|
+
`remote_session_prompt`, `remote_session_snapshot`, `remote_session_cancel`.
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
See [`cordis.patch.yml`](cordis.patch.yml) and
|
|
79
|
+
[`examples/local-plugin.patch.yml`](../../examples/local-plugin.patch.yml).
|
|
80
|
+
|
|
81
|
+
## Security
|
|
82
|
+
|
|
83
|
+
The token stays local and is never returned to the browser. The browser uses DSH's authenticated
|
|
84
|
+
`/api` route. By default the model key is written to the remote service environment; set
|
|
85
|
+
`credentialProxy: true` to keep it local and inject it through the reverse-tunnel proxy. See the
|
|
86
|
+
[root README](../../README.md#security).
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# dsh-remote-local-plugin host bundle.
|
|
2
|
+
#
|
|
3
|
+
# One row owns the host registry, SSH tunnels, plugin-owned remote
|
|
4
|
+
# provisioning, the local model credential proxy, and the authenticated host
|
|
5
|
+
# API. Its browser half registers the Settings page and remote chat drawer.
|
|
6
|
+
# The terminal-controller fork is bundled with this package; this patch disables
|
|
7
|
+
# the stock row and mounts the fork so mirrored Sessions use SSH PTYs.
|
|
8
|
+
- id: terminal-controller
|
|
9
|
+
disabled: true
|
|
10
|
+
- insert:
|
|
11
|
+
- id: terminal-controller-remote
|
|
12
|
+
name: dsh-remote-terminal-controller
|
|
13
|
+
- id: dsh-remote-local
|
|
14
|
+
name: dsh-remote-local-plugin
|
|
15
|
+
config:
|
|
16
|
+
# Empty means $DSH_HOME/remote.
|
|
17
|
+
stateDir: ''
|
|
18
|
+
sshBinary: ssh
|
|
19
|
+
# Empty means <remoteDshHome>/remote-agent/agent.json.
|
|
20
|
+
remoteStateFile: ''
|
|
21
|
+
probeTimeoutMs: 10000
|
|
22
|
+
connectTimeoutMs: 15000
|
|
23
|
+
healthIntervalMs: 15000
|
|
24
|
+
reconnect: true
|
|
25
|
+
maxReconnectDelayMs: 30000
|
|
26
|
+
strictHostKeyChecking: accept-new
|
|
27
|
+
|
|
28
|
+
# One-click remote provisioning.
|
|
29
|
+
autoProvision: true
|
|
30
|
+
remoteDshHome: ~/.dsh
|
|
31
|
+
remoteInstallDir: ~/.local/share/dsh-remote
|
|
32
|
+
remoteDshVersion: 0.2.1-rc.2
|
|
33
|
+
remotePnpmVersion: 11.21.0
|
|
34
|
+
remoteStart: systemd
|
|
35
|
+
provisionTimeoutMs: 600000
|
|
36
|
+
|
|
37
|
+
# Default: copy the locally resolved key into the remote service env.
|
|
38
|
+
credentialProxy: false
|
|
39
|
+
copyModelKey: true
|
|
40
|
+
remoteModelBaseUrl: https://api.deepseek.com/anthropic
|
|
41
|
+
|
|
42
|
+
# Optional: keep the key local and proxy through a reverse SSH tunnel.
|
|
43
|
+
credentialProxyUpstream: https://api.deepseek.com/anthropic
|
|
44
|
+
credentialProxyRemotePort: 47821
|
|
45
|
+
modelCredentialRef: DEEPSEEK_API_KEY
|
|
46
|
+
|
|
47
|
+
# Mirror remote workspaces/sessions into the ordinary local UI.
|
|
48
|
+
mirrorSessions: true
|
|
49
|
+
mirrorPollMs: 1500
|
|
50
|
+
mirrorMaxEvents: 2000
|