@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.
Files changed (2) hide show
  1. package/README.md +96 -91
  2. package/package.json +9 -1
package/README.md CHANGED
@@ -1,53 +1,48 @@
1
1
  # @yangfan1998/dsh-qqbot-plus
2
2
 
3
- **One-install QQ bot bundle for DeepSeek Harness.**
3
+ **DeepSeek Harness 的 QQ 机器人整合包:装一次,带网关、识图、语音和 B 站工具。**
4
4
 
5
- `@yangfan1998/dsh-qqbot-plus` mounts the [`@zaofan/dsh-qqbot`](https://www.npmjs.com/package/@zaofan/dsh-qqbot) gateway together with three optional tools:
5
+ `@yangfan1998/dsh-qqbot-plus` 会挂载 [`@zaofan/dsh-qqbot`](https://www.npmjs.com/package/@zaofan/dsh-qqbot) 网关,并额外提供:
6
6
 
7
- - `qqbot_describe_image` — image understanding / OCR via an image-capable model
8
- - `tts_speak` — Edge TTS voice messages (mp3)
9
- - `bili_read` / `bili_search` / `bili_hot` / `bili_frames` — Bilibili video, danmaku, comments and thumbnail understanding
7
+ - `qqbot_describe_image` — 图片理解 / OCR
8
+ - `tts_speak` — Edge TTS 语音(mp3)
9
+ - `bili_read` / `bili_search` / `bili_hot` / `bili_frames` — B 站视频、弹幕、评论、缩略图理解
10
10
 
11
- It is a **bundle**, not a fork of the QQ gateway. The gateway remains `@zaofan/dsh-qqbot` and can be upgraded independently.
11
+ 它是 **bundle**,不是 QQ 网关的 fork。网关仍然是 `@zaofan/dsh-qqbot`,可以独立升级。
12
12
 
13
- > Status: `0.1.0` · not yet published to npm. Build a local tarball with `npm pack`.
13
+ > 当前版本:`0.1.0`。已发布到 npm;本地也可以 `npm pack` 后安装。
14
14
 
15
15
  ---
16
16
 
17
- ## Requirements
17
+ ## 环境要求
18
18
 
19
- | Item | Requirement |
19
+ | 项目 | 要求 |
20
20
  |---|---|
21
21
  | Node.js | `>= 22.13` |
22
22
  | DeepSeek Harness | `>= 0.2.1-alpha.2` |
23
- | QQ bot | AppID + AppSecret from QQ Open Platform |
24
- | LLM route | An image-capable model for `qqbot_describe_image` (default `zhipu/aliyun/qwen3-vl-plus`) |
25
- | TTS (optional) | `edge-tts` executable on `PATH`, or set `tts.bin` |
26
- | Bilibili (optional) | No key required for public data; `BILIBILI_SESSDATA` unlocks subtitles |
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
- ## Install
30
+ ## 安装
31
31
 
32
- ### Local tarball (works today, no npm account needed)
32
+ ### 方式一:从 npm 安装(推荐)
33
33
 
34
34
  ```bash
35
- cd /path/to/dsh-qqbot-plus
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
- If pnpm reports `ERR_PNPM_IGNORED_BUILDS` (the QQ gateway pulls `onnxruntime-node` / `protobufjs`):
38
+ 如果 pnpm 报 `ERR_PNPM_IGNORED_BUILDS`(QQ 网关依赖的 `onnxruntime-node` / `protobufjs`):
43
39
 
44
40
  ```bash
45
- cd ~/.dsh/profiles/<your-profile>
41
+ cd ~/.dsh/profiles/<你的profile>
46
42
  pnpm approve-builds --all
47
43
  ```
48
44
 
49
- Then add the bundle to the profile's `package.json` (the plugin manager does not
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
- Verify the composed tree before booting:
61
+ 启动前先确认组合树:
67
62
 
68
63
  ```bash
69
- dsh --profile <your-profile> --dump-config | grep -A3 'id: im-qqbot'
70
- dsh --profile <your-profile> --dump-config | grep -A3 'id: qqbot-plus'
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
- ### npm (after publishing)
68
+ ### 方式二:从本地 tarball 安装
74
69
 
75
70
  ```bash
76
- dsh plugin --profile <your-profile> add @yangfan1998/dsh-qqbot-plus
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
- > Use a **fresh profile**. The bundle patch inserts an `im-qqbot` row; if you already installed `@zaofan/dsh-qqbot` in that profile, you will get a duplicate `im-qqbot` and the patch will not activate.
80
- >
81
- > For an existing gateway, **do not add this package to `dsh.profile.bundles`**. Install the package, then copy the `- insert:` block from [`cordis.tools-only.yml`](./cordis.tools-only.yml) into the profile's own `cordis.patch.yml`.
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
- ## Configure credentials
86
+ ## 配置凭据
86
87
 
87
- The bundle patch uses `__FROM_ENV__` for `appId` / `appSecret`. Either:
88
+ bundle 的 `cordis.patch.yml` 使用 `__FROM_ENV__` 读取 `appId` / `appSecret`。
88
89
 
89
- ### Option A — environment variables
90
+ ### 方式 A:环境变量
90
91
 
91
92
  ```bash
92
93
  export QQBOT_APPID=1905977275
93
- export QQBOT_APP_SECRET=your-secret
94
+ export QQBOT_APP_SECRET=你的secret
94
95
  ```
95
96
 
96
- ### Option B — literal values in the profile patch
97
+ ### 方式 B:直接写 profile patch
97
98
 
98
- Edit the `im-qqbot` row in your profile's `cordis.patch.yml`:
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: 'your-secret'
106
+ appSecret: '你的secret'
106
107
  ```
107
108
 
108
- Never commit real secrets. The QQ bot must also have the group-message permission enabled by the group owner if you want non-@ group messages.
109
+ 不要把真实密钥提交到 Git。
110
+
111
+ 如果想让机器人接收非 @ 的群消息,群主还需要在 QQ 机器人资料页开启“接收群消息/通知”。
109
112
 
110
113
  ---
111
114
 
112
- ## Tool configuration
115
+ ## 工具配置
113
116
 
114
- The bundle's `cordis.patch.yml` ships safe defaults. Override them in the `qqbot-plus` row:
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
- ### Vision
140
+ ### 识图
141
+
142
+ 只要你的 LLM 路由里有支持 `image` 输入的模型即可。模型必须在 `llm-pi-ai`(或其他 LLM 插件)的 provider 配置里存在。
138
143
 
139
- Any route whose model accepts `image` input works. The model must be available in your `llm-pi-ai` (or other LLM plugin) provider config. If the model is missing, `qqbot_describe_image` disables itself and the rest of the bundle keeps running.
144
+ 模型不可用时,`qqbot_describe_image` 会自动禁用;不会拖垮整个插件。
140
145
 
141
- ### TTS
146
+ ### 语音
142
147
 
143
- `tts_speak` shells out to `edge-tts` and writes an mp3 under `downloads/tts` by default.
148
+ `tts_speak` 调用外部 `edge-tts`,默认把 mp3 写到 `downloads/tts`。
144
149
 
145
150
  ```bash
146
151
  python3 -m pip install edge-tts
147
- # or point at an existing venv:
152
+ # 或者指向已有 venv:
148
153
  # tts.bin: /path/to/venv/bin/edge-tts
149
154
  ```
150
155
 
151
- If `edge-tts` is unavailable, the tool returns a clear error; it does not crash the plugin.
156
+ `edge-tts` 不可用时,工具会返回明确错误,不会让插件崩溃。
152
157
 
153
- ### Bilibili
158
+ ### B 站
154
159
 
155
- Public video metadata, danmaku and comments work without a cookie. Subtitles often require login:
160
+ 公开视频的元数据、弹幕、评论不需要 Cookie;字幕通常需要登录:
156
161
 
157
162
  ```bash
158
- export BILIBILI_SESSDATA=your-sessdata
163
+ export BILIBILI_SESSDATA=你的SESSDATA
159
164
  ```
160
165
 
161
- Bilibili can rate-limit anonymous requests; the tool throttles requests and caches the anonymous `buvid3` cookie.
166
+ B 站会限流匿名请求;工具内部做了节流,并缓存匿名 `buvid3` Cookie。
162
167
 
163
168
  ---
164
169
 
165
- ## Tools
170
+ ## 工具列表
166
171
 
167
- | Tool | Purpose |
172
+ | 工具 | 用途 |
168
173
  |---|---|
169
- | `qqbot_describe_image` | Inspect one local image or URL; OCR, tables, screenshots, photos |
170
- | `tts_speak` | Generate a short mp3 with Edge TTS; send it with `send_media(kind="voice")` |
171
- | `bili_read` | Metadata, danmaku, hot comments (nested), optional subtitles |
172
- | `bili_search` | Search Bilibili by title/keyword; returns BV ids with match scores |
173
- | `bili_hot` | Bilibili trending list |
174
- | `bili_frames` | Thumbnail sprite sheet → vision model summary; low-resolution, do not treat as factual |
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
- ## Optional extensions
183
+ ## 可选扩展
179
184
 
180
- The package ships two `{dataRoot}/.qqbot-extensions` extensions:
185
+ 包内带了两个 `{dataRoot}/.qqbot-extensions` 扩展:
181
186
 
182
- - `extensions/inbound/bili-card-url.mjs` — extracts a Bilibili URL from a QQ mini-program card's raw payload. It intentionally only accepts URLs, never bare `BV...` substrings (QQ message ids can contain false BVs).
183
- - `extensions/outbound/abs-image-paths.mjs` — rewrites relative markdown image paths to absolute paths before QQ upload.
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
- Copy them into the QQ bot's data root:
190
+ 复制到 QQ 机器人的数据根:
186
191
 
187
192
  ```bash
188
- DATA_ROOT="/path/to/qqbot/data-root" # usually <im-qqbot.cwd>/dshqqbot
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` resolves relative paths against `process.cwd()`; set `QQBOT_CWD` if your host cwd differs from `im-qqbot.cwd`.
201
+ `abs-image-paths` 默认用 `process.cwd()` 解析相对路径;如果宿主 cwd 和 `im-qqbot.cwd` 不一致,设置 `QQBOT_CWD`。
197
202
 
198
203
  ---
199
204
 
200
- ## What is NOT included
205
+ ## 不包含什么
201
206
 
202
- - No QQ AppID / AppSecret / API keys / cookies
203
- - No persona or group prompt (bring your own)
204
- - No sticker/meme image packs (third-party art licensing)
205
- - No web settings page; configure via `cordis.patch.yml` or env
206
- - No `launchd` / systemd unit; deployment is up to you
207
+ - 不包含 QQ AppID / AppSecret / API Key / Cookie
208
+ - 不包含人设或群守则(自带你的)
209
+ - 不包含表情包图库(第三方素材授权问题)
210
+ - 不包含 Web 设置页;通过 `cordis.patch.yml` 或环境变量配置
211
+ - 不包含 `launchd` / systemd 服务文件;部署方式由你决定
207
212
 
208
213
  ---
209
214
 
210
- ## Security notes
215
+ ## 安全说明
211
216
 
212
- - The Bilibili tool makes outbound HTTPS requests to `bilibili.com`, `b23.tv` and `api.bilibili.com`.
213
- - The vision tool downloads only `http(s)` images you pass it; it does not scan arbitrary files.
214
- - `tts_speak` executes the configured `edge-tts` binary with text as an argument. Do not point `tts.bin` at an untrusted script.
215
- - This package does not bundle credentials. Run it with a dedicated QQ bot account.
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
- ## Publishing checklist
224
+ ## 发布检查
220
225
 
221
- - [ ] `npm pack` and install the tarball into a fresh test profile
222
- - [ ] verify `im-qqbot` + `qqbot-plus` both activate
223
- - [ ] verify `qqbot_describe_image` with a real image
224
- - [ ] verify `tts_speak` with `edge-tts`
225
- - [ ] verify `bili_read` with a public BV
226
- - [ ] replace the placeholder version/author/repository in `package.json`
227
- - [ ] `npm publish` (needs an npm account)
228
- - [ ] push to your own GitHub repository (do not reuse another account's credentials)
229
- - [ ] add the `dsh-plugin` topic and submit to the DSH plugin market
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
- ## License
238
+ ## 许可证
234
239
 
235
- MIT. See [LICENSE](./LICENSE).
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.0",
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
  }