@yangfan1998/dsh-qqbot-plus 0.1.0 → 0.1.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/README.md +96 -91
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -1,53 +1,48 @@
|
|
|
1
1
|
# @yangfan1998/dsh-qqbot-plus
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**DeepSeek Harness 的 QQ 机器人整合包:装一次,带网关、识图、语音和 B 站工具。**
|
|
4
4
|
|
|
5
|
-
`@yangfan1998/dsh-qqbot-plus`
|
|
5
|
+
`@yangfan1998/dsh-qqbot-plus` 会挂载 [`@zaofan/dsh-qqbot`](https://www.npmjs.com/package/@zaofan/dsh-qqbot) 网关,并额外提供:
|
|
6
6
|
|
|
7
|
-
- `qqbot_describe_image` —
|
|
8
|
-
- `tts_speak` — Edge TTS
|
|
9
|
-
- `bili_read` / `bili_search` / `bili_hot` / `bili_frames` —
|
|
7
|
+
- `qqbot_describe_image` — 图片理解 / OCR
|
|
8
|
+
- `tts_speak` — Edge TTS 语音(mp3)
|
|
9
|
+
- `bili_read` / `bili_search` / `bili_hot` / `bili_frames` — B 站视频、弹幕、评论、缩略图理解
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
它是 **bundle**,不是 QQ 网关的 fork。网关仍然是 `@zaofan/dsh-qqbot`,可以独立升级。
|
|
12
12
|
|
|
13
|
-
>
|
|
13
|
+
> 当前版本:`0.1.0`。已发布到 npm;本地也可以 `npm pack` 后安装。
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 环境要求
|
|
18
18
|
|
|
19
|
-
|
|
|
19
|
+
| 项目 | 要求 |
|
|
20
20
|
|---|---|
|
|
21
21
|
| Node.js | `>= 22.13` |
|
|
22
22
|
| DeepSeek Harness | `>= 0.2.1-alpha.2` |
|
|
23
|
-
| QQ
|
|
24
|
-
|
|
|
25
|
-
| TTS
|
|
26
|
-
|
|
|
23
|
+
| QQ 机器人 | QQ 开放平台的 AppID + AppSecret |
|
|
24
|
+
| 识图模型 | 支持图片输入的 LLM 路由(默认 `zhipu/aliyun/qwen3-vl-plus`) |
|
|
25
|
+
| TTS(可选) | `edge-tts` 可执行文件在 `PATH`,或配置 `tts.bin` |
|
|
26
|
+
| B 站(可选) | 公开数据不需要 Key;`BILIBILI_SESSDATA` 可解锁字幕 |
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## 安装
|
|
31
31
|
|
|
32
|
-
###
|
|
32
|
+
### 方式一:从 npm 安装(推荐)
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
|
|
36
|
-
npm pack
|
|
37
|
-
# produces yangfan1998-dsh-qqbot-plus-0.1.0.tgz
|
|
38
|
-
|
|
39
|
-
dsh plugin --profile <your-profile> add ./yangfan1998-dsh-qqbot-plus-0.1.0.tgz
|
|
35
|
+
dsh plugin --profile <你的profile> add @yangfan1998/dsh-qqbot-plus
|
|
40
36
|
```
|
|
41
37
|
|
|
42
|
-
|
|
38
|
+
如果 pnpm 报 `ERR_PNPM_IGNORED_BUILDS`(QQ 网关依赖的 `onnxruntime-node` / `protobufjs`):
|
|
43
39
|
|
|
44
40
|
```bash
|
|
45
|
-
cd ~/.dsh/profiles
|
|
41
|
+
cd ~/.dsh/profiles/<你的profile>
|
|
46
42
|
pnpm approve-builds --all
|
|
47
43
|
```
|
|
48
44
|
|
|
49
|
-
|
|
50
|
-
auto-append bundle packages in all DSH versions):
|
|
45
|
+
然后把这个 bundle 加进 profile 的 `package.json`(部分 DSH 版本的插件管理器不会自动追加):
|
|
51
46
|
|
|
52
47
|
```json
|
|
53
48
|
{
|
|
@@ -63,59 +58,67 @@ auto-append bundle packages in all DSH versions):
|
|
|
63
58
|
}
|
|
64
59
|
```
|
|
65
60
|
|
|
66
|
-
|
|
61
|
+
启动前先确认组合树:
|
|
67
62
|
|
|
68
63
|
```bash
|
|
69
|
-
dsh --profile
|
|
70
|
-
dsh --profile
|
|
64
|
+
dsh --profile <你的profile> --dump-config | grep -A3 'id: im-qqbot'
|
|
65
|
+
dsh --profile <你的profile> --dump-config | grep -A3 'id: qqbot-plus'
|
|
71
66
|
```
|
|
72
67
|
|
|
73
|
-
###
|
|
68
|
+
### 方式二:从本地 tarball 安装
|
|
74
69
|
|
|
75
70
|
```bash
|
|
76
|
-
|
|
71
|
+
cd /path/to/dsh-qqbot-plus
|
|
72
|
+
npm pack
|
|
73
|
+
# 生成 yangfan1998-dsh-qqbot-plus-0.1.0.tgz
|
|
74
|
+
|
|
75
|
+
dsh plugin --profile <你的profile> add ./yangfan1998-dsh-qqbot-plus-0.1.0.tgz
|
|
77
76
|
```
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
### 方式三:已经有 QQ 网关的 profile
|
|
79
|
+
|
|
80
|
+
这个包默认会插入 `im-qqbot`。如果你已经装了 `@zaofan/dsh-qqbot`,**不要**把本包加入 `dsh.profile.bundles`,否则会出现重复的 `im-qqbot`。
|
|
81
|
+
|
|
82
|
+
改为:安装本包后,把 [`cordis.tools-only.yml`](./cordis.tools-only.yml) 里的 `- insert:` 段复制到你 profile 自己的 `cordis.patch.yml`。
|
|
82
83
|
|
|
83
84
|
---
|
|
84
85
|
|
|
85
|
-
##
|
|
86
|
+
## 配置凭据
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
bundle 的 `cordis.patch.yml` 使用 `__FROM_ENV__` 读取 `appId` / `appSecret`。
|
|
88
89
|
|
|
89
|
-
###
|
|
90
|
+
### 方式 A:环境变量
|
|
90
91
|
|
|
91
92
|
```bash
|
|
92
93
|
export QQBOT_APPID=1905977275
|
|
93
|
-
export QQBOT_APP_SECRET
|
|
94
|
+
export QQBOT_APP_SECRET=你的secret
|
|
94
95
|
```
|
|
95
96
|
|
|
96
|
-
###
|
|
97
|
+
### 方式 B:直接写 profile patch
|
|
97
98
|
|
|
98
|
-
|
|
99
|
+
编辑 profile 的 `cordis.patch.yml` 里的 `im-qqbot` 行:
|
|
99
100
|
|
|
100
101
|
```yaml
|
|
101
102
|
- id: im-qqbot
|
|
102
103
|
name: '@zaofan/dsh-qqbot'
|
|
103
104
|
config:
|
|
104
105
|
appId: '1905977275'
|
|
105
|
-
appSecret: '
|
|
106
|
+
appSecret: '你的secret'
|
|
106
107
|
```
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
不要把真实密钥提交到 Git。
|
|
110
|
+
|
|
111
|
+
如果想让机器人接收非 @ 的群消息,群主还需要在 QQ 机器人资料页开启“接收群消息/通知”。
|
|
109
112
|
|
|
110
113
|
---
|
|
111
114
|
|
|
112
|
-
##
|
|
115
|
+
## 工具配置
|
|
113
116
|
|
|
114
|
-
|
|
117
|
+
bundle 自带安全默认值。覆盖时改 `qqbot-plus` 行:
|
|
115
118
|
|
|
116
119
|
```yaml
|
|
117
120
|
- id: qqbot-plus
|
|
118
|
-
name: @yangfan1998/dsh-qqbot-plus
|
|
121
|
+
name: '@yangfan1998/dsh-qqbot-plus'
|
|
119
122
|
config:
|
|
120
123
|
vision:
|
|
121
124
|
provider: zhipu
|
|
@@ -134,58 +137,60 @@ The bundle's `cordis.patch.yml` ships safe defaults. Override them in the `qqbot
|
|
|
134
137
|
replyLimit: 5
|
|
135
138
|
```
|
|
136
139
|
|
|
137
|
-
###
|
|
140
|
+
### 识图
|
|
141
|
+
|
|
142
|
+
只要你的 LLM 路由里有支持 `image` 输入的模型即可。模型必须在 `llm-pi-ai`(或其他 LLM 插件)的 provider 配置里存在。
|
|
138
143
|
|
|
139
|
-
|
|
144
|
+
模型不可用时,`qqbot_describe_image` 会自动禁用;不会拖垮整个插件。
|
|
140
145
|
|
|
141
|
-
###
|
|
146
|
+
### 语音
|
|
142
147
|
|
|
143
|
-
`tts_speak`
|
|
148
|
+
`tts_speak` 调用外部 `edge-tts`,默认把 mp3 写到 `downloads/tts`。
|
|
144
149
|
|
|
145
150
|
```bash
|
|
146
151
|
python3 -m pip install edge-tts
|
|
147
|
-
#
|
|
152
|
+
# 或者指向已有 venv:
|
|
148
153
|
# tts.bin: /path/to/venv/bin/edge-tts
|
|
149
154
|
```
|
|
150
155
|
|
|
151
|
-
|
|
156
|
+
`edge-tts` 不可用时,工具会返回明确错误,不会让插件崩溃。
|
|
152
157
|
|
|
153
|
-
###
|
|
158
|
+
### B 站
|
|
154
159
|
|
|
155
|
-
|
|
160
|
+
公开视频的元数据、弹幕、评论不需要 Cookie;字幕通常需要登录:
|
|
156
161
|
|
|
157
162
|
```bash
|
|
158
|
-
export BILIBILI_SESSDATA
|
|
163
|
+
export BILIBILI_SESSDATA=你的SESSDATA
|
|
159
164
|
```
|
|
160
165
|
|
|
161
|
-
|
|
166
|
+
B 站会限流匿名请求;工具内部做了节流,并缓存匿名 `buvid3` Cookie。
|
|
162
167
|
|
|
163
168
|
---
|
|
164
169
|
|
|
165
|
-
##
|
|
170
|
+
## 工具列表
|
|
166
171
|
|
|
167
|
-
|
|
|
172
|
+
| 工具 | 用途 |
|
|
168
173
|
|---|---|
|
|
169
|
-
| `qqbot_describe_image` |
|
|
170
|
-
| `tts_speak` |
|
|
171
|
-
| `bili_read` |
|
|
172
|
-
| `bili_search` |
|
|
173
|
-
| `bili_hot` |
|
|
174
|
-
| `bili_frames` |
|
|
174
|
+
| `qqbot_describe_image` | 看一张本地图片或 URL;OCR、表格、截图、照片 |
|
|
175
|
+
| `tts_speak` | 用 Edge TTS 生成短语音 mp3;再用 `send_media(kind="voice")` 发出 |
|
|
176
|
+
| `bili_read` | 视频元数据、弹幕、热评(含楼中楼)、可选字幕 |
|
|
177
|
+
| `bili_search` | 按标题/关键词搜 B 站,返回 BV 和匹配度 |
|
|
178
|
+
| `bili_hot` | B 站热门榜 |
|
|
179
|
+
| `bili_frames` | 视频缩略图拼图 → 视觉模型概述;分辨率低,不要当事实 |
|
|
175
180
|
|
|
176
181
|
---
|
|
177
182
|
|
|
178
|
-
##
|
|
183
|
+
## 可选扩展
|
|
179
184
|
|
|
180
|
-
|
|
185
|
+
包内带了两个 `{dataRoot}/.qqbot-extensions` 扩展:
|
|
181
186
|
|
|
182
|
-
- `extensions/inbound/bili-card-url.mjs` —
|
|
183
|
-
- `extensions/outbound/abs-image-paths.mjs` —
|
|
187
|
+
- `extensions/inbound/bili-card-url.mjs` — 从 QQ 小程序卡片的 raw 数据里提取 B 站 URL。只接受 URL,不接受裸 `BV...`,因为 QQ message id 里可能刚好包含假 BV。
|
|
188
|
+
- `extensions/outbound/abs-image-paths.mjs` — 发图前把 markdown 里的相对图片路径改成绝对路径。
|
|
184
189
|
|
|
185
|
-
|
|
190
|
+
复制到 QQ 机器人的数据根:
|
|
186
191
|
|
|
187
192
|
```bash
|
|
188
|
-
DATA_ROOT="/path/to/qqbot/data-root" #
|
|
193
|
+
DATA_ROOT="/path/to/qqbot/data-root" # 通常是 <im-qqbot.cwd>/dshqqbot
|
|
189
194
|
PKG_DIR="$(node -e "console.log(require.resolve('@yangfan1998/dsh-qqbot-plus'))" | xargs dirname)"
|
|
190
195
|
|
|
191
196
|
mkdir -p "$DATA_ROOT/.qqbot-extensions/inbound" "$DATA_ROOT/.qqbot-extensions/outbound"
|
|
@@ -193,43 +198,43 @@ cp "$PKG_DIR/extensions/inbound/bili-card-url.mjs" "$DATA_ROOT/.qqbot-extensions
|
|
|
193
198
|
cp "$PKG_DIR/extensions/outbound/abs-image-paths.mjs" "$DATA_ROOT/.qqbot-extensions/outbound/"
|
|
194
199
|
```
|
|
195
200
|
|
|
196
|
-
`abs-image-paths`
|
|
201
|
+
`abs-image-paths` 默认用 `process.cwd()` 解析相对路径;如果宿主 cwd 和 `im-qqbot.cwd` 不一致,设置 `QQBOT_CWD`。
|
|
197
202
|
|
|
198
203
|
---
|
|
199
204
|
|
|
200
|
-
##
|
|
205
|
+
## 不包含什么
|
|
201
206
|
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
+
- 不包含 QQ AppID / AppSecret / API Key / Cookie
|
|
208
|
+
- 不包含人设或群守则(自带你的)
|
|
209
|
+
- 不包含表情包图库(第三方素材授权问题)
|
|
210
|
+
- 不包含 Web 设置页;通过 `cordis.patch.yml` 或环境变量配置
|
|
211
|
+
- 不包含 `launchd` / systemd 服务文件;部署方式由你决定
|
|
207
212
|
|
|
208
213
|
---
|
|
209
214
|
|
|
210
|
-
##
|
|
215
|
+
## 安全说明
|
|
211
216
|
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
- `tts_speak`
|
|
215
|
-
-
|
|
217
|
+
- B 站工具会访问 `bilibili.com`、`b23.tv` 和 `api.bilibili.com`。
|
|
218
|
+
- 识图工具只下载你传入的 `http(s)` 图片,不扫描任意文件。
|
|
219
|
+
- `tts_speak` 会用配置的 `edge-tts` 可执行文件执行文本参数;不要把 `tts.bin` 指向不可信脚本。
|
|
220
|
+
- 本包不内置任何凭据。建议用专门的 QQ 机器人账号运行。
|
|
216
221
|
|
|
217
222
|
---
|
|
218
223
|
|
|
219
|
-
##
|
|
224
|
+
## 发布检查
|
|
220
225
|
|
|
221
|
-
- [ ] `npm pack`
|
|
222
|
-
- [ ]
|
|
223
|
-
- [ ]
|
|
224
|
-
- [ ]
|
|
225
|
-
- [ ]
|
|
226
|
-
- [ ]
|
|
227
|
-
- [ ] `npm publish
|
|
228
|
-
- [ ]
|
|
229
|
-
- [ ]
|
|
226
|
+
- [ ] `npm pack` 后在全新测试 profile 安装
|
|
227
|
+
- [ ] 确认 `im-qqbot` + `qqbot-plus` 都激活
|
|
228
|
+
- [ ] 用真实图片验证 `qqbot_describe_image`
|
|
229
|
+
- [ ] 用 `edge-tts` 验证 `tts_speak`
|
|
230
|
+
- [ ] 用公开 BV 验证 `bili_read`
|
|
231
|
+
- [ ] 更新 `package.json` 里的版本/作者/仓库
|
|
232
|
+
- [ ] `npm publish`(需要 npm 账号和 2FA)
|
|
233
|
+
- [ ] 推到自己的 GitHub 仓库(不要复用别人的凭据)
|
|
234
|
+
- [ ] 加 `dsh-plugin` topic,提交到 DSH 插件市场
|
|
230
235
|
|
|
231
236
|
---
|
|
232
237
|
|
|
233
|
-
##
|
|
238
|
+
## 许可证
|
|
234
239
|
|
|
235
|
-
MIT
|
|
240
|
+
MIT,见 [LICENSE](./LICENSE)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yangfan1998/dsh-qqbot-plus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "One-install DeepSeek Harness QQ bot bundle: @zaofan/dsh-qqbot gateway plus vision, Edge TTS and Bilibili reading tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -52,5 +52,13 @@
|
|
|
52
52
|
"engines": {
|
|
53
53
|
"dsh": ">=0.2.1-alpha.2"
|
|
54
54
|
}
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/FanFFF/dsh-qqbot-plus.git"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/FanFFF/dsh-qqbot-plus#readme",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/FanFFF/dsh-qqbot-plus/issues"
|
|
55
63
|
}
|
|
56
64
|
}
|