@wenbin_wb/dsh-bridge 1.0.0 → 1.0.2
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 +28 -1
- package/cordis.patch.yml +1 -1
- package/lib/index.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,9 +21,36 @@
|
|
|
21
21
|
> 本插件基于 **DeepSeek Harness v0.1.0-rc.6** 开发测试。
|
|
22
22
|
> DSH 是开发者预览版,插件契约可能随版本变化,请关注 [CHANGELOG](./CHANGELOG.md)。
|
|
23
23
|
|
|
24
|
+
## 环境要求
|
|
25
|
+
|
|
26
|
+
安装插件前,请先确保:
|
|
27
|
+
|
|
28
|
+
1. **Node.js ≥ 22**(DSH 要求 `^22.19.0` 或 `≥ 24.0.0`)
|
|
29
|
+
2. **dsh CLI 可用**——即能在终端直接运行 `dsh` 命令
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 检查 Node 版本
|
|
33
|
+
node -v # 应显示 v22.19+ 或 v24+
|
|
34
|
+
|
|
35
|
+
# 检查 dsh 是否可用
|
|
36
|
+
dsh --version
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
如果 `dsh` 命令提示"无法识别/找不到",说明它没有全局安装,先安装 DSH:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g @deepseek-ai/dsh@0.1.0-rc.6
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
> ⚠️ 与 DSH 版本保持一致:本插件基于 `0.1.0-rc.6` 测试,建议安装相同版本以免契约不匹配。
|
|
46
|
+
> 若没有全局安装的权限,也可以用 `npx` 方式(无需全局安装):
|
|
47
|
+
> ```bash
|
|
48
|
+
> npx --yes @deepseek-ai/dsh plugin --profile web add @wenbin_wb/dsh-bridge
|
|
49
|
+
> ```
|
|
50
|
+
|
|
24
51
|
## 安装
|
|
25
52
|
|
|
26
|
-
从 npm
|
|
53
|
+
从 npm 安装:
|
|
27
54
|
|
|
28
55
|
```bash
|
|
29
56
|
dsh plugin --profile web add @wenbin_wb/dsh-bridge
|
package/cordis.patch.yml
CHANGED
package/lib/index.js
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
import { createServer, request as httpRequest } from 'node:http';
|
|
9
9
|
import { get as httpsGet } from 'node:https';
|
|
10
10
|
import { networkInterfaces, homedir } from 'node:os';
|
|
11
|
-
import { join } from 'node:path';
|
|
11
|
+
import { join, dirname } from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import { readFileSync } from 'node:fs';
|
|
12
14
|
import { readFile, writeFile, mkdir, unlink } from 'node:fs/promises';
|
|
13
15
|
import QRCode from 'qrcode';
|
|
14
16
|
import { installBridgeRpc } from './bridge-rpc.js';
|
|
@@ -18,7 +20,9 @@ import { CloudflaredManager } from './cloudflared-manager.mjs';
|
|
|
18
20
|
const name = 'dsh-bridge';
|
|
19
21
|
const inject = ['connection', 'webServer'];
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
// 从 package.json 动态读取版本号,发版只需改 package.json 一处
|
|
24
|
+
const PACKAGE_JSON = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'));
|
|
25
|
+
const VERSION = PACKAGE_JSON.version ?? '0.0.0';
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* 选择最佳局域网 IP
|