dsh-fish-soul 0.19.21 → 0.19.22
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 +1 -1
- package/lib/behavior.js +15 -13
- package/lib/browse.js +18 -6
- package/lib/client.js +30 -2
- package/lib/config-schema.js +11 -1
- package/lib/gateway-util.js +8 -2
- package/lib/gateway.js +17 -1
- package/lib/life.js +4 -0
- package/lib/prompts.js +27 -2
- package/lib/routes-soul.js +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/behavior.js
CHANGED
|
@@ -15,6 +15,7 @@ import { segmentsToText, sanitizeName } from './channels/onebot.js';
|
|
|
15
15
|
import { insertMemory, getMood, setMood, relTime } from './soul-memory.js';
|
|
16
16
|
import { MOOD_STATE_GUARD } from './mood-guard.js';
|
|
17
17
|
import { recallSync, vectorRanks, excludedMemories } from './retrieval.js';
|
|
18
|
+
import { renderPrompt } from './prompts.js';
|
|
18
19
|
|
|
19
20
|
const num = (x, d, lo, hi) => { const n = Number(x); return Number.isFinite(n) ? Math.min(hi, Math.max(lo, n)) : d; };
|
|
20
21
|
const bool = (x, d) => (x === undefined || x === null ? d : x === true);
|
|
@@ -353,7 +354,8 @@ function mergeToN(chunks, n, sep) {
|
|
|
353
354
|
* 只补不改;没有 [语音] 的文本原样返回(一个字节不动,连换行都保留原样);
|
|
354
355
|
* 含 [语音] 时先归一换行(\r\n → \n):CRLF 文本里 \r 夹在中间,
|
|
355
356
|
* 下游 split(/\n{2,}/) 本来就拆不开,不归一等于没做;
|
|
356
|
-
* [语音]
|
|
357
|
+
* #269 追加:模型还会把标记**写在同一行中间**(「写这么轻一句,我读着反倒重 [语音] 那句…」),
|
|
358
|
+
* 行首不是标记 ⇒ 整段被当文字发出去,永远不转语音(用户报障就是这个)。这种就在标记前切一刀。
|
|
357
359
|
* 缩进认所有非换行空白(半角空格 / tab / 全角空格 U+3000):下游 VOICE_RE 用的是 \s,
|
|
358
360
|
* 提纯这一侧若只认半角,就会出现「下游认得出、却在拆段时拆不开」。
|
|
359
361
|
*/
|
|
@@ -361,8 +363,14 @@ export function normalizeVoiceParagraphs(input) {
|
|
|
361
363
|
const raw = String(input ?? '');
|
|
362
364
|
if (!raw.includes('[语音]')) return raw;
|
|
363
365
|
const t = raw.replace(/\r\n?/g, '\n');
|
|
366
|
+
// 行内标记先切段(行首标记保持原样),再给「紧跟正文的单换行标记」补空行。
|
|
367
|
+
const split = t.split('\n').map((line) => {
|
|
368
|
+
if (!line.includes('[语音]') || /^[^\S\n]*\[语音\]/.test(line)) return line;
|
|
369
|
+
const at = line.indexOf('[语音]');
|
|
370
|
+
return `${line.slice(0, at).trimEnd()}\n\n${line.slice(at)}`;
|
|
371
|
+
}).join('\n');
|
|
364
372
|
// 「行首(可带空白缩进)是 [语音]」且「前面不是空行/不在文首」⇒ 前面补一个换行。
|
|
365
|
-
return
|
|
373
|
+
return split.replace(/(?<=[^\n])\n([^\S\n]*\[语音\])/g, "\n\n$1");
|
|
366
374
|
}
|
|
367
375
|
|
|
368
376
|
/** "最近发过的话"的规整化:去掉 [语音] 标记再规整,跨条复读的判定和记录共用。 */
|
|
@@ -981,15 +989,9 @@ export class DiaryWriter {
|
|
|
981
989
|
if (!force && mat.episodes.length === 0 && mat.self.length === 0) { setKv(this.db, 'diary.last', date); return null; }
|
|
982
990
|
setKv(this.db, `diary.tries.${date}`, tries + 1);
|
|
983
991
|
const name = this.personaName();
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
`- 某件小事让你想到别的什么(联想、突然明白的瞬间)\n- 今天某个让你在意/开心/别扭的时刻,具体在哪\n- 对某个人的新印象或改观\n- 一句随手的小念头或自言自语\n` +
|
|
988
|
-
`规则:\n` +
|
|
989
|
-
`- 只写材料里有依据的事,没提到的不要编;别人的私事一笔带过、别写细节。\n` +
|
|
990
|
-
`- 100~200 字,连贯短文;不要列表、不要分点、不要小标题。\n` +
|
|
991
|
-
`- 不要提 AI、模型、系统这些词,也不要任何关于「写日记」这件事本身的说明。\n` +
|
|
992
|
-
`- 日期写 ${date} 就行,不要用「今天」开头的套话开头。\n` +
|
|
992
|
+
// 材料整块走 {{materials}}:条件分支(有就加、没有就不加)留在这里,
|
|
993
|
+
// 提示词那段归用户(#263)。顺序与拼出来的文本和以前逐字一致 —— 见 prompts-diary 测试。
|
|
994
|
+
const materials =
|
|
993
995
|
(mat.recent.length ? `最近几篇日记(换一个新角度写,除非今天有新的事,别重复之前的写法和切入点):\n${mat.recent.map((e) => `- ${e}`).join('\n')}\n` : '') +
|
|
994
996
|
`今天聊过的:\n${mat.episodes.map((e) => `- ${e}`).join('\n') || '(没怎么聊天)'}\n` +
|
|
995
997
|
(mat.self.length ? `今天自己说过的事:\n${mat.self.map((e) => `- ${e}`).join('\n')}\n` : '') +
|
|
@@ -999,8 +1001,8 @@ export class DiaryWriter {
|
|
|
999
1001
|
`${mat.people.map((p) => `- ${p.name}`).join('\n')}\n` +
|
|
1000
1002
|
(mat.people.some((p) => p.ownerId === 'user:master') ? '上面第一个是你的主人。' : '') +
|
|
1001
1003
|
'who 必须原样照抄上面的名字(连括号都不要加),不要自己编称呼。刷到的视频作者、群里没跟你说过话的路人都不算。\n'
|
|
1002
|
-
: '')
|
|
1003
|
-
|
|
1004
|
+
: '');
|
|
1005
|
+
const prompt = renderPrompt('diary', { name, date, materials }, { log: (lvl, msg) => this.log(lvl, msg) });
|
|
1004
1006
|
const reply = await this.callLlm(prompt, { feature: 'diary', thinkFallback: true });
|
|
1005
1007
|
const parsed = parseJson(reply) ?? {};
|
|
1006
1008
|
const diary = (String(parsed.diary ?? '').trim() || looseDiary(reply)).slice(0, 600);
|
package/lib/browse.js
CHANGED
|
@@ -67,6 +67,23 @@ export function afterRound(self, label, watched, pick) {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* kv 里「最近搜过的词」(最新的在前)。纯读,浏览器提词与网关插话共用一个口径。
|
|
72
|
+
*
|
|
73
|
+
* 为什么抽出来:网关那边的 `bili` 是 **BiliChannel**(私信渠道),不是 BiliBrowser ——
|
|
74
|
+
* 直接在网关里调 `bili.recentKeywords()` 会拿到 undefined(typecheck 抓到过一次)。
|
|
75
|
+
* 数据本来就在 kv 里,谁都能读,不该依赖某个类的实例。
|
|
76
|
+
*
|
|
77
|
+
* ⚠️ 这份 kv 是纯词表、**没有时间戳**,所以做不了「只看 N 天内的」——
|
|
78
|
+
* 设置页也因此没给这个选项(给了也是假的)。
|
|
79
|
+
*/
|
|
80
|
+
export function recentSearchKeywords(db, n = 5) {
|
|
81
|
+
try {
|
|
82
|
+
const raw = JSON.parse(getKv(db, 'bili.search.recent', '[]'));
|
|
83
|
+
return Array.isArray(raw) ? raw.map((x) => String(x ?? '')).filter((x) => x !== '').slice(0, n) : [];
|
|
84
|
+
} catch { return []; }
|
|
85
|
+
}
|
|
86
|
+
|
|
70
87
|
export class BiliBrowser {
|
|
71
88
|
/**
|
|
72
89
|
* @param {object} deps
|
|
@@ -264,12 +281,7 @@ export class BiliBrowser {
|
|
|
264
281
|
}
|
|
265
282
|
|
|
266
283
|
/** 最近搜过的词(最新的在前,最多 5 个),给提词当"别重复"的参考。 */
|
|
267
|
-
recentKeywords() {
|
|
268
|
-
try {
|
|
269
|
-
const raw = JSON.parse(getKv(this.db, 'bili.search.recent', '[]'));
|
|
270
|
-
return Array.isArray(raw) ? raw.map((x) => String(x ?? '')).filter((x) => x !== '').slice(0, 5) : [];
|
|
271
|
-
} catch { return []; }
|
|
272
|
-
}
|
|
284
|
+
recentKeywords() { return recentSearchKeywords(this.db); }
|
|
273
285
|
|
|
274
286
|
/** 记下这次搜的词,重复的挪到最前。 */
|
|
275
287
|
noteKeyword(word) {
|
package/lib/client.js
CHANGED
|
@@ -463,6 +463,9 @@ window.__ModuleLoader__.load({
|
|
|
463
463
|
h(Switch, { label: "整理时对照聊天原文", checked: d.transcriptReview === true, onChange: (v) => save({ transcriptReview: v }) })),
|
|
464
464
|
d.transcriptReview === true ? Row({ title: "最多看几句", desc: "一次给多少条原文,太多会占掉整理用的上下文" },
|
|
465
465
|
Num({ min: 1, max: 200, value: tMax, onChange: (e) => setTMax(e.target.value), onBlur: () => { const n = Number(tMax); if (n >= 1 && n !== d.transcriptMaxLines) save({ transcriptMaxLines: n }); } }), Muted("句")) : null,
|
|
466
|
+
// #252 ①:先只在主人身上试,别一开就对所有人
|
|
467
|
+
d.transcriptReview === true ? Row({ title: "只对主人开", desc: "打开后只有整理「主人」的记忆时才对照原文,别人仍只看记忆。想在主人身上先试一轮就打开它" },
|
|
468
|
+
h(Switch, { label: "只对主人开", checked: d.transcriptMasterOnly === true, onChange: (v) => save({ transcriptMasterOnly: v }) })) : null,
|
|
466
469
|
Row({ title: "上次", meta: lastText },
|
|
467
470
|
Button({ disabled: busy || d.running || d.pending === 0, onClick: now }, busy ? "整理中…" : "现在整理")),
|
|
468
471
|
// #239:有被丢弃的批次时显示出来,不然用户只看到「没记住」查不到原因
|
|
@@ -584,6 +587,28 @@ window.__ModuleLoader__.load({
|
|
|
584
587
|
Muted("条。到上限就拒,防止拿她当群发工具。")) : null));
|
|
585
588
|
}
|
|
586
589
|
|
|
590
|
+
/**
|
|
591
|
+
* QQ 面板保存时的 interject 请求体(抽成纯函数才测得动,同 biliSaveBody)。
|
|
592
|
+
*
|
|
593
|
+
* 🔴 **这里必须逐个字段拼**,不能把 form 里的 ij 整个发过去:服务端 `/channels/qq-config`
|
|
594
|
+
* 是 `{ ...cur.interject, ...body.interject }` 合并后过 `interjectConfig()`,
|
|
595
|
+
* 所以**请求体里没有的键会退回配置里的旧值**(首次保存时就是默认值)。
|
|
596
|
+
* #219 的 interest 少了这一行,用户点开关 → 请求体没这个键 → 存进去还是 `enabled:false`,
|
|
597
|
+
* 表现是「开关点了又弹回去」。
|
|
598
|
+
*/
|
|
599
|
+
function qqInterjectBody(ij) {
|
|
600
|
+
// 空串不能被 Number() 变成 0:用户清空输入框 = 「没改」,不是「命中不加分」
|
|
601
|
+
const raw = ij?.interest?.weight;
|
|
602
|
+
const w = raw === '' || raw === null || raw === undefined ? NaN : Number(raw);
|
|
603
|
+
return {
|
|
604
|
+
enabled: ij?.enabled === true, chance: Number(ij?.chance) / 100,
|
|
605
|
+
cooldownMinutes: Number(ij?.cooldownMinutes), maxPerHour: Number(ij?.maxPerHour),
|
|
606
|
+
keywords: split(ij?.keywords),
|
|
607
|
+
// 写入口也夹一次(读侧 interjectConfig 夹只保护「用」,不保护「存」)
|
|
608
|
+
interest: { enabled: ij?.interest?.enabled === true, weight: Number.isFinite(w) ? Math.min(1, Math.max(0, w)) : 0.2 }
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
|
|
587
612
|
// ── QQ 接入(SnowLuma 直连)与会话工作区 ──
|
|
588
613
|
function ChannelPane({ data, refresh, notify }) {
|
|
589
614
|
const qq = data?.qq ?? {};
|
|
@@ -605,7 +630,7 @@ window.__ModuleLoader__.load({
|
|
|
605
630
|
enabled: next.enabled, wsUrl: next.wsUrl, ...(next.accessToken !== "" ? { accessToken: next.accessToken } : {}),
|
|
606
631
|
masterQqUin: next.masterQqUin, groupAllowList: split(next.groupAllowList), allGroups: next.allGroups === true, privateAllowList: split(next.privateAllowList), allFriends: next.allFriends === true, mentionOnly: next.mentionOnly === true,
|
|
607
632
|
followUpCount: Number(next.followUpCount), followUpSeconds: Number(next.followUpSeconds), batchMs: Number(next.batchMs), replyWindowMinutes: Number(next.replyWindowMinutes), callNames: split(next.callNames),
|
|
608
|
-
interject:
|
|
633
|
+
interject: qqInterjectBody(next.ij),
|
|
609
634
|
groupAdmin: { enabled: next.ga.enabled === true, groupId: next.ga.groupId, announce: next.ga.announce === true, autoApprove: next.ga.autoApprove === true }
|
|
610
635
|
});
|
|
611
636
|
if (res?.ok) { if (next.accessToken !== "") setForm({ ...next, accessToken: "" }); refresh(); } else notify(res?.error ?? "保存失败");
|
|
@@ -663,6 +688,9 @@ window.__ModuleLoader__.load({
|
|
|
663
688
|
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "插话概率" }, ijNum("chance", "插话概率", 0, 100), Muted("%"), ijNum("maxPerHour", "每小时最多", 0, 30), Muted("次/小时")) : null,
|
|
664
689
|
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "说完话后冷却" }, ijNum("cooldownMinutes", "冷却", 0, 1440), Muted("分钟")) : null,
|
|
665
690
|
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "感兴趣的话题" }, Input({ value: ij.keywords ?? "", placeholder: "猫, 原神, 考研", onChange: (e) => patch({ ij: { ...ij, keywords: e.target.value } }), onBlur: () => save() })) : null,
|
|
691
|
+
form.enabled && !form.mentionOnly && ij.enabled ? Row({ title: "最近搜的也算兴趣", desc: "她最近在 B 站搜过的词被群里提及时也加分;命中只算一次,不按命中几个词叠加" },
|
|
692
|
+
h(Switch, { label: "动态兴趣", checked: ij.interest?.enabled === true, onChange: (v) => save({ ij: { ...ij, interest: { ...(ij.interest ?? {}), enabled: v } } }) }),
|
|
693
|
+
ij.interest?.enabled === true ? Num({ min: 0, max: 1, step: 0.05, value: ij.interest?.weight ?? 0.2, "aria-label": "兴趣加分", onChange: (e) => patch({ ij: { ...ij, interest: { ...(ij.interest ?? {}), weight: e.target.value } } }), onBlur: () => save() }) : null) : null,
|
|
666
694
|
form.enabled ? Row({ title: "收藏表情包", desc: qq.stickers?.collect !== false ? undefined : "看到喜欢的表情会存下来,之后自己用" },
|
|
667
695
|
h(Switch, { label: "收藏表情包", checked: qq.stickers?.collect !== false, onChange: (v) => run("/stickers/config", { collect: v }, v ? "会收藏喜欢的表情了" : "不再收藏表情", "保存失败") }),
|
|
668
696
|
Num({ min: 0, max: 100, value: form.stickersPerDay, "aria-label": "每天收藏几张", onChange: (e) => patch({ stickersPerDay: e.target.value }), onBlur: () => { if (form.stickersPerDay !== "") run("/stickers/config", { perDay: form.stickersPerDay }, "每天的上限改了", "保存失败"); } }),
|
|
@@ -1245,7 +1273,7 @@ window.__ModuleLoader__.load({
|
|
|
1245
1273
|
exports.apply = apply;
|
|
1246
1274
|
exports.inject = inject;
|
|
1247
1275
|
// 纯函数抽出来才测得动(test/bili-switch-persist.mjs):不碰 DOM,只拼请求体。
|
|
1248
|
-
exports.__test = { biliSaveBody, biliPostUrl };
|
|
1276
|
+
exports.__test = { biliSaveBody, biliPostUrl, qqInterjectBody };
|
|
1249
1277
|
return module.exports;
|
|
1250
1278
|
}
|
|
1251
1279
|
});
|
package/lib/config-schema.js
CHANGED
|
@@ -26,6 +26,11 @@ export function fishSoulConfigSchema(z) {
|
|
|
26
26
|
cooldownMinutes: z.number().default(15),
|
|
27
27
|
maxPerHour: z.number().default(3),
|
|
28
28
|
keywords: z.array(z.string()).default([]),
|
|
29
|
+
// #219 她最近搜过的词也算兴趣来源。默认关 ⇒ 不配就是老行为(只认手填的 keywords)。
|
|
30
|
+
interest: z.object({
|
|
31
|
+
enabled: z.boolean().default(false),
|
|
32
|
+
weight: z.number().default(0.2) // 命中加分(与手填关键词的 +0.35 分开,好单独调)
|
|
33
|
+
}).default({}),
|
|
29
34
|
masterQuiet: z.boolean().default(true), // #59 主人在跟她聊时少插话(默认开)
|
|
30
35
|
masterQuietMinutes: z.number().default(5) // 主人多久内说过话算"在聊"
|
|
31
36
|
}).default({}),
|
|
@@ -140,7 +145,12 @@ export function fishSoulConfigSchema(z) {
|
|
|
140
145
|
// 关着就只看她已经记下的结论 —— 结论本身错了她发现不了。
|
|
141
146
|
// 开了要配合 chatArchive(原文存在那)。取不到原文就自动退回只看记忆。
|
|
142
147
|
transcriptReview: z.boolean().default(false),
|
|
143
|
-
transcriptMaxLines: z.number().default(40) // 一次最多给多少条原文(夹到 1~200)
|
|
148
|
+
transcriptMaxLines: z.number().default(40), // 一次最多给多少条原文(夹到 1~200)
|
|
149
|
+
// #252 ①:只对主人这一个 owner 开原文对照(其余人继续只看记忆)。
|
|
150
|
+
// 为什么要这个:默认值是全员生效还是只对主人生效,是两件完全不同的事 ——
|
|
151
|
+
// 想「先在主人身上试一轮,看 dream.log 的 transcriptLines 是不是非零」时,
|
|
152
|
+
// 只有这个开关能做到,不然一开就是所有人。默认 false ⇒ 与以前完全一致。
|
|
153
|
+
transcriptMasterOnly: z.boolean().default(false)
|
|
144
154
|
}).default({}),
|
|
145
155
|
growth: z.object({ // 她慢慢长出来的变化:聊完整理时攒证据,够了才生效(人格页可看 / 删 / 清空)
|
|
146
156
|
enabled: z.boolean().default(true),
|
package/lib/gateway-util.js
CHANGED
|
@@ -18,10 +18,14 @@ export function typingDelayMs(text, random = Math.random) {
|
|
|
18
18
|
* 群里没被点名时,想不想插一句(0..1):基础概率,聊到她感兴趣的话题 +0.35,说话的是熟人 +0.1,
|
|
19
19
|
* 在提问 +0.05;群里刷屏(一分钟 ≥ 8 条)减半,太短的 / 只有图的再打三折。
|
|
20
20
|
*/
|
|
21
|
-
export function interjectScore({ text, base = 0.05, keywords = [], relation = 'stranger', isMaster = false, busyCount = 0 }) {
|
|
21
|
+
export function interjectScore({ text, base = 0.05, keywords = [], interest = [], interestWeight = 0, relation = 'stranger', isMaster = false, busyCount = 0 }) {
|
|
22
22
|
const t = String(text ?? '');
|
|
23
23
|
let score = Math.max(0, Math.min(1, Number(base) || 0));
|
|
24
24
|
if (keywords.some((k) => k !== '' && t.includes(k))) score += 0.35;
|
|
25
|
+
// #219 动态兴趣:她最近搜过 / 看过的东西被提及时也算感兴趣。
|
|
26
|
+
// 命中只算一次(不按命中词数叠加):叠加会让「搜过猫和狗」的消息几乎必插嘴,
|
|
27
|
+
// 而插话本来就是低概率动作。weight = 0 等于没开。
|
|
28
|
+
if (interestWeight > 0 && interest.some((k) => k !== '' && t.includes(k))) score += interestWeight;
|
|
25
29
|
if (isMaster || relation === 'friend' || relation === 'close') score += 0.1;
|
|
26
30
|
if (/[??]\s*$|[吗呢嘛]\s*$/.test(t)) score += 0.05;
|
|
27
31
|
if (busyCount >= 8) score *= 0.5;
|
|
@@ -124,7 +128,9 @@ export function interjectConfig(raw) {
|
|
|
124
128
|
keywords: Array.isArray(v.keywords) ? v.keywords.map((x) => String(x).trim()).filter(Boolean).slice(0, 50) : [],
|
|
125
129
|
// #59 主人在聊的闸门:默认开,主人最近 masterQuietMinutes 分钟内跟她说过话就少插话
|
|
126
130
|
masterQuiet: v.masterQuiet !== false,
|
|
127
|
-
masterQuietMinutes: num(v.masterQuietMinutes, 5, 0, 1440)
|
|
131
|
+
masterQuietMinutes: num(v.masterQuietMinutes, 5, 0, 1440),
|
|
132
|
+
// #219 动态兴趣(她最近搜过的词)。默认关;weight 写入口也夹一次范围(读侧夹只保护「用」)。
|
|
133
|
+
interest: { enabled: v.interest?.enabled === true, weight: num(v.interest?.weight, 0.2, 0, 1) }
|
|
128
134
|
};
|
|
129
135
|
}
|
|
130
136
|
|
package/lib/gateway.js
CHANGED
|
@@ -48,6 +48,7 @@ import {
|
|
|
48
48
|
} from './gateway-dispatch.js';
|
|
49
49
|
import { adapterOf, DouyinAdapter } from './douyin-adapter.js';
|
|
50
50
|
import { findRepeatedParagraphs, normSentText, normalizeVoiceParagraphs, QQ_MAX_PARAGRAPHS, collapseOverflowParagraphs } from './behavior.js';
|
|
51
|
+
import { recentSearchKeywords } from './browse.js';
|
|
51
52
|
import { 该收这条, 拆成消息段, 抠正文图, 兜底表情包 } from './channels/vendor/qq-bridge.js';
|
|
52
53
|
|
|
53
54
|
/** 抖音 uid 绑定表的 kv key(`douyin.uin.<纯数字uid>`);uid 不合法返回 ''。 */
|
|
@@ -804,6 +805,17 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
804
805
|
return { lines, images };
|
|
805
806
|
}
|
|
806
807
|
|
|
808
|
+
/**
|
|
809
|
+
* 插话用的动态兴趣词(#219):她最近搜过的词(kv `bili.search.recent`,最多 5 个)。
|
|
810
|
+
*
|
|
811
|
+
* 读 kv 而不是 `this.bili.recentKeywords()`:网关手里的 `bili` 是 **BiliChannel**(私信渠道),
|
|
812
|
+
* 那个方法在 BiliBrowser 上(typecheck 抓到过一次)。数据在 kv 里,直接读最稳。
|
|
813
|
+
*
|
|
814
|
+
* `owner_id='self'` 的记忆**故意不接**:里面混着能力陈述(#76)和计划/想象(#75),
|
|
815
|
+
* 拿它当兴趣会让她对自己的能力缺陷感兴趣。要接得先设计过滤,那是另一件事。
|
|
816
|
+
*/
|
|
817
|
+
interestWords() { return recentSearchKeywords(this.db); }
|
|
818
|
+
|
|
807
819
|
/** 这条没点名的群消息,她插一句的概率(插话关着 / 睡觉 / 冷却中 / 到了每小时上限 → 0)。 */
|
|
808
820
|
interjectChance(m, person, cfg) {
|
|
809
821
|
const ij = cfg.interject;
|
|
@@ -817,8 +829,12 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
817
829
|
this.interjects.set(m.channelId, times);
|
|
818
830
|
if (times.length >= ij.maxPerHour) return 0;
|
|
819
831
|
const busyCount = (this.backlog.get(m.channelId) ?? []).filter((x) => now - x.timeMs < 60_000).length;
|
|
832
|
+
// #219:动态兴趣(她最近搜过的词)。没开 / 拿不到就是空数组 —— 这条路不能因为
|
|
833
|
+
// B站 没跑起来就抛错(插话判定在每条群消息上,抛一次就是整条消息不回)。
|
|
834
|
+
const interest = ij.interest?.enabled === true ? this.interestWords() : [];
|
|
820
835
|
let score = interjectScore({
|
|
821
|
-
text: m.text, base: ij.chance, keywords: ij.keywords,
|
|
836
|
+
text: m.text, base: ij.chance, keywords: ij.keywords, interest, interestWeight: ij.interest?.weight ?? 0,
|
|
837
|
+
relation: person?.relation_stage ?? 'stranger',
|
|
822
838
|
isMaster: m.userId === this.masterQq(), busyCount
|
|
823
839
|
});
|
|
824
840
|
// #59 主人在跟她聊:主人刚说过话就少在群里抢话。乘 0.2 而不是直接归零 —— 归零会让她在群里突然消失,
|
package/lib/life.js
CHANGED
|
@@ -1053,6 +1053,10 @@ export class LifeEngine {
|
|
|
1053
1053
|
try {
|
|
1054
1054
|
const cfg = this.getConfig()?.memory ?? {};
|
|
1055
1055
|
if (cfg.transcriptReview !== true) return '';
|
|
1056
|
+
// #252 ①:只对主人开。ownerId 的形状是 `user:<canonical_id>`(主人是 `user:master`)。
|
|
1057
|
+
// 拦在取样这一步而不是 runDream:history-import 等地也调 runDream,
|
|
1058
|
+
// 判在入口就会有一条路漏掉。
|
|
1059
|
+
if (cfg.transcriptMasterOnly === true && ownerId !== 'user:master') return '';
|
|
1056
1060
|
const until = Date.now();
|
|
1057
1061
|
const earliest = Math.min(...recent.map((m) => Number(m.created_at) || until));
|
|
1058
1062
|
// ⚠️ 往前多留一点:记忆是**整理出来的**,原文一定比它早。
|
package/lib/prompts.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* 全仓 21 个 LLM 调用点里,绝大多数提示词把 `${date}` / `${who}` / 材料摘要
|
|
6
6
|
* 直接拼在正文中间。整段外置后,用户删掉一个占位符就会让记忆整理拿到半截
|
|
7
7
|
* JSON 提纲 —— 那不是「可定制」,那是「一改就坏」。
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* 所以这里只外置**能安全插值**的段落:纯静态的那些(语气 / 防线 / 说法),
|
|
9
|
+
* 以及材料整块走一个占位符、条件分支留在代码里的那些(目前只有日记)。
|
|
10
|
+
* 改了最坏情况是语气不像她;不会让解析失败、不会让记忆错人。
|
|
10
11
|
*
|
|
11
12
|
* 约定:
|
|
12
13
|
* - 文件放 `~/.dsh/fish-soul/prompts/<key>.md`,纯文本,整段覆盖。
|
|
@@ -49,6 +50,21 @@ export const PROMPT_DEFAULTS = Object.freeze({
|
|
|
49
50
|
// 上网:能查 / 不能查(能查那句含工具名,代码里插 {{tool}})
|
|
50
51
|
webAvailable: '[上网] 遇到你不知道或者可能过时的事(新闻、比赛、新出的东西、没听过的梗),可以先用 {{tool}} 查;回复里别贴链接、别用 markdown,像聊天一样用自己的话说。',
|
|
51
52
|
webUnavailable: '[上网] 现在不能上网查,不知道的就直说不知道。',
|
|
53
|
+
|
|
54
|
+
// 每日日记(#263 第三步):第一个带占位符的功能提示词 —— 材料整块走 {{materials}},
|
|
55
|
+
// 条件分支(有就加、没有就不加)仍在代码里,不给用户「删一个占位符就拿到半截提纲」的机会。
|
|
56
|
+
diary:
|
|
57
|
+
'你是{{name}}。今天是 {{date}},睡前给自己写一篇日记(只给自己看,以后自己会翻)。\n' +
|
|
58
|
+
'语气:像跟自己说话,口语、自然、有点情绪温度;写自己的感受和琢磨,不要汇报流水账。\n' +
|
|
59
|
+
'从下面这些里面挑真的有感觉的写(每次换着挑,别全用;没感觉就不硬写):\n' +
|
|
60
|
+
'- 某件小事让你想到别的什么(联想、突然明白的瞬间)\n- 今天某个让你在意/开心/别扭的时刻,具体在哪\n- 对某个人的新印象或改观\n- 一句随手的小念头或自言自语\n' +
|
|
61
|
+
'规则:\n' +
|
|
62
|
+
'- 只写材料里有依据的事,没提到的不要编;别人的私事一笔带过、别写细节。\n' +
|
|
63
|
+
'- 100~200 字,连贯短文;不要列表、不要分点、不要小标题。\n' +
|
|
64
|
+
'- 不要提 AI、模型、系统这些词,也不要任何关于「写日记」这件事本身的说明。\n' +
|
|
65
|
+
'- 日期写 {{date}} 就行,不要用「今天」开头的套话开头。\n' +
|
|
66
|
+
'{{materials}}' +
|
|
67
|
+
'只输出 JSON:{"diary":"……","topics":[{"who":"对方的名字","topic":"想聊的事(一句话)"}]}',
|
|
52
68
|
});
|
|
53
69
|
|
|
54
70
|
/** 每个 key 说白了是什么,设置页直接展示。 */
|
|
@@ -60,6 +76,7 @@ export const PROMPT_META = Object.freeze({
|
|
|
60
76
|
stickerCollect: { title: '收藏表情', desc: '判断什么样的表情值得收、怎么起名字和标签。' },
|
|
61
77
|
webAvailable: { title: '能上网时', desc: '{{tool}} 会被替换成实际工具名,别删掉这个占位符。' },
|
|
62
78
|
webUnavailable: { title: '不能上网时', desc: '没网可用时提示她直说不知道。' },
|
|
79
|
+
diary: { title: '每日日记', desc: '睡前那篇日记的语气、写什么、不能写什么。材料由代码填在 {{materials}} 里,别删这个占位符。' },
|
|
63
80
|
});
|
|
64
81
|
|
|
65
82
|
/** 用户可编辑的 key 列表(顺序即设置页展示顺序)。 */
|
|
@@ -136,11 +153,19 @@ export const PLACEHOLDERS = Object.freeze({
|
|
|
136
153
|
stickerCollect: {},
|
|
137
154
|
webAvailable: { tool: '搜索工具名(自动填,别删)' },
|
|
138
155
|
webUnavailable: {},
|
|
156
|
+
diary: {
|
|
157
|
+
name: '她自己的名字(自动填,别删)',
|
|
158
|
+
date: '这一篇的日期 YYYY-MM-DD(自动填,别删)',
|
|
159
|
+
materials: '今天聊过的 / 她自己说过的 / 最近几篇日记(自动填,别删)'
|
|
160
|
+
},
|
|
139
161
|
});
|
|
140
162
|
|
|
141
163
|
/** 必填占位符:删掉就回退默认(缺了它这段就没意义了)。 */
|
|
142
164
|
export const REQUIRED_PLACEHOLDERS = Object.freeze({
|
|
143
165
|
webAvailable: new Set(['tool']),
|
|
166
|
+
// 三个都必填:删掉 name / date 就不知道写谁的哪天;删掉 materials 等于「让她凭空编一篇」,
|
|
167
|
+
// 那正是这条提示词一直在防的事(只写材料里有依据的)。删了整段回退默认。
|
|
168
|
+
diary: new Set(['name', 'date', 'materials']),
|
|
144
169
|
});
|
|
145
170
|
|
|
146
171
|
/**
|
package/lib/routes-soul.js
CHANGED
|
@@ -162,6 +162,7 @@ export async function handleSoulRoute({ method, path, url, req, res, send, readB
|
|
|
162
162
|
const transcriptCfg = (m) => ({
|
|
163
163
|
transcriptReview: m.transcriptReview === true,
|
|
164
164
|
transcriptMaxLines: Math.min(200, Math.max(1, Math.floor(Number(m.transcriptMaxLines) || 40))),
|
|
165
|
+
transcriptMasterOnly: m.transcriptMasterOnly === true,
|
|
165
166
|
});
|
|
166
167
|
const memState = () => {
|
|
167
168
|
const m = getConfig().memory ?? {};
|
|
@@ -185,6 +186,7 @@ export async function handleSoulRoute({ method, path, url, req, res, send, readB
|
|
|
185
186
|
if (b.maxLines !== undefined && Number.isFinite(Number(b.maxLines))) s.maxLines = Math.min(80, Math.max(10, Math.floor(Number(b.maxLines))));
|
|
186
187
|
if (b.transcriptReview !== undefined) s.transcriptReview = b.transcriptReview === true;
|
|
187
188
|
if (b.transcriptMaxLines !== undefined && Number.isFinite(Number(b.transcriptMaxLines))) s.transcriptMaxLines = Math.min(200, Math.max(1, Math.floor(Number(b.transcriptMaxLines))));
|
|
189
|
+
if (b.transcriptMasterOnly !== undefined) s.transcriptMasterOnly = b.transcriptMasterOnly === true;
|
|
188
190
|
saveConfig({ memory: s });
|
|
189
191
|
send(200, memState());
|
|
190
192
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-fish-soul",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.22",
|
|
4
4
|
"description": "鱼 · 人格、按人记忆(可纠正、有印象、能导入旧聊天记录)、日程自走与主动开口,直连 SnowLuma 收发 QQ(群里会自己插话),B站 / 抖音小号私信与自己刷视频;按功能选模型并统计用量花费,能听会说 QQ 语音、收藏表情包、学群里的梗,可选上网查;心情影响说话、去 AI 味、每个群的设定、按聊天选模型、每晚写日记、每周记忆存档与可选周记(DSH 插件,单角色 feiyu)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"test": "node test/check-test-chain.mjs && node test/check-release-version.mjs && node test/wire-helper.mjs && node test/marker-audit.mjs && node test/douyin-send.mjs && node test/douyin-mechanism.mjs && node test/douyin-route.mjs && node test/douyin-adapter.mjs && node test/douyin-contract.mjs && node test/memory-bulk-move.mjs && node test/safe-download.mjs && node test/douyin-exact-id.mjs && node test/douyin-pb-init.mjs && node test/douyin-conversation.mjs && node test/douyin-inbox.mjs && node test/douyin-quarantine.mjs && node test/douyin-send-target.mjs && node test/douyin-send-exclusive.mjs && node test/douyin-gap-dedupe.mjs && node test/douyin-message-id-dedupe.mjs && node test/douyin-push-poll-dedupe.mjs && node test/douyin-share-card-dedupe.mjs && node test/douyin-share-card-dom.mjs && node test/douyin-inline-share.mjs && node test/douyin-short-link.mjs && node test/douyin-inline-ledger.mjs && node test/douyin-group-chat.mjs && node test/douyin-group-read.mjs && node test/douyin-group-reply.mjs && node test/session-overflow-recycle.mjs && node test/douyin-read-fail-retry.mjs && node test/douyin-read-cache.mjs && node test/douyin-dm-media-conv.mjs && node test/douyin-meta-lines.mjs && node test/douyin-read-fail-retry-poll.mjs && node test/douyin-live-fails.mjs && node test/douyin-inbox-contract.mjs && node test/person-attribution.mjs && node test/memory-owner-reassign.mjs && node test/douyin-poll-and-timer-safety.mjs && node test/p2-limits.mjs && node test/resource-safety.mjs && node test/leftover-edge-cases.mjs && node test/douyin-master-person-merge.mjs && node test/douyin-master-uid.mjs && node test/douyin-identity-e2e.mjs && node test/douyin-note-upload-poll.mjs && node test/douyin-post-jobs.mjs && node test/douyin-video-post.mjs && node test/douyin-video-trigger.mjs && node test/douyin-video-driver.mjs && node test/retrieval-filtered-vectors.mjs && node test/security-boundaries.mjs && node test/douyin-cdp-cursor.mjs && node test/douyin-nav-timeout.mjs && node test/persona-isolation.mjs && node test/prompts.mjs && node test/prompts-route.mjs && node test/diary-topics-217.mjs && node test/smoke.mjs && node test/life-context-interaction.mjs && node test/life-clock-refresh.mjs && node test/browser-launch-early-exit.mjs && node test/douyin-browser.mjs && node test/douyin-crash-restore.mjs && node test/douyin-page-alive.mjs && node test/douyin-eval-timeout.mjs && node test/douyin-bridge-timeout.mjs && node test/douyin-goto-budget.mjs && node test/douyin-music.mjs && node test/douyin-ax-button.mjs && node test/startup-gate.mjs && node test/outbox.mjs && node test/import-coverage.mjs && node test/update-check.mjs && node test/issue-fixes.mjs && node test/import-resume.mjs && node test/maibot-extras.mjs && node test/slang-global.mjs && node test/worldinfo.mjs && node test/memory-bulk.mjs && node test/memory-tiers.mjs && node test/retrieval-tier-weights.mjs && node test/retrieval-tier-weights-route.mjs && node test/memory-weekly.mjs && node test/issue-98-self-archive.mjs && node test/issue-99-memory-order.mjs && node test/issue-115-memory-date.mjs && node test/issue-119-memory-page.mjs && node test/issue-125-memory-filter.mjs && node test/issue-78-diagnostic.mjs && node test/memory-storage.mjs && node test/memory-storage-restore.mjs && node test/backup-restore.mjs && node test/douyin-group.mjs && node test/review-fixes.mjs && node test/at-reads-video.mjs && node test/search-source.mjs && node test/followups.mjs && node test/detail-config.mjs && node test/qq-send-any-image.mjs && node test/qq-read-attachment.mjs && node test/qq-batch-window.mjs && node test/llm-roomy-budget.mjs && node test/llm-failure-backoff.mjs && node test/llm-budget-and-social-backoff.mjs && node test/comment-video.mjs && node test/frames.mjs && node test/face-name.mjs && node test/comment-reply.mjs && node test/chat-comment.mjs && node test/at-target.mjs && node test/quota-caps.mjs && node test/client-lint.mjs && node test/client-panels.mjs && node test/dsh-desktop.mjs && node test/dsh-desktop-as-master.mjs && node test/desktop-as-master-switch.mjs && node test/group-mention-only.mjs && node test/qq-private-allowlist.mjs && node test/issue-59-interject.mjs && node test/issue-59-diagnose.mjs && node test/diag-douyin-running.mjs && node test/sticker-backfill.mjs && node test/issue-118-sticker-diagnostics.mjs && node test/sticker-manage.mjs && node test/bili-emotes.mjs && node test/qq-outbound-sanitize.mjs && node test/repeat-guard-cross-turn.mjs && node test/voice-paragraph-split.mjs && node test/voice-paragraph-split-wire.mjs && node test/person-delete.mjs && node test/qq-group-admin.mjs && node test/douyin-recovery.mjs && node test/session-preset.mjs && node test/qq-connect-error.mjs && node test/douyin-comment-bridge.mjs && node test/douyin-comment-write-unknown.mjs && node test/douyin-reply-verify-status.mjs && node test/bili-comment-emoji.mjs && node test/douyin-state-echo.mjs && node test/issue-75-proactive.mjs && node test/issue-76-capability.mjs && node test/douyin-http-browse.mjs && node test/douyin-verify-backoff.mjs && node test/douyin-digg-bridge.mjs && node test/memory-evidence-transcript.mjs && node test/chat-archive-default.mjs && node test/issue-113-desktop-archive.mjs && node test/dream-transcript-wire.mjs && node test/douyin-frames-collect.mjs && node test/master-qq-uin-rebind.mjs && node test/douyin-session-health.mjs && node test/douyin-delivered.mjs && node test/douyin-card-share.mjs && node test/douyin-push-drop.mjs && node test/douyin-stranger-dm.mjs && node test/douyin-uid-binding.mjs && node test/image-webp-fallback.mjs && node test/douyin-emoji-fallback.mjs && node test/douyin-panel-width-threshold.mjs && node test/douyin-emoji-panel-close.mjs && node test/relay-other-platform.mjs && node test/relay-to-friend.mjs && node test/relay-sender-id.mjs && node test/dsh-home-guard.mjs && node test/relay-config-route.mjs && node test/share-fallback.mjs && node test/share-quota-refund.mjs && node test/issue-101-voice-files.mjs && node test/voice-volcengine.mjs && node test/voice-minimax-dashscope.mjs && node test/bili-switch-persist.mjs && node test/cross-channel-context.mjs && node test/reply-target.mjs && node test/shared-session.mjs && node test/outbound-quote-and-images.mjs && node test/sticker-bracket-fallback.mjs && node test/dream-transcript-scope.mjs && node test/memory-date-context.mjs && node test/memory-time-dedupe.mjs && node test/context-source-platform.mjs && node test/memory-source-label.mjs && node test/issue-239-maxtokens-wire.mjs && node test/issue-239-maxtokens.mjs && node test/pending-delivery.mjs && node test/recall-window-78.mjs && node test/memory-recall-recent-78.mjs && node test/client-syntax.mjs && node test/diag-log.mjs && node test/check-rings.mjs && node test/release-workflow.mjs && node test/sticker-import-gif.mjs && node test/sticker-real-gif.mjs && node test/sticker-upload-binary.mjs && node test/sticker-vision-tags.mjs && node test/sticker-manual-tags.mjs && node test/sticker-auto-name.mjs && node test/self-update.mjs && node test/group-list.mjs && node test/douyin-inbox-noise.mjs && node test/douyin-inbox-diag.mjs && node test/douyin-inbox-stuck.mjs && node test/reply-window.mjs && node test/douyin-sticker-heuristic.mjs && node test/douyin-image-boundary.mjs && node test/media-image-boundary.mjs && node test/douyin-comment-identity-cid.mjs && node test/qq-mention-only-echo.mjs && node test/bili-panel-pagination.mjs && node test/bili-comment-link.mjs && node test/bili-comment-visibility.mjs && node test/bili-allowlist.mjs && node test/douyin-master-uid-mismatch.mjs && node test/vision-model.mjs && node test/image-inbound-fail.mjs && node test/group-backlog-images.mjs && node test/group-master-tag.mjs && node test/check-route-guard.mjs && node test/check-client-imports.mjs && node test/chat-archive-fts.mjs && node test/chat-search-tool.mjs && node test/memory-invalidate-kind.mjs && node test/dream-merge-duplicates.mjs && node test/mood-guard.mjs && node test/time-awareness.mjs && node test/tts-strip-emoji.mjs && node test/session-reset-route.mjs && node test/check-secrets.mjs && node test/check-secrets-nickname.mjs && node test/check-docs-freshness.mjs && node test/check-package-json-format.mjs && node test/wire-limits.mjs && node test/check-chromium-suites.mjs && node test/check-no-stash-scripts.mjs && node test/douyin-video-wire.mjs && node test/douyin-self-uid.mjs && node test/douyin-group-cursor.mjs && node test/douyin-dom-text.mjs && node test/video-gen.mjs && node test/scheduled-tasks.mjs && node test/scheduled-tasks-ui.mjs && node test/douyin-wave12-fixes.mjs && node test/prefetch-vec-await.mjs && node test/wave2-token-optimizations.mjs && node test/wave3-memory-retrieval.mjs && node test/rc5-token-inflation.mjs && node test/pending-surfaced-closure.mjs && node test/memory-digest-retry-239.mjs && node test/issue-244-paragraph-split.mjs && node test/issue-244-cleanout-e2e.mjs && node test/issue-269-qq-split-budget.mjs && node test/issue-247-media-url.mjs && node test/check-fork-pr-gate.mjs && node test/check-pr-hygiene.mjs && node test/check-import-cycles.mjs && node test/check-file-size-budget.mjs && node test/check-file-size-budget-rule.mjs && node test/check-silent-catch.mjs && node test/check-silent-catch-rule.mjs && node test/douyin-cookie-refresh.mjs && node test/douyin-back-to-list.mjs && node test/douyin-fastpath.mjs && node test/douyin-post-id-backfill.mjs && node test/douyin-canary-panel.mjs && node test/douyin-note-text.mjs && node test/bili-playback.mjs",
|
|
67
|
+
"test": "node test/check-test-chain.mjs && node test/check-release-version.mjs && node test/wire-helper.mjs && node test/marker-audit.mjs && node test/douyin-send.mjs && node test/douyin-mechanism.mjs && node test/douyin-route.mjs && node test/douyin-adapter.mjs && node test/douyin-contract.mjs && node test/memory-bulk-move.mjs && node test/safe-download.mjs && node test/douyin-exact-id.mjs && node test/douyin-pb-init.mjs && node test/douyin-conversation.mjs && node test/douyin-inbox.mjs && node test/douyin-quarantine.mjs && node test/douyin-send-target.mjs && node test/douyin-send-exclusive.mjs && node test/douyin-gap-dedupe.mjs && node test/douyin-message-id-dedupe.mjs && node test/douyin-push-poll-dedupe.mjs && node test/douyin-share-card-dedupe.mjs && node test/douyin-share-card-dom.mjs && node test/douyin-inline-share.mjs && node test/douyin-short-link.mjs && node test/douyin-inline-ledger.mjs && node test/douyin-group-chat.mjs && node test/douyin-group-read.mjs && node test/douyin-group-reply.mjs && node test/session-overflow-recycle.mjs && node test/douyin-read-fail-retry.mjs && node test/douyin-read-cache.mjs && node test/douyin-dm-media-conv.mjs && node test/douyin-meta-lines.mjs && node test/douyin-read-fail-retry-poll.mjs && node test/douyin-live-fails.mjs && node test/douyin-inbox-contract.mjs && node test/person-attribution.mjs && node test/memory-owner-reassign.mjs && node test/douyin-poll-and-timer-safety.mjs && node test/p2-limits.mjs && node test/resource-safety.mjs && node test/leftover-edge-cases.mjs && node test/douyin-master-person-merge.mjs && node test/douyin-master-uid.mjs && node test/douyin-identity-e2e.mjs && node test/douyin-note-upload-poll.mjs && node test/douyin-post-jobs.mjs && node test/douyin-video-post.mjs && node test/douyin-video-trigger.mjs && node test/douyin-video-driver.mjs && node test/retrieval-filtered-vectors.mjs && node test/security-boundaries.mjs && node test/douyin-cdp-cursor.mjs && node test/douyin-nav-timeout.mjs && node test/persona-isolation.mjs && node test/prompts.mjs && node test/prompts-route.mjs && node test/diary-topics-217.mjs && node test/smoke.mjs && node test/life-context-interaction.mjs && node test/life-clock-refresh.mjs && node test/browser-launch-early-exit.mjs && node test/douyin-browser.mjs && node test/douyin-crash-restore.mjs && node test/douyin-page-alive.mjs && node test/douyin-eval-timeout.mjs && node test/douyin-bridge-timeout.mjs && node test/douyin-goto-budget.mjs && node test/douyin-music.mjs && node test/douyin-ax-button.mjs && node test/startup-gate.mjs && node test/outbox.mjs && node test/import-coverage.mjs && node test/update-check.mjs && node test/issue-fixes.mjs && node test/import-resume.mjs && node test/maibot-extras.mjs && node test/slang-global.mjs && node test/worldinfo.mjs && node test/memory-bulk.mjs && node test/memory-tiers.mjs && node test/retrieval-tier-weights.mjs && node test/retrieval-tier-weights-route.mjs && node test/memory-weekly.mjs && node test/issue-98-self-archive.mjs && node test/issue-99-memory-order.mjs && node test/issue-115-memory-date.mjs && node test/issue-119-memory-page.mjs && node test/issue-125-memory-filter.mjs && node test/issue-78-diagnostic.mjs && node test/memory-storage.mjs && node test/memory-storage-restore.mjs && node test/backup-restore.mjs && node test/douyin-group.mjs && node test/review-fixes.mjs && node test/at-reads-video.mjs && node test/search-source.mjs && node test/followups.mjs && node test/detail-config.mjs && node test/qq-send-any-image.mjs && node test/qq-read-attachment.mjs && node test/qq-batch-window.mjs && node test/llm-roomy-budget.mjs && node test/llm-failure-backoff.mjs && node test/llm-budget-and-social-backoff.mjs && node test/comment-video.mjs && node test/frames.mjs && node test/face-name.mjs && node test/comment-reply.mjs && node test/chat-comment.mjs && node test/at-target.mjs && node test/quota-caps.mjs && node test/client-lint.mjs && node test/client-panels.mjs && node test/dsh-desktop.mjs && node test/dsh-desktop-as-master.mjs && node test/desktop-as-master-switch.mjs && node test/group-mention-only.mjs && node test/qq-private-allowlist.mjs && node test/issue-59-interject.mjs && node test/issue-59-diagnose.mjs && node test/diag-douyin-running.mjs && node test/sticker-backfill.mjs && node test/issue-118-sticker-diagnostics.mjs && node test/sticker-manage.mjs && node test/bili-emotes.mjs && node test/qq-outbound-sanitize.mjs && node test/repeat-guard-cross-turn.mjs && node test/voice-paragraph-split.mjs && node test/voice-paragraph-split-wire.mjs && node test/person-delete.mjs && node test/qq-group-admin.mjs && node test/douyin-recovery.mjs && node test/session-preset.mjs && node test/qq-connect-error.mjs && node test/douyin-comment-bridge.mjs && node test/douyin-comment-write-unknown.mjs && node test/douyin-reply-verify-status.mjs && node test/bili-comment-emoji.mjs && node test/douyin-state-echo.mjs && node test/issue-75-proactive.mjs && node test/issue-76-capability.mjs && node test/douyin-http-browse.mjs && node test/douyin-verify-backoff.mjs && node test/douyin-digg-bridge.mjs && node test/memory-evidence-transcript.mjs && node test/chat-archive-default.mjs && node test/issue-113-desktop-archive.mjs && node test/dream-transcript-wire.mjs && node test/douyin-frames-collect.mjs && node test/master-qq-uin-rebind.mjs && node test/douyin-session-health.mjs && node test/douyin-delivered.mjs && node test/douyin-card-share.mjs && node test/douyin-push-drop.mjs && node test/douyin-stranger-dm.mjs && node test/douyin-uid-binding.mjs && node test/image-webp-fallback.mjs && node test/douyin-emoji-fallback.mjs && node test/douyin-panel-width-threshold.mjs && node test/douyin-emoji-panel-close.mjs && node test/relay-other-platform.mjs && node test/relay-to-friend.mjs && node test/relay-sender-id.mjs && node test/dsh-home-guard.mjs && node test/relay-config-route.mjs && node test/share-fallback.mjs && node test/share-quota-refund.mjs && node test/issue-101-voice-files.mjs && node test/voice-volcengine.mjs && node test/voice-minimax-dashscope.mjs && node test/bili-switch-persist.mjs && node test/cross-channel-context.mjs && node test/reply-target.mjs && node test/shared-session.mjs && node test/outbound-quote-and-images.mjs && node test/sticker-bracket-fallback.mjs && node test/dream-transcript-scope.mjs && node test/memory-date-context.mjs && node test/memory-time-dedupe.mjs && node test/context-source-platform.mjs && node test/memory-source-label.mjs && node test/issue-239-maxtokens-wire.mjs && node test/issue-239-maxtokens.mjs && node test/pending-delivery.mjs && node test/recall-window-78.mjs && node test/memory-recall-recent-78.mjs && node test/client-syntax.mjs && node test/diag-log.mjs && node test/check-rings.mjs && node test/release-workflow.mjs && node test/sticker-import-gif.mjs && node test/sticker-real-gif.mjs && node test/sticker-upload-binary.mjs && node test/sticker-vision-tags.mjs && node test/sticker-manual-tags.mjs && node test/sticker-auto-name.mjs && node test/self-update.mjs && node test/group-list.mjs && node test/douyin-inbox-noise.mjs && node test/douyin-inbox-diag.mjs && node test/douyin-inbox-stuck.mjs && node test/reply-window.mjs && node test/douyin-sticker-heuristic.mjs && node test/douyin-image-boundary.mjs && node test/media-image-boundary.mjs && node test/douyin-comment-identity-cid.mjs && node test/qq-mention-only-echo.mjs && node test/bili-panel-pagination.mjs && node test/bili-comment-link.mjs && node test/bili-comment-visibility.mjs && node test/bili-allowlist.mjs && node test/douyin-master-uid-mismatch.mjs && node test/vision-model.mjs && node test/image-inbound-fail.mjs && node test/group-backlog-images.mjs && node test/group-master-tag.mjs && node test/check-route-guard.mjs && node test/check-client-imports.mjs && node test/chat-archive-fts.mjs && node test/chat-search-tool.mjs && node test/memory-invalidate-kind.mjs && node test/dream-merge-duplicates.mjs && node test/mood-guard.mjs && node test/time-awareness.mjs && node test/tts-strip-emoji.mjs && node test/session-reset-route.mjs && node test/check-secrets.mjs && node test/check-secrets-nickname.mjs && node test/check-docs-freshness.mjs && node test/check-package-json-format.mjs && node test/wire-limits.mjs && node test/check-chromium-suites.mjs && node test/check-no-stash-scripts.mjs && node test/douyin-video-wire.mjs && node test/douyin-self-uid.mjs && node test/douyin-group-cursor.mjs && node test/douyin-dom-text.mjs && node test/video-gen.mjs && node test/scheduled-tasks.mjs && node test/scheduled-tasks-ui.mjs && node test/douyin-wave12-fixes.mjs && node test/prefetch-vec-await.mjs && node test/wave2-token-optimizations.mjs && node test/wave3-memory-retrieval.mjs && node test/rc5-token-inflation.mjs && node test/pending-surfaced-closure.mjs && node test/memory-digest-retry-239.mjs && node test/issue-244-paragraph-split.mjs && node test/issue-244-cleanout-e2e.mjs && node test/issue-269-qq-split-budget.mjs && node test/voice-inline-paragraph.mjs && node test/issue-247-media-url.mjs && node test/check-fork-pr-gate.mjs && node test/check-pr-hygiene.mjs && node test/check-import-cycles.mjs && node test/check-file-size-budget.mjs && node test/check-file-size-budget-rule.mjs && node test/check-silent-catch.mjs && node test/check-silent-catch-rule.mjs && node test/douyin-cookie-refresh.mjs && node test/douyin-back-to-list.mjs && node test/douyin-fastpath.mjs && node test/douyin-post-id-backfill.mjs && node test/douyin-canary-panel.mjs && node test/douyin-note-text.mjs && node test/bili-playback.mjs && node test/prompts-diary.mjs && node test/interject-interest.mjs && node test/transcript-master-only.mjs",
|
|
68
68
|
"test:douyin": "node test/parallel.mjs 4 --only douyin",
|
|
69
69
|
"test:fast": "node test/parallel.mjs 4 --skip \"douyin|browser\"",
|
|
70
70
|
"typecheck": "npx --yes -p typescript tsc -p tsconfig.check.json"
|