@tnnevol/dsh-midscene 0.2.1-rc.2.12 → 0.2.1-rc.2.19
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 +26 -7
- package/lib/client.js +3812 -2192
- package/lib/index.d.ts +239 -22
- package/lib/index.js +538 -83
- package/lib/style.css +1 -1
- package/package.json +5 -5
- package/skills/SOURCE.md +7 -6
- package/skills/dsh-midscene/SKILL.md +12 -6
- package/skills/midscenejs/GENERATION.md +25 -5
- package/skills/midscenejs/SKILL.md +10 -4
- package/skills/midscenejs/references/midscene-test/configuration.md +42 -0
- package/skills/midscenejs/references/midscene-test/github-actions.md +138 -0
- package/skills/midscenejs/references/midscene-test/use.md +64 -14
- package/skills/midscenejs/references/model-config.md +85 -19
package/README.md
CHANGED
|
@@ -7,23 +7,39 @@
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
dsh plugin --profile web add @tnnevol/dsh-midscene@0.2.1-rc.2.
|
|
10
|
+
dsh plugin --profile web add @tnnevol/dsh-midscene@0.2.1-rc.2.19
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
安装后重启 DSH Web profile。
|
|
14
14
|
|
|
15
15
|
## 接入
|
|
16
16
|
|
|
17
|
-
在运行 Midscene 命令的工作目录写 `.env
|
|
17
|
+
在运行 Midscene 命令的工作目录写 `.env`(四行都是固定值,换模型请改插件设置而非本文件):
|
|
18
18
|
|
|
19
19
|
```sh
|
|
20
20
|
MIDSCENE_MODEL_BASE_URL="http://127.0.0.1:8787/v1"
|
|
21
|
-
MIDSCENE_MODEL_API_KEY="
|
|
22
|
-
MIDSCENE_MODEL_NAME="
|
|
23
|
-
MIDSCENE_MODEL_FAMILY="
|
|
21
|
+
MIDSCENE_MODEL_API_KEY="<插件设置页显示的接入密钥>"
|
|
22
|
+
MIDSCENE_MODEL_NAME="dsh-model"
|
|
23
|
+
MIDSCENE_MODEL_FAMILY="deepseek"
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
`MIDSCENE_MODEL_NAME` 固定为 `dsh-model`——它代表「跟随 DSH 当前会话的模型」,具体用哪个模型由插件设置决定,不必也不应该在这里写死模型名。上面这段可以在插件设置页点「复制接入配置」直接取到,端口与密钥以那里显示的为准。
|
|
27
|
+
|
|
28
|
+
想直接指定某个模型时,`MIDSCENE_MODEL_NAME` 也可以换成 `提供方/模型`(从 `curl -s http://127.0.0.1:8787/v1/models` 里选,建议选 `vision: true` 的模型——Midscene 靠截图理解页面)。
|
|
29
|
+
|
|
30
|
+
### 浏览器扩展不需要配置
|
|
31
|
+
|
|
32
|
+
上面的配置**只给跑脚本的这一侧用**。桥接模式下推理在 Node / CLI 侧完成,Chrome 里的 Midscene 扩展只当「眼睛和手」——截图、点击、输入,**不参与模型调用**,因此扩展的 `Model Env Config` **留空也能正常用**。
|
|
33
|
+
|
|
34
|
+
唯一需要把这段粘进扩展的地方,是使用**扩展自带的 Playground**(在扩展侧边栏里手写自然语言指令、由扩展自己驱动页面)。用本插件做桥接自动化时不需要这一步。
|
|
35
|
+
|
|
36
|
+
判据:若漏掉 CLI 侧的配置,报错是
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
Model configuration is incomplete: model name (MIDSCENE_MODEL_NAME) is required
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
——**报错点在 CLI 侧**,说明配置属于这一侧;而扩展能不能连上只取决于它是否已安装、首次连接有没有点过 **Allow**,与填没填模型无关。
|
|
27
43
|
|
|
28
44
|
## 端点
|
|
29
45
|
|
|
@@ -31,7 +47,10 @@ MIDSCENE_MODEL_FAMILY="glm-v"
|
|
|
31
47
|
| --- | --- |
|
|
32
48
|
| `GET /v1/models` | 模型目录(标识为「提供方/模型」) |
|
|
33
49
|
| `POST /v1/chat/completions` | 对话补全(流式与非流式,支持图片输入) |
|
|
34
|
-
| `GET /v1/health` |
|
|
50
|
+
| `GET /v1/health` | 健康检查(含各职责当前解析到的模型) |
|
|
51
|
+
| `GET /v1/midscene-env` | 直接返回上文那段接入配置,便于脚本拉取 |
|
|
52
|
+
|
|
53
|
+
只提供 OpenAI Chat Completions 一种协议;请求 `/v1/responses` 或 `/v1/systemone` 会得到明确的 404 与替代指引,而不是难懂的失败。
|
|
35
54
|
|
|
36
55
|
安装插件后 Midscene 的浏览器自动化技能随插件内置分发,会话中可直接使用,无需 `npx skills add`。
|
|
37
56
|
|