@zaofan/dsh-qqbot 1.6.6 → 1.6.8

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 (48) hide show
  1. package/README.md +55 -0
  2. package/README_EN.md +5 -0
  3. package/client/qqbot-settings.js +5866 -5279
  4. package/dist/api/group-admin.d.ts +26 -0
  5. package/dist/api/group-admin.d.ts.map +1 -1
  6. package/dist/api/group-admin.js +38 -0
  7. package/dist/api/group-admin.js.map +1 -1
  8. package/dist/channel-tools.d.ts +45 -0
  9. package/dist/channel-tools.d.ts.map +1 -1
  10. package/dist/channel-tools.js +77 -10
  11. package/dist/channel-tools.js.map +1 -1
  12. package/dist/config.d.ts +7 -0
  13. package/dist/config.d.ts.map +1 -1
  14. package/dist/config.js +3 -0
  15. package/dist/config.js.map +1 -1
  16. package/dist/features/botplay-ext.d.ts +269 -0
  17. package/dist/features/botplay-ext.d.ts.map +1 -0
  18. package/dist/features/botplay-ext.js +213 -0
  19. package/dist/features/botplay-ext.js.map +1 -0
  20. package/dist/features/botplay.d.ts +152 -21
  21. package/dist/features/botplay.d.ts.map +1 -1
  22. package/dist/features/botplay.js +706 -21
  23. package/dist/features/botplay.js.map +1 -1
  24. package/dist/features/broadcast.d.ts.map +1 -1
  25. package/dist/features/broadcast.js +17 -5
  26. package/dist/features/broadcast.js.map +1 -1
  27. package/dist/features/extension-store.d.ts +49 -0
  28. package/dist/features/extension-store.d.ts.map +1 -1
  29. package/dist/features/extension-store.js +90 -0
  30. package/dist/features/extension-store.js.map +1 -1
  31. package/dist/features/session-registry.d.ts +17 -0
  32. package/dist/features/session-registry.d.ts.map +1 -1
  33. package/dist/features/session-registry.js +24 -0
  34. package/dist/features/session-registry.js.map +1 -1
  35. package/dist/features/sticker-store.d.ts +11 -0
  36. package/dist/features/sticker-store.d.ts.map +1 -1
  37. package/dist/features/sticker-store.js +26 -0
  38. package/dist/features/sticker-store.js.map +1 -1
  39. package/dist/gateway/bootstrap.d.ts.map +1 -1
  40. package/dist/gateway/bootstrap.js +22 -1
  41. package/dist/gateway/bootstrap.js.map +1 -1
  42. package/dist/middleware/sticker-capture.d.ts.map +1 -1
  43. package/dist/middleware/sticker-capture.js +10 -0
  44. package/dist/middleware/sticker-capture.js.map +1 -1
  45. package/docs/USER-GUIDE.md +903 -619
  46. package/docs/botplay-contract.md +92 -0
  47. package/package.json +2 -1
  48. package/settings-host.js +4717 -4245
package/README.md CHANGED
@@ -41,6 +41,11 @@ QQ 官方**没有开放踢人接口**,所以这一块走"你自己的 QQ 号 +
41
41
  **🗂️ 归档了也会自己回家**
42
42
  不小心把她的会话点了「归档」藏进侧边栏深处?不用满世界找——那个会话**下次在 QQ 里被消息触发时**,会自己从归档里摘出来回到侧边栏(你主动归档的其它会话不受影响)。
43
43
 
44
+ **🔝 QQ 一有动静,她的会话自己爬到最上面**(v1.6.8)
45
+ 侧边栏里正在跟你聊的那个会话,不该被别的压着 —— QQ 里一有消息、她**真的回了话**,对应会话就会自动插到「**还热着**」的那批之后(10 分钟内聊过的算热,**置顶的永不动**),冷掉的会话自然被它越过。全程事件驱动、不轮询;宿主没起来、或聊天页没开着时天然不排序。
46
+
47
+ ![侧边栏会话自动重排:刚聊过的「鲸鱼娘舒尔特诗格权限修复」跃到工作区最前,越过了 12 小时 / 1 天前的那批](docs/screenshots/session-reorder.png)
48
+
44
49
  **🖥️ 不碰配置文件,设置面板点点点**
45
50
  怎么回、能发什么图、什么时候开口、什么人格——面板上改完保存即生效(只有增删账号才要重启)。还有 ✏️ 预设人格编辑器,直接在网页里改她的"性格文件"。
46
51
 
@@ -297,6 +302,56 @@ dsh: disabling profile plugin row "mcp-chrome": Plugin ... is incompatible with
297
302
 
298
303
  想强行运行,可用官方提供的**确切版本例外**(`dsh plugin allow-version`,或插件管理页里授予),但官方警告"可能崩溃或数据丢失",自行权衡。
299
304
 
305
+ ## 🤖 自定义事件 + 「让 AI 写」(v1.6.7)
306
+
307
+ 普通的互动卡片只能「点按钮 → 回一句固定文本」,能力被编辑器框死。
308
+ 这一版让卡片**变成一个真的 JS 模块**(可以叫 AI 帮你写),于是它能做到编辑器做不到的事:
309
+
310
+ - **自己维护状态**:谁点过、点了几次、本轮名单 —— 落盘、升级不丢
311
+ - **自己判权限**:QQ 的按钮权限是"整张卡片一个",但模块里能用 `ctx.user.isOwner` 做到"这个按钮只有主人能点"
312
+ - **自己发消息**:文本 / markdown / 图片,还能 @ 某人
313
+ - **调 AI**:`ctx.appendSilent()` 静默记进上下文;或 `ctx.appendWake()` **把 AI 叫起来**
314
+ - **调官方 API**:模块拿到 `ctx.appId` / `ctx.appSecret`,自己换 token 就能 fetch 任意官方接口
315
+
316
+ ### 📸 长什么样
317
+
318
+ **① 面板:事件列表 + 「让 AI 写」+ 自定义事件信息区**
319
+
320
+ ![自定义事件面板](docs/screenshots/botplay-custom-event-panel.png)
321
+
322
+ **② 效果:签到统计 + 结束后唤醒 AI(AI 自己开口总结)**
323
+
324
+ ![唤醒 AI 演示](docs/screenshots/botplay-wake-ai-demo.png)
325
+
326
+ **③ 那 AI 到底收到了什么?(这就是 `ctx.appendWake` 的内容)**
327
+
328
+ ![AI 收到的唤醒内容](docs/screenshots/botplay-wake-payload.png)
329
+
330
+ > 事件模块自己决定"什么时候叫醒 AI、告诉它什么",并顺手把"你只要补一句人话、别复述名单"
331
+ > 这种约束一起发过去 —— 所以 AI 的回复才既贴群气氛、又不啰嗦。
332
+ > **这一段不是插件写死的,是卡片模块(AI 写的那个 .mjs)自己组织的。**
333
+
334
+ > 上面第二张就是"第三方框架做不到的事":**卡片点完后 AI 也知道了结果**,
335
+ > 而且它会顺着群里的气氛自己说人话 —— 那段「带头营业(尾巴摇摇)」不是模板文案,是 AI 现场说的。
336
+
337
+ ### 怎么用
338
+
339
+ 1. 面板 → 📤 群发 → **互动事件** → 底部「🤖 让 AI 写自定义事件」输入框
340
+ 2. 用大白话写你要什么,例如:
341
+ > 我想写一个签到人数统计,有两个按钮,按钮1是签到,所有人都能点且每个人只能点一次;
342
+ > 按钮2是结束,只能我点。我点结束后,bot 发送消息到 QQ 上,统计签到人数和所有签到者的名称
343
+ 3. 点 **🤖 让 AI 写** —— 面板会把「你的需求 + 官方文档链接 + 契约 + 环境信息」发进当前会话;
344
+ AI 按契约写一个 `.mjs` 放进 `{dataRoot}/.qqbot-extensions/botplay/`,并登记到 `botplay-events.json`
345
+ 4. 改完模块后,面板点 **🔄 重载模块** 即生效(**不用重启**)
346
+ 5. 想让它回到普通编辑器:把事件 JSON 里的 `file` 字段删掉即可
347
+
348
+ ### 契约在哪
349
+
350
+ `docs/botplay-contract.md` —— **纯文本、可直接改**(改完重启宿主生效)。
351
+ 它定义了模块导出哪些钩子、`ctx` 有哪些能力(含上面那几条),也是「让 AI 写」时发给 AI 的那份说明。
352
+
353
+ ---
354
+
300
355
  ## 🔨 锤子面板:禁言 / 踢人(v1.6.3)
301
356
 
302
357
  dock 面板里的 **🔨 锤子**(原来叫「🔇 禁言」),下面分两页:
package/README_EN.md CHANGED
@@ -27,6 +27,11 @@ The little ball at the corner of the settings panel opens a whole control deck:
27
27
 
28
28
  **🛡️ Group-admin helper** — join approval + mute management over official APIs, with human-readable errors (not an admin / cannot mute the owner…).
29
29
 
30
+ **🔝 A QQ message brings her session back to the top** (v1.6.8)
31
+ The web-sidebar session you are actually talking to should not be buried. As soon as a QQ message lands in one of her web sessions **and she really replies**, that session is moved to just after the still-"hot" ones (anything active within 10 minutes counts as hot; **pinned sessions never move**), so it leapfrogs whatever has gone cold. Fully event-driven, no polling — and nothing happens when the chat page is closed or the host is not up yet.
32
+
33
+ ![Sidebar auto-reorder: the just-active session jumps to the top of its workspace, leapfrogging the 12-hour / 1-day-old ones](docs/screenshots/session-reorder.png)
34
+
30
35
  **🖥️ No config-file surgery** — reply pacing, sticker gates, scheduled wake-ups, outbound mode and per-bot personas are all in the panel; saving applies live (only adding/removing bots needs a restart). There is even a ✏️ persona editor to tweak her "personality file" right in the browser.
31
36
 
32
37
  **📦 Clean & lean** — drive image sending / recall from plain text (`[MEDIA:image|path]` / `[RECALL]`); the repo contains no bot credentials or private data.