dsh-fish-soul 0.18.18 → 0.18.20
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/db.js +14 -0
- package/lib/douyin-social.js +35 -5
- package/lib/gateway-media.js +2 -1
- package/lib/gateway-util.js +20 -0
- package/lib/gateway.js +98 -12
- package/lib/index.js +7 -2
- package/lib/life.js +66 -14
- package/lib/soul-memory.js +22 -1
- package/package.json +3 -3
package/README.md
CHANGED
package/lib/db.js
CHANGED
|
@@ -184,6 +184,20 @@ CREATE TABLE IF NOT EXISTS douyin_seen (
|
|
|
184
184
|
seen_at INTEGER NOT NULL,
|
|
185
185
|
seen_real_at INTEGER NOT NULL
|
|
186
186
|
);
|
|
187
|
+
|
|
188
|
+
-- 她自己发出去的消息(#160):引用回复要拿被引用的原文,而 QQ 的消息号会跨天复用、
|
|
189
|
+
-- 而且宿主重启后内存 Map 就空了。以前只有内存里的 ownMessages,重启后只能问 OneBot 的
|
|
190
|
+
-- get_msg —— 跨天复用时会取回隔天那条、被时间校验收掉 ⇒「原文没取到」。
|
|
191
|
+
-- 这里按 (channel_id, message_id) 落库,重启后照样认得出「引用的是我自己说的话」。
|
|
192
|
+
-- 只存 text(≤500 字,够引用用);at = 真实毫秒,用来淘汰旧行。
|
|
193
|
+
CREATE TABLE IF NOT EXISTS own_message (
|
|
194
|
+
channel_id TEXT NOT NULL,
|
|
195
|
+
message_id TEXT NOT NULL,
|
|
196
|
+
text TEXT NOT NULL DEFAULT '',
|
|
197
|
+
at INTEGER NOT NULL,
|
|
198
|
+
PRIMARY KEY (channel_id, message_id)
|
|
199
|
+
);
|
|
200
|
+
CREATE INDEX IF NOT EXISTS idx_own_message_at ON own_message(at);
|
|
187
201
|
`;
|
|
188
202
|
|
|
189
203
|
/** 旧库增量迁移:ALTER 失败(列已存在)即忽略。 */
|
package/lib/douyin-social.js
CHANGED
|
@@ -299,13 +299,17 @@ export const COMMENT_STATE_JS = `(() => {
|
|
|
299
299
|
};
|
|
300
300
|
})()`;
|
|
301
301
|
|
|
302
|
-
/**
|
|
302
|
+
/** 编辑页上的「选择音乐 / 添加音乐」入口(页面有多个同名节点,取最后一个——真正可点的那颗;优先取其按钮容器并避免在视口内时不必要的滚动)。 */
|
|
303
303
|
const MUSIC_ENTRY_JS = String.raw`(() => {
|
|
304
|
-
const els = [...document.querySelectorAll('div, span, button')].filter((x) => x.children.length === 0 &&
|
|
304
|
+
const els = [...document.querySelectorAll('div, span, button')].filter((x) => x.children.length === 0 && /^(选择音乐|添加音乐)$/.test((x.innerText || '').trim()));
|
|
305
305
|
const el = els[els.length - 1];
|
|
306
306
|
if (!el) return null;
|
|
307
|
-
el.
|
|
308
|
-
|
|
307
|
+
const target = el.closest('[class*="preview-button"], button') || el;
|
|
308
|
+
let r = target.getBoundingClientRect();
|
|
309
|
+
if (r.top < 0 || r.bottom > window.innerHeight || r.left < 0 || r.right > window.innerWidth) {
|
|
310
|
+
target.scrollIntoView({ block: 'center', behavior: 'instant' });
|
|
311
|
+
r = target.getBoundingClientRect();
|
|
312
|
+
}
|
|
309
313
|
return r.width && r.height ? { x: Math.round(r.left + r.width / 2), y: Math.round(r.top + r.height / 2) } : null;
|
|
310
314
|
})()`;
|
|
311
315
|
|
|
@@ -555,6 +559,8 @@ export async function ensurePageAlive(br, { timeoutMs = 3000, reload = true } =
|
|
|
555
559
|
async function clickMusicEntry(br, timing) {
|
|
556
560
|
const sel = await br.eval(MUSIC_ENTRY_JS, { timeoutMs: timing.evalTimeoutMs }).catch(() => null);
|
|
557
561
|
if (!sel) return false;
|
|
562
|
+
await br.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: sel.x, y: sel.y }, br.sessionId).catch(() => {});
|
|
563
|
+
await sleep(150);
|
|
558
564
|
await realClick(br, sel.x, sel.y);
|
|
559
565
|
await sleep(1200);
|
|
560
566
|
return true;
|
|
@@ -645,7 +651,7 @@ async function pickNoteMusic(br, music, { allowDuplicate = false, timing = PAGE_
|
|
|
645
651
|
.find(x => (x.innerText || x.textContent || '').trim() === '使用' && x.children.length <= 1);
|
|
646
652
|
if (!el) return null;
|
|
647
653
|
const r = el.getBoundingClientRect();
|
|
648
|
-
return r.width > 0 && r.height > 0 ? { x: Math.round(r.left + r.width / 2), y: Math.round(r.top + r.height / 2) } :
|
|
654
|
+
return r.width > 0 && r.height > 0 ? { x: Math.round(r.left + r.width / 2), y: Math.round(r.top + r.height / 2) } : { x: card.x, y: card.y };
|
|
649
655
|
})()`, { timeoutMs: timing.evalTimeoutMs }).catch(() => null);
|
|
650
656
|
if (domBtn) btn = domBtn;
|
|
651
657
|
}
|
|
@@ -656,6 +662,24 @@ async function pickNoteMusic(br, music, { allowDuplicate = false, timing = PAGE_
|
|
|
656
662
|
await br.send('Input.dispatchMouseEvent', { type: 'mouseMoved', x: btn.x, y: btn.y }, br.sessionId).catch(() => {});
|
|
657
663
|
await sleep(250);
|
|
658
664
|
await realClick(br, btn.x, btn.y);
|
|
665
|
+
if (btn.backendNodeId) {
|
|
666
|
+
// 真机容错:getBoxModel 偶尔返回的是内层 span 偏移坐标(甚至超出了 400px 卡片右边界),
|
|
667
|
+
// 或者窗口在后台时 mousePressed 没触发 React 合成 onClick —— 仅在抽屉仍开着时用该节点的 DOM click 补一道。
|
|
668
|
+
await sleep(250);
|
|
669
|
+
const stillOpen = await br.eval(MUSIC_OPEN_JS, { timeoutMs: timing.evalTimeoutMs }).catch(() => false);
|
|
670
|
+
if (stillOpen) {
|
|
671
|
+
const resolved = await br.send('DOM.resolveNode', { backendNodeId: btn.backendNodeId }, br.sessionId, timing.evalTimeoutMs).catch(() => null);
|
|
672
|
+
const objectId = resolved?.object?.objectId;
|
|
673
|
+
if (objectId) {
|
|
674
|
+
await br.send('Runtime.callFunctionOn', {
|
|
675
|
+
objectId,
|
|
676
|
+
functionDeclaration: `function () { if (typeof this.click === 'function') this.click(); }`,
|
|
677
|
+
returnByValue: true
|
|
678
|
+
}, br.sessionId, timing.evalTimeoutMs).catch(() => {});
|
|
679
|
+
await br.send('Runtime.releaseObject', { objectId }, br.sessionId, timing.evalTimeoutMs).catch(() => {});
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
659
683
|
const verified = await waitFor(() => br.eval(`(() => {
|
|
660
684
|
const want = ${JSON.stringify(music)}.replace(/\\s+/g, '');
|
|
661
685
|
const visible = el => { const r = el.getBoundingClientRect(); const s = getComputedStyle(el); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; };
|
|
@@ -672,6 +696,12 @@ async function pickNoteMusic(br, music, { allowDuplicate = false, timing = PAGE_
|
|
|
672
696
|
if (text.length <= 250 && text.replace(/\\s+/g, '').includes(want)) return true;
|
|
673
697
|
}
|
|
674
698
|
}
|
|
699
|
+
const binders = [...document.querySelectorAll('[class*="music-binder"], [class*="music-text"]')].filter(visible);
|
|
700
|
+
for (const b of binders) {
|
|
701
|
+
if (b.closest('.semi-sidesheet, [class*="music-collection-container"]')) continue;
|
|
702
|
+
const text = (b.innerText || '').trim();
|
|
703
|
+
if (text.length <= 250 && text.replace(/\\s+/g, '').includes(want)) return true;
|
|
704
|
+
}
|
|
675
705
|
return false;
|
|
676
706
|
})()`, { timeoutMs: timing.evalTimeoutMs }).catch(() => false), { tries: 10, gapMs: 500, budgetMs: timing.waitBudgetMs });
|
|
677
707
|
return verified ? { ok: true } : { ok: false, error: '已点击使用,但编辑页未确认显示歌名' };
|
package/lib/gateway-media.js
CHANGED
|
@@ -509,7 +509,8 @@ export const mediaMethods = {
|
|
|
509
509
|
}
|
|
510
510
|
try {
|
|
511
511
|
const id = await this.channel.send(target, [{ type: 'record', data: { file: `base64://${bytes.toString('base64')}` } }]);
|
|
512
|
-
|
|
512
|
+
// #160:带上 target(发到哪个聊天),否则这条只进内存、重启后又取不到了
|
|
513
|
+
this.rememberOwn?.(id, `[语音] ${said}`, target);
|
|
513
514
|
this.note('sent', { channelId: target, title: 'QQ·主人', text: `🔊${said}`, reason: `${where}里要的语音,发到 QQ 私聊` });
|
|
514
515
|
this.soul.journalOut?.(target, `[语音] ${said}`);
|
|
515
516
|
} catch (error) {
|
package/lib/gateway-util.js
CHANGED
|
@@ -194,6 +194,10 @@ export function sessionChannelOf(channelId) {
|
|
|
194
194
|
|
|
195
195
|
/** 通道 id → 给人看的平台名(跨平台注入时标明「这句是在哪儿说的」)。 */
|
|
196
196
|
export function platformLabelOf(channelId) {
|
|
197
|
+
// 桌面端先认原始 channelId:sessionChannelOf('dsh') 会落到 'qq-private'(它只按
|
|
198
|
+
// bili / douyin / group 前缀分流),所以以前那个 `kind === 'dsh'` 分支永远不命中。
|
|
199
|
+
// 这里不去改 sessionChannelOf —— 它还用来判「是不是群 / 是不是私聊」,动它会牵一片。
|
|
200
|
+
if (String(channelId ?? '') === 'dsh') return 'DSH 桌面端';
|
|
197
201
|
const kind = sessionChannelOf(channelId);
|
|
198
202
|
if (kind === 'bili-private') return 'B站私信';
|
|
199
203
|
if (kind === 'douyin-private') return '抖音私信';
|
|
@@ -202,6 +206,22 @@ export function platformLabelOf(channelId) {
|
|
|
202
206
|
return 'QQ 私聊';
|
|
203
207
|
}
|
|
204
208
|
|
|
209
|
+
/**
|
|
210
|
+
* 这一轮的消息是从哪儿发来的(#78)。
|
|
211
|
+
*
|
|
212
|
+
* 🔴 不能用「会话绑定的通道」推断:会话合并之后 B站/抖音私信都并进了 QQ 会话,
|
|
213
|
+
* boundChannel 永远是 QQ ⇒ DSH 里打的字会被说成 QQ。权威来源有两个:
|
|
214
|
+
* ① `desktop`:宿主在 DSH 界面里打字的轮次(beginTurn 的 desktop 标志);
|
|
215
|
+
* ② 这一轮的 channelId:B站 / 抖音 / 群 是从哪个通道进来的。
|
|
216
|
+
*
|
|
217
|
+
* @param {{desktop?: boolean, channelId?: string}} o
|
|
218
|
+
* @returns {string} 例如「QQ 私聊」「DSH 桌面端」
|
|
219
|
+
*/
|
|
220
|
+
export function sourceLabelOf({ desktop = false, channelId = '' } = {}) {
|
|
221
|
+
if (desktop === true) return 'DSH 桌面端';
|
|
222
|
+
return platformLabelOf(channelId);
|
|
223
|
+
}
|
|
224
|
+
|
|
205
225
|
/** 是不是群聊(QQ 群 / 抖音群)。 */
|
|
206
226
|
export function isGroupChannelId(channelId) {
|
|
207
227
|
const s = String(channelId ?? '');
|
package/lib/gateway.js
CHANGED
|
@@ -133,6 +133,9 @@ const IMAGE_EXT = new Set(['.png', '.jpg', '.jpeg', '.gif', '.webp']);
|
|
|
133
133
|
const IMAGE_LIST_LIMIT = 64;
|
|
134
134
|
const MAX_PARAGRAPHS = 5;
|
|
135
135
|
const SEEN_LIMIT = 4000;
|
|
136
|
+
/** 带通道的出站消息缓存键(channel_id 与 message_id 之间用一个不会出现的分隔符)。 */
|
|
137
|
+
const ownKey = (channelId, messageId) => `${channelId}\u0000${messageId}`;
|
|
138
|
+
|
|
136
139
|
const OWN_LIMIT = 500;
|
|
137
140
|
/** 戳一戳的冷却表上限(无界 Map 会随「不同人 × 不同群」长期累积)。 */
|
|
138
141
|
const POKE_LIMIT = 500;
|
|
@@ -230,7 +233,7 @@ export class ChatGateway {
|
|
|
230
233
|
db, channel, log: this.log,
|
|
231
234
|
windowMs: () => clampReplyWindow(this.qqConfig().replyWindowMinutes) * 60_000,
|
|
232
235
|
onSent: (id, item) => {
|
|
233
|
-
this.rememberOwn(id, item.text);
|
|
236
|
+
this.rememberOwn(id, item.text, item.channel_id);
|
|
234
237
|
this.note('sent', { channelId: item.channel_id, title: item.title, text: item.text || '[图片]', reason: `重发成功(第 ${item.attempts + 1} 次)` });
|
|
235
238
|
},
|
|
236
239
|
onGiveUp: (item, reason) => {
|
|
@@ -286,6 +289,12 @@ export class ChatGateway {
|
|
|
286
289
|
this.seen = new Set();
|
|
287
290
|
/** 她自己发出的消息 id → 正文摘要(识别"引用我"、给引用补原文) */
|
|
288
291
|
this.ownMessages = new Map();
|
|
292
|
+
// #160:引用查询专用的缓存,键是 (channel_id, message_id)。
|
|
293
|
+
// ownMessages 不能改键形状 —— normalizeMessageEvent 用它的 .has(id) 判断
|
|
294
|
+
// 「这条引用的是不是我」(那条路没有 channelId 上下文,只有裸 id)。
|
|
295
|
+
// 但引用查询**有** channelId,而 message_id 只在聊天内唯一 ——
|
|
296
|
+
// 用裸 id 查,A 聊天缓存过的号会被 B 聊天命中 ⇒ 引用到别人聊天里的话。
|
|
297
|
+
this.ownMessagesByChannel = new Map();
|
|
289
298
|
/** channelId → [{name, text, timeMs, messageId}](群里没点名的话) */
|
|
290
299
|
this.backlog = new Map();
|
|
291
300
|
/** channelId → 插话的时间戳(每小时上限 / 冷却) */
|
|
@@ -1524,10 +1533,45 @@ export class ChatGateway {
|
|
|
1524
1533
|
batch.timer.unref?.();
|
|
1525
1534
|
}
|
|
1526
1535
|
|
|
1527
|
-
|
|
1536
|
+
/**
|
|
1537
|
+
* 这条消息是不是她自己发的、说了什么(#160)。
|
|
1538
|
+
*
|
|
1539
|
+
* 先查内存(这次运行里发的,最快),再查库(重启之前发的)。
|
|
1540
|
+
* 库这一步是必须的:QQ 的消息号会跨天复用,而 `get_msg` 取回来的是「这个号现在指的那条」——
|
|
1541
|
+
* 宿主一重启内存就空了,于是取到隔天那条、被时间校验收掉 ⇒ 一直显示「原文没取到」。
|
|
1542
|
+
*
|
|
1543
|
+
* @param {string} replyId
|
|
1544
|
+
* @param {string} channelId 在哪个聊天里被引用的(消息号只在聊天内唯一,同号在不同聊天是两条消息)
|
|
1545
|
+
* @returns {string} 她说的原文;不是她发的(或查不到)返回 ''
|
|
1546
|
+
*/
|
|
1547
|
+
ownMessageText(replyId, channelId) {
|
|
1548
|
+
const id = String(replyId ?? '');
|
|
1549
|
+
if (id === '') return '';
|
|
1550
|
+
const ch = String(channelId ?? '');
|
|
1551
|
+
// 有通道就只认「这个通道里发的那条」—— message_id 只在聊天内唯一,
|
|
1552
|
+
// 拿裸 id 查会把别的聊天的同号消息当成她说的。
|
|
1553
|
+
if (ch !== '') {
|
|
1554
|
+
const hit = this.ownMessagesByChannel.get(ownKey(ch, id));
|
|
1555
|
+
if (hit !== undefined) return hit;
|
|
1556
|
+
} else {
|
|
1557
|
+
// 没有通道上下文(老调用方):只能退回裸 id 查 —— 那是原来的行为。
|
|
1558
|
+
const mem = this.ownMessages.get(id);
|
|
1559
|
+
if (mem !== undefined) return mem;
|
|
1560
|
+
}
|
|
1561
|
+
try {
|
|
1562
|
+
const row = this.db.prepare('SELECT text FROM own_message WHERE channel_id = ? AND message_id = ?').get(ch, id);
|
|
1563
|
+
if (row === undefined) return '';
|
|
1564
|
+
// 查到了顺手塞回内存:同一条被引用多次时不用反复查库
|
|
1565
|
+
this.rememberOwnCacheOnly(id, String(row.text ?? ''), ch);
|
|
1566
|
+
return String(row.text ?? '');
|
|
1567
|
+
} catch { /* 表还没建出来 / 库忙:退回问 OneBot,别让引用整条挂掉 */ }
|
|
1568
|
+
return '';
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
async quoteLine(replyId, channelId = '') {
|
|
1528
1572
|
if (!replyId) return '';
|
|
1529
|
-
const own = this.
|
|
1530
|
-
if (own !==
|
|
1573
|
+
const own = this.ownMessageText(replyId, channelId);
|
|
1574
|
+
if (own !== '') return `【引用 我自己:${own.slice(0, 40)}】`;
|
|
1531
1575
|
const msg = await this.channel.getMessage(replyId);
|
|
1532
1576
|
// 取不到原文就说取不到,别让模型以为引用了句空话然后瞎接
|
|
1533
1577
|
if (!msg) return '【引用了一条消息(原文没取到)】';
|
|
@@ -1654,7 +1698,7 @@ export class ChatGateway {
|
|
|
1654
1698
|
|
|
1655
1699
|
const lines = [];
|
|
1656
1700
|
for (const { m } of items) {
|
|
1657
|
-
const quote = platform === 'qq' ? await this.quoteLine(m.replyId) : '';
|
|
1701
|
+
const quote = platform === 'qq' ? await this.quoteLine(m.replyId, channelId) : '';
|
|
1658
1702
|
const body = `${quote}${m.text || '(空消息)'}`;
|
|
1659
1703
|
// 群里一行一个人:对方自己打的换行压成 ⏎,免得有人换行伪造「主人:……」(【】是插件生成的块,比如合并转发,对方打不出来,原样留着)
|
|
1660
1704
|
const flat = body.split(/(【[^】]*】)/).map((part, i) => (i % 2 === 1 ? part : part.replace(/\s*\n\s*/g, ' ⏎ '))).join('');
|
|
@@ -2147,10 +2191,52 @@ export class ChatGateway {
|
|
|
2147
2191
|
} catch (error) { this.log('warn', `[fish-soul] DSH 语音保存失败:${String(error instanceof Error ? error.message : error)}`); }
|
|
2148
2192
|
}
|
|
2149
2193
|
|
|
2150
|
-
|
|
2194
|
+
/** 只进内存、不写库:给「从库里读出来之后回填」用。 */
|
|
2195
|
+
rememberOwnCacheOnly(messageId, text, channelId = '') {
|
|
2151
2196
|
if (!messageId) return;
|
|
2152
|
-
|
|
2197
|
+
const id = String(messageId);
|
|
2198
|
+
this.ownMessages.set(id, text);
|
|
2153
2199
|
if (this.ownMessages.size > OWN_LIMIT) this.ownMessages.delete(this.ownMessages.keys().next().value);
|
|
2200
|
+
const ch = String(channelId ?? '');
|
|
2201
|
+
if (ch === '') return;
|
|
2202
|
+
this.ownMessagesByChannel.set(ownKey(ch, id), text);
|
|
2203
|
+
if (this.ownMessagesByChannel.size > OWN_LIMIT) this.ownMessagesByChannel.delete(this.ownMessagesByChannel.keys().next().value);
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
/**
|
|
2207
|
+
* 记下她自己刚发出去的一条消息(#160)。
|
|
2208
|
+
*
|
|
2209
|
+
* 内存 + 库都写:内存给这次运行用(快),库给重启后 / 跨天复用消息号时用。
|
|
2210
|
+
* 写库失败只记 warn —— 这是引用回复的兜底,不能因为它把发送流程打挂
|
|
2211
|
+
* (本项目踩过:定时器路径上抛错 = 进程退出)。
|
|
2212
|
+
*/
|
|
2213
|
+
rememberOwn(messageId, text, channelId = '') {
|
|
2214
|
+
if (!messageId) return;
|
|
2215
|
+
this.rememberOwnCacheOnly(messageId, text, channelId);
|
|
2216
|
+
const ch = String(channelId ?? '');
|
|
2217
|
+
// 没给 channelId 就只进内存 —— 宁可在库里留个空,也不要写进错的聊天
|
|
2218
|
+
// (消息号只在聊天内唯一,写错聊天 = 引用到别人的话)。
|
|
2219
|
+
if (ch === '') return;
|
|
2220
|
+
try {
|
|
2221
|
+
this.db.prepare('INSERT OR REPLACE INTO own_message(channel_id, message_id, text, at) VALUES(?,?,?,?)')
|
|
2222
|
+
.run(ch, String(messageId), String(text ?? '').slice(0, 500), Date.now());
|
|
2223
|
+
this.pruneOwnMessages();
|
|
2224
|
+
} catch (error) {
|
|
2225
|
+
this.log('warn', `[fish-soul] 出站消息落库失败(重启后引用她会退化成问 OneBot):${String(error instanceof Error ? error.message : error)}`);
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
/**
|
|
2230
|
+
* 清掉太老的 own_message(默认留 7 天)。
|
|
2231
|
+
* 一天最多跑一次:每发一条消息都 DELETE 全表不值得。
|
|
2232
|
+
*/
|
|
2233
|
+
pruneOwnMessages() {
|
|
2234
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
2235
|
+
try {
|
|
2236
|
+
if (getKv(this.db, 'own_message.pruned', '') === today) return;
|
|
2237
|
+
setKv(this.db, 'own_message.pruned', today);
|
|
2238
|
+
this.db.prepare('DELETE FROM own_message WHERE at < ?').run(Date.now() - 7 * 86_400_000);
|
|
2239
|
+
} catch { /* 清理失败不影响发送 */ }
|
|
2154
2240
|
}
|
|
2155
2241
|
|
|
2156
2242
|
/**
|
|
@@ -2327,10 +2413,10 @@ export class ChatGateway {
|
|
|
2327
2413
|
}
|
|
2328
2414
|
}
|
|
2329
2415
|
const messages = paragraphs.map((p, i) => (voiced[i] ? [voiced[i]] : isGroup ? 拆成消息段(p) : [{ type: 'text', data: { text: p } }]));
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2416
|
+
// #161:图片一张一条,不并进最后那条文字。
|
|
2417
|
+
// 以前 push 进最后一条的段数组 ⇒ OneBot 收到一个 message 里 [text, image] 两段
|
|
2418
|
+
// ⇒ QQ 渲染成「文字带着图」一个气泡,用户没法单独转发那张图,排布也挤。
|
|
2419
|
+
for (const one of images) messages.push([one]);
|
|
2334
2420
|
// 语音消息不能带引用
|
|
2335
2421
|
if (replyTo && messages[0][0]?.type !== 'record') messages[0].unshift({ type: 'reply', data: { id: String(replyTo) } });
|
|
2336
2422
|
let allOk = true;
|
|
@@ -2349,7 +2435,7 @@ export class ChatGateway {
|
|
|
2349
2435
|
if (i > 0) await this.sleep(Math.min(6000, typingDelayMs(paragraphs[i] ?? '', this.random) * profile.delay));
|
|
2350
2436
|
try {
|
|
2351
2437
|
const id = await this.channel.send(row.channel_id, segs, convId);
|
|
2352
|
-
this.rememberOwn(id, text);
|
|
2438
|
+
this.rememberOwn(id, text, row.channel_id);
|
|
2353
2439
|
} catch (error) {
|
|
2354
2440
|
const msg = String(error instanceof Error ? error.message : error);
|
|
2355
2441
|
if (classifySendError(error) === 'retry') {
|
package/lib/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import { loadSharp, sharpReady } from './imageconv.js';
|
|
|
49
49
|
import {
|
|
50
50
|
ChatGateway, SOURCE_QQ, SOURCE_PROACTIVE, SOURCE_BILI, SOURCE_DOUYIN, CHAT_TOOLS, RELAY_TOOL, RELAY_FRIEND_TOOL, DOUYIN_VIDEO_TOOL, WEB_TOOLS, OWN_WEB_TOOL, isOpenMotionTool, splitChannelId, sessionChannelOf
|
|
51
51
|
} from './gateway.js';
|
|
52
|
-
import { platformLabelOf, platformOf, parseRelayTarget } from './gateway-util.js';
|
|
52
|
+
import { platformLabelOf, platformOf, parseRelayTarget, sourceLabelOf } from './gateway-util.js';
|
|
53
53
|
import { douyinVideoIdsOf } from './douyin-adapter.js';
|
|
54
54
|
import { VirtualClock } from './clock.js';
|
|
55
55
|
import { EmbeddingClient, VectorWorker, recall, recallSync, vectorRanks } from './retrieval.js';
|
|
@@ -750,7 +750,12 @@ async function startup(ctx, config, { log, gate }) {
|
|
|
750
750
|
const inDouyinGroup = session.channel === 'douyin-group';
|
|
751
751
|
const speakers = session.speakers ?? [];
|
|
752
752
|
if (speakers.length > 0) {
|
|
753
|
-
|
|
753
|
+
// #78:这一轮是从哪个平台进来的。
|
|
754
|
+
// 🔴 不能拿会话绑定的通道推断:会话合并之后 B站私信 / 抖音私信都并进了 QQ 会话,
|
|
755
|
+
// boundChannel 永远是 QQ,那样 DSH 里打的字会被说成 QQ(或反过来)。
|
|
756
|
+
// 权威来源是 beginTurn 的 desktop 标志 + 这一轮的 channelId。
|
|
757
|
+
const fromLabel = sourceLabelOf({ desktop: session.desktop === true, channelId: session.channelId ?? '' });
|
|
758
|
+
lines.push(`[当前说话人] ${speakers.map((s) => `${s.displayName}(${s.ownerId === UNKNOWN_OWNER ? '身份未识别' : STAGE_LABEL[s.person?.relation_stage] ?? '陌生人'})`).join('、')};这条消息是从${fromLabel}发来的`);
|
|
754
759
|
}
|
|
755
760
|
const now = clock.now();
|
|
756
761
|
const inGroup = session.channel === 'qq-group' || inDouyinGroup;
|
package/lib/life.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { VirtualClock } from './clock.js';
|
|
19
19
|
import { getKv, setKv, getProfile, setProfile } from './db.js';
|
|
20
|
-
import { PROFILE_FIELDS, mergeProfileFields, settleAffinity, ensureBirthdayPending, stageBase } from './soul-memory.js';
|
|
20
|
+
import { PROFILE_FIELDS, mergeProfileFields, settleAffinity, ensureBirthdayPending, stageBase, roleDayLabel } from './soul-memory.js';
|
|
21
21
|
import { douyinVideoIdsOf } from './douyin-adapter.js';
|
|
22
22
|
import { pad2 } from './time-util.js';
|
|
23
23
|
|
|
@@ -844,6 +844,47 @@ export class LifeEngine {
|
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
+
/**
|
|
848
|
+
* 这个人在聊天存档里的通道名(#166)。
|
|
849
|
+
*
|
|
850
|
+
* 🔴 存档里存的是 gateway 的 channelId(`private:<QQ>` / `bili:<uid>` / `douyin:<昵称>`),
|
|
851
|
+
* 不是 `qq:<uin>`,也不是 canonical_id。以前拼的是后者 ⇒ 永远对不上 ⇒ 每次都落到
|
|
852
|
+
* 「无过滤全库取样」⇒ 整理某个人的印象时喂进去的是主人和群里的话(#166 串台的真根因)。
|
|
853
|
+
*
|
|
854
|
+
* 候选来源两处:这个人**自己的记忆行**里的 channel_id(= 存档键;抖音那路靠它 ——
|
|
855
|
+
* person 里是 `douyin:<uid>`、存档里是 `douyin:<昵称>`,不硬猜昵称),以及 person 行的
|
|
856
|
+
* qq_uin / bili_uid。群通道一律排除(他在群里说的话不是"他和我的对话")。
|
|
857
|
+
*
|
|
858
|
+
* @param {object|null} person
|
|
859
|
+
* @param {Array<{channel?: string, channel_id?: string}>} recent 这个人近期的记忆行
|
|
860
|
+
* @returns {string[]}
|
|
861
|
+
*/
|
|
862
|
+
transcriptChannelsOf(person, recent = []) {
|
|
863
|
+
const out = [];
|
|
864
|
+
const add = (ch) => {
|
|
865
|
+
const c = String(ch ?? '').trim();
|
|
866
|
+
if (c === '') return;
|
|
867
|
+
// 群通道一律排除:他在群里说的话不是"他和我的对话"
|
|
868
|
+
if (c.startsWith('group:') || c.startsWith('douyin-group:')) return;
|
|
869
|
+
if (!out.includes(c)) out.push(c);
|
|
870
|
+
};
|
|
871
|
+
// ① 这个人自己的记忆行:channel_id 存的就是存档键
|
|
872
|
+
for (const m of Array.isArray(recent) ? recent : []) {
|
|
873
|
+
// 只认私聊通道 —— 群聊的 channel 不算
|
|
874
|
+
if (m?.channel !== 'qq-private' && m?.channel !== 'bili-private' && m?.channel !== 'douyin-private') continue;
|
|
875
|
+
add(m.channel_id);
|
|
876
|
+
}
|
|
877
|
+
// ② person 行本身:QQ / B站 的 id 能直接推出存档键
|
|
878
|
+
if (person !== null && person !== undefined) {
|
|
879
|
+
const qq = String(person.qq_uin ?? '').trim();
|
|
880
|
+
// 只要求是纯数字:存档键本身已经能定位一个私聊,不再对号长做额外限制
|
|
881
|
+
if (/^\d+$/.test(qq)) add(`private:${qq}`);
|
|
882
|
+
const bili = String(person.bili_uid ?? '').trim();
|
|
883
|
+
if (bili !== '') add(`bili:${bili}`);
|
|
884
|
+
}
|
|
885
|
+
return out;
|
|
886
|
+
}
|
|
887
|
+
|
|
847
888
|
/**
|
|
848
889
|
* 给 Dream 取一段「原文」当参照(默认关,见 memory.transcriptReview)。
|
|
849
890
|
*
|
|
@@ -851,11 +892,18 @@ export class LifeEngine {
|
|
|
851
892
|
* 不能因为它把 Dream 卡住或者让整理失败。
|
|
852
893
|
*
|
|
853
894
|
* 时间窗取「这批记忆里最早那条到现在」,太长没意义,所以夹到 14 天。
|
|
854
|
-
*
|
|
895
|
+
*
|
|
896
|
+
* 候选通道名来自两处:这个人**自己的记忆行**里的 channel_id(= 存档键,抖音昵称那条路靠它)、
|
|
897
|
+
* 以及 person 行的 qq_uin / bili_uid。
|
|
898
|
+
*
|
|
899
|
+
* 🔴 **取不到就返回空串,绝不退化成无过滤取样。**
|
|
900
|
+
* 以前那一步「宁可给宽一点」把全库原文塞了进来,于是给抖音陌生人整理印象时,
|
|
901
|
+
* 模型看到的是主人 45 条私聊 + 群里 757 条 ⇒ 把主人的事写成这个人的(#166)。
|
|
902
|
+
* 少一段原文只是复核得糙一点;多一段别人的原文是**记错人**,后者坏得多。
|
|
855
903
|
*
|
|
856
904
|
* @param {string} ownerId 这轮整理谁的记忆
|
|
857
905
|
* @param {Array<{created_at:number}>} recent 这批记忆(用来定时间窗)
|
|
858
|
-
* @param {object|null} person
|
|
906
|
+
* @param {object|null} person 这个人(用来拼通道名)
|
|
859
907
|
* @returns {string} 拼好的原文行;没开 / 拿不到 = ''
|
|
860
908
|
*/
|
|
861
909
|
transcriptSample(ownerId, recent, person) {
|
|
@@ -871,20 +919,22 @@ export class LifeEngine {
|
|
|
871
919
|
// 留 1 小时缓冲,够覆盖「一轮聊完才整理」的间隔。
|
|
872
920
|
const since = Math.max(earliest - 3600_000, until - 14 * 86_400_000);
|
|
873
921
|
const limit = Math.min(200, Math.max(1, Math.floor(Number(cfg.transcriptMaxLines) || 40)));
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
922
|
+
const channels = this.transcriptChannelsOf(person, recent);
|
|
923
|
+
if (channels.length === 0) return '';
|
|
924
|
+
const rows = [];
|
|
877
925
|
for (const ch of channels) {
|
|
878
|
-
|
|
879
|
-
if (rows.length
|
|
926
|
+
for (const row of this.transcripts.sample({ channel: ch, since, until, limit })) rows.push(row);
|
|
927
|
+
if (rows.length >= limit) break;
|
|
880
928
|
}
|
|
881
|
-
if (rows.length === 0) rows = this.transcripts.sample({ since, until, limit });
|
|
882
929
|
if (rows.length === 0) return '';
|
|
883
|
-
//
|
|
930
|
+
// 时间正序,太长就截断单条。
|
|
931
|
+
// 时间戳按角色时区(UTC+8)标:原来用 toISOString() 是 UTC,比角色时区差 8 小时,
|
|
932
|
+
// 模型据此判断"几点说的"会整体偏早(#167 同族:日期/时刻一律用角色时区)。
|
|
884
933
|
return rows
|
|
885
934
|
.slice()
|
|
886
|
-
.
|
|
887
|
-
.
|
|
935
|
+
.sort((a, b) => Number(a.at) - Number(b.at))
|
|
936
|
+
.slice(-limit)
|
|
937
|
+
.map((r) => `[${new Date(Number(r.at) + 8 * 3600_000).toISOString().slice(5, 16).replace('T', ' ')}] ${r.self ? '我' : (person?.display_name ?? '对方')}:${String(r.content).slice(0, 200)}`)
|
|
888
938
|
.join('\n');
|
|
889
939
|
} catch { return ''; }
|
|
890
940
|
}
|
|
@@ -904,7 +954,7 @@ export class LifeEngine {
|
|
|
904
954
|
this.dreamControllers.set(ownerId, controller);
|
|
905
955
|
try {
|
|
906
956
|
const recent = this.db.prepare(`
|
|
907
|
-
SELECT id, kind, content, emotion, importance, created_at FROM memory
|
|
957
|
+
SELECT id, kind, content, emotion, importance, created_at, channel, channel_id FROM memory
|
|
908
958
|
WHERE character_id = 'feiyu' AND owner_id = ? AND status = 'active' AND valid_to IS NULL
|
|
909
959
|
ORDER BY created_at DESC LIMIT 50
|
|
910
960
|
`).all(ownerId);
|
|
@@ -925,7 +975,7 @@ export class LifeEngine {
|
|
|
925
975
|
const name = person?.display_name ?? ownerId;
|
|
926
976
|
|
|
927
977
|
const text = await this.callLlm(
|
|
928
|
-
`整理「${name}」(${ownerId})的近期记忆(共 ${recent.length}
|
|
978
|
+
`整理「${name}」(${ownerId})的近期记忆(共 ${recent.length} 条,新的在前)。今天是 ${roleDayLabel(this.clock.now())}。只输出 JSON:` +
|
|
929
979
|
`{"missedPending":[{"dueInHours":数字,"reason":"..."}],` +
|
|
930
980
|
`"suggestedRelationStage":"stranger|acquaintance|friend|close|null"` +
|
|
931
981
|
(writeProfile ? `,"profileFields":{${PROFILE_FIELDS.map(([k, l]) => `"${k}":"${l}(≤30 字,不知道就空)"`).join(',')}}` : '') +
|
|
@@ -937,6 +987,8 @@ export class LifeEngine {
|
|
|
937
987
|
// reason 里写「原文实际说的是什么」,因为这条会从历史真相里彻底排除。
|
|
938
988
|
'outdated 只填被更新的记忆明确推翻的旧事实(比如搬家、换工作、分手),拿不准就空着;' +
|
|
939
989
|
'corrected 只填和原文明确冲突的(下面给了原文时才有意义),拿不准就空着 —— 宁可漏填,别把真事判成记错。' +
|
|
990
|
+
// #167:模型不知道今天是几号就会自己猜。写进印象的绝对日期一律以开头给的「今天」为准。
|
|
991
|
+
'要写具体日期(几月几号)时以开头给的「今天」为准,别自己估;不确定就写相对说法,别编一个日期。' +
|
|
940
992
|
(profile ? `现在的印象:${profile.text}。` : '') +
|
|
941
993
|
(writeProfile && profile?.lockedFields?.length ? `(${profile.lockedFields.map((k) => PROFILE_FIELDS.find(([f]) => f === k)?.[1] ?? k).join('、')}是主人写的,不用填)` : '') +
|
|
942
994
|
`近期记忆:${recent.map((m) => `#${m.id}[${day(m.created_at)}] ${m.content}`).join(';')}` +
|
package/lib/soul-memory.js
CHANGED
|
@@ -37,6 +37,25 @@ export function relTime(ms, now) {
|
|
|
37
37
|
|
|
38
38
|
export const KIND_LABEL = { fact: '事实', event: '事件', feeling: '感受', episode: '聊过', diary: '日记', weekly: '周记' };
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* 角色时区里「今天是几月几号星期几」,给整理记忆用的提示词。
|
|
42
|
+
*
|
|
43
|
+
* #167 的真根因:整理记忆的提示词里只有相对时间(「刚才 / 昨天 / 3 天前」,来自 relTime),
|
|
44
|
+
* 模型要写绝对日期就只能自己猜 ⇒ 今天 20 号,记忆正文里写成 19 号。
|
|
45
|
+
* 年 / 月 / 日 / 星期都要给全:缺了星期,它也编得出"周三"。
|
|
46
|
+
*
|
|
47
|
+
* @param {number} ms 虚拟钟(角色时间)
|
|
48
|
+
* @returns {string} 例如「2026年11月20日 星期五」
|
|
49
|
+
*/
|
|
50
|
+
export function roleDayLabel(ms) {
|
|
51
|
+
const t = new Date(Number(ms) + TZ);
|
|
52
|
+
const y = t.getUTCFullYear();
|
|
53
|
+
const m = t.getUTCMonth() + 1;
|
|
54
|
+
const d = t.getUTCDate();
|
|
55
|
+
const w = '日一二三四五六'[t.getUTCDay()];
|
|
56
|
+
return `${y}年${m}月${d}日 星期${w}`;
|
|
57
|
+
}
|
|
58
|
+
|
|
40
59
|
// ───────────────────────── 关系 ─────────────────────────
|
|
41
60
|
|
|
42
61
|
export const STAGES = ['stranger', 'acquaintance', 'friend', 'close'];
|
|
@@ -539,7 +558,7 @@ export class ChatDigester {
|
|
|
539
558
|
const growing = g.enabled === true;
|
|
540
559
|
const where = isGroup ? `群「${this.titleOf?.(channelId) ?? channelId}」里` : `和${[...owners.keys()][0]}私聊`;
|
|
541
560
|
const prompt =
|
|
542
|
-
`你在帮「${me}
|
|
561
|
+
`你在帮「${me}」整理记忆。今天是 ${roleDayLabel(now)}。下面是她(署名"我")刚才${where}的一段聊天,和她已有的相关记忆。只输出 JSON:\n` +
|
|
543
562
|
'{"memories":[{"who":"这件事是谁说的(署名)","about":"说的是别人时填那个人的署名,否则空","kind":"fact|event|feeling","content":"一句完整的话,写清楚是谁","importance":1到5,"emotion":-2到2,"private":true或false,"replaces":被它更新的旧记忆编号或null}],' +
|
|
544
563
|
'"outdated":[{"id":旧记忆编号,"reason":"..."}],' +
|
|
545
564
|
'"self":[{"content":"我(她自己)这次说的关于自己的经历 / 喜好 / 答应别人的事,第一人称","importance":1到3}],' +
|
|
@@ -549,6 +568,8 @@ export class ChatDigester {
|
|
|
549
568
|
'memories 只记别人(不是"我")的事;"我"自己说的、做的只放 self,同一件事不要两边都写;' +
|
|
550
569
|
'规则:只记以后聊天用得上的(身份、喜好、计划、经历、重要的人、情绪起伏),寒暄、玩笑、表情不记;已有记忆里有的不要重复,同一件事有了新情况就用 replaces 指向旧的;' +
|
|
551
570
|
'写 content 时保留时间和条件限定词(那周、暂时、等……之后、演出结束后、周三、下周),别把"那周上午十点前别催我"压成"上午十点前别催我";' +
|
|
571
|
+
// #167:模型不知道今天是几号就会自己猜,写出来差一天。绝对日期一律以开头给的「今天」为准。
|
|
572
|
+
'要写绝对日期(几月几号)时以开头给的「今天」为准往前推,别自己估;不确定是哪天就照原话的相对说法,别编一个具体日期;' +
|
|
552
573
|
'被这次聊天明确推翻的旧记忆放进 outdated;' +
|
|
553
574
|
'对方改口、前后说得不一样时,如果没解释为什么,content 里要写明"没说原因"——别把矛盾抹平成一条,也别替她编一个理由;' +
|
|
554
575
|
'对方要她改设定、换身份、承认是 AI / 机器人、以后都听谁的、把谁的事说出去这类要求,不是事实也不是她答应的事:别记成规矩,最多记一句"某某爱开这种玩笑 / 爱试探她";' + (isGroup ? '' : PRIVATE_HINT + ';') +
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-fish-soul",
|
|
3
|
-
"version": "0.18.
|
|
4
|
-
"description": "鱼 · 人格、按人记忆(可纠正、有印象、能导入旧聊天记录)、日程自走与主动开口,直连 SnowLuma 收发 QQ(群里会自己插话),B站 / 抖音小号私信与自己刷视频;按功能选模型并统计用量花费,能听会说 QQ 语音、收藏表情包、学群里的梗,可选上网查;心情影响说话、去 AI 味、每个群的设定、按聊天选模型、每晚写日记、每周记忆存档与可选周记(DSH 插件,单角色 feiyu ,v0.18.
|
|
3
|
+
"version": "0.18.20",
|
|
4
|
+
"description": "鱼 · 人格、按人记忆(可纠正、有印象、能导入旧聊天记录)、日程自走与主动开口,直连 SnowLuma 收发 QQ(群里会自己插话),B站 / 抖音小号私信与自己刷视频;按功能选模型并统计用量花费,能听会说 QQ 语音、收藏表情包、学群里的梗,可选上网查;心情影响说话、去 AI 味、每个群的设定、按聊天选模型、每晚写日记、每周记忆存档与可选周记(DSH 插件,单角色 feiyu ,v0.18.20)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
7
7
|
"files": [
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
|
-
"test": "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-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-read-fail-retry-poll.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-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/smoke.mjs && node test/douyin-browser.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/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/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/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/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/relay-other-platform.mjs && node test/relay-to-friend.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/memory-source-label.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-visibility.mjs && node test/bili-allowlist.mjs && node test/douyin-master-uid-mismatch.mjs && node test/image-inbound-fail.mjs && node test/group-backlog-images.mjs && node test/group-master-tag.mjs && node test/check-test-chain.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/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/douyin-video-wire.mjs && node test/video-gen.mjs",
|
|
67
|
+
"test": "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-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-read-fail-retry-poll.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-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/smoke.mjs && node test/douyin-browser.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/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/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/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/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/relay-other-platform.mjs && node test/relay-to-friend.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/dream-transcript-scope.mjs && node test/memory-date-context.mjs && node test/context-source-platform.mjs && node test/memory-source-label.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-visibility.mjs && node test/bili-allowlist.mjs && node test/douyin-master-uid-mismatch.mjs && node test/image-inbound-fail.mjs && node test/group-backlog-images.mjs && node test/group-master-tag.mjs && node test/check-test-chain.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/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/douyin-video-wire.mjs && node test/video-gen.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
|
}
|