dsh-mobile 0.1.0-alpha.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.
- package/LICENSE +201 -0
- package/README.md +207 -0
- package/README.zh.md +213 -0
- package/SECURITY.md +29 -0
- package/assets/brand/app-icon-master.png +0 -0
- package/assets/brand/repository-hero.png +0 -0
- package/cordis.patch.yml +18 -0
- package/lib/cli.js +202 -0
- package/lib/client.js +212 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.mts +409 -0
- package/lib/index.mjs +2118 -0
- package/package.json +117 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Guangqi Zhang
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://unpkg.com/dsh-mobile@0.1.0-alpha.1/assets/brand/repository-hero.png" alt="A lively whale girl using a phone beside a desktop running DSH" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">DSH Mobile</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">Private, authenticated LAN access to the stock DeepSeek Harness Web UI.</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/v/dsh-mobile?label=npm&color=CB3837" alt="npm version"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/dm/dsh-mobile?color=2563EB" alt="npm downloads"></a>
|
|
12
|
+
<img src="https://img.shields.io/badge/build-verified-059669" alt="Verified build">
|
|
13
|
+
<a href="apps/mobile/README.md"><img src="https://img.shields.io/badge/platform-Android-3DDC84?logo=android&logoColor=white" alt="Android"></a>
|
|
14
|
+
<a href="#a-native-dsh-plugin"><img src="https://img.shields.io/badge/DSH-stock%20compatible-2563EB" alt="Compatible with stock DSH"></a>
|
|
15
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-0F172A" alt="Apache-2.0 license"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.zh.md">简体中文</a> ·
|
|
20
|
+
<a href="#quick-start">Quick start</a> ·
|
|
21
|
+
<a href="#customize-the-mobile-web-ui">Customize the UI</a> ·
|
|
22
|
+
<a href="#uninstall">Uninstall</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
> Public npm alpha. The source repository remains private during the current testing phase. Android is the only supported native app. This is a community project, not an official DeepSeek product.
|
|
26
|
+
|
|
27
|
+
DSH Mobile reuses DSH's own Web application, sessions, and plugin slots. It adds an authenticated HTTPS gateway, device pairing, session revocation, and a small responsive Client face. Use the Android shell without browser chrome, or open the same LAN address directly in any mobile browser.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
| Capability | Android app | Mobile browser |
|
|
32
|
+
| --- | :---: | :---: |
|
|
33
|
+
| Live DSH Web UI | Yes | Yes |
|
|
34
|
+
| Authenticated HTTPS LAN access | Yes | Yes |
|
|
35
|
+
| One-time device pairing | Yes | Yes |
|
|
36
|
+
| Custom mobile CSS | Yes | Yes |
|
|
37
|
+
| File selection and downloads | Yes | Browser-dependent |
|
|
38
|
+
| iOS native app | Not yet | Safari can use the Web UI |
|
|
39
|
+
|
|
40
|
+
Host-native actions such as opening desktop files remain subject to stock DSH and operating-system restrictions. Treat every paired device as a fully trusted operator of the computer, not as a guest account.
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
Prerequisites: stock DSH can run through either an installed `dsh` command or the source checkout's `pnpm dsh` script, and the computer and Android device share a trusted private LAN. DSH requires Node.js 22.19.x or Node.js 24 or later.
|
|
45
|
+
|
|
46
|
+
### Choose the DSH command
|
|
47
|
+
|
|
48
|
+
If `dsh` is available in the terminal, use the commands below as written.
|
|
49
|
+
|
|
50
|
+
If you cloned the DSH source and do not have a global `dsh` command, first install its workspace dependencies from the DSH repository root:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
corepack enable
|
|
54
|
+
pnpm install
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then replace `dsh` in every example with `pnpm dsh`. The complete source-checkout flow is:
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
pnpm dsh plugin --profile web add dsh-mobile
|
|
61
|
+
pnpm dsh plugin --profile web exec dsh-mobile setup
|
|
62
|
+
pnpm dsh --profile web
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
You may also invoke the source checkout from another directory without creating a global command:
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
pnpm --dir "<path-to-deepseek-harness>" dsh --profile web
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 1. Install
|
|
72
|
+
|
|
73
|
+
Install the public package directly from npm:
|
|
74
|
+
|
|
75
|
+
```powershell
|
|
76
|
+
dsh plugin --profile web add dsh-mobile
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Repository collaborators and offline installations may instead install an exact tarball:
|
|
80
|
+
|
|
81
|
+
```powershell
|
|
82
|
+
dsh plugin --profile web add "<path-to-dsh-mobile.tgz>"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
No DSH source patch or custom DSH build is required.
|
|
86
|
+
|
|
87
|
+
### 2. Run setup once
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
dsh plugin --profile web exec dsh-mobile setup
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The setup command selects a private LAN address, creates a local TLS certificate, and stores all plugin-owned configuration under `$DSH_HOME/mobile-access/`. If more than one LAN address is available, select one explicitly:
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
dsh plugin --profile web exec dsh-mobile setup --address 192.168.1.20
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For a non-default DSH Web port:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
dsh plugin --profile web exec dsh-mobile setup --dsh-port 39080
|
|
103
|
+
dsh --profile web --port 39080
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 3. Start and pair
|
|
107
|
+
|
|
108
|
+
```powershell
|
|
109
|
+
dsh --profile web
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
1. Copy the generated `dsh-mobile-ca.cer` to Android and install it as a user CA certificate.
|
|
113
|
+
2. Open the Mobile card in the lower-left corner of the desktop DSH UI.
|
|
114
|
+
3. Start access and create a pairing link. The link is copied to the clipboard.
|
|
115
|
+
4. Paste the link into the Android app, or open it directly in a mobile browser.
|
|
116
|
+
|
|
117
|
+
Pairing links expire after two minutes and work once. The app and each browser have separate cookie stores, so pair them separately.
|
|
118
|
+
|
|
119
|
+
## Everyday control
|
|
120
|
+
|
|
121
|
+
The Mobile card remains in DSH's lower-left corner. Stopping mobile access closes only the external HTTPS listener and active mobile sessions; the local DSH Web UI keeps running. Starting it again does not reinstall the plugin.
|
|
122
|
+
|
|
123
|
+
The two access modes are equivalent:
|
|
124
|
+
|
|
125
|
+
- Android app: a thin system WebView shell without browser address and tab bars.
|
|
126
|
+
- Mobile browser: open the setup origin directly; no app installation is required.
|
|
127
|
+
|
|
128
|
+
## Customize the mobile Web UI
|
|
129
|
+
|
|
130
|
+
Setup creates:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
$DSH_HOME/mobile-access/mobile.css
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This file loads only through the authenticated mobile gateway. It does not modify the DSH installation and survives DSH upgrades.
|
|
137
|
+
|
|
138
|
+
Basic theme controls:
|
|
139
|
+
|
|
140
|
+
```css
|
|
141
|
+
:root {
|
|
142
|
+
--dsh-mobile-accent: #2563eb;
|
|
143
|
+
--dsh-mobile-font-scale: 1.05;
|
|
144
|
+
--dsh-mobile-radius: 16px;
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Narrow-screen adjustments:
|
|
149
|
+
|
|
150
|
+
```css
|
|
151
|
+
@media (max-width: 720px) {
|
|
152
|
+
textarea { min-height: 88px; }
|
|
153
|
+
button, [role='button'] { min-height: 48px; }
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Prefer CSS variables, spacing, typography, and touch sizes. Do not depend on generated class names. Delete `mobile.css` and refresh to return to the built-in defaults.
|
|
158
|
+
|
|
159
|
+
## A native DSH plugin
|
|
160
|
+
|
|
161
|
+
One standard bundle contributes two faces: the Host face owns the gateway and loopback control route; the Client face owns the responsive layer and desktop control card. The package injects only stock `webServer`, installs with `dsh plugin add`, and uninstalls with `dsh plugin remove`.
|
|
162
|
+
|
|
163
|
+
```mermaid
|
|
164
|
+
flowchart LR
|
|
165
|
+
Phone["Android app or mobile browser"] -->|"HTTPS and paired session"| Gateway["DSH Mobile plugin"]
|
|
166
|
+
Gateway -->|"loopback-only proxy"| DSH["Stock DSH Web UI"]
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Security model
|
|
170
|
+
|
|
171
|
+
- The gateway accepts only the selected private LAN CIDR, exact Host, and same-origin browser requests.
|
|
172
|
+
- The Android app never bypasses TLS validation. The certificate must cover the LAN address in use.
|
|
173
|
+
- Pairing creates an HttpOnly session; devices and active sessions can be revoked from the computer.
|
|
174
|
+
- Control and device-management routes are loopback-only.
|
|
175
|
+
- Authentication happens before any request reaches the stock DSH loopback server. DSH itself is never rebound to `0.0.0.0`.
|
|
176
|
+
|
|
177
|
+
Do not expose this gateway through public Wi-Fi, port forwarding, a public IP, or an untrusted VPN. See [SECURITY.md](SECURITY.md).
|
|
178
|
+
|
|
179
|
+
## Uninstall
|
|
180
|
+
|
|
181
|
+
Normal removal preserves certificates, paired devices, and custom CSS:
|
|
182
|
+
|
|
183
|
+
```powershell
|
|
184
|
+
dsh plugin --profile web remove dsh-mobile
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
To remove all local data, purge before removing the package:
|
|
188
|
+
|
|
189
|
+
```powershell
|
|
190
|
+
dsh plugin --profile web exec dsh-mobile purge --yes
|
|
191
|
+
dsh plugin --profile web remove dsh-mobile
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Android app
|
|
195
|
+
|
|
196
|
+
The supported native shell lives in [`apps/mobile/android`](apps/mobile/android). It does not bundle a copy of the DSH frontend; it renders the same authenticated HTTPS page used by mobile browsers. See the [Android guide](apps/mobile/README.md).
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
```powershell
|
|
201
|
+
npm ci
|
|
202
|
+
npm run verify
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Release validation starts from the actual `npm pack` tarball and exercises install, setup, boot, pairing, and uninstall against an isolated stock DSH Web profile.
|
|
206
|
+
|
|
207
|
+
Apache-2.0 licensed. See [LICENSE](LICENSE).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://unpkg.com/dsh-mobile@0.1.0-alpha.1/assets/brand/repository-hero.png" alt="鲸鱼娘拿着手机连接桌面上的 DSH" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">DSH Mobile</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">让手机通过受保护的局域网连接直接控制原生 DeepSeek Harness Web UI。</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/v/dsh-mobile?label=npm&color=CB3837" alt="npm 版本"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/dm/dsh-mobile?color=2563EB" alt="npm 下载量"></a>
|
|
12
|
+
<img src="https://img.shields.io/badge/build-verified-059669" alt="构建已验证">
|
|
13
|
+
<a href="apps/mobile/README.zh-CN.md"><img src="https://img.shields.io/badge/platform-Android-3DDC84?logo=android&logoColor=white" alt="Android"></a>
|
|
14
|
+
<a href="#为什么符合-dsh-的插件理念"><img src="https://img.shields.io/badge/DSH-stock%20compatible-2563EB" alt="兼容原生 DSH"></a>
|
|
15
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-0F172A" alt="Apache-2.0 许可证"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md">English</a> ·
|
|
20
|
+
<a href="#快速开始">快速开始</a> ·
|
|
21
|
+
<a href="#自定义移动端-web-ui">自定义 UI</a> ·
|
|
22
|
+
<a href="#卸载">卸载</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
> 当前为公开 npm Alpha,源码仓库在测试阶段暂时保持私有,仅支持 Android。它是社区项目,不是 DeepSeek 官方产品。
|
|
26
|
+
|
|
27
|
+
DSH Mobile 不是另一套远程控制面板。插件直接复用 DSH 自己的 Web 应用、会话和插件槽位,在外层增加 HTTPS、设备配对、会话撤销和移动端样式。你可以用 Android App 获得无浏览器栏的体验,也可以直接用手机浏览器访问同一个局域网地址。
|
|
28
|
+
|
|
29
|
+
## 主要能力
|
|
30
|
+
|
|
31
|
+
| 能力 | Android App | 手机浏览器 |
|
|
32
|
+
| --- | :---: | :---: |
|
|
33
|
+
| 实时访问 DSH Web UI | 支持 | 支持 |
|
|
34
|
+
| HTTPS 局域网入口 | 支持 | 支持 |
|
|
35
|
+
| 一次性设备配对 | 支持 | 支持 |
|
|
36
|
+
| 自定义移动端 CSS | 支持 | 支持 |
|
|
37
|
+
| 文件选择与下载 | 支持 | 由浏览器决定 |
|
|
38
|
+
| iOS | 暂不支持 | 可用 Safari 访问网页 |
|
|
39
|
+
|
|
40
|
+
宿主文件选择器、打开本机文档等动作仍受原生 DSH 和操作系统限制。配对设备应视为电脑上的完全可信操作者,而不是低权限访客。
|
|
41
|
+
|
|
42
|
+
## 快速开始
|
|
43
|
+
|
|
44
|
+
前置条件:能够通过已经安装的 `dsh` 命令或源码仓库中的 `pnpm dsh` 启动原生 DSH,电脑和 Android 手机位于同一可信局域网。DSH 需要 Node.js 22.19.x,或 Node.js 24 以上版本。
|
|
45
|
+
|
|
46
|
+
### 选择 DSH 命令
|
|
47
|
+
|
|
48
|
+
如果终端中能够直接运行 `dsh`,后续命令保持原样即可。
|
|
49
|
+
|
|
50
|
+
如果你直接克隆了 DSH 源码,没有全局 `dsh` 命令,请先在 DSH 源码根目录安装工作区依赖:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
corepack enable
|
|
54
|
+
pnpm install
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
然后把后续示例中的 `dsh` 全部替换为 `pnpm dsh`。源码版的完整快速启动命令如下:
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
pnpm dsh plugin --profile web add dsh-mobile
|
|
61
|
+
pnpm dsh plugin --profile web exec dsh-mobile setup
|
|
62
|
+
pnpm dsh --profile web
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
如果当前终端不在 DSH 源码目录,也不需要创建全局命令:
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
pnpm --dir "<DSH源码目录>" dsh --profile web
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 1. 安装插件
|
|
72
|
+
|
|
73
|
+
直接从公开 npm 安装:
|
|
74
|
+
|
|
75
|
+
```powershell
|
|
76
|
+
dsh plugin --profile web add dsh-mobile
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
仓库协作者或离线环境也可以安装指定 tarball:
|
|
80
|
+
|
|
81
|
+
```powershell
|
|
82
|
+
dsh plugin --profile web add "<插件安装包路径>"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
这两种方式都使用 DSH 官方插件命令,不需要修改或替换 DSH 源码。
|
|
86
|
+
|
|
87
|
+
### 2. 运行一次设置向导
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
dsh plugin --profile web exec dsh-mobile setup
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
向导会自动选择唯一的私有局域网地址,生成本地 TLS 证书,并把配置保存到 `$DSH_HOME/mobile-access/`。如果电脑有多个可用网卡,向导会列出候选地址并要求明确选择:
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
dsh plugin --profile web exec dsh-mobile setup --address 192.168.1.20
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
如果 DSH Web 使用非默认端口,也可以一次指定:
|
|
100
|
+
|
|
101
|
+
```powershell
|
|
102
|
+
dsh plugin --profile web exec dsh-mobile setup --dsh-port 39080
|
|
103
|
+
dsh --profile web --port 39080
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 3. 启动、配对与连接
|
|
107
|
+
|
|
108
|
+
```powershell
|
|
109
|
+
dsh --profile web
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
1. 将向导输出的 `dsh-mobile-ca.cer` 复制到 Android,并在系统设置中安装为用户 CA 证书。
|
|
113
|
+
2. 在电脑 DSH 左下角打开“移动端”卡片。
|
|
114
|
+
3. 确认服务已开启,点击“生成配对链接”。链接会复制到剪贴板。
|
|
115
|
+
4. 在 Android App 中粘贴链接,或直接在手机浏览器中打开链接。
|
|
116
|
+
|
|
117
|
+
配对链接两分钟内有效且只能使用一次。App 与浏览器拥有各自的 Cookie 存储,因此需要分别配对。
|
|
118
|
+
|
|
119
|
+
## 日常使用
|
|
120
|
+
|
|
121
|
+
安装后,“移动端”卡片会常驻 DSH 左下角。关闭移动访问只会停止外部 HTTPS 监听并断开移动会话,不会停止 DSH 本身;重新开启不需要再次安装插件。
|
|
122
|
+
|
|
123
|
+
手机有两种等价入口:
|
|
124
|
+
|
|
125
|
+
- Android App:使用系统 WebView 打开同一 DSH 页面,没有浏览器地址栏和标签栏。
|
|
126
|
+
- 手机浏览器:直接访问向导显示的 `https://局域网地址:端口`,无需安装 App。
|
|
127
|
+
|
|
128
|
+
## 自定义移动端 Web UI
|
|
129
|
+
|
|
130
|
+
设置向导会创建:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
$DSH_HOME/mobile-access/mobile.css
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
它只在通过移动网关访问时加载,不修改 DSH 安装目录,升级或卸载 DSH 时也不会覆盖它。修改后刷新手机页面即可看到效果。
|
|
137
|
+
|
|
138
|
+
### 最简单的主题调整
|
|
139
|
+
|
|
140
|
+
```css
|
|
141
|
+
:root {
|
|
142
|
+
--dsh-mobile-accent: #2563eb;
|
|
143
|
+
--dsh-mobile-font-scale: 1.05;
|
|
144
|
+
--dsh-mobile-radius: 16px;
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 只调整窄屏布局
|
|
149
|
+
|
|
150
|
+
```css
|
|
151
|
+
@media (max-width: 720px) {
|
|
152
|
+
textarea {
|
|
153
|
+
min-height: 88px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
button,
|
|
157
|
+
[role='button'] {
|
|
158
|
+
min-height: 48px;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
建议优先调整 CSS 变量、字体比例、间距和触控尺寸,不要依赖构建后生成的类名。写错样式不会影响 Host 网关;删除 `mobile.css` 后刷新即可恢复插件默认样式。
|
|
164
|
+
|
|
165
|
+
## 为什么符合 DSH 的插件理念
|
|
166
|
+
|
|
167
|
+
DSH Mobile 通过一个标准 bundle 同时贡献两张 face:Host face 提供局域网网关和本地控制接口,Client face 提供移动端样式与左下角控制卡。它只注入原生 `webServer` 服务,通过 `dsh plugin add/remove` 安装和卸载,不修改 `deepseek-harness` 文件。
|
|
168
|
+
|
|
169
|
+
```mermaid
|
|
170
|
+
flowchart LR
|
|
171
|
+
Phone["Android App 或手机浏览器"] -->|"HTTPS + 已配对会话"| Gateway["DSH Mobile 插件"]
|
|
172
|
+
Gateway -->|"仅回环代理"| DSH["原生 DSH Web UI"]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## 安全模型
|
|
176
|
+
|
|
177
|
+
- 网关只接受设置向导选定的私有局域网 CIDR、精确 Host 和同源浏览器请求。
|
|
178
|
+
- Android App 不跳过 TLS 校验;证书必须覆盖实际访问的局域网 IP。
|
|
179
|
+
- 配对设备获得短期 HttpOnly Session,设备和会话都可在电脑端撤销。
|
|
180
|
+
- 管理接口只允许从电脑回环地址访问,移动端无法打开、关闭网关或管理其他设备。
|
|
181
|
+
- 外层网关在认证后才代理到原生 DSH 的回环端口,不会把 DSH 自身绑定到 `0.0.0.0`。
|
|
182
|
+
|
|
183
|
+
不要在公共 Wi-Fi、端口转发、公网 IP 或不可信 VPN 中开放本插件。更多说明见 [SECURITY.md](SECURITY.md)。
|
|
184
|
+
|
|
185
|
+
## 卸载
|
|
186
|
+
|
|
187
|
+
普通卸载保留证书、已配对设备和自定义 CSS,方便以后重新安装:
|
|
188
|
+
|
|
189
|
+
```powershell
|
|
190
|
+
dsh plugin --profile web remove dsh-mobile
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
如果希望彻底删除本地数据,必须先运行清理,再卸载包:
|
|
194
|
+
|
|
195
|
+
```powershell
|
|
196
|
+
dsh plugin --profile web exec dsh-mobile purge --yes
|
|
197
|
+
dsh plugin --profile web remove dsh-mobile
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Android App
|
|
201
|
+
|
|
202
|
+
当前仅维护 Android 薄壳,源码位于 [`apps/mobile/android`](apps/mobile/android)。App 不复制 DSH 前端,只渲染插件提供的同一 HTTPS 页面;浏览器访问始终是一等能力。构建与安全边界见 [Android 文档](apps/mobile/README.zh-CN.md)。
|
|
203
|
+
|
|
204
|
+
## 开发
|
|
205
|
+
|
|
206
|
+
```powershell
|
|
207
|
+
npm ci
|
|
208
|
+
npm run verify
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
真实安装验证应从 `npm pack` 生成的 tarball 开始,并在隔离的原生 DSH Web profile 中完成安装、设置、启动、配对和卸载。
|
|
212
|
+
|
|
213
|
+
Apache-2.0 licensed. See [LICENSE](LICENSE).
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
`dsh-mobile` exposes a control surface that can run tools on the host computer. Treat every paired device as security-sensitive.
|
|
4
|
+
|
|
5
|
+
## Supported versions
|
|
6
|
+
|
|
7
|
+
Only the newest prerelease receives security fixes while the project is in alpha. The README compatibility table identifies the exact DSH release tested with each plugin version.
|
|
8
|
+
|
|
9
|
+
## Reporting a vulnerability
|
|
10
|
+
|
|
11
|
+
Do not open a public issue for a suspected vulnerability. Use GitHub's private vulnerability-reporting form for `saya-ch/dsh-mobile`. Include the affected version, deployment topology, reproduction steps, and whether a device credential, session Cookie, or local access is required.
|
|
12
|
+
|
|
13
|
+
The maintainer will acknowledge a complete report within seven days. Publication timing is coordinated with the reporter after a fix and a revocation or upgrade path are available.
|
|
14
|
+
|
|
15
|
+
## Deployment requirements
|
|
16
|
+
|
|
17
|
+
- Keep the ordinary DSH Web listener on loopback.
|
|
18
|
+
- Expose only the plugin-owned HTTPS listener to the LAN.
|
|
19
|
+
- Use a certificate trusted by every client platform; never instruct a WebView to ignore TLS errors.
|
|
20
|
+
- Keep pairing closed except during a short local onboarding action.
|
|
21
|
+
- Revoke a lost device immediately and rotate the device registry if credential theft is suspected.
|
|
22
|
+
- Do not expose the gateway directly to the public Internet.
|
|
23
|
+
- Treat every paired device as a fully trusted operator. Stock DSH methods reached through the authenticated loopback proxy may read configuration or run tools with the desktop user's authority.
|
|
24
|
+
|
|
25
|
+
## Known alpha limitation
|
|
26
|
+
|
|
27
|
+
The current DSH HTML boot process contains inline JavaScript and applies some styles dynamically. To keep the stock Web UI runnable, the gateway's Content Security Policy currently includes `script-src 'self' 'unsafe-inline'` and `style-src 'self' 'unsafe-inline'`. The remaining directives still restrict origins, connections, frames, objects, workers, images, and form targets, but this policy does not eliminate script-injection risk. Removing these allowances requires upstream DSH support for nonces, stable hashes, or external boot resources.
|
|
28
|
+
|
|
29
|
+
This repository never accepts private keys, npm tokens, pairing values, device credentials, Cookies, or captured settings in issues, logs, fixtures, or example configuration.
|
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Community bundle for the stock DSH Web profile. Installation contributes a
|
|
2
|
+
# Host gateway and a browser Client face; it does not patch DSH source files.
|
|
3
|
+
- insert:
|
|
4
|
+
- id: mobile-access
|
|
5
|
+
name: dsh-mobile
|
|
6
|
+
inject: [webServer]
|
|
7
|
+
config:
|
|
8
|
+
setupFile: !!js dshHomePath('mobile-access/setup.json')
|
|
9
|
+
stateFile: !!js dshHomePath('mobile-access/devices.json')
|
|
10
|
+
controlFile: !!js dshHomePath('mobile-access/control.json')
|
|
11
|
+
customCssFile: !!js dshHomePath('mobile-access/mobile.css')
|
|
12
|
+
initiallyEnabled: false
|
|
13
|
+
listenHost: 127.0.0.1
|
|
14
|
+
listenPort: 3443
|
|
15
|
+
upstreamOrigin: http://127.0.0.1:3080
|
|
16
|
+
allowedCidrs: [127.0.0.0/8]
|
|
17
|
+
tls:
|
|
18
|
+
mode: disabled
|