dsh-onebot-genji 0.15.2 → 0.17.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/lib/client.js CHANGED
@@ -116,7 +116,7 @@ window.__ModuleLoader__.load({
116
116
  id: "connection",
117
117
  title: "连接",
118
118
  fields: [
119
- { key: "mode", label: "连接模式", type: "enum", options: ["reverse", "forward"], optionLabels: { reverse: "反向 WebSocket(NapCat 连接本插件)", forward: "正向 WebSocket(插件连接 NapCat)" }, hint: "反向=它连我,正向=我连它" },
119
+ { key: "mode", label: "连接模式", type: "enum", options: ["reverse", "forward"], optionLabels: { reverse: "反向 WebSocket(NapCat 连接本插件)", forward: "正向 WebSocket(插件连接 NapCat)" }, hint: "反向 = 它连我,正向 = 我连它" },
120
120
  { key: "host", label: "反向 WS 监听地址", showIf: { key: "mode", value: "reverse" }, type: "string", hint: "反向模式监听地址" },
121
121
  { key: "port", label: "反向 WS 监听端口", showIf: { key: "mode", value: "reverse" }, type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", hint: "反向模式监听端口" },
122
122
  { key: "url", label: "正向 WS 服务器地址", showIf: { key: "mode", value: "forward" }, type: "string", hint: "正向模式服务器地址" },
@@ -135,9 +135,9 @@ window.__ModuleLoader__.load({
135
135
  ],
136
136
  fields: [
137
137
  { key: "requireMention", label: "群聊必须 @ 机器人", type: "boolean" },
138
- { key: "memberTools", label: "成员工具权限", type: "enum", options: ["none", "send", "all"], optionLabels: { none: "禁用全部", send: "仅发送类", all: "不限" }, hint: "非管理员回合可用的 qq_* 工具:仅发送类=可分条/发图(含工作区图库)" },
138
+ { key: "memberTools", label: "成员工具权限", type: "enum", options: ["none", "send", "all"], optionLabels: { none: "禁用全部", send: "仅发送类", all: "不限" }, hint: "非管理员回合可用的 qq_* 工具:仅发送类 = 可分条 / 发图 / 发语音(含工作区图库)" },
139
139
  { key: "adminUsers", label: "管理员用户列表", type: "stringArray" },
140
- { key: "dmPolicy", label: "私聊策略", type: "enum", options: ["open", "allowlist", "disabled"], optionLabels: { open: "开放", allowlist: "白名单", disabled: "禁用" }, hint: "开放=任何人都能私聊;白名单=只有下面名单里的 QQ 号能私聊;禁用=谁都不理" },
140
+ { key: "dmPolicy", label: "私聊策略", type: "enum", options: ["open", "allowlist", "disabled"], optionLabels: { open: "开放", allowlist: "白名单", disabled: "禁用" }, hint: "开放 = 任何人都能私聊;白名单 = 只有下面名单里的 QQ 号能私聊;禁用 = 谁都不理" },
141
141
  { key: "groupPolicy", label: "群聊策略", type: "enum", options: ["open", "allowlist", "disabled"], optionLabels: { open: "开放", allowlist: "白名单", disabled: "禁用" } },
142
142
  { key: "allowFrom", label: "私聊白名单", showIf: { key: "dmPolicy", value: "allowlist" }, type: "stringArray" },
143
143
  { key: "groupAllowFrom", label: "群聊白名单", showIf: { key: "groupPolicy", value: "allowlist" }, type: "stringArray" },
@@ -163,8 +163,7 @@ window.__ModuleLoader__.load({
163
163
  { id: "dm", title: "私聊", keys: [
164
164
  "proactiveEnabled", "proactiveTargetUsers", "proactiveMinIdleMinutes", "proactiveMinGapMinutes",
165
165
  "proactiveMaxPerDay", "proactiveQuietFrom", "proactiveQuietTo", "proactiveAttemptGapMinutes",
166
- "proactiveBurstProb", "proactiveFollowupEnabled", "proactiveFollowupMinSec",
167
- "proactiveFollowupMaxSec", "proactiveFollowupProb", "proactiveFollowupMaxPerDay",
166
+ "proactiveBurstProb",
168
167
  ] },
169
168
  ],
170
169
  fields: [
@@ -188,7 +187,7 @@ window.__ModuleLoader__.load({
188
187
  // 2026-11-19(本地加):主动搭话——排在「行为 → 私聊」分区(原来在「权限 → 私聊」)。
189
188
  // 原文在 lib/proactive.js,配置读宿主 Config.proactive(面板键带 proactive 前缀)。
190
189
  { key: "proactiveEnabled", label: "主动搭话", type: "boolean", hint: "隔一阵自己来找你(安静时段和频率都由下面几项控制)" },
191
- { key: "proactiveTargetUsers", label: "搭话目标用户", type: "stringArray", hint: "留空=管理员列表", showIf: { key: "proactiveEnabled", value: true } },
190
+ { key: "proactiveTargetUsers", label: "搭话目标用户", type: "stringArray", hint: "留空 = 管理员列表", showIf: { key: "proactiveEnabled", value: true } },
192
191
  { key: "proactiveMinIdleMinutes", label: "你安静多久才搭话(分钟)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveEnabled", value: true } },
193
192
  { key: "proactiveMinGapMinutes", label: "两次搭话最小间隔(分钟)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveEnabled", value: true } },
194
193
  { key: "proactiveMaxPerDay", label: "每天最多搭话次数", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveEnabled", value: true } },
@@ -196,11 +195,6 @@ window.__ModuleLoader__.load({
196
195
  { key: "proactiveQuietTo", label: "安静时段止(小时)", type: "number", pattern: "^[0-9]+$", patternHint: "0–23 的整数", showIf: { key: "proactiveEnabled", value: true } },
197
196
  { key: "proactiveAttemptGapMinutes", label: "判定间隔(分钟)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", hint: "每次判定要不要发话的最小间隔", showIf: { key: "proactiveEnabled", value: true } },
198
197
  { key: "proactiveBurstProb", label: "连发概率", type: "number", hint: "0–1 之间的小数,比如 0.5;越大越容易一次说两三句", showIf: { key: "proactiveEnabled", value: true } },
199
- { key: "proactiveFollowupEnabled", label: "补一句话", type: "boolean", hint: "你先开口后,过一小会儿再补一句", showIf: { key: "proactiveEnabled", value: true } },
200
- { key: "proactiveFollowupMinSec", label: "补话最短等待(秒)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveFollowupEnabled", values: [true] } },
201
- { key: "proactiveFollowupMaxSec", label: "补话最长等待(秒)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveFollowupEnabled", values: [true] } },
202
- { key: "proactiveFollowupProb", label: "补话概率", type: "number", hint: "0–1 之间的小数", showIf: { key: "proactiveFollowupEnabled", values: [true] } },
203
- { key: "proactiveFollowupMaxPerDay", label: "补话每天上限", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "proactiveFollowupEnabled", values: [true] } },
204
198
  // T11:DSH 首页左侧边栏入口开关(关=不注册侧边栏入口与配对面板;
205
199
  // 插件菜单下的设置页入口保留。客户端按启动时快照决定,改完刷新生效)。
206
200
  ],
@@ -213,7 +207,22 @@ window.__ModuleLoader__.load({
213
207
  desc: "表情包管理",
214
208
  fields: [
215
209
  { key: "stickerAutoCollect", label: "自动收集表情包", type: "boolean", hint: "收到的新图自动收进「未审核」,不会直接进聊天" },
216
- { key: "stickerRoot", label: "表情包库目录", type: "string", placeholder: "留空=%USERPROFILE%\\.dsh\\dsh-onebot-genji\\stickers", hint: "里面有「已审核」(聊天只从这里挑图)与「未审核」两个子目录" },
210
+ { key: "stickerRoot", label: "表情包库目录", type: "string", placeholder: "留空 = %USERPROFILE%\\.dsh\\dsh-onebot-genji\\stickers", hint: "里面有「已审核」(聊天只从这里挑图)与「未审核」两个子目录" },
211
+ ],
212
+ },
213
+ {
214
+ // 2026-11-23(本地加):QQ 空间说说。独立页签,排在「表情包」之后。
215
+ // 顺序按主人要求:开关 → 每日上限 → 其余门槛。
216
+ id: "qzone",
217
+ title: "QQ空间",
218
+ desc: "说说自动发布",
219
+ fields: [
220
+ { key: "qzoneEnabled", label: "发 QQ 空间说说", type: "boolean", hint: "自己发动态,不是回消息;关掉就完全不发" },
221
+ { key: "qzoneVisibility", label: "可见范围", type: "enum", options: ["public", "friends", "private"], optionLabels: { public: "所有人", friends: "好友", private: "仅自己" }, showIf: { key: "qzoneEnabled", value: true } },
222
+ { key: "qzoneMaxPerDay", label: "一天最多发几条", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", hint: "按本地日期重置;0 = 不发", showIf: { key: "qzoneEnabled", value: true } },
223
+ { key: "qzoneMinGapMinutes", label: "两条之间至少隔多久(分钟)", type: "number", pattern: "^[0-9]+$", patternHint: "≥0 的整数", showIf: { key: "qzoneEnabled", value: true } },
224
+ { key: "qzoneQuietFrom", label: "安静时段起(小时)", type: "number", pattern: "^[0-9]+$", patternHint: "0–23 的整数", hint: "这段时间内不发;起止填一样 = 不设安静时段", showIf: { key: "qzoneEnabled", value: true } },
225
+ { key: "qzoneQuietTo", label: "安静时段止(小时)", type: "number", pattern: "^[0-9]+$", patternHint: "0–23 的整数", showIf: { key: "qzoneEnabled", value: true } },
217
226
  ],
218
227
  },
219
228
  {
@@ -301,11 +310,6 @@ window.__ModuleLoader__.load({
301
310
  groupContextLines: 3, // 本地加(2026-11-18):被 @ 时带上的群聊上下文条数;默认 3
302
311
  requireMention: true,
303
312
  memberTools: "none",
304
- bystanderEnabled: false,
305
- bystanderCapacity: 50,
306
- bystanderCooldownMinutes: 45,
307
- bystanderDailyLimit: 20,
308
- bystanderTopics: [],
309
313
  adminUsers: [],
310
314
  dmPolicy: "open",
311
315
  groupPolicy: "open",
@@ -342,11 +346,13 @@ window.__ModuleLoader__.load({
342
346
  proactiveQuietTo: 6,
343
347
  proactiveAttemptGapMinutes: 30,
344
348
  proactiveBurstProb: 0.5,
345
- proactiveFollowupEnabled: true,
346
- proactiveFollowupMinSec: 45,
347
- proactiveFollowupMaxSec: 180,
348
- proactiveFollowupProb: 0.3,
349
- proactiveFollowupMaxPerDay: 3,
349
+ // 2026-11-23(本地加):QQ 空间说说。
350
+ qzoneEnabled: false,
351
+ qzoneMaxPerDay: 3,
352
+ qzoneMinGapMinutes: 240,
353
+ qzoneQuietFrom: 22,
354
+ qzoneQuietTo: 6,
355
+ qzoneVisibility: "public",
350
356
  newMessagePolicy: "steer",
351
357
  autoSteerPolicy: "admin",
352
358
  deferredTimeoutMs: 600000,
@@ -398,8 +404,8 @@ window.__ModuleLoader__.load({
398
404
  // src/bridge.ts、deferredTimeout=src/deferred.ts(X 为运行时秒数占位)、
399
405
  // rateLimited=src/inbound.ts。
400
406
  var NOTICE_KEYS = [
401
- { key: "steerAccepted", label: "插话提示", def: "✅ 已作为补充指令提交给当前任务,模型将在下一步读取。" },
402
- { key: "queue", label: "排队提示", def: "⏳ 当前任务运行中,新消息已排队,将在当前任务结束后依次处理。" },
407
+ { key: "steerAccepted", label: "插话提示", def: "✅ 已作为补充指令提交给当前任务,模型将在下一步读取" },
408
+ { key: "queue", label: "排队提示", def: "⏳ 当前任务运行中,新消息已排队,将在当前任务结束后依次处理" },
403
409
  { key: "answerAccepted", label: "回答回执", def: "✔ 已提交回答" },
404
410
  { key: "deferredTimeout", label: "超时补发提示", def: "⏳ 等待模型回复超时(已静默等待约 X 秒),任务仍在后台运行;完成后将自动补发最终结果。如需停止请发送 /stop。" },
405
411
  { key: "rateLimited", label: "限流提示", def: "⏳ 消息太频繁,请稍后再试。" },
@@ -546,11 +552,6 @@ window.__ModuleLoader__.load({
546
552
  reactionEmoji: vNumber(0, 1000),
547
553
  requireMention: vBoolean(),
548
554
  memberTools: vEnum(["none", "send", "all"]),
549
- bystanderEnabled: vBoolean(),
550
- bystanderCapacity: vNumber(),
551
- bystanderCooldownMinutes: vNumber(),
552
- bystanderDailyLimit: vNumber(),
553
- bystanderTopics: vArray(vString(0, 64)),
554
555
  adminUsers: vArray(vString(0, 64)),
555
556
  dmPolicy: vEnum(["open", "allowlist", "disabled"]),
556
557
  groupPolicy: vEnum(["open", "allowlist", "disabled"]),
@@ -629,11 +630,13 @@ window.__ModuleLoader__.load({
629
630
  proactiveQuietTo: vNumber(),
630
631
  proactiveAttemptGapMinutes: vNumber(),
631
632
  proactiveBurstProb: vNumber(),
632
- proactiveFollowupEnabled: vBoolean(),
633
- proactiveFollowupMinSec: vNumber(),
634
- proactiveFollowupMaxSec: vNumber(),
635
- proactiveFollowupProb: vNumber(),
636
- proactiveFollowupMaxPerDay: vNumber(),
633
+ // 2026-11-23(本地加):QQ 空间说说。
634
+ qzoneEnabled: vBoolean(),
635
+ qzoneMaxPerDay: vNumber(),
636
+ qzoneMinGapMinutes: vNumber(),
637
+ qzoneQuietFrom: vNumber(),
638
+ qzoneQuietTo: vNumber(),
639
+ qzoneVisibility: vEnum(["public", "friends", "private"]),
637
640
  notices: vObject({
638
641
  steerAccepted: vNoticeValue(),
639
642
  queue: vNoticeValue(),
@@ -681,11 +684,6 @@ window.__ModuleLoader__.load({
681
684
  sidebarEntryEnabled: vOptional(vBoolean()),
682
685
  requireMention: vOptional(vBoolean()),
683
686
  memberTools: vOptional(vEnum(["none", "send", "all"])),
684
- bystanderEnabled: vOptional(vBoolean()),
685
- bystanderCapacity: vOptional(vNumber(5, 500)),
686
- bystanderCooldownMinutes: vOptional(vNumber(5, 1440)),
687
- bystanderDailyLimit: vOptional(vNumber(1, 200)),
688
- bystanderTopics: vOptional(vArray(vString(0, 64))),
689
687
  adminUsers: vOptional(vArray(vString(0, 64))),
690
688
  dmPolicy: vOptional(vEnum(["open", "allowlist", "disabled"])),
691
689
  groupPolicy: vOptional(vEnum(["open", "allowlist", "disabled"])),
@@ -760,11 +758,13 @@ window.__ModuleLoader__.load({
760
758
  proactiveQuietTo: vOptional(vNumber(0, 23)),
761
759
  proactiveAttemptGapMinutes: vOptional(vNumber(0, 1440)),
762
760
  proactiveBurstProb: vOptional(vNumber(0, 1)),
763
- proactiveFollowupEnabled: vOptional(vBoolean()),
764
- proactiveFollowupMinSec: vOptional(vNumber(0, 3600)),
765
- proactiveFollowupMaxSec: vOptional(vNumber(0, 3600)),
766
- proactiveFollowupProb: vOptional(vNumber(0, 1)),
767
- proactiveFollowupMaxPerDay: vOptional(vNumber(0, 48)),
761
+ // 2026-11-23(本地加):QQ 空间说说。
762
+ qzoneEnabled: vOptional(vBoolean()),
763
+ qzoneMaxPerDay: vOptional(vNumber(0, 20)),
764
+ qzoneMinGapMinutes: vOptional(vNumber(0, 1440)),
765
+ qzoneQuietFrom: vOptional(vNumber(0, 23)),
766
+ qzoneQuietTo: vOptional(vNumber(0, 23)),
767
+ qzoneVisibility: vOptional(vEnum(["public", "friends", "private"])),
768
768
  notices: vOptional(vObject({
769
769
  steerAccepted: vNoticeValue(),
770
770
  queue: vNoticeValue(),
@@ -916,7 +916,8 @@ window.__ModuleLoader__.load({
916
916
  "group.connection.desc": "连 NapCat 的通道",
917
917
  "group.permissions.desc": "谁能触发与使用",
918
918
  "group.behavior.desc": "回复、限流与消息处理",
919
- "group.bystander.desc": "群聊旁观与主动插话",
919
+ "group.stickers.desc": "表情包库与审核",
920
+ "group.qzone.desc": "说说自动发布",
920
921
  "group.session.desc": "新会话与工作区",
921
922
  "group.media.desc": "语音、图片与媒体限额",
922
923
  "group.diagnostics.desc": "日志与调试",
@@ -975,7 +976,8 @@ window.__ModuleLoader__.load({
975
976
  "group.connection.desc": "How it links to NapCat",
976
977
  "group.permissions.desc": "Who can trigger it",
977
978
  "group.behavior.desc": "Replies, limits and message handling",
978
- "group.bystander.desc": "Group lurking and proactive remarks",
979
+ "group.stickers.desc": "Sticker library and review",
980
+ "group.qzone.desc": "Automatic status posts",
979
981
  "group.session.desc": "New sessions and workspace",
980
982
  "group.media.desc": "Voice, images and media caps",
981
983
  "group.diagnostics.desc": "Logs and debugging",
@@ -1047,7 +1049,7 @@ window.__ModuleLoader__.load({
1047
1049
  title: "Permissions",
1048
1050
  fields: {
1049
1051
  requireMention: { label: "Require @ in group chats" },
1050
- memberTools: { label: "Member tool access", options: { none: "All disabled", send: "Send-only", all: "Unrestricted" }, hint: "Which qq_* tools non-admin turns may use: send-only = split messages / send images (workspace galleries included)" },
1052
+ memberTools: { label: "Member tool access", options: { none: "All disabled", send: "Send-only", all: "Unrestricted" }, hint: "Which qq_* tools non-admin turns may use: send-only = split messages / send images or voice (workspace galleries included)" },
1051
1053
  adminUsers: { label: "Admin user list" },
1052
1054
  dmPolicy: { label: "DM policy", options: { open: "Open", allowlist: "Allowlist", disabled: "Disabled" } },
1053
1055
  groupPolicy: { label: "Group policy", options: { open: "Open", allowlist: "Allowlist", disabled: "Disabled" } },
@@ -1076,7 +1078,7 @@ window.__ModuleLoader__.load({
1076
1078
  stickerReplyProb: { label: "Sticker probability", hint: "0–1, default 0.39 (39%)" },
1077
1079
  // 2026-11-19(本地加):主动搭话英文词条(从权限组搬过来;缺了会回落 zh,插件启动时打警告)。
1078
1080
  proactiveEnabled: { label: "Proactive messages", hint: "Come find you on my own after a while (quiet hours and frequency below)" },
1079
- proactiveTargetUsers: { label: "Proactive target users", hint: "Empty=the admin list" },
1081
+ proactiveTargetUsers: { label: "Proactive target users", hint: "Empty = the admin list" },
1080
1082
  proactiveMinIdleMinutes: { label: "Idle minutes before reaching out" },
1081
1083
  proactiveMinGapMinutes: { label: "Min gap between proactive messages (minutes)" },
1082
1084
  proactiveMaxPerDay: { label: "Max proactive messages per day" },
@@ -1084,11 +1086,6 @@ window.__ModuleLoader__.load({
1084
1086
  proactiveQuietTo: { label: "Quiet hours end (hour)" },
1085
1087
  proactiveAttemptGapMinutes: { label: "Decision interval (minutes)", hint: "Minimum gap between two decide-run checks" },
1086
1088
  proactiveBurstProb: { label: "Burst probability", hint: "Decimal 0-1, e.g. 0.5; higher = more likely to send two or three lines at once" },
1087
- proactiveFollowupEnabled: { label: "Follow-up line", hint: "After you speak first, add one more line a bit later" },
1088
- proactiveFollowupMinSec: { label: "Follow-up min wait (seconds)" },
1089
- proactiveFollowupMaxSec: { label: "Follow-up max wait (seconds)" },
1090
- proactiveFollowupProb: { label: "Follow-up probability", hint: "Decimal 0-1" },
1091
- proactiveFollowupMaxPerDay: { label: "Follow-up daily cap" },
1092
1089
  newMessagePolicy: { label: "New messages while a task runs", options: { queue: "Queue", steer: "Steer" } },
1093
1090
  autoSteerPolicy: { label: "Auto-steer eligibility", options: { admin: "Admins only", all: "All members" } },
1094
1091
  deferredTimeoutMs: { label: "Model reply wait timeout (ms)" },
@@ -1100,7 +1097,18 @@ window.__ModuleLoader__.load({
1100
1097
  title: "Stickers",
1101
1098
  fields: {
1102
1099
  stickerAutoCollect: { label: "Auto-collect stickers", hint: "New images land in Pending and never go into chats directly" },
1103
- stickerRoot: { label: "Sticker library root", placeholder: "Empty=%USERPROFILE%\\.dsh\\dsh-onebot-genji\\stickers", hint: "Holds 已审核 (approved — chats only pick from here) and 未审核 (pending)" },
1100
+ stickerRoot: { label: "Sticker library root", placeholder: "Empty = %USERPROFILE%\\.dsh\\dsh-onebot-genji\\stickers", hint: "Holds 已审核 (approved — chats only pick from here) and 未审核 (pending)" },
1101
+ },
1102
+ },
1103
+ qzone: {
1104
+ title: "Qzone",
1105
+ fields: {
1106
+ qzoneEnabled: { label: "Post to Qzone", hint: "Post status updates by myself, not replies; off = nothing is posted" },
1107
+ qzoneMaxPerDay: { label: "Max posts per day", hint: "Resets on the local date; 0 = none" },
1108
+ qzoneMinGapMinutes: { label: "Min gap between posts (minutes)" },
1109
+ qzoneQuietFrom: { label: "Quiet hours start (hour)", hint: "Nothing is posted in this window; same start and end = no quiet hours" },
1110
+ qzoneQuietTo: { label: "Quiet hours end (hour)" },
1111
+ qzoneVisibility: { label: "Visibility", options: { public: "Everyone", friends: "Friends", private: "Only me" } },
1104
1112
  },
1105
1113
  },
1106
1114
  session: {
@@ -1504,10 +1512,6 @@ window.__ModuleLoader__.load({
1504
1512
  interimRecallMs: [0, undefined],
1505
1513
  inboxQueueDelayMs: [0, undefined],
1506
1514
  deferredTimeoutMs: [0, undefined],
1507
- // #58 旁观:容量条数 / 冷却分钟 / 每日上限。
1508
- bystanderCapacity: [5, 500],
1509
- bystanderCooldownMinutes: [5, 1440],
1510
- bystanderDailyLimit: [1, 200],
1511
1515
  textImageThreshold: [0, undefined],
1512
1516
  // 本地加(2026-11-01):媒体上限都做防呆——多打一位数当场标红。
1513
1517
  // 键序与 ALL_FIELDS(媒体组字段序)一致,便于测试逐位对齐。
@@ -1524,10 +1528,11 @@ window.__ModuleLoader__.load({
1524
1528
  proactiveQuietTo: [0, 23],
1525
1529
  proactiveAttemptGapMinutes: [0, 1440],
1526
1530
  proactiveBurstProb: [0, 1],
1527
- proactiveFollowupMinSec: [0, 3600],
1528
- proactiveFollowupMaxSec: [0, 3600],
1529
- proactiveFollowupProb: [0, 1],
1530
- proactiveFollowupMaxPerDay: [0, 48],
1531
+ // 2026-11-23(本地加):QQ 空间说说门槛。
1532
+ qzoneMaxPerDay: [0, 20],
1533
+ qzoneMinGapMinutes: [0, 1440],
1534
+ qzoneQuietFrom: [0, 23],
1535
+ qzoneQuietTo: [0, 23],
1531
1536
  };
1532
1537
  /**
1533
1538
  * 批 3(UX §5.6):数字行内校验——判定语义与 host validatePatch 逐字对齐
@@ -2012,7 +2017,9 @@ window.__ModuleLoader__.load({
2012
2017
  "aria-label": format(tr("notice.textAria", "{label}文案"), { label: noticeLabel }),
2013
2018
  })));
2014
2019
  }
2015
- // 本地改(2026-11-18):发送错误通知挪到整组最下面(notices 段之后再插回)。
2020
+ // 本地改(2026-11-18):发送错误通知从原位摘出来,交给渲染末段重新插回。
2021
+ // 本地改(2026-11-22):插回位置改成「@notices 段之后、下一个分区标题之前」
2022
+ //(即「限流提示」和「私聊」中间),不再挂到整组最末尾。
2016
2023
  if (nk.key === "steerAccepted" && group.id === "behavior")
2017
2024
  consumed["sendErrorNotice"] = "tail";
2018
2025
  // 本地改(2026-11-18):等待模型回复超时挪到「超时补发提示」下面,只在它开着时显示。
@@ -2077,6 +2084,13 @@ window.__ModuleLoader__.load({
2077
2084
  noticesPlaced = true;
2078
2085
  for (var noticeRow of noticeRows)
2079
2086
  sectionNodes.push(noticeRow);
2087
+ // 本地改(2026-11-22):发送错误通知夹在「限流提示」(通知段最后一项)
2088
+ // 和下一个分区标题(私聊)之间,不再挂到整组最末尾。
2089
+ if (consumedNoticeFields["sendErrorNotice"] === "tail") {
2090
+ for (var tailNode of tailFieldNodes)
2091
+ sectionNodes.push(tailNode);
2092
+ tailFieldNodes = [];
2093
+ }
2080
2094
  continue;
2081
2095
  }
2082
2096
  if (byKey[sectionKey] != null)
@@ -2085,6 +2099,8 @@ window.__ModuleLoader__.load({
2085
2099
  }
2086
2100
  // 本地改(2026-11-18):分区块排在通知段之后、尾部字段(发送错误通知)之前。
2087
2101
  // 本地改(2026-11-19):分区里写了 "@notices" 时通知段已就地插入,不再重复追加。
2102
+ // 本地改(2026-11-22):sendErrorNotice 已随 @notices 就地插入(tailFieldNodes
2103
+ // 被清空),所以尾部这里一般不会再有东西。
2088
2104
  fieldNodes = looseNodes.concat(noticesPlaced ? [] : noticeRows).concat(sectionNodes).concat(tailFieldNodes);
2089
2105
  }
2090
2106
  // 组标题 + 一句人话描述(经 opts.groupDesc 传入;缺省不渲染)。标题走词条
package/lib/commands.js CHANGED
@@ -241,11 +241,12 @@ async function handleSilentCommand(ctx, chatId, arg) {
241
241
  * Shared with the bridge's auto-steer path ('steer' policy) so both surfaces
242
242
  * word the confirmation identically; exported for the deterministic text
243
243
  * wait in tests. */
244
- export const STEER_ACCEPTED_NOTICE = '✅ 已作为补充指令提交给当前任务,模型将在下一步读取。';
244
+ // 2026-11-22:末尾不带「。」,与出站剥句号的规则对齐。
245
+ export const STEER_ACCEPTED_NOTICE = '✅ 已作为补充指令提交给当前任务,模型将在下一步读取';
245
246
  /** T2 (P1): the /steer usage hint — replied whenever the command cannot
246
247
  * steer (empty argument, no live chat, or no running task). Never crashes,
247
248
  * never silently no-ops. */
248
- export const STEER_USAGE_HINT = '用法:/steer <补充内容> —— 在任务运行期间向当前任务追加一条补充指令,模型会在下一步读取;当前没有运行中的任务,直接发送消息即可开始新任务。';
249
+ export const STEER_USAGE_HINT = '用法:/steer <补充内容> —— 在任务运行期间向当前任务追加一条补充指令,模型会在下一步读取;当前没有运行中的任务,直接发送消息即可开始新任务';
249
250
  /** T2 (P1) /steer: steer one supplementary instruction into the RUNNING
250
251
  * turn (both newMessagePolicy modes — an explicit /steer is always allowed).
251
252
  * Without a running task (or with an empty argument, or no live chat) it
package/lib/cq.js CHANGED
@@ -115,12 +115,13 @@ export function detectExplicitMention(segments, raw, selfId, botQQ, atAllCounts
115
115
  return false;
116
116
  }
117
117
  /**
118
- * T1 (PR port): 唤醒词命中判定——只认消息开头命中。用 startsWith 而非
119
- * includes:消息正文里偶然提到唤醒词(如有人在句中写到唤醒词)不再误触;
118
+ * 唤醒词命中判定。
119
+ * 2026-11-20 本地改(主人要求恢复):句中出现即算——「大鱼」「黑鱼」这类
120
+ * 复合词里的唤醒词也要能叫醒,所以用 includes 而不是 startsWith。
120
121
  * 大小写不敏感、两侧空白忽略;空词表恒 false。
121
122
  * @param text - 消息纯文本(segmentText 结果)。
122
123
  * @param names - 唤醒词表(管理员档或成员档)。
123
- * @returns 是否以任一唤醒词开头。
124
+ * @returns 是否包含任一唤醒词。
124
125
  */
125
126
  export function detectWakeName(text, names) {
126
127
  const needle = text.trim().toLowerCase();
@@ -128,7 +129,7 @@ export function detectWakeName(text, names) {
128
129
  return false;
129
130
  return names.some(name => {
130
131
  const wake = name.trim().toLowerCase();
131
- return wake !== '' && needle.startsWith(wake);
132
+ return wake !== '' && needle.includes(wake);
132
133
  });
133
134
  }
134
135
  /**
package/lib/inbound.js CHANGED
@@ -209,17 +209,6 @@ export class InboundPipeline {
209
209
  nickname: inbound.nickname,
210
210
  text: inbound.text,
211
211
  });
212
- // 群聊旁观 (#58):被 @ 门挡下的消息不派发回合,改喂旁听缓冲(nickname
213
- // 在此尚未消毒,桥侧渲染回顾文本时统一 sanitize)。seam 缺席 = 零行为。
214
- if (this.ctx.feedBystander !== undefined) {
215
- await this.ctx.feedBystander(chatId, {
216
- seq: inbound.messageId ?? '',
217
- time: inbound.time,
218
- userId,
219
- nickname: inbound.nickname,
220
- text: inbound.text,
221
- });
222
- }
223
212
  return;
224
213
  }
225
214
  // M3-D5 identity whitelist: the sanitized nickname feeds the single-line
@@ -468,6 +457,9 @@ export class InboundPipeline {
468
457
  const settings = this.ctx.getSettings(chatId);
469
458
  settings.lastImagePath = resolved.path;
470
459
  settings.pendingImageRef = undefined;
460
+ // 2026-11-20 本地加:落盘即收进表情包库「未审核」(Hash 去重、删过的不回收)。
461
+ // 原先靠 5 分钟定时器扫媒体目录,主人要求改成零延迟。
462
+ this.ctx.collectSticker?.(resolved.path);
471
463
  // T6 (PR port GIF 分帧):开关开启且确为 gif 时,旁边拼一张四格分帧长图
472
464
  // 附在消息里;关闭/失败一律静默为空串(不装依赖也不开开关时行为与上游
473
465
  // 逐字节等价)。
package/lib/index.js CHANGED
@@ -37,8 +37,11 @@ const PROACTIVE_MESSAGE_SOURCE = { kind: 'plugin:dsh-onebot' };
37
37
  let createUserMessage;
38
38
  let BlockAssembler;
39
39
  let ProactiveTalk;
40
+ // 2026-11-23:QQ 空间说说(设置面板 → 行为 → QQ空间)。
41
+ let QzonePost;
40
42
  let StickerStore;
41
43
  let DEFAULT_STICKER_ROOT;
44
+ let pickStickerByTag;
42
45
  try {
43
46
  ;
44
47
  ({ default: z } = await import('@deepseek-ai/schemastery'));
@@ -53,7 +56,9 @@ try {
53
56
  ({ describeError } = await import('./errors.js'));
54
57
  ({ createUserMessage, BlockAssembler } = await import('@deepseek-ai/dsh-llm'));
55
58
  ({ ProactiveTalk } = await import('./proactive.js'));
59
+ ({ QzonePost } = await import('./qzone.js'));
56
60
  ({ StickerStore, DEFAULT_STICKER_ROOT } = await import('./stickers.js'));
61
+ ({ pickStickerByTag } = await import('./sticker-tag.js'));
57
62
  ({ resolveUserQuestions } = await import('./ask-tool.js'));
58
63
  }
59
64
  catch (error) {
@@ -141,16 +146,6 @@ export const Config = z.object({
141
146
  .description('入站连发合并(T7 PR 移植):开启后每个会话一条串行链(先到先答,带图慢消息不再插队),同会话紧挨的几条消息并成一条投递(斜杠命令不合并、注入消息不合并直接串行);全局积压超过 50 条丢弃一条并记警告;已知代价:每条消息延迟约一个合并窗口(默认 600ms)才投递;默认关闭——关闭时不排队不合并,与上游行为逐字节等价'),
142
147
  inboxQueueDelayMs: z.number().default(600)
143
148
  .description('连发合并窗口(毫秒,T7 PR 移植):同会话最后一条消息进来后等这么久再合并投递,从首条算起最多 3000ms 封顶;仅在 inboxQueueEnabled 开启时生效;0=立即投递(等同关闭合并,串行链仍生效)'),
144
- bystanderEnabled: z.boolean().default(false)
145
- .description('群聊旁观:开启后未被 @ 的群消息进每群旁听缓冲,命中触发条件(提到唤醒词/话题词/明显提问/群内持续活跃)时开一次「回顾回合」,机器人可插话也可沉默([[不回]]);默认关'),
146
- bystanderCapacity: z.number().default(50)
147
- .description('群聊旁观:每群旁听缓冲条数上限(超出淘汰最旧);默认 50'),
148
- bystanderTopics: z.array(z.string()).default([])
149
- .description('群聊旁观:话题词表,消息包含任一词即触发回顾(子串匹配,大小写不敏感);默认空'),
150
- bystanderCooldownMinutes: z.number().default(45)
151
- .description('群聊旁观:每群两次回顾回合的最小间隔(分钟);默认 45,防刷屏'),
152
- bystanderDailyLimit: z.number().default(20)
153
- .description('群聊旁观:每群每日回顾回合上限(按本地日期重置);默认 20,防刷屏'),
154
149
  dmPolicy: z.union([z.const('open'), z.const('allowlist'), z.const('disabled')]).default('open')
155
150
  .description('私聊策略:open=仅管理员;allowlist=仅 allowFrom;disabled=拒绝所有私聊'),
156
151
  groupPolicy: z.union([z.const('open'), z.const('allowlist'), z.const('disabled')]).default('open')
@@ -221,18 +216,21 @@ export const Config = z.object({
221
216
  .description('模型判定「没话头」或生成失败后,至少隔这么久再试一次(分钟)'),
222
217
  burstProb: z.number().min(0).max(1).default(0.5)
223
218
  .description('开口时拆成 2~3 条连着发的概率(0–1)'),
224
- followupEnabled: z.boolean().default(true)
225
- .description('聊完补话:主人刚说完、你也回完了,隔一会儿再判断一次要不要补一句'),
226
- followupMinSec: z.number().min(0).default(45)
227
- .description('聊完补话的窗口起点(秒)'),
228
- followupMaxSec: z.number().min(0).default(180)
229
- .description('聊完补话的窗口终点(秒)'),
230
- followupProb: z.number().min(0).max(1).default(0.3)
231
- .description('补话窗口内掷骰通过的概率(0–1)'),
232
- followupMaxPerDay: z.number().min(0).default(3)
233
- .description('每天最多补话几次'),
234
219
  }).default({})
235
220
  .description('主动搭话(合并自 startup/qq-alive.mjs,2026-11-19):机器人自己判断要不要主动找主人说话'),
221
+ // QQ 空间说说(本地加 2026-11-23,主人要求):自己发动态,不是回消息。
222
+ qzoneEnabled: z.boolean().default(false)
223
+ .description('QQ 空间说说(本地加 2026-11-23):按下面的门槛自己发一条说说;false = 完全关闭(不建定时器、不花 token)'),
224
+ qzoneMaxPerDay: z.number().min(0).max(20).default(3)
225
+ .description('一天最多发几条说说(按本地日期重置;0 = 不发)'),
226
+ qzoneMinGapMinutes: z.number().min(0).default(240)
227
+ .description('两条说说之间至少隔多少分钟'),
228
+ qzoneQuietFrom: z.number().min(0).max(23).default(22)
229
+ .description('安静时段起点(小时,含)——这段时间不自动发'),
230
+ qzoneQuietTo: z.number().min(0).max(23).default(6)
231
+ .description('安静时段终点(小时,不含)'),
232
+ qzoneVisibility: z.union([z.const('public'), z.const('friends'), z.const('private')]).default('public')
233
+ .description('说说默认可见范围:public 所有人 / friends 好友 / private 仅自己'),
236
234
  rateLimitPerMinute: z.number().default(30)
237
235
  .description('每 chat 每分钟允许的普通消息条数上限(60 秒滑动窗口);命令消息不计入也不受限;超限时每窗口最多提示一次;0=禁用频控'),
238
236
  restrictedMemberPrefix: z.boolean().default(true)
@@ -551,6 +549,37 @@ export function apply(ctx, config) {
551
549
  dshHome: dshHome(),
552
550
  media,
553
551
  transcriber,
552
+ // 2026-11-20 本地加:图片落盘即收进「未审核」(原来靠 5 分钟定时器扫目录,
553
+ // 主人要求零延迟)。开关 stickerAutoCollect 关掉就不给这个钩子。
554
+ stickerCollect: config.stickerAutoCollect === false
555
+ ? undefined
556
+ : (path) => {
557
+ try {
558
+ const result = stickerStoreOf().addFile(path, { approved: false });
559
+ if (result.added)
560
+ log('info', '[stickers] 收到图片,已进未审核: ' + result.item.file);
561
+ }
562
+ catch (error) {
563
+ log('warn', '[stickers] 即时收集失败: ' + describeError(error));
564
+ }
565
+ },
566
+ // 2026-11-23 本地加:正文 `<表情:关键词>` 标签 → 已审核库里的一张图。
567
+ // 不设开关:匹配不上就静默跳过(没写等于没写),不会有副作用;
568
+ // 每次现读索引,跟面板刷新同一口径。
569
+ stickerPick: (key) => {
570
+ try {
571
+ const store = stickerStoreOf();
572
+ const items = store.list();
573
+ const file = pickStickerByTag(items, key, f => store.approvedPathOf(f));
574
+ if (file === null)
575
+ log('debug', '[stickers] 表情包标签没匹配上: ' + key);
576
+ return file;
577
+ }
578
+ catch (error) {
579
+ log('warn', '[stickers] 表情包标签解析失败: ' + describeError(error));
580
+ return null;
581
+ }
582
+ },
554
583
  agents: ctx.agents,
555
584
  sessions: ctx.sessions,
556
585
  agentPresets: ctx.agentPresets,
@@ -591,11 +620,6 @@ export function apply(ctx, config) {
591
620
  // 侧缺省兜底:开关默认关、窗口默认 600ms)。
592
621
  inboxQueueEnabled: config.inboxQueueEnabled,
593
622
  inboxQueueDelayMs: config.inboxQueueDelayMs,
594
- bystanderEnabled: config.bystanderEnabled,
595
- bystanderCapacity: config.bystanderCapacity,
596
- bystanderTopics: config.bystanderTopics,
597
- bystanderCooldownMinutes: config.bystanderCooldownMinutes,
598
- bystanderDailyLimit: config.bystanderDailyLimit,
599
623
  interimMessages: config.interimMessages,
600
624
  interimRecallMs: config.interimRecallMs,
601
625
  interimRecall: config.interimRecall,
@@ -691,8 +715,32 @@ export function apply(ctx, config) {
691
715
  generateText: proactiveGenerateText,
692
716
  });
693
717
  }
694
- /** 表情包自动收集的定时器(开关关掉时不建)。 */
718
+ /** 表情包自动收集的定时器(2026-11-20 已去掉——改成收到图立刻入库)。 */
695
719
  let stickerTimer;
720
+ // QQ 空间说说(本地加 2026-11-23):跟主动搭话同一个生成通道(当前会话模型),
721
+ // 发布走 NapCat 的 send_qzone_msg 扩展接口。
722
+ const qzonePublish = async (content, ugcRight) => {
723
+ const result = await connection.call('send_qzone_msg', { content, ugc_right: ugcRight });
724
+ const tid = result !== null && typeof result === 'object' ? String(result.tid ?? '') : '';
725
+ return tid;
726
+ };
727
+ let qzone;
728
+ if (config.qzoneEnabled !== false) {
729
+ qzone = new QzonePost({
730
+ config: {
731
+ enabled: true,
732
+ maxPerDay: config.qzoneMaxPerDay,
733
+ minGapMinutes: config.qzoneMinGapMinutes,
734
+ quietFrom: config.qzoneQuietFrom,
735
+ quietTo: config.qzoneQuietTo,
736
+ visibility: config.qzoneVisibility,
737
+ },
738
+ log,
739
+ dshHome: dshHome(),
740
+ generateText: proactiveGenerateText,
741
+ publish: qzonePublish,
742
+ });
743
+ }
696
744
  // Lifecycle: start the bridge and transport; unwind everything on unload.
697
745
  // The effect body is async (cordis AsyncEffect): injectChannel.start() must
698
746
  // be awaited — it skips history before arming its poll timer, and a stop
@@ -732,27 +780,26 @@ export function apply(ctx, config) {
732
780
  // 等连接就绪后再调 —— 漏了这一步实例就是个死对象:noteInbound 因为 chatIds
733
781
  // 还是空的直接 return(连 lastUserAt 都不写),定时器也从不排。
734
782
  proactive?.start();
735
- // 表情包自动收集(2026-11-19 本地加):每 5 分钟扫一次入站媒体目录,新图只进
736
- // 「未审核」;不调模型、不占显存。关掉开关就连定时器都不建。
783
+ // QQ 空间说说(本地加 2026-11-23):跟搭话一样等连接就绪后再排节拍。
784
+ qzone?.start();
785
+ // 表情包自动收集(2026-11-19 本地加 / 2026-11-20 改成零延迟):新图在入站
786
+ // 落盘那一刻就由 inbound 的 collectSticker 收进「未审核」,这里不再排定时器。
787
+ // 只留启动时扫一遍——把停机期间漏掉的、或手动丢进媒体目录的旧图补进来。
737
788
  if (config.stickerAutoCollect !== false) {
738
- const collectOnce = () => {
739
- try {
740
- const result = stickerStoreOf().collect(mediaDir);
741
- if (result.added > 0)
742
- log('info', '[stickers] 自动收集 ' + result.added + ' 张进未审核');
743
- }
744
- catch (error) {
745
- log('warn', '[stickers] 自动收集失败: ' + describeError(error));
746
- }
747
- };
748
- collectOnce();
749
- stickerTimer = setInterval(collectOnce, 300_000);
750
- stickerTimer.unref?.();
789
+ try {
790
+ const result = stickerStoreOf().collect(mediaDir);
791
+ if (result.added > 0)
792
+ log('info', '[stickers] 启动补扫 ' + result.added + ' 张进未审核');
793
+ }
794
+ catch (error) {
795
+ log('warn', '[stickers] 启动补扫失败: ' + describeError(error));
796
+ }
751
797
  }
752
798
  // QQ 平台说明与 qq_* 工具现按会话 agent 注入(见 ChatBridge.installChannelScope)
753
799
  return async () => {
754
800
  if (stickerTimer !== undefined)
755
801
  clearInterval(stickerTimer);
802
+ qzone?.stop();
756
803
  proactive?.stop();
757
804
  await injectChannel?.stop();
758
805
  await bridge.stop();