qfish 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hyun20202023-ui
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,393 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ <div align="center">
2
+
3
+ <img src="assets/logo.png" width="150" alt="qfish">
4
+
5
+ # qfish
6
+
7
+ **让 DeepSeek Harness 直接接管 QQ**
8
+
9
+ 一条灵活、自主、有点脾气的大肥鱼
10
+
11
+ ![license](https://img.shields.io/github/license/hyun20202023-ui/dsh-qfish?style=flat-square&color=4a6fbf)
12
+ ![stars](https://img.shields.io/github/stars/hyun20202023-ui/dsh-qfish?style=flat-square&color=2b3a67)
13
+ ![issues](https://img.shields.io/github/issues/hyun20202023-ui/dsh-qfish?style=flat-square&color=9aa4b2)
14
+ ![platform](https://img.shields.io/badge/platform-DeepSeek%20Harness-5b7fd4?style=flat-square)
15
+ ![version](https://img.shields.io/badge/version-0.1.0-f7f3ee?style=flat-square&labelColor=2b3a67)
16
+
17
+ </div>
18
+
19
+ ---
20
+
21
+ > 大多数 QQ 机器人活在框架里:人设是配置项,记忆是数据库,什么时候说话靠关键词。
22
+ >
23
+ > qfish 不走这条路。它是 DSH 的插件,QQ 只是它的手和嘴,判断交给模型自己做。
24
+
25
+ ---
26
+
27
+ ## 目录
28
+
29
+ - [它是什么](#它是什么)
30
+ - [快速开始](#快速开始)
31
+ - [功能模块](#功能模块)
32
+ - [默认值](#默认值)
33
+ - [它记在哪](#它记在哪)
34
+ - [常见问题](#常见问题)
35
+
36
+ ---
37
+
38
+ ## 它是什么
39
+
40
+ <div align="center">
41
+
42
+ | 陪伴 | 说话 | 眼睛 | 手脚 |
43
+ |:---:|:---:|:---:|:---:|
44
+ | 群聊收敛,私聊放开<br>同一份人设和记忆 | 短句、按人设、有情绪<br>不套客服腔 | 看图、看视频<br>字幕画面弹幕一起过 | 搜图、联网、音乐卡片<br>提醒、群管理、运维 |
45
+
46
+ </div>
47
+
48
+ **聊天与陪伴**
49
+
50
+ 群聊里它不抢话,私聊里它话多一点。同一条鱼,两种状态。
51
+
52
+ **尽量像人地说话**
53
+
54
+ 短句为主,不写小作文;按人设说话,有情绪和好感度,态度会变。
55
+
56
+ **图片和视频**
57
+
58
+ 发图能看图说话;发 B 站视频会把字幕、画面、弹幕、热评都过一遍,看完再聊。太长会直接说太长,不装看过。看完写摘要(没写就用字幕兜底)和感想(它愿意写才有),存进观看记录。
59
+
60
+ **工具**
61
+
62
+ 搜图、联网、音乐卡片、提醒、群管理、跨群发消息、跑服务器命令(仅后台权限)。
63
+
64
+ **一个控制台**
65
+
66
+ 会话、记忆、社交、观看记录、配置、日志,全在一个网页里。
67
+
68
+ **花费可控**
69
+
70
+ 聊久了会自动轮换上下文,旧内容压成摘要,不会越聊越贵;看视频是主要开销,时长、频率、描述长短都能在控制台调。
71
+
72
+ ---
73
+
74
+ ## 快速开始
75
+
76
+ 两种跑法:本机跑,或者丢到服务器。装插件那步一样,起 NapCat 和开控制台不一样。
77
+
78
+ ### 准备
79
+
80
+ - DeepSeek Harness(本地桌面版,或服务器上的 dsh),并且已经能正常对话(有默认模型)
81
+ - 一个 QQ 小号
82
+ - NapCat
83
+ - 服务器跑的话:一台能开端口的小鸡
84
+
85
+ ### ① 装插件
86
+
87
+ 本地和服务器一样,让 DSH 装:
88
+
89
+ ```
90
+ 用 plugin_manager 的 install_bundle 安装这个插件:
91
+ https://github.com/hyun20202023-ui/dsh-qfish
92
+ ```
93
+
94
+ 装完重启 DSH。
95
+
96
+ ### ② 起 NapCat
97
+
98
+ **本地**
99
+
100
+ 1. 装 NapCat,登录 QQ;
101
+ 2. 网络配置 → 新建 **WebSocket 服务器**;
102
+ 3. 端口 3001,消息格式 `array`。
103
+
104
+ **服务器(Docker)**
105
+
106
+ ```bash
107
+ docker run -d --name napcat --restart unless-stopped \
108
+ -p 3001:3001 -p 6099:6099 \
109
+ -v /opt/napcat:/app/napcat \
110
+ mlikiowa/napcat-docker:latest
111
+ ```
112
+
113
+ - `3001`:给插件连的 WebSocket;
114
+ - `6099`:NapCat 的网页,用来扫码;
115
+ - `/opt/napcat`:登录状态和数据,重启不丢。
116
+
117
+ 起来之后用浏览器打开 `http://服务器IP:6099`,扫码登录 QQ。
118
+
119
+ ### ③ 填配置
120
+
121
+ DSH → 插件设置 → **qfish**:
122
+
123
+ | 配置 | 本地 | 服务器 |
124
+ |---|---|---|
125
+ | `url` | `ws://127.0.0.1:3001` | `ws://127.0.0.1:3001` |
126
+ | `accessTokenRef` | NapCat 设了 token 才填 | 同左 |
127
+ | `consoleEnabled` | `true` | `true` |
128
+ | `consoleListen` | `127.0.0.1` | **`0.0.0.0`** |
129
+ | `consolePort` | `8090` | `8090`(被占用会自动顺延) |
130
+ | `consoleToken` | 留空自动生成 | 建议自己设一长串 |
131
+
132
+ **服务器还要放行端口**
133
+
134
+ - 开 `8090`(控制台);
135
+ - 开 `6099`(NapCat 网页);
136
+ - `3001` 只给本机插件用,别暴露到公网。
137
+
138
+ ### ④ 登录
139
+
140
+ - **本地**:控制台 → 行为参数 → 顶部二维码;也可以直接在 NapCat 界面扫。
141
+ - **服务器**:浏览器开 `http://服务器IP:6099` 扫码;控制台行为参数里也有二维码。
142
+
143
+ 登录成功后再进下一步。
144
+
145
+ ### ⑤ 打开控制台
146
+
147
+ 控制台是一个网页,**必须带 token 才能进**,地址长这样:
148
+
149
+ ```
150
+ http://地址:8090/?t=令牌
151
+ ```
152
+
153
+ **本地**
154
+
155
+ 1. 地址固定是 `http://127.0.0.1:8090`;
156
+ 2. token 在哪里:
157
+ - 配置里的 `consoleToken`;
158
+ - 留空的话,读这个文件:`<profile>/onebot-data/console-token.txt`;
159
+ - 或者 DSH 启动日志里「控制台已启动:http://…」那一行,整行就是带 token 的地址。
160
+ 3. 拼起来就是:
161
+
162
+ ```
163
+ http://127.0.0.1:8090/?t=CAIvQF3D...
164
+ ```
165
+
166
+ **服务器**
167
+
168
+ 1. 先把配置里的 `consoleListen` 改成 `0.0.0.0`——不改的话,只有服务器自己能访问,你在外面打不开;
169
+ 2. 放行端口 `8090`(安全组 / 防火墙);
170
+ 3. 建议顺手把 `consoleToken` 设成一个自己记得住的长串,别用自动生成的;
171
+ 4. 地址换成服务器 IP:
172
+
173
+ ```
174
+ http://你的服务器IP:8090/?t=你的令牌
175
+ ```
176
+
177
+ **进不去的时候**
178
+
179
+ | 现象 | 原因 |
180
+ |---|---|
181
+ | 浏览器显示 `unauthorized` | 地址里没带 `?t=`,或 token 不对 |
182
+ | 一直转圈、打不开 | `consoleListen` 还是 `127.0.0.1`,或者端口没放行 |
183
+ | 能打开但页面空白 | 端口对了、token 错了,刷新时检查地址 |
184
+ | 本地能开、远程不能 | 只放行了 NapCat 的 6099,没放行 8090 |
185
+
186
+ **右下角按钮**
187
+
188
+ DSH 页面右下角的悬浮按钮也能打开控制台,但它内置的地址是 `127.0.0.1:8090`。在服务器上使用时,手动把地址换成服务器 IP。
189
+
190
+ ---
191
+
192
+ ## 功能模块
193
+
194
+ ### 人设与说话
195
+
196
+ | 功能 | 说明 |
197
+ |---|---|
198
+ | 人设文件 | 性格写在 markdown 里,改文件就换人 |
199
+ | 语言模仿 | 会学群里人的说法和句式 |
200
+ | 黑话表 | 群里的黑话看得懂,被骂时也会用 |
201
+ | 禁词表 | 回复里出现的词自动删掉 |
202
+ | 梗百科 | 查梗、加梗,聊天时能用上 |
203
+
204
+ ### 记忆与会话
205
+
206
+ | 功能 | 说明 |
207
+ |---|---|
208
+ | 长期记忆 | 按人存,有上限,满了自动压缩 |
209
+ | 会话摘要 | 轮换时压缩上下文,新会话带着走 |
210
+ | 群聊缓存 | 进群先看最近几句,接得上话 |
211
+ | 记忆锁定 | 重要的那条可以锁住,不被压缩 |
212
+
213
+ ### 群聊与私聊
214
+
215
+ | 功能 | 说明 |
216
+ |---|---|
217
+ | 接话概率 | 群里不是每条都回 |
218
+ | 认识的人接话概率 | 认识的人说话,更容易接 |
219
+ | 闭嘴 | 只对某个人静音,不影响别人 |
220
+ | 私聊 | 话比群里多,记得你的事 |
221
+
222
+ ### 社交
223
+
224
+ | 功能 | 说明 |
225
+ |---|---|
226
+ | 联系人档案 | 名字、称呼、备注 |
227
+ | 好感度 | 会影响语气和态度 |
228
+ | 认人 | 聊久了会主动问怎么称呼 |
229
+
230
+ ### 看图与看视频
231
+
232
+ | 功能 | 说明 |
233
+ |---|---|
234
+ | 看图 | 收到图片会看内容,再决定怎么接 |
235
+ | 看视频 | 字幕、画面、弹幕、热评一起过 |
236
+ | 观看记录 | 看完写摘要和感想,存着能翻 |
237
+ | 主动分享 | 有合适的视频会自己发(默认关闭) |
238
+
239
+ ### 内容工具
240
+
241
+ | 功能 | 说明 |
242
+ |---|---|
243
+ | B 站 | 找视频、看视频、发卡片 |
244
+ | 音乐 | 网易云 / QQ 音乐卡片 |
245
+ | 表情包 | 收、存、随机发 |
246
+ | 搜图 | pixiv、booru、以图搜图 |
247
+ | 联网 | 搜索、抓网页正文 |
248
+
249
+ ### 管理与运维
250
+
251
+ | 功能 | 说明 |
252
+ |---|---|
253
+ | 提醒 | 定时提醒 |
254
+ | 群管理 | 禁言、踢人、处理加群和好友申请 |
255
+ | 发消息 | 跨群、私聊、@ 人 |
256
+ | 服务器命令 | `/dsh` 跑运维命令,仅后台权限 |
257
+ | 代理 | 走 Clash / HTTP 代理访问外网 |
258
+ | 贴吧 | 配置百度 Cookie 抓贴吧内容 |
259
+
260
+ ---
261
+
262
+ ## 默认值
263
+
264
+ 都能在控制台改,这里只是出厂设置。
265
+
266
+ | 项 | 默认 |
267
+ |---|:---:|
268
+ | 一次回复最多条数 | 4 |
269
+ | 每条最多字数 | 12 |
270
+ | 群聊接话概率 | 5% |
271
+ | 记忆上限 | 45 条/人 |
272
+ | 会话轮换 | 30 轮 / 40 万字符 |
273
+ | 观看记录 | 50 条 |
274
+ | 同一视频缓存 | 10 分钟 |
275
+ | 视频时长上限 | 10 分钟 |
276
+ | 每小时视频上限 | 20 条 |
277
+
278
+ ---
279
+
280
+ ## 它记在哪
281
+
282
+ 数据都在 profile 的数据目录,纯 JSON / 文本,能直接看、直接备份。
283
+
284
+ | 文件 | 内容 |
285
+ |---|---|
286
+ | `memories.json` | 记忆 |
287
+ | `summaries.json` | 摘要 |
288
+ | `state.json` | 会话索引 |
289
+ | `bili-memory.json` | 观看记录 |
290
+ | `contacts.json` | 联系人 |
291
+ | `frames/` | 九宫格缓存 |
292
+
293
+ 会自己清的东西:读图会话用完即删、旧会话段轮换后删、临时视频抽完帧就删。
294
+
295
+ ---
296
+
297
+ ## 常见问题
298
+
299
+ <details>
300
+ <summary><b>它不回我</b></summary>
301
+
302
+ - 群里没 @ 也没叫名字,可能在按概率接话
303
+ - 看看接话概率是不是调太低了
304
+ - 去控制台「运行日志」翻翻有没有报错
305
+
306
+ </details>
307
+
308
+ <details>
309
+ <summary><b>看视频失败</b></summary>
310
+
311
+ - 超过时长上限会被拒绝,这是正常的
312
+ - B 站 Cookie 可能过期了
313
+ - 卡片发不出是签名服务的问题,文字链接还能用
314
+
315
+ </details>
316
+
317
+ <details>
318
+ <summary><b>扫码登不上</b></summary>
319
+
320
+ - 二维码有时效,重新生成
321
+ - NapCat 掉线时,控制台会提示重连
322
+
323
+ </details>
324
+
325
+ <details>
326
+ <summary><b>控制台打不开</b></summary>
327
+
328
+ - 确认服务在跑
329
+ - 确认地址和端口
330
+ - 别漏了地址里的 token
331
+
332
+ </details>
333
+
334
+ <details>
335
+ <summary><b>QQ 在线,但一条都不回(日志里是 blocked)</b></summary>
336
+
337
+ DSH 可能把 qfish 的会话标成了「已归档」。归档的会话会被 DSH 直接拒绝执行,模型一次都不会跑。
338
+
339
+ 1. 退出 DSH;
340
+ 2. 打开 `~/.dsh/storages/workspace.json`(Windows:`C:\Users\你的用户名\.dsh\storages\workspace.json`);
341
+ 3. 删掉 `archivedSessionIds` 里所有以 `onebot:` 开头的条目;
342
+ 4. 保存,重开 DSH。
343
+
344
+ </details>
345
+
346
+ <details>
347
+ <summary><b>DSH 里有会话了,但控制台聊天框不动</b></summary>
348
+
349
+ 多半是 profile 没配默认模型,插件新建的会话拿不到模型,每轮直接被判 blocked。
350
+
351
+ 在 profile 的 `cordis.patch.yml` 里加:
352
+
353
+ ```yaml
354
+ - id: agent-default-model
355
+ name: "@deepseek-ai/dsh-agent-default-model"
356
+ config:
357
+ provider: deepseek-account
358
+ model: deepseek-flash
359
+ reasoningEffort: high
360
+ ```
361
+
362
+ 重启 DSH。
363
+
364
+ </details>
365
+
366
+ <details>
367
+ <summary><b>控制台打不开,或者端口被占</b></summary>
368
+
369
+ 多半是开了两个 DSH。任务管理器里把所有 `DeepSeek Harness` 进程结束,只留一个再启动。
370
+
371
+ </details>
372
+
373
+ <details>
374
+ <summary><b>同一个 QQ 能在两台机器上同时登吗</b></summary>
375
+
376
+ 不能。两个 NapCat 登同一个号会互相踢,表现就是「刚才还好好的,突然掉线」。
377
+
378
+ </details>
379
+
380
+ <details>
381
+ <summary><b>NapCat 里改了网络配置,插件还是连不上</b></summary>
382
+
383
+ 确认改的是**当前实例**的配置。NapCat 桌面版里 SnowLuma 后端和 napcat 后端的配置文件不在同一个位置,改错文件不会生效。改完还要重启那个实例。
384
+
385
+ </details>
386
+
387
+ ---
388
+
389
+ <div align="center">
390
+
391
+ 见 [LICENSE](LICENSE)
392
+
393
+ </div>
@@ -0,0 +1,96 @@
1
+ Fusion Pixel Font
2
+ https://github.com/TakWolf/fusion-pixel-font
3
+
4
+ Copyright (c) 2022, TakWolf (https://takwolf.com).
5
+
6
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
7
+ This license is copied below, and is also available with a FAQ at:
8
+ https://openfontlicense.org
9
+
10
+
11
+ -----------------------------------------------------------
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+ -----------------------------------------------------------
14
+
15
+ PREAMBLE
16
+ The goals of the Open Font License (OFL) are to stimulate worldwide
17
+ development of collaborative font projects, to support the font creation
18
+ efforts of academic and linguistic communities, and to provide a free and
19
+ open framework in which fonts may be shared and improved in partnership
20
+ with others.
21
+
22
+ The OFL allows the licensed fonts to be used, studied, modified and
23
+ redistributed freely as long as they are not sold by themselves. The
24
+ fonts, including any derivative works, can be bundled, embedded,
25
+ redistributed and/or sold with any software provided that any reserved
26
+ names are not used by derivative works. The fonts and derivatives,
27
+ however, cannot be released under any other type of license. The
28
+ requirement for fonts to remain under this license does not apply
29
+ to any document created using the fonts or their derivatives.
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to the set of files released by the Copyright
33
+ Holder(s) under this license and clearly marked as such. This may
34
+ include source files, build scripts and documentation.
35
+
36
+ "Reserved Font Name" refers to any names specified as such after the
37
+ copyright statement(s).
38
+
39
+ "Original Version" refers to the collection of Font Software components as
40
+ distributed by the Copyright Holder(s).
41
+
42
+ "Modified Version" refers to any derivative made by adding to, deleting,
43
+ or substituting -- in part or in whole -- any of the components of the
44
+ Original Version, by changing formats or by porting the Font Software to a
45
+ new environment.
46
+
47
+ "Author" refers to any designer, engineer, programmer, technical
48
+ writer or other person who contributed to the Font Software.
49
+
50
+ PERMISSION & CONDITIONS
51
+ Permission is hereby granted, free of charge, to any person obtaining
52
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
53
+ redistribute, and sell modified and unmodified copies of the Font
54
+ Software, subject to the following conditions:
55
+
56
+ 1) Neither the Font Software nor any of its individual components,
57
+ in Original or Modified Versions, may be sold by itself.
58
+
59
+ 2) Original or Modified Versions of the Font Software may be bundled,
60
+ redistributed and/or sold with any software, provided that each copy
61
+ contains the above copyright notice and this license. These can be
62
+ included either as stand-alone text files, human-readable headers or
63
+ in the appropriate machine-readable metadata fields within text or
64
+ binary files as long as those fields can be easily viewed by the user.
65
+
66
+ 3) No Modified Version of the Font Software may use the Reserved Font
67
+ Name(s) unless explicit written permission is granted by the corresponding
68
+ Copyright Holder. This restriction only applies to the primary font name as
69
+ presented to the users.
70
+
71
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
72
+ Software shall not be used to promote, endorse or advertise any
73
+ Modified Version, except to acknowledge the contribution(s) of the
74
+ Copyright Holder(s) and the Author(s) or with their explicit written
75
+ permission.
76
+
77
+ 5) The Font Software, modified or unmodified, in part or in whole,
78
+ must be distributed entirely under this license, and must not be
79
+ distributed under any other license. The requirement for fonts to
80
+ remain under this license does not apply to any document created
81
+ using the Font Software.
82
+
83
+ TERMINATION
84
+ This license becomes null and void if any of the above conditions are
85
+ not met.
86
+
87
+ DISCLAIMER
88
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
89
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
90
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
91
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
92
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
93
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
94
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
96
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file