@cmach_socket/opencode-qq-bot 0.10.0 → 0.11.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/README.md CHANGED
@@ -69,7 +69,7 @@ bun install
69
69
 
70
70
  - 环境变量与插件选项不再是配置来源,OpenCode 插件选项里只剩 `agent`;`config.json` 不存在时插件直接报错退出。
71
71
  - 字段写错会告警并回退到默认值,JSON 语法错误直接报错。
72
- - 标「立即」的字段保存即生效,标「重启」的字段要重载插件。
72
+ - 标「立即」的字段保存即生效,标「重启」的字段要重载插件;面板顶栏的「重启插件」会就地完成这次重载。
73
73
  - 会话的 cwd、文件工具、`AGENTS.md` 与 git 都取这个工作目录,不跟随加载插件的项目目录。
74
74
  - 面板(默认开启,只监听 `127.0.0.1:7391`)可以可视化编辑这份配置,见 [docs/panel.md](docs/panel.md)。
75
75
  首次启动会在 `config.json` 里写入 `panel.token`;不想要面板就设 `panel.enabled: false`,
@@ -119,27 +119,28 @@ NapCat 连接断开后机器人就不再响应。根治办法是在 `opencode.js
119
119
 
120
120
  模型只能操作当前会话绑定的群聊或私聊,工具都带 `qq_` 前缀:
121
121
 
122
- | 工具 | 说明 |
123
- | -------------------------- | ------------------------------------------------------------------------------------------- |
124
- | `qq_request_reply` | 申请本轮的回复权限,必须说明为什么要回复;权限只在本轮有效 |
125
- | `qq_send_message` | 发消息。`content` 文本,`reply=false` 表示已读不回,`unlimit_length=true` 解除长度告警 |
126
- | `qq_send_image` | 发图片,`file` 传路径或 URL,`base64` 传 `base64://` 数据 |
127
- | `qq_send_record` | 发语音 |
128
- | `qq_send_sticker` | 发收藏表情(表情包),`id` 填收藏表情编号,编号见 `qq_favorite_list` 或 `/emoji-label list` |
129
- | `qq_favorite_list` | 列收藏表情(表情包)的编号与标签 |
130
- | `qq_collect_sticker` | 收藏聊天里最近收到的动画表情,`description` 填中文名字(最多 12 个字,只用文字和数字) |
131
- | `qq_send_forward` | 发合并转发,`nodes` 为节点列表 |
132
- | `qq_send_poke` | 戳一戳 |
133
- | `qq_delete_message` | 撤回机器人自己发送过的消息 |
134
- | `qq_get_group_member_info` | 查用户资料:群聊返回群名片与昵称,私聊返回昵称 |
135
- | `qq_fetch_ptt_text` | 转写当前聊天最近收到的语音 |
136
- | `qq_get_login_info` | 机器人自己的 QQ 号与昵称(要求当前会话已绑定 QQ 聊天) |
137
- | `qq_send_file` | 发文件,`file` 传路径,只能发白名单目录里的普通文件;member / proactive 只能取媒体目录 |
138
- | `qq_diary_write` | 写日记,`content` 正文,`date` 省略即今天,`title` 标题;仅 owner 私聊 |
139
- | `qq_diary_read` | 读日记,`date` 省略即最近一篇;仅 owner 私聊 |
140
- | `qq_diary_list` | 列日记,`days` 默认最近 7 篇,只列日期与标题;仅 owner 私聊 |
122
+ | 工具 | 说明 |
123
+ | -------------------------- | -------------------------------------------------------------------------------------------------------------- |
124
+ | `qq_request_reply` | 申请本轮的回复权限,必须说明为什么要回复;权限只在本轮有效 |
125
+ | `qq_send_message` | 发消息。`content` 文本列表,一条内容发一条消息,`reply=false` 表示已读不回,`unlimit_length=true` 解除长度告警 |
126
+ | `qq_send_image` | 发图片,`file` 传路径或 URL 列表,`base64` 传 `base64://` 数据列表,一条一个 |
127
+ | `qq_send_record` | 发语音,`file` 传路径、URL 或 `base64://` 数据列表,一条一个 |
128
+ | `qq_send_sticker` | 发收藏表情(表情包),`id` 填收藏表情编号列表,编号见 `qq_favorite_list` 或 `/emoji-label list` |
129
+ | `qq_favorite_list` | 列收藏表情(表情包)的编号与标签 |
130
+ | `qq_collect_sticker` | 收藏聊天里最近收到的动画表情,`description` 填中文名字(最多 12 个字,只用文字和数字) |
131
+ | `qq_send_forward` | 发合并转发,`nodes` 为节点列表 |
132
+ | `qq_send_poke` | 戳一戳 |
133
+ | `qq_delete_message` | 撤回机器人自己发送过的消息 |
134
+ | `qq_get_group_member_info` | 查用户资料:群聊返回群名片与昵称,私聊返回昵称 |
135
+ | `qq_fetch_ptt_text` | 转写当前聊天最近收到的语音 |
136
+ | `qq_get_login_info` | 机器人自己的 QQ 号与昵称(要求当前会话已绑定 QQ 聊天) |
137
+ | `qq_send_file` | 发文件,`file` 传路径列表,只能发白名单目录里的普通文件;member / proactive 只能取媒体目录 |
138
+ | `qq_diary_write` | 写日记,`content` 正文,`date` 省略即今天,`title` 标题;仅 owner 私聊 |
139
+ | `qq_diary_read` | 读日记,`date` 省略即最近一篇;仅 owner 私聊 |
140
+ | `qq_diary_list` | 列日记,`days` 默认最近 7 篇,只列日期与标题;仅 owner 私聊 |
141
141
 
142
142
  发送类工具(消息、图片、语音、收藏表情、转发、戳一戳)成功后都算本轮已回复,不会再触发补发提醒。
143
+ 要分多条发,把多条内容放进同一次调用的列表参数里(`content` / `file` / `id` 都是列表),一次发完。
143
144
  连续调用发送类工具会被拒绝,中间调用任意其它工具后即可再次发送。
144
145
  工具只在当前聊天配置仍启用、且会话正处理 QQ 消息轮次时可用。
145
146
 
@@ -191,6 +192,7 @@ NapCat 连接断开后机器人就不再响应。根治办法是在 `opencode.js
191
192
  | ---------------------------- | ------------------------------------- | -------------------------------------------- |
192
193
  | `wake` | `all` / `mention` / `prefix` / `none` | 群里什么时候必须回复,默认 `mention` |
193
194
  | `wake.prefixes` | 字符串数组 | `wake` 为 `prefix` 时的唤醒前缀,命中即必回 |
195
+ | `wake.ignorePrefixes` | 字符串数组 | 忽略前缀,命中即整条不理,不回复也不进上下文 |
194
196
  | `proactive.enabled` | 布尔 | `false` 表示这个聊天不主动开口 |
195
197
  | `proactive.startProbability` | 0 到 1 | 这个聊天单次心跳的触发概率,不写时用全局公式 |
196
198
  | `collect.privateMs` | 毫秒(≥ 0) | 这个私聊的消息收集窗口,`0` 表示立即回复 |
@@ -200,10 +202,12 @@ NapCat 连接断开后机器人就不再响应。根治办法是在 `opencode.js
200
202
  | `soulPath` | 文件或目录路径 | 覆盖这个聊天使用的角色设定文件 |
201
203
  | `soulName` | 文件名 | 覆盖这个聊天使用的角色设定文件名 |
202
204
 
203
- - 会话字段与全局配置项同名:`wake.prefixes`、`proactive.enabled`、`soulPath` / `soulName`
204
- 在两边含义一致,没写的继续用全局值。
205
+ - 会话字段与全局配置项同名:`wake.prefixes`、`wake.ignorePrefixes`、`proactive.enabled`、
206
+ `soulPath` / `soulName` 在两边含义一致,没写的继续用全局值。
205
207
  - `wake` 只作用于群聊,私聊永远回复:`all` 每条都必回,`mention` 被 @ 才必回,
206
208
  `prefix` 命中前缀才必回(被 @ 同样必回),`none` 这个群完全不理。
209
+ - `wake.ignorePrefixes` 群聊私聊都算:消息以这些前缀开头就整条丢掉,模型看不到它,
210
+ 比被 @ 机器人还优先;机器人自己的管理命令不受影响。
207
211
  - 必回与不必回都会写进提示词,模型知道这轮该不该说话;`/status` 会列出每个聊天当前的唤醒方式与主动说话开关。
208
212
  - 改完下一轮生效;单个字段写错只忽略这一项并告警,整个文件解析失败会沿用上一份。
209
213
 
@@ -244,7 +248,7 @@ TUI 侧执行时结果发到该会话绑定的 QQ 聊天:
244
248
  | `/compact group:123` | 让上游压缩该聊天的上下文;聊天正在执行时先 `/stop` 再压缩 |
245
249
  | `/tools [group:123]` | 查看各聊天使用的配置档与可用工具 |
246
250
  | `/emoji-label [all\|inc\|list]` | 给收藏表情生成中文标签(TUI 侧是 `/qq-emoji-label`) |
247
- | `/diary [write\|list\|show\|auto]` | 日记:写一篇、列出最近几篇、看某天的日记、生成当天总结;仅 owner 私聊(TUI 侧是 `/qq-diary`) |
251
+ | `/diary [write\|list\|show\|auto]` | 日记:写一篇、列出最近几篇、看某天的日记、生成当天日记;仅 owner 私聊(TUI 侧是 `/qq-diary`) |
248
252
 
249
253
  ## 收藏表情(表情包)
250
254
 
@@ -265,7 +269,7 @@ TUI 侧执行时结果发到该会话绑定的 QQ 聊天:
265
269
 
266
270
  ## 日记
267
271
 
268
- 把聊天的流水记成一篇篇 Markdown 日记,主人可以直接读到、发给模型读,也能在每天结束时自动总结一篇。
272
+ 把聊天的流水记成一篇篇 Markdown 日记,主人可以直接读到、发给模型读,也能在每天结束时自动生成一篇。
269
273
 
270
274
  ```
271
275
  /diary write 今天群里在聊新版本发布 写一篇日记
@@ -273,13 +277,13 @@ TUI 侧执行时结果发到该会话绑定的 QQ 聊天:
273
277
  /diary list 列出最近 7 篇
274
278
  /diary list 30 列出最近 30 篇
275
279
  /diary show 2026-11-10 看某天的日记
276
- /diary auto 立刻把今天的素材总结成一篇
280
+ /diary auto 立刻用今天的素材生成一篇
277
281
  ```
278
282
 
279
283
  - 日记是文件,不是数据库里的条目:默认放在机器人工作目录的 `diary/` 下,文件名是日期(`private-200/2026-11-10.md`)。
280
284
  - 日记范围固定为 **owner 自己的私聊**:群聊与 admin 的私聊都不采集、不生成、不推送。
281
285
  - 成品不设条数上限,也不会自动清理;只有中间产物(原始素材)按 `diary.retentionDays` 过期清理。
282
- - `show` 会把日记文件本身作为附件发出来,自动总结也用同样的方式推送。
286
+ - `show` 会把日记文件本身作为附件发出来,自动生成的日记也用同样的方式推送。
283
287
  - 日记功能默认开启,关掉用 `diary.enabled=false`。
284
288
 
285
289
  详见 [docs/diary.md](docs/diary.md)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmach_socket/opencode-qq-bot",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "OpenCode V2 plugin bridging a QQ group chat (NapCat via NapLink) to an OpenCode session.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -5,6 +5,8 @@
5
5
  * JSON Schema、面板表单)都由它生成,不再各写一份。
6
6
  */
7
7
 
8
+ import { DEFAULT_TIME_ZONE } from "../time-format"
9
+
8
10
  /** 配置项的值类型,决定前端渲染成哪种控件。 */
9
11
  export type FieldType =
10
12
  | "boolean"
@@ -15,6 +17,7 @@ export type FieldType =
15
17
  | "numberList"
16
18
  | "stringList"
17
19
  | "clock"
20
+ | "timezone"
18
21
  | "modelRef"
19
22
  | "path"
20
23
 
@@ -140,6 +143,14 @@ export const CONFIG_FIELDS: readonly ConfigField[] = [
140
143
  default: true,
141
144
  hot: true,
142
145
  },
146
+ {
147
+ path: "timezone",
148
+ group: "general",
149
+ type: "timezone",
150
+ label: "时区",
151
+ description: "消息时间与当前时间按该 IANA 时区显示,默认东八区",
152
+ default: DEFAULT_TIME_ZONE,
153
+ },
143
154
  {
144
155
  path: "toolProfilesPath",
145
156
  group: "general",
@@ -323,6 +334,15 @@ export const CONFIG_FIELDS: readonly ConfigField[] = [
323
334
  default: ["/"],
324
335
  hot: true,
325
336
  },
337
+ {
338
+ path: "wake.ignorePrefixes",
339
+ group: "wake",
340
+ type: "stringList",
341
+ label: "忽略前缀",
342
+ description: "消息以这些前缀开头就完全不理:不回复,也不进模型上下文",
343
+ default: [],
344
+ hot: true,
345
+ },
326
346
  {
327
347
  path: "wake.ignoreAtAll",
328
348
  group: "wake",
@@ -689,7 +709,7 @@ export const CONFIG_FIELDS: readonly ConfigField[] = [
689
709
  path: "diary.summaryTime",
690
710
  group: "diary",
691
711
  type: "clock",
692
- label: "每天几点生成总结",
712
+ label: "每天几点生成日记",
693
713
  description: "本地时间 HH:mm",
694
714
  default: "23:30",
695
715
  },
@@ -707,7 +727,7 @@ export const CONFIG_FIELDS: readonly ConfigField[] = [
707
727
  path: "diary.summaryTargets",
708
728
  group: "diary",
709
729
  type: "stringList",
710
- label: "生成总结的聊天",
730
+ label: "生成日记的聊天",
711
731
  description: "group:123 / private:456;留空表示按准入名单推导",
712
732
  default: [],
713
733
  },
@@ -762,8 +782,8 @@ export const CONFIG_FIELDS: readonly ConfigField[] = [
762
782
  path: "diary.timeoutMs",
763
783
  group: "diary",
764
784
  type: "number",
765
- label: "总结超时(毫秒)",
766
- description: "等待模型生成总结的超时时间",
785
+ label: "生成日记超时(毫秒)",
786
+ description: "等待模型生成日记的超时时间",
767
787
  default: 120000,
768
788
  min: 0,
769
789
  exclusiveMin: true,
@@ -22,6 +22,16 @@ const BOOLEAN_SPELLINGS = ["1", "0", "true", "false", "yes", "no", "on", "off"]
22
22
  /** 合法的时刻格式:`HH:mm`。 */
23
23
  const CLOCK = /^([01]?\d|2[0-3]):([0-5]\d)$/
24
24
 
25
+ /** 判断 IANA 时区名是否被运行时接受。 */
26
+ function isTimeZone(value: string): boolean {
27
+ try {
28
+ new Intl.DateTimeFormat("en-US", { timeZone: value })
29
+ return true
30
+ } catch {
31
+ return false
32
+ }
33
+ }
34
+
25
35
  /** 配置告警回调。 */
26
36
  export type ConfigWarning = (message: string) => void
27
37
 
@@ -303,6 +313,23 @@ function leafSchema(field: ConfigField, warn: ConfigWarning): z.ZodTypeAny {
303
313
  }
304
314
  return trimmed
305
315
  })
316
+ case "timezone":
317
+ return z
318
+ .unknown()
319
+ .optional()
320
+ .transform((value) => {
321
+ if (!present(value)) return fallback
322
+ if (typeof value !== "string") {
323
+ warn(`${path} 必须是字符串:${String(value)}`)
324
+ return fallback
325
+ }
326
+ const trimmed = value.trim()
327
+ if (!isTimeZone(trimmed)) {
328
+ warn(`${path} 不是合法的 IANA 时区:${trimmed}`)
329
+ return fallback
330
+ }
331
+ return trimmed
332
+ })
306
333
  case "modelRef":
307
334
  return z
308
335
  .unknown()
@@ -516,6 +543,11 @@ export function createStrictFieldSchema(field: ConfigField): z.ZodType {
516
543
  .pipe(z.array(z.string().min(1)))
517
544
  case "clock":
518
545
  return z.string().trim().regex(CLOCK, "必须是 HH:mm 格式的时刻")
546
+ case "timezone":
547
+ return z
548
+ .string()
549
+ .trim()
550
+ .refine(isTimeZone, { message: "必须是合法的 IANA 时区,例如 Asia/Shanghai" })
519
551
  case "modelRef":
520
552
  return z
521
553
  .string()
@@ -33,6 +33,8 @@ export interface ProactiveConfig {
33
33
  export interface WakeConfig {
34
34
  /** 全局唤醒前缀,命中即必回。 */
35
35
  prefixes: string[]
36
+ /** 忽略前缀,命中即整条不理:不回复,也不进模型上下文。 */
37
+ ignorePrefixes: string[]
36
38
  /** 是否忽略 @全体成员。 */
37
39
  ignoreAtAll: boolean
38
40
  /** 回复机器人自己的消息是否必回。 */
@@ -167,7 +169,7 @@ export interface DiaryConfig {
167
169
  maxLineChars: number
168
170
  /** 单个聊天单天最多保留多少条素材。 */
169
171
  maxLinesPerDay: number
170
- /** 等待模型总结的超时时间(毫秒)。 */
172
+ /** 等待模型生成日记的超时时间(毫秒)。 */
171
173
  timeoutMs: number
172
174
  }
173
175
 
@@ -222,6 +224,8 @@ export interface QQBotConfig {
222
224
  warnLength: number
223
225
  /** 重启后是否复用上一次的会话。 */
224
226
  reuseSession: boolean
227
+ /** 消息时间与当前时间使用的 IANA 时区。 */
228
+ timezone: string
225
229
  proactive: ProactiveConfig
226
230
  wake: WakeConfig
227
231
  collect: CollectConfig
package/src/config.ts CHANGED
@@ -132,7 +132,11 @@ export function resolveConfig(
132
132
  allowGroups: [...parsed.proactive.allowGroups],
133
133
  allowUsers: [...parsed.proactive.allowUsers],
134
134
  },
135
- wake: { ...parsed.wake, prefixes: [...parsed.wake.prefixes] },
135
+ wake: {
136
+ ...parsed.wake,
137
+ prefixes: [...parsed.wake.prefixes],
138
+ ignorePrefixes: [...parsed.wake.ignorePrefixes],
139
+ },
136
140
  reply: { ...parsed.reply },
137
141
  trace: { ...parsed.trace },
138
142
  reminder: { ...parsed.reminder },
@@ -39,7 +39,7 @@ export const DIARY_USAGE = [
39
39
  "write [日期] <内容> 写一篇日记(默认今天)",
40
40
  "list [天数] 列出最近几篇日记(默认 7 篇)",
41
41
  "show <日期> 看某天的日记,日期用 YYYY-MM-DD",
42
- "auto [日期] 立刻生成或重生成某天的自动总结",
42
+ "auto [日期] 立刻生成或重生成某天的日记",
43
43
  ].join("\n")
44
44
 
45
45
  /**
@@ -93,7 +93,7 @@ export interface DiaryRunnerDeps {
93
93
  store: DiaryStore
94
94
  /** 素材读取。 */
95
95
  collector: DiaryCollector
96
- /** 自动总结。 */
96
+ /** 自动生成。 */
97
97
  summarizer: DiarySummarizer
98
98
  }
99
99
 
@@ -114,7 +114,7 @@ export function formatDiaryList(
114
114
  return [head, ...entries.map((entry) => `${entry.date} ${entry.title}`)].join("\n")
115
115
  }
116
116
 
117
- /** 创建日记命令执行器;同一时间只跑一个自动总结任务。 */
117
+ /** 创建日记命令执行器;同一时间只跑一个自动生成任务。 */
118
118
  export function createDiaryRunner(deps: DiaryRunnerDeps): DiaryCommandRunner {
119
119
  const { config, logger, client, limiter, outbound, sensitive, store, collector, summarizer } =
120
120
  deps
@@ -202,20 +202,20 @@ export function createDiaryRunner(deps: DiaryRunnerDeps): DiaryCommandRunner {
202
202
  return
203
203
  }
204
204
  if (!(await collector.has(targetKey(target), date))) {
205
- await report(target, `${label} ${date} 没有聊天素材,跳过总结。`)
205
+ await report(target, `${label} ${date} 没有聊天素材,跳过生成。`)
206
206
  return
207
207
  }
208
208
  if (running) {
209
- await report(target, "已经有日记总结任务在跑了,请等它结束。")
209
+ await report(target, "已经有日记生成任务在跑了,请等它结束。")
210
210
  return
211
211
  }
212
212
  running = true
213
- // 总结可能要跑很久,放到后台执行,结果用 QQ 消息回。
213
+ // 生成可能要跑很久,放到后台执行,结果用 QQ 消息回。
214
214
  void (async () => {
215
215
  await report(target, `开始生成 ${label} ${date} 的日记…`)
216
216
  const title = await summarizer.summarize(targetKey(target), date)
217
217
  if (!title) {
218
- await report(target, `${label} ${date} 的日记总结失败,素材保留待下次重试。`)
218
+ await report(target, `${label} ${date} 的日记生成失败,素材保留待下次重试。`)
219
219
  return
220
220
  }
221
221
  await report(target, `${label} ${date} 的日记已生成:${title}`)
@@ -224,10 +224,10 @@ export function createDiaryRunner(deps: DiaryRunnerDeps): DiaryCommandRunner {
224
224
  })
225
225
  })()
226
226
  .catch((error: unknown) => {
227
- logger.error("日记总结任务失败", error)
227
+ logger.error("日记生成任务失败", error)
228
228
  return report(
229
229
  target,
230
- `${label} 日记总结失败:${error instanceof Error ? error.message : String(error)}`,
230
+ `${label} 日记生成失败:${error instanceof Error ? error.message : String(error)}`,
231
231
  )
232
232
  })
233
233
  .finally(() => {
@@ -272,7 +272,7 @@ const DIARY_USAGE_LINES = [
272
272
  "/diary write [日期] <内容> — 写一篇日记(默认今天)",
273
273
  "/diary list [天数] — 列出最近几篇日记(默认 7 篇)",
274
274
  "/diary show <日期> — 看某天的日记,日期用 YYYY-MM-DD",
275
- "/diary auto [日期] — 立刻生成或重生成某天的自动总结",
275
+ "/diary auto [日期] — 立刻生成或重生成某天的日记",
276
276
  ]
277
277
 
278
278
  /**
@@ -284,7 +284,7 @@ const DIARY_USAGE_LINES = [
284
284
  export function diaryCommand(runner: DiaryCommandRunner): CommandDefinition {
285
285
  return {
286
286
  name: DIARY_COMMAND,
287
- description: "写、看、列出聊天日记:write 手写,show 看某天,list 列最近几篇,auto 自动总结。",
287
+ description: "写、看、列出聊天日记:write 手写,show 看某天,list 列最近几篇,auto 自动生成。",
288
288
  usage: DIARY_USAGE_LINES,
289
289
  run: async (context, args) => {
290
290
  // 日记只属于 owner:QQ 侧只认 owner 自己的私聊。
@@ -7,7 +7,7 @@ import { parseTargetKey, targetLabel } from "../chat"
7
7
  * 程序读它,人也能直接打开看。
8
8
  */
9
9
 
10
- /** 日记来源:自动总结、命令手写、模型用工具写入。 */
10
+ /** 日记来源:自动生成、命令手写、模型用工具写入。 */
11
11
  export type DiarySource = "auto" | "manual" | "model"
12
12
 
13
13
  /** 日记的元数据,对应文件里的 front matter。 */
@@ -28,7 +28,7 @@ export interface DiarySchedulerDeps {
28
28
  store: DiaryStore
29
29
  /** 素材读取。 */
30
30
  collector: DiaryCollector
31
- /** 自动总结。 */
31
+ /** 自动生成。 */
32
32
  summarizer: DiarySummarizer
33
33
  }
34
34
 
@@ -77,7 +77,7 @@ export class DiaryScheduler {
77
77
  return this.lastTick
78
78
  }
79
79
 
80
- /** 下次总结时刻(毫秒):按配置里的时刻算,今天过了就顺延到明天。 */
80
+ /** 下次生成时刻(毫秒):按配置里的时刻算,今天过了就顺延到明天。 */
81
81
  nextSummaryAt(now: Date = new Date()): number {
82
82
  const minutes = minutesOfDay(this.deps.config.diary.summaryTime)
83
83
  const target = new Date(now)
@@ -114,7 +114,7 @@ export class DiaryScheduler {
114
114
  /**
115
115
  * 跑一轮调度。
116
116
  *
117
- * 已经过了总结时刻、该聊天今天还没有自动日记时才动手;
117
+ * 已经过了生成时刻、该聊天今天还没有自动日记时才动手;
118
118
  * 当天没有素材就跳过,不调用模型也不推送。
119
119
  */
120
120
  async tick(now: Date = new Date()): Promise<void> {
@@ -127,7 +127,7 @@ export class DiaryScheduler {
127
127
  const target = minutesOfDay(this.deps.config.diary.summaryTime)
128
128
  const current = now.getHours() * 60 + now.getMinutes()
129
129
  if (current < target) {
130
- this.lastOutcome = `未到总结时刻(${this.deps.config.diary.summaryTime})`
130
+ this.lastOutcome = `未到生成时刻(${this.deps.config.diary.summaryTime})`
131
131
  return
132
132
  }
133
133
  const date = dateKey(now)
@@ -137,7 +137,7 @@ export class DiaryScheduler {
137
137
  done += 1
138
138
  }
139
139
  this.lastOutcome =
140
- done > 0 ? `已检查 ${done} 个聊天(${date})` : `没有可总结的聊天(${date})`
140
+ done > 0 ? `已检查 ${done} 个聊天(${date})` : `没有可生成日记的聊天(${date})`
141
141
  })
142
142
  }
143
143
 
@@ -145,7 +145,7 @@ export class DiaryScheduler {
145
145
  private targets(): ChatTarget[] {
146
146
  const scope = diaryScopeChat(this.deps.config)
147
147
  if (!scope) {
148
- this.deps.logger.warn("没有配置 ownerQQ,日记不做总结也不推送")
148
+ this.deps.logger.warn("没有配置 ownerQQ,日记不生成也不推送")
149
149
  return []
150
150
  }
151
151
  if (!isTargetAllowed(this.deps.config.access, scope, this.deps.config.ownerQQ)) return []
@@ -5,7 +5,7 @@ import type { QQBotConfig } from "../config"
5
5
  * 日记的范围:只有 owner 与机器人的那条私聊。
6
6
  *
7
7
  * 维护者裁定(日记范围收窄到 owner 的会话):
8
- * 采集、总结、工具、命令与推送都只认这一条会话,
8
+ * 采集、生成、工具、命令与推送都只认这一条会话,
9
9
  * 剩下的会话一旦只有一条,跨聊天串档的前提就不存在了。
10
10
  */
11
11
  export function diaryScopeChat(config: QQBotConfig): ChatTarget | undefined {