dsh-remote-ui 0.6.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/README.md +97 -0
- package/cordis.patch.yml +7 -0
- package/lib/client.js +2078 -0
- package/lib/index.js +1590 -0
- package/package.json +43 -0
- package/screenshots.json +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
> ⚠️ **兼容别名包(dsh-remote-ui)**:本目录由 `npm run sync:alias` 从 `packages/dsh-remote-web` 自动生成,
|
|
2
|
+
> 用于旧名条目在改名审核通过前继续可装。请勿手改——改源包后重新生成。
|
|
3
|
+
|
|
4
|
+
# dsh-remote-web — 公网远程控制 dsh web 的插件
|
|
5
|
+
|
|
6
|
+
> 曾用名 **dsh-remote-ui**(≤0.4.9);2026-09 更名 **dsh-remote-web** —— 本插件是
|
|
7
|
+
> dsh-remote 全家桶的 **dsh web 插件半**(远程控制宿主插件,不是纯 UI/皮肤插件),
|
|
8
|
+
> 名称与功能定位一致。旧名安装可由新版 `dsh-setup.mjs` 自动迁移/清理。
|
|
9
|
+
|
|
10
|
+
> **给 DeepSeek Harness(dsh web)一个「随时随地」的公网入口。**
|
|
11
|
+
> 安装后在 dsh web 的设置页登录账号,即得到一个专属的**加密远程地址**:人在办公室外、
|
|
12
|
+
> 用手机流量或任意网络打开它,都能像坐在电脑前一样操作 dsh——继续对话、看工具执行、
|
|
13
|
+
> 审批授权、改设置。**不要求手机和电脑在同一 WiFi/局域网**,也不需要公网 IP、
|
|
14
|
+
> 路由器映射或自己搭服务器,开箱即用、全程加密。
|
|
15
|
+
> 懂技术的用户也可以把服务部署到自己的服务器上,数据与流量完全自控(普通用户无需关心)。
|
|
16
|
+
|
|
17
|
+
以下为面向开发者/维护者的实现说明:
|
|
18
|
+
|
|
19
|
+
Embeds the dsh-remote configuration UI into dsh web itself (the "everything is a
|
|
20
|
+
plugin" model):
|
|
21
|
+
|
|
22
|
+
- Entry point: the **Settings** page, via the official `settings.section`
|
|
23
|
+
extension point (`order: 30`, below "Agent presets").
|
|
24
|
+
- Inline configuration panel:
|
|
25
|
+
- Connection-mode tabs: **Cloud service** (SaaS) / **Self-hosted**
|
|
26
|
+
- Remote-control URL (from the relay `public-config` `app_url`, copyable)
|
|
27
|
+
- Account: phone + password login/save, registration (with SVG captcha);
|
|
28
|
+
signed-in state shows plan / upgrade / invite / feedback / **sign out**
|
|
29
|
+
- Bridge service: launchd status (pid), start/stop switch; shows device id and
|
|
30
|
+
autostart state — never exposes config paths or passwords
|
|
31
|
+
- **About dsh-remote** card (for newcomers: SaaS convenience, bandwidth costs,
|
|
32
|
+
self-hosting option)
|
|
33
|
+
- **User feedback** card (submodule of the commercial edition): submit
|
|
34
|
+
feedback (category + captcha anti-abuse) and track "my feedback" threads
|
|
35
|
+
with admin replies; satisfaction popup ~10 minutes after first use
|
|
36
|
+
- First-run hint: a red dot on the "Remote Control" entry (localStorage
|
|
37
|
+
`dsh-remote-seen-dot`).
|
|
38
|
+
- Config file: `~/.dsh-remote/.dsh-config.json` by default (0600), overridable
|
|
39
|
+
via the entry config `relayDir` or `DSH_RELAY_DIR`.
|
|
40
|
+
|
|
41
|
+
## Architecture (dual-half plugin)
|
|
42
|
+
|
|
43
|
+
| Half | File | Responsibility |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| Node half (host plugin) | `lib/index.js` | Injects `webServer`; same-origin `/dsh-remote/*` routes: status / config / start / stop / captcha / register / login / remote-url / feedback proxy; relay requests bypass system proxies (6s timeout) |
|
|
46
|
+
| Browser half (client plugin) | `lib/client.js` | Hand-written `__ModuleLoader__.load({id, factory})` bundle (no build step); registers the `settings.section` entry + satisfaction popup; only requires `react` (seed module) |
|
|
47
|
+
|
|
48
|
+
The browser half needs no Vite/tsdown rebuild: `dsh-client-modules` reads
|
|
49
|
+
`exports["./client"]` at startup and serves it with index.html (restart
|
|
50
|
+
`dsh web` after changes).
|
|
51
|
+
|
|
52
|
+
## Install / Uninstall
|
|
53
|
+
|
|
54
|
+
`npx @mrrisega/dsh-remote`(一键安装)会自动把插件装进 dsh web 默认 profile。
|
|
55
|
+
也可以单独管理:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# 单独安装/重装(把插件装进 dsh web 默认 profile)
|
|
59
|
+
npx @mrrisega/dsh-remote plugin
|
|
60
|
+
|
|
61
|
+
# 卸载
|
|
62
|
+
npx @mrrisega/dsh-remote plugin --uninstall
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
What it does:
|
|
66
|
+
|
|
67
|
+
- `package.json` dependency: `"dsh-remote-web": "link:<包目录>/packages/dsh-remote-web"`
|
|
68
|
+
- `cordis.patch.yml` insert: `{ id: dsh-remote-web, name: 'dsh-remote-web', config: { relayDir: '~/.dsh-remote' } }`
|
|
69
|
+
- runs `pnpm install` (fallback `npm install`) in the profile
|
|
70
|
+
|
|
71
|
+
Restart `dsh web` afterwards. Manual alternative: edit the two files above and
|
|
72
|
+
restart.
|
|
73
|
+
|
|
74
|
+
> Note: a failing browser plugin blocks the whole web app from starting
|
|
75
|
+
> (framework constraint). Rollback = remove the patch entry and restart.
|
|
76
|
+
|
|
77
|
+
## Development
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
# node half: restart dsh web (profile uses link: dependency, source is live)
|
|
81
|
+
# browser half: edit lib/client.js, restart dsh web (no build)
|
|
82
|
+
dsh --profile web --port 3090 --no-open # verify on a separate port, 3080 untouched
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Verify: `/` `__DSH_BOOT__` contains `dsh-remote-web`; `/plugins/dsh-remote-web/client.js`
|
|
86
|
+
200; `/dsh-remote/status` returns JSON; panel renders in headless Chrome.
|
|
87
|
+
|
|
88
|
+
## Known limitations
|
|
89
|
+
|
|
90
|
+
- The entry uses the official Settings-page slot (`settings.section`, `order: 30`).
|
|
91
|
+
- First-run red dot relies on DOM fallback injection (MutationObserver matching
|
|
92
|
+
the nav cell class + "远程控制" text); if the hash/wording changes the dot
|
|
93
|
+
simply won't show — the panel itself is unaffected.
|
|
94
|
+
- Start/stop switches call launchctl (same bootstrap/bootout logic as
|
|
95
|
+
`dsh-setup.mjs`).
|
|
96
|
+
- Feedback API defaults to the account API base (`cfg.api_url`); self-hosted or
|
|
97
|
+
compatible implementations can override with `feedback_url` in the config.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# dsh-remote-ui(旧名别名,同步自 dsh-remote-web) — dsh web 远程控制插件(dsh-remote 的插件半)
|
|
2
|
+
# 提供设置页「远程控制」面板与同源 /dsh-remote/* 路由。
|
|
3
|
+
# relayDir 默认取 ~/.dsh-remote(与 npx @mrrisega/dsh-remote 写入的
|
|
4
|
+
# .dsh-config.json 相同),也可在面板或 entry config 中覆盖。
|
|
5
|
+
- insert:
|
|
6
|
+
- id: dsh-remote-ui
|
|
7
|
+
name: 'dsh-remote-ui'
|