dsh-remote-local-plugin 0.0.0-stage → 0.8.1

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.
Files changed (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -2
  3. package/assets/dsh-remote-agent-0.2.1.tgz +0 -0
  4. package/cordis.patch.yml +50 -0
  5. package/lib/client.js +1571 -0
  6. package/lib/client.js.map +7 -0
  7. package/lib/index.js +4637 -0
  8. package/lib/types/config.d.ts +94 -0
  9. package/lib/types/credentials/proxy.d.ts +40 -0
  10. package/lib/types/errors.d.ts +23 -0
  11. package/lib/types/host-api/contract.d.ts +217 -0
  12. package/lib/types/host-api/handler.d.ts +15 -0
  13. package/lib/types/host-api/terminal.d.ts +15 -0
  14. package/lib/types/hosts/id.d.ts +16 -0
  15. package/lib/types/hosts/store.d.ts +34 -0
  16. package/lib/types/hosts/types.d.ts +85 -0
  17. package/lib/types/index.d.ts +19 -0
  18. package/lib/types/mirror/service.d.ts +87 -0
  19. package/lib/types/mirror/test-visibility.d.ts +23 -0
  20. package/lib/types/remote/directory.d.ts +19 -0
  21. package/lib/types/remote/files.d.ts +14 -0
  22. package/lib/types/remote/local-directory.d.ts +11 -0
  23. package/lib/types/remote/provisioner.d.ts +32 -0
  24. package/lib/types/remote/terminal.d.ts +55 -0
  25. package/lib/types/service.d.ts +92 -0
  26. package/lib/types/ssh/probe.d.ts +33 -0
  27. package/lib/types/ssh/target.d.ts +24 -0
  28. package/lib/types/ssh/tunnel.d.ts +50 -0
  29. package/lib/types/tools.d.ts +19 -0
  30. package/node_modules/dsh-remote-terminal-controller/README.md +9 -0
  31. package/node_modules/dsh-remote-terminal-controller/cordis.patch.yml +8 -0
  32. package/node_modules/dsh-remote-terminal-controller/lib/client.js +1367 -0
  33. package/node_modules/dsh-remote-terminal-controller/lib/index.js +3 -0
  34. package/node_modules/dsh-remote-terminal-controller/package.json +59 -0
  35. 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,98 @@
1
- # Temporary Holding Version
1
+ # dsh-remote-local-plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Remote development that appears as ordinary local sessions.
4
+
5
+ ## Supported environment
6
+
7
+ This plugin targets the official **DSH Desktop** application. Tested/supported versions:
8
+
9
+ - [DSH Desktop](https://github.com/deepseek-ai/deepseek-harness) [`0.2.1-rc.2`](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.2)
10
+ - Plugin [`0.8.1`](https://www.npmjs.com/package/dsh-remote-local-plugin)
11
+ - Remote DSH [`0.2.1-rc.2`](https://github.com/deepseek-ai/deepseek-harness/releases/tag/dsh-v0.2.1-rc.2)
12
+ - Remote [Node.js `22.19+`](https://nodejs.org/en/download) on Linux/macOS
13
+
14
+ Other DSH GUI plugins, forks, modified clients, and other DSH versions have not been tested. The
15
+ package dependency range is permissive for installation only; it is not a support guarantee.
16
+
17
+ ## What it does
18
+
19
+ - Durable host registry at `$DSH_HOME/remote/hosts.json` (mode `0600`).
20
+ - SSH discovery of the remote agent's private state file.
21
+ - **Plugin-owned provisioning**: uploads the bundled `dsh-remote-agent` tarball, installs pnpm/DSH
22
+ when missing, starts remote `dsh web`, waits for it, and connects. No separate installer command.
23
+ - One loopback SSH tunnel per host, health checks, exponential backoff, manual reconnect.
24
+ - Default direct key mode: the resolved local key is copied into the remote service environment.
25
+ - Optional reverse SSH forward and **local model credential proxy** for key-local deployments.
26
+ - **Native session mirror**: remote workspaces/sessions become local workspaces and Sessions in the
27
+ ordinary sidebar. A small custom Agent façade routes prompts and cancellation to the remote agent
28
+ while the normal Conversation UI renders the mirrored events.
29
+ - `+ 新会话` creates the remote session, creates its local mirror, and opens it through
30
+ `uiWorkspace.openSession` — not a popup.
31
+ - Sidebar **+** menu to create a workspace locally (native flow) or on a connected remote host.
32
+ - SSH-backed remote workspace file listing/preview.
33
+ - Automatic remote Node.js discovery/install (nvm, Volta, fnm, Bun, asdf, mise, Nix, Homebrew, login shell; verified Node tarball fallback).
34
+ - Chinese / English client copy follows the DSH locale service.
35
+ - Remote SSH PTY terminals for mirror Sessions; local Sessions keep the local terminal.
36
+ - Remote approval questions bridged into the normal local approval UI.
37
+ - Model tools for every operation.
38
+ - Authenticated host API at `/api/dsh-remote` through DSH Connection's Fetch route.
39
+
40
+ ## Install
41
+
42
+ ### From the DSH plugin page
43
+
44
+ After the npm package is published, use **Plugins → Add plugin** and enter:
45
+
46
+ ```text
47
+ dsh-remote-local-plugin
48
+ ```
49
+
50
+ The package bundles the remote agent asset and the terminal-controller fork. Restart DSH after the
51
+ plugin page asks for it.
52
+
53
+ ### From a source checkout
54
+
55
+ ```sh
56
+ cd ../..
57
+ ./scripts/install-local.sh # desktop profile
58
+ ./scripts/install-local.sh --profile web
59
+ ```
60
+
61
+ The installer creates one tarball containing the terminal-controller fork; restart DSH after it
62
+ finishes.
63
+
64
+ ## Use
65
+
66
+ 1. **Settings → 远程开发**
67
+ 2. Enter an SSH target (`my-host`) and click **保存并连接**.
68
+ 3. Wait for `已连接` (first use installs the remote side).
69
+ 4. Use **Workspaces +** to create a workspace; local folders use the native picker, remote folders
70
+ use the SSH browser.
71
+ 5. Create a session from the workspace row or Settings. The mirrored session opens in the normal
72
+ Conversation UI.
73
+ 6. Continue prompting. **Workspace files** and **New terminal** follow the selected Session.
74
+
75
+ ## Boundaries
76
+
77
+ - The remote browser UI is intentionally not exposed by default; the remote API-remotes carrier is
78
+ disabled so approvals reach the native local UI.
79
+ - Sessions over `mirrorMaxEvents` are not mirrored.
80
+ - On plugin restart, old mirrors are archived and recreated.
81
+
82
+ ## Tools
83
+
84
+ `remote_hosts_list`, `remote_host_add`, `remote_host_connect`, `remote_host_provision`,
85
+ `remote_workspace_add`, `remote_workspaces_list`, `remote_session_create`, `remote_sessions_list`,
86
+ `remote_session_prompt`, `remote_session_snapshot`, `remote_session_cancel`.
87
+
88
+ ## Configuration
89
+
90
+ See [`cordis.patch.yml`](cordis.patch.yml) and
91
+ [`examples/local-plugin.patch.yml`](../../examples/local-plugin.patch.yml).
92
+
93
+ ## Security
94
+
95
+ The token stays local and is never returned to the browser. The browser uses DSH's authenticated
96
+ `/api` route. By default the model key is written to the remote service environment; set
97
+ `credentialProxy: true` to keep it local and inject it through the reverse-tunnel proxy. See the
98
+ [root README](../../README.md#security).
@@ -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