dsh-mobile 0.1.0-alpha.19 → 0.1.0-alpha.20
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.en.md +8 -0
- package/README.md +16 -7
- package/lib/index.d.mts +10 -1
- package/lib/index.mjs +22 -1
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -44,6 +44,14 @@ pnpm dsh --profile web
|
|
|
44
44
|
|
|
45
45
|
Open **Mobile Access** in the lower-left DeepSeek Harness sidebar, enable it, and select **Create and copy key**. In the Android app, tap **Scan**, select the computer, and enter the key. The paired device remains trusted until it is revoked, expires, or its app data is cleared.
|
|
46
46
|
|
|
47
|
+
## Compatibility
|
|
48
|
+
|
|
49
|
+
| DSH Mobile | Verified DeepSeek Harness releases |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `0.1.0-alpha.20` | `0.1.0-rc.5`, `0.1.0-rc.6` |
|
|
52
|
+
|
|
53
|
+
At startup, the plugin verifies the DSH Host version and the frontend dependencies required by the mobile layout. An unverified release fails with a clear error instead of serving a broken page. CI also tracks the DSH main branch layout slots and mobile semantic markers. If a DSH upgrade reports an incompatibility, update DSH Mobile first.
|
|
54
|
+
|
|
47
55
|
## Connection options
|
|
48
56
|
|
|
49
57
|
| Client | Best for | Notes |
|
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
<p align="center">在手机上安全、实时地使用电脑中的 DeepSeek Harness。</p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/v/dsh-mobile?tag=alpha&
|
|
10
|
+
<a href="https://www.npmjs.com/package/dsh-mobile"><img src="https://img.shields.io/npm/v/dsh-mobile?tag=alpha&label=npm&color=CB3837" alt="npm 版本"></a>
|
|
11
11
|
<a href="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml"><img src="https://github.com/saya-ch/dsh-mobile/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
12
|
-
<a href="https://github.com/saya-ch/dsh-mobile/releases"><img src="https://img.shields.io/badge/Android-10%2B-3DDC84?logo=android&
|
|
12
|
+
<a href="https://github.com/saya-ch/dsh-mobile/releases"><img src="https://img.shields.io/badge/Android-10%2B-3DDC84?logo=android&logoColor=white" alt="Android 10+"></a>
|
|
13
13
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-0F172A" alt="Apache-2.0"></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<a href="README.en.md">English</a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
|
-
> Alpha 版本,当前原生 App 仅支持 Android
|
|
23
|
+
> Alpha 版本,当前原生 App 仅支持 Android。本项目为 DeepSeek Harness 社区插件。
|
|
24
24
|
|
|
25
25
|
<p align="center"><a href="https://github.com/saya-ch/dsh-mobile/releases"><strong>下载 Android App</strong></a></p>
|
|
26
26
|
|
|
@@ -65,12 +65,21 @@ pnpm dsh --profile web
|
|
|
65
65
|
|
|
66
66
|
插件不会修改 DeepSeek Harness 源码。设置、证书、设备和自定义文件保存在 `$DSH_HOME/mobile-access/`。
|
|
67
67
|
|
|
68
|
+
## 兼容性
|
|
69
|
+
|
|
70
|
+
| DSH Mobile | 已验证的 DeepSeek Harness |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| `0.1.0-alpha.20` | `0.1.0-rc.5`、`0.1.0-rc.6` |
|
|
73
|
+
|
|
74
|
+
插件会在启动时检查 DSH Host 版本和移动布局所需的前端依赖;遇到未经验证的版本会直接给出错误,不会带着不兼容页面继续启动。CI 也会持续检查 DSH 主分支的布局插槽和移动端语义标记。升级 DSH 后如遇兼容提示,请先升级 DSH Mobile。
|
|
75
|
+
|
|
68
76
|
## 连接方式
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
78
|
+
|
|
79
|
+
| 方式 | 适合场景 | 说明 |
|
|
80
|
+
| ------------- | ------------------ | ------------------------------------------ |
|
|
81
|
+
| Android App | 日常使用 | 自动发现、无浏览器栏、App 内私有证书固定 |
|
|
82
|
+
| 手机浏览器 | 临时或跨平台访问 | 打开“移动访问”卡片显示的 HTTPS 地址 |
|
|
74
83
|
|
|
75
84
|
Android 同时使用 mDNS/NSD、UDP 公告、主动 UDP 查询和 HTTPS 探测发现 DeepSeek Harness。发现只广播设备名、地址、端口、协议版本和稳定 `instanceId`,不会广播密钥或令牌。
|
|
76
85
|
|
package/lib/index.d.mts
CHANGED
|
@@ -302,6 +302,15 @@ declare function parseControlFile(value: unknown): string;
|
|
|
302
302
|
/** Parse configuration and reject unsafe topology, credential, and resource combinations. */
|
|
303
303
|
declare function parseGatewayConfig(raw: unknown): ResolvedGatewayConfig;
|
|
304
304
|
//#endregion
|
|
305
|
+
//#region src/compatibility.d.ts
|
|
306
|
+
/** DeepSeek Harness prereleases verified by this plugin release. */
|
|
307
|
+
declare const SUPPORTED_DSH_VERSIONS: readonly ["0.1.0-rc.5", "0.1.0-rc.6"];
|
|
308
|
+
/**
|
|
309
|
+
* Reject an unverified DeepSeek Harness Host before opening the LAN listener.
|
|
310
|
+
* @param version - Version reported by the installed DSH WebServer package.
|
|
311
|
+
*/
|
|
312
|
+
declare function assertSupportedDshVersion(version: unknown): asserts version is typeof SUPPORTED_DSH_VERSIONS[number];
|
|
313
|
+
//#endregion
|
|
305
314
|
//#region src/control.d.ts
|
|
306
315
|
/** Versioned durable preference for the resident mobile-access runtime. */
|
|
307
316
|
interface MobileAccessControlState {
|
|
@@ -429,5 +438,5 @@ declare const inject: string[];
|
|
|
429
438
|
/** Mount the resident control route and its optional authenticated LAN gateway. */
|
|
430
439
|
declare function apply(ctx: Context, config: PluginConfig): Promise<void>;
|
|
431
440
|
//#endregion
|
|
432
|
-
export { AUTH_PREFIX, AccessController, type AccessControllerOptions, AccessError, type AuthoritySpec, BoundedRateLimiter, CSRF_COOKIE, CSRF_HEADER, Config, DEVICE_COOKIE, type DeviceSnapshot, type DeviceStore, type DeviceSummary, type DisabledTlsConfig, JsonDeviceStore, JsonMobileAccessControlStore, LOCAL_ADMIN_PREFIX, MemoryDeviceStore, type MobileAccessControlState, type MobileAccessControlStore, MobileAccessGateway, MobileAccessGatewayController, type MobileAccessRuntime, type PairingResult, type ParsedCidr, type PluginConfig, type ProvidedTlsConfig, type RenewalResult, RequestTrustPolicy, type ResolvedGatewayConfig, SESSION_COOKIE, type SessionAuthorization, type StoredDevice, type TlsConfig, WS_PATHS, addressAllowed, apply, inject, isLoopbackAddress, name, parseAuthority, parseCidr, parseControlFile, parseDeviceSnapshot, parseGatewayConfig, parseMobileAccessControlState, resolveAuthority, rewriteMobileIndex };
|
|
441
|
+
export { AUTH_PREFIX, AccessController, type AccessControllerOptions, AccessError, type AuthoritySpec, BoundedRateLimiter, CSRF_COOKIE, CSRF_HEADER, Config, DEVICE_COOKIE, type DeviceSnapshot, type DeviceStore, type DeviceSummary, type DisabledTlsConfig, JsonDeviceStore, JsonMobileAccessControlStore, LOCAL_ADMIN_PREFIX, MemoryDeviceStore, type MobileAccessControlState, type MobileAccessControlStore, MobileAccessGateway, MobileAccessGatewayController, type MobileAccessRuntime, type PairingResult, type ParsedCidr, type PluginConfig, type ProvidedTlsConfig, type RenewalResult, RequestTrustPolicy, type ResolvedGatewayConfig, SESSION_COOKIE, SUPPORTED_DSH_VERSIONS, type SessionAuthorization, type StoredDevice, type TlsConfig, WS_PATHS, addressAllowed, apply, assertSupportedDshVersion, inject, isLoopbackAddress, name, parseAuthority, parseCidr, parseControlFile, parseDeviceSnapshot, parseGatewayConfig, parseMobileAccessControlState, resolveAuthority, rewriteMobileIndex };
|
|
433
442
|
//# sourceMappingURL=index.d.mts.map
|
package/lib/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { X509Certificate, createHash, createPrivateKey, createPublicKey, randomBytes, timingSafeEqual } from "node:crypto";
|
|
2
3
|
import { basename, dirname, extname, isAbsolute, join, resolve } from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -694,6 +695,18 @@ function parseGatewayConfig(raw) {
|
|
|
694
695
|
});
|
|
695
696
|
}
|
|
696
697
|
//#endregion
|
|
698
|
+
//#region src/compatibility.ts
|
|
699
|
+
/** DeepSeek Harness prereleases verified by this plugin release. */
|
|
700
|
+
const SUPPORTED_DSH_VERSIONS = Object.freeze(["0.1.0-rc.5", "0.1.0-rc.6"]);
|
|
701
|
+
/**
|
|
702
|
+
* Reject an unverified DeepSeek Harness Host before opening the LAN listener.
|
|
703
|
+
* @param version - Version reported by the installed DSH WebServer package.
|
|
704
|
+
*/
|
|
705
|
+
function assertSupportedDshVersion(version) {
|
|
706
|
+
if (typeof version === "string" && SUPPORTED_DSH_VERSIONS.some((candidate) => candidate === version)) return;
|
|
707
|
+
throw new Error(`unsupported DeepSeek Harness version ${typeof version === "string" ? version : "(unknown)"}; supported versions: ${SUPPORTED_DSH_VERSIONS.join(", ")}`);
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
697
710
|
//#region src/control.ts
|
|
698
711
|
/** Keeps one runtime aligned with a changing network selection. */
|
|
699
712
|
var FollowingMobileAccessRuntime = class {
|
|
@@ -1164,6 +1177,7 @@ const DISCOVERY_INTERVAL_MS = 3e3;
|
|
|
1164
1177
|
const MDNS_SERVICE_TYPE = "dsh-mobile";
|
|
1165
1178
|
const MOBILE_LAYOUT_MODULE = "@deepseek-ai/dsh-client-ui-layout";
|
|
1166
1179
|
const MOBILE_LAYOUT_PATH = `${AUTH_PREFIX}/mobile-layout.js`;
|
|
1180
|
+
const MOBILE_LAYOUT_DEPENDENCIES = Object.freeze(["@deepseek-ai/dsh-client-runtime", "@deepseek-ai/dsh-client-ui-theme"]);
|
|
1167
1181
|
const PAIR_PAGE = `<!doctype html>
|
|
1168
1182
|
<html lang="en">
|
|
1169
1183
|
<meta charset="utf-8">
|
|
@@ -1194,6 +1208,7 @@ function rewriteMobileIndex(html) {
|
|
|
1194
1208
|
if (typeof parsed.rev !== "string" || !Array.isArray(parsed.entries)) throw new Error("upstream DSH boot manifest is malformed");
|
|
1195
1209
|
const layout = parsed.entries.filter((entry) => entry !== null && typeof entry === "object" && entry.id === MOBILE_LAYOUT_MODULE);
|
|
1196
1210
|
if (layout.length !== 1 || typeof layout[0]?.url !== "string" || typeof layout[0].rev !== "string") throw new Error("upstream DSH boot manifest has no unique layout module");
|
|
1211
|
+
if (!Array.isArray(layout[0].inject) || MOBILE_LAYOUT_DEPENDENCIES.some((dependency) => !layout[0]?.inject?.includes(dependency))) throw new Error("upstream DSH layout module has unsupported dependencies");
|
|
1197
1212
|
layout[0].url = MOBILE_LAYOUT_PATH;
|
|
1198
1213
|
layout[0].rev = "dsh-mobile-layout-v1";
|
|
1199
1214
|
const replacement = `window.__DSH_MOBILE_FRONTEND__="dedicated";${assignment}${JSON.stringify(parsed)};`;
|
|
@@ -2650,6 +2665,11 @@ async function materializeManagedSetup(setup, table) {
|
|
|
2650
2665
|
const name = "dsh-mobile";
|
|
2651
2666
|
/** The stock WebServer is the only DSH Host service this plugin requires. */
|
|
2652
2667
|
const inject = ["webServer"];
|
|
2668
|
+
function installedDshVersion() {
|
|
2669
|
+
const manifest = createRequire(import.meta.url)("@deepseek-ai/dsh-host-webserver/package.json");
|
|
2670
|
+
if (manifest === null || typeof manifest !== "object") return void 0;
|
|
2671
|
+
return manifest.version;
|
|
2672
|
+
}
|
|
2653
2673
|
function mapAdminError(error) {
|
|
2654
2674
|
if (error instanceof HttpError) return error;
|
|
2655
2675
|
const code = error.code;
|
|
@@ -2716,6 +2736,7 @@ async function loadSetup(config) {
|
|
|
2716
2736
|
}
|
|
2717
2737
|
/** Mount the resident control route and its optional authenticated LAN gateway. */
|
|
2718
2738
|
async function apply(ctx, config) {
|
|
2739
|
+
assertSupportedDshVersion(installedDshVersion());
|
|
2719
2740
|
const loaded = await loadSetup(config);
|
|
2720
2741
|
let gateway;
|
|
2721
2742
|
const startGateway = async (candidateConfig) => {
|
|
@@ -2796,6 +2817,6 @@ async function apply(ctx, config) {
|
|
|
2796
2817
|
}, "dsh-mobile: local control and authenticated LAN gateway");
|
|
2797
2818
|
}
|
|
2798
2819
|
//#endregion
|
|
2799
|
-
export { AUTH_PREFIX, AccessController, AccessError, BoundedRateLimiter, CSRF_COOKIE, CSRF_HEADER, Config, DEVICE_COOKIE, JsonDeviceStore, JsonMobileAccessControlStore, LOCAL_ADMIN_PREFIX, MemoryDeviceStore, MobileAccessGateway, MobileAccessGatewayController, RequestTrustPolicy, SESSION_COOKIE, WS_PATHS, addressAllowed, apply, inject, isLoopbackAddress, name, parseAuthority, parseCidr, parseControlFile, parseDeviceSnapshot, parseGatewayConfig, parseMobileAccessControlState, resolveAuthority, rewriteMobileIndex };
|
|
2820
|
+
export { AUTH_PREFIX, AccessController, AccessError, BoundedRateLimiter, CSRF_COOKIE, CSRF_HEADER, Config, DEVICE_COOKIE, JsonDeviceStore, JsonMobileAccessControlStore, LOCAL_ADMIN_PREFIX, MemoryDeviceStore, MobileAccessGateway, MobileAccessGatewayController, RequestTrustPolicy, SESSION_COOKIE, SUPPORTED_DSH_VERSIONS, WS_PATHS, addressAllowed, apply, assertSupportedDshVersion, inject, isLoopbackAddress, name, parseAuthority, parseCidr, parseControlFile, parseDeviceSnapshot, parseGatewayConfig, parseMobileAccessControlState, resolveAuthority, rewriteMobileIndex };
|
|
2800
2821
|
|
|
2801
2822
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "DeepSeek Harness 移动端适配与安全局域网访问插件,支持 Android App 和手机浏览器。",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsdown",
|
|
53
|
-
"check:mobile-release": "node ./scripts/check-mobile-release.mjs",
|
|
53
|
+
"check:mobile-release": "node ./scripts/check-mobile-release.mjs",
|
|
54
|
+
"check:dsh-compatibility": "node ./scripts/check-dsh-compatibility.mjs",
|
|
54
55
|
"check:release-tag": "node ./scripts/check-release-version.mjs --tag-env",
|
|
55
56
|
"check:version": "node ./scripts/check-release-version.mjs",
|
|
56
57
|
"clean": "node ./scripts/clean.mjs",
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
"license": "Apache-2.0",
|
|
89
90
|
"peerDependencies": {
|
|
90
91
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
91
|
-
"@deepseek-ai/dsh-host-webserver": "
|
|
92
|
+
"@deepseek-ai/dsh-host-webserver": "0.1.0-rc.5 || 0.1.0-rc.6",
|
|
92
93
|
"react": "^18.2.0"
|
|
93
94
|
},
|
|
94
95
|
"peerDependenciesMeta": {
|