dsh-fish-soul 0.19.8 → 0.19.10
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 +38 -5
- package/lib/browse.js +1 -1
- package/lib/channels/vendor/douyin-bridge/browser.mjs +9 -0
- package/lib/channels/vendor/douyin-bridge/douyin-dm.mjs +2 -2
- package/lib/douyin-browse.js +1 -1
- package/lib/gateway-media.js +3 -2
- package/lib/gateway.js +45 -12
- package/lib/outbox.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/behavior.js
CHANGED
|
@@ -296,18 +296,42 @@ export function normSentText(s) {
|
|
|
296
296
|
* ≥ minLen 字、且跟窗口 windowMs 内某条完全一致或二元组相似度 ≥ threshold 的,返回它们的下标。
|
|
297
297
|
* 短句允许重复("哈哈哈哈"这种不该误杀)。
|
|
298
298
|
*/
|
|
299
|
-
export function findRepeatedParagraphs(history, paragraphs, { now = Date.now(), windowMs = 120000, minLen = 12, threshold = 0.8 } = {}) {
|
|
299
|
+
export function findRepeatedParagraphs(history, paragraphs, { now = Date.now(), windowMs = 120000, minLen = 12, threshold = 0.8, allowRestate = false } = {}) {
|
|
300
300
|
const recent = (Array.isArray(history) ? history : []).filter((h) => now - Number(h?.at ?? 0) <= windowMs);
|
|
301
301
|
const dups = [];
|
|
302
302
|
(Array.isArray(paragraphs) ? paragraphs : []).forEach((p, i) => {
|
|
303
303
|
const n = normSentText(p);
|
|
304
|
-
if ([...n].length
|
|
305
|
-
|
|
306
|
-
}
|
|
304
|
+
if ([...n].length < minLen) return;
|
|
305
|
+
if (recent.some((h) => isRepeatOf(h, n, minLen, threshold, allowRestate))) dups.push(i);
|
|
307
306
|
});
|
|
308
307
|
return dups;
|
|
309
308
|
}
|
|
310
309
|
|
|
310
|
+
/**
|
|
311
|
+
* 旧话题(stale)里的近义阈值。
|
|
312
|
+
*
|
|
313
|
+
* 不用「stale 就直接跳过近义判定」—— 那等于把近义守卫整体关掉:群里任何人说一句话
|
|
314
|
+
* 都会让上一条记录变 stale,用户看到的「重复」又恰恰多不是逐字节相同。
|
|
315
|
+
* 抬高到 0.95 才是真正的分寸:换个说法(0.87 上下)放行,几乎原样再发一遍(0.95+)仍拦。
|
|
316
|
+
*/
|
|
317
|
+
const STALE_THRESHOLD = 0.95;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* 单条历史是否算这一段话的复读(分寸见 findRepeatedParagraphs 的注释)。
|
|
321
|
+
*
|
|
322
|
+
* - **一字不差**:不管中间有没有人说话、有没有换话题,都算重复。人不会把 5 分钟前
|
|
323
|
+
* 说过的一整段话原样再说一遍;真出现了那就是模型在复读,也正是用户说的「发重复的话」。
|
|
324
|
+
* `allowRestate`(对方明确要求「再说一遍」)时放行 —— 那时原样重发是对的。
|
|
325
|
+
* - **换个近义说法**:同一段对话里按 `threshold`(0.8)判;换了话题(`stale`)后阈值抬到
|
|
326
|
+
* `STALE_THRESHOLD`(0.95)—— 换个说法回答旧问题是自然的,几乎原样再发仍拦。
|
|
327
|
+
*/
|
|
328
|
+
function isRepeatOf(h, n, minLen, threshold, allowRestate = false) {
|
|
329
|
+
const hn = String(h?.norm ?? '');
|
|
330
|
+
if (hn === n) return !allowRestate;
|
|
331
|
+
if ([...hn].length < minLen) return false;
|
|
332
|
+
return bigramDice(hn, n) >= (h?.stale === true ? STALE_THRESHOLD : threshold);
|
|
333
|
+
}
|
|
334
|
+
|
|
311
335
|
/**
|
|
312
336
|
* 去 AI 味(只改写 / 删 / 截短,不撤回):返回 { text, changes }。
|
|
313
337
|
* 改完变成空的(整段都是套话 / AI 自称)返回空字符串,调用方这轮就不发。
|
|
@@ -532,7 +556,16 @@ export function chatModelsConfig(raw) {
|
|
|
532
556
|
return { private: cleanSel(raw?.private), group: cleanSel(raw?.group), overrides: overrides.slice(0, 200) };
|
|
533
557
|
}
|
|
534
558
|
|
|
535
|
-
/**
|
|
559
|
+
/**
|
|
560
|
+
* 这个聊天用哪个模型:单独指定的 → 私聊 / 群聊默认 → null(= 跟 DSH 默认);提供方已经没了的跳过。
|
|
561
|
+
*
|
|
562
|
+
* @param {object} raw 配置
|
|
563
|
+
* @param {string} channelId
|
|
564
|
+
* @param {object} [opts]
|
|
565
|
+
* @param {(provider: string) => boolean} [opts.known] 这个提供方还在不在。
|
|
566
|
+
* ⚠️ 别只写 `= () => true` —— 零参默认值会让 TS 推断成「不接受参数」,
|
|
567
|
+
* 下面 `known(s.provider)` 就报 TS2554(2026-11-28 实测)。
|
|
568
|
+
*/
|
|
536
569
|
export function resolveChatModel(raw, channelId, { known = () => true } = {}) {
|
|
537
570
|
const c = chatModelsConfig(raw);
|
|
538
571
|
const kind = String(channelId ?? '').split(':')[0];
|
package/lib/browse.js
CHANGED
|
@@ -73,7 +73,7 @@ export class BiliBrowser {
|
|
|
73
73
|
* @param {import('./clock.js').VirtualClock} deps.clock
|
|
74
74
|
* @param {import('./channels/bilibili.js').BiliClient} deps.client
|
|
75
75
|
* @param {() => object} deps.getConfig 返回 config.bili
|
|
76
|
-
* @param {(prompt: string) => Promise<string|null>} deps.callLlm
|
|
76
|
+
* @param {(prompt: string, opts?: {feature?: string, maxTokens?: number, images?: any[], needImages?: boolean}) => Promise<string|null>} deps.callLlm
|
|
77
77
|
* @param {() => {name: string, brief: string}} deps.persona
|
|
78
78
|
* @param {{enqueueRealtime(id: number, text: string): void}} [deps.worker]
|
|
79
79
|
* @param {(level: string, msg: string) => void} [deps.log]
|
|
@@ -207,6 +207,15 @@ export async function killTree(pid) {
|
|
|
207
207
|
* 一个受控浏览器实例。
|
|
208
208
|
*/
|
|
209
209
|
export class Browser {
|
|
210
|
+
/**
|
|
211
|
+
* @param {object} opts
|
|
212
|
+
* @param {string} [opts.exe]
|
|
213
|
+
* @param {string} opts.userDataDir
|
|
214
|
+
* @param {number} [opts.port]
|
|
215
|
+
* @param {(msg: string) => void} [opts.log] 日志回调。⚠️ 必须声明参数,别只写 `log = () => {}` ——
|
|
216
|
+
* 零参默认值会让 TS 推断成「不接受任何参数」,下面 `this.log(msg)` 全报 TS2554(2026-11-28 实测 8 处)。
|
|
217
|
+
* @param {string[]} [opts.extraArgs]
|
|
218
|
+
*/
|
|
210
219
|
constructor({ exe, userDataDir, port = 47880, log = () => {}, extraArgs = [] }) {
|
|
211
220
|
this.exe = exe
|
|
212
221
|
/** fish-soul:额外启动参数(静音、无头测试等) */
|
|
@@ -1164,7 +1164,7 @@ function hasNewBubble(before, after) {
|
|
|
1164
1164
|
* 3. 截到 `Page.fileChooserOpened` 后,用 `DOM.setFileInputFiles {backendNodeId}` 塞文件。
|
|
1165
1165
|
* ⚠️ 只对隐藏的 `input[type=file]` 调 `setFileInputFiles` 是**没用**的 ——
|
|
1166
1166
|
* 抖音的隐藏 input 不是真正上传的那个。
|
|
1167
|
-
* 4. 选完文件会弹「发送给
|
|
1167
|
+
* 4. 选完文件会弹「发送给 <对方>」确认框(`MsgInputSendFileModalbox`),
|
|
1168
1168
|
* **真正开始上传是点里面的「发送」按钮**(`MsgInputSendFileModalbtnSure`)。
|
|
1169
1169
|
* 点文字叶子节点不生效,必须点带 `btnSure` class 的那个。
|
|
1170
1170
|
* 5. 上传链路(实测):
|
|
@@ -1220,7 +1220,7 @@ export async function sendImage({ browser, file, uname = '', expectConvId = '',
|
|
|
1220
1220
|
backendNodeId: chooser.params?.backendNodeId,
|
|
1221
1221
|
}, browser.sessionId)
|
|
1222
1222
|
|
|
1223
|
-
// ④ 等「发送给
|
|
1223
|
+
// ④ 等「发送给 <对方>」确认框
|
|
1224
1224
|
let modal = false
|
|
1225
1225
|
for (let i = 0; i < 15; i++) {
|
|
1226
1226
|
await sleep(600)
|
package/lib/douyin-browse.js
CHANGED
|
@@ -137,7 +137,7 @@ export class DouyinBrowser {
|
|
|
137
137
|
* @param {import('./clock.js').VirtualClock} deps.clock
|
|
138
138
|
* @param {import('./channels/douyin.js').DouyinHost} deps.host
|
|
139
139
|
* @param {() => object} deps.getConfig 返回 config.douyin
|
|
140
|
-
* @param {(prompt: string) => Promise<string|null>} deps.callLlm
|
|
140
|
+
* @param {(prompt: string, opts?: {feature?: string, maxTokens?: number, images?: any[], needImages?: boolean}) => Promise<string|null>} deps.callLlm
|
|
141
141
|
* @param {() => {name: string, brief: string}} deps.persona
|
|
142
142
|
* @param {[number, number]} [deps.dwellMs] 推荐页每条看多久(真实毫秒)
|
|
143
143
|
* @param {(opts: {browser: object, id: string, commentLimit?: number}) => Promise<object>} [deps.readDetail]
|
package/lib/gateway-media.js
CHANGED
|
@@ -131,6 +131,7 @@ export const mediaMethods = {
|
|
|
131
131
|
reason: paused ? '这个聊天暂停着' : !cfg.autoReply ? '自动回复关着' : stale ? '超过回复时限的旧消息' : '不是主人 / 白名单 / 互关' });
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
|
+
this.shouldClearRecentSent?.(m.channelId, m.text);
|
|
134
135
|
this.note('reply', { channelId: m.channelId, who, text: m.text });
|
|
135
136
|
this.enqueue(m, person, cfg);
|
|
136
137
|
},
|
|
@@ -180,7 +181,7 @@ export const mediaMethods = {
|
|
|
180
181
|
// 超时限 / 暂停 / 未授权 / 开关关着都是「确定不处理」,与「结果不确定需核实」分开。
|
|
181
182
|
return { done: true, review: '只记不回' };
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
this.shouldClearRecentSent?.(m.channelId, m.text);
|
|
184
185
|
this.note('reply', { channelId: m.channelId, who, text: m.text });
|
|
185
186
|
this.enqueue(m, person, cfg);
|
|
186
187
|
// 🔴 必须返回 `queued`:结算由 `turn/end` 回写(网关那边 settle)。
|
|
@@ -223,7 +224,7 @@ export const mediaMethods = {
|
|
|
223
224
|
// 同私信:结果明确的不记不回返回 done,别被 drainInbox 标 unknown 挡住整个群
|
|
224
225
|
return { done: true, review: '只记不回' };
|
|
225
226
|
}
|
|
226
|
-
|
|
227
|
+
this.shouldClearRecentSent?.(m.channelId, m.text);
|
|
227
228
|
this.note('reply', { channelId: m.channelId, who, text: m.text });
|
|
228
229
|
this.enqueue(m, person, cfg);
|
|
229
230
|
// 同私信:结算交给 turn/end,别在 drainInbox 里提前标 unknown
|
package/lib/gateway.js
CHANGED
|
@@ -75,6 +75,11 @@ const POKE_LIMIT = 500;
|
|
|
75
75
|
const BACKLOG_LIMIT = 12;
|
|
76
76
|
const BACKLOG_MAX_AGE_MS = 15 * 60_000;
|
|
77
77
|
const DECISION_LIMIT = 300;
|
|
78
|
+
/**
|
|
79
|
+
* 对方明确要求「再说一遍」的说法。命中时跨条复读守卫放行原话 ——
|
|
80
|
+
* 否则「你刚才说什么」会被当成复读拦掉,整轮静默(2026-11-28 独立审查发现)。
|
|
81
|
+
*/
|
|
82
|
+
const RESTATE_RE = /再说一?遍|再说一次|再说下|重发一?下|重发|刚才说什么|刚才说啥|刚说的啥|你刚说|没看到|被刷走|上面那条|上一条/;
|
|
78
83
|
const POKE_GAP_MS = 60_000;
|
|
79
84
|
const PAUSE_KEY = 'chat.paused';
|
|
80
85
|
/** 主人在 QQ 里发的控制命令:/鱼 暂停 [30分钟|2小时]、/鱼 继续、/鱼 同意、/鱼 拒绝、/鱼 新会话 */
|
|
@@ -131,6 +136,7 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
131
136
|
windowMs: () => clampReplyWindow(this.qqConfig().replyWindowMinutes) * 60_000,
|
|
132
137
|
onSent: (id, /** @type {any} */ item) => {
|
|
133
138
|
this.rememberOwn(id, item.text, item.channel_id);
|
|
139
|
+
this.noteOutboxSent(item);
|
|
134
140
|
this.note('sent', { channelId: item.channel_id, title: item.title, text: item.text || '[图片]', reason: `重发成功(第 ${item.attempts + 1} 次)` });
|
|
135
141
|
},
|
|
136
142
|
onGiveUp: (/** @type {any} */ item, reason) => {
|
|
@@ -185,9 +191,9 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
185
191
|
this.unusable = new Map();
|
|
186
192
|
/** @type {Map<string, any>} */
|
|
187
193
|
this.turnMood = new Map();
|
|
188
|
-
/** @type {Map<string, Array<{at: number, norm: string}>>} */
|
|
194
|
+
/** @type {Map<string, Array<{at: number, norm: string, stale?: boolean}>>} */
|
|
189
195
|
this.recentSent = new Map();
|
|
190
|
-
/** @type {Map<string, {at: number, norm: string}>} */
|
|
196
|
+
/** @type {Map<string, {at: number, norm: string, text?: string}>} */
|
|
191
197
|
this.lastInbound = new Map();
|
|
192
198
|
/** channelId → Promise<Agent>(同一聊天并发来消息时只建一个会话) */
|
|
193
199
|
this.inflight = new Map();
|
|
@@ -568,8 +574,9 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
568
574
|
if (cur !== null && (m.timeMs < Number(cur.timeMs) || (m.timeMs === Number(cur.timeMs) && m.messageId === cur.messageId))) return;
|
|
569
575
|
}
|
|
570
576
|
this.advanceCursor(m.channelId, m.timeMs, m.messageId);
|
|
571
|
-
//
|
|
572
|
-
|
|
577
|
+
// 只有真正新的实质入站消息才算「换了话题」:极短敷衍语(如"嗯""好")或短时重复输入不算。
|
|
578
|
+
// 标记 stale 而不是清空 —— 清空会让跨条复读守卫在正常多轮对话里彻底失效。
|
|
579
|
+
this.shouldClearRecentSent(m.channelId, m.text);
|
|
573
580
|
if (m.chatType === 'group' && !this.groupAllowed(m.groupId, cfg)) return;
|
|
574
581
|
if (m.chatType === 'group' && !backfill) {
|
|
575
582
|
this.slang?.observe(m.channelId, m.nickname || m.userId, m.text);
|
|
@@ -1058,10 +1065,16 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
1058
1065
|
}
|
|
1059
1066
|
|
|
1060
1067
|
/**
|
|
1061
|
-
*
|
|
1062
|
-
* - 规整化后 ≤ 2 字(空消息 / 纯图 / "嗯""好""哦哦"
|
|
1063
|
-
* - 同一频道 3 分钟内(180s)跟上一条入站内容规整化后完全一致(断线重推 /
|
|
1064
|
-
* -
|
|
1068
|
+
* 判定这条入站消息是否算「实质新输入」:
|
|
1069
|
+
* - 规整化后 ≤ 2 字(空消息 / 纯图 / "嗯""好""哦哦" 等敷衍短语)不算;
|
|
1070
|
+
* - 同一频道 3 分钟内(180s)跟上一条入站内容规整化后完全一致(断线重推 / 重复发送)不算;
|
|
1071
|
+
* - 其余算,并把该频道「最近发过的话」标记成 `stale`(说在旧话题里)。
|
|
1072
|
+
*
|
|
1073
|
+
* 🔴 这里**不能**再整份清空记录(以前是 `recentSent.delete(channelId)`)。
|
|
1074
|
+
* 清空之后只要用户每轮说点新东西,守卫就永远只有空历史 —— 「跨条复读」等于没做,
|
|
1075
|
+
* 她隔一轮把同一段话再说一遍也拦不住(2026-11-28 用户反馈「鱼有时候会发重复的话」)。
|
|
1076
|
+
* 标记 stale 保留了两件事的分寸:一字不差照样拦(那才是重复),
|
|
1077
|
+
* 换个说法回答旧问题则放行(用户再问不误拦)。
|
|
1065
1078
|
*/
|
|
1066
1079
|
shouldClearRecentSent(channelId, text, now = Date.now()) {
|
|
1067
1080
|
const inNorm = normSentText(text);
|
|
@@ -1069,27 +1082,46 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
1069
1082
|
const store = (this.lastInbound ??= new Map());
|
|
1070
1083
|
const prev = store.get(channelId);
|
|
1071
1084
|
if (prev && prev.norm === inNorm && now - prev.at <= 180_000) return false;
|
|
1072
|
-
|
|
1085
|
+
// 留一份原文:dropRepeats 要据此判断对方说这句话是不是在要求「再说一遍」
|
|
1086
|
+
store.set(channelId, { norm: inNorm, at: now, text: String(text ?? '') });
|
|
1087
|
+
const sentList = this.recentSent?.get(channelId) ?? [];
|
|
1088
|
+
for (const h of sentList) h.stale = true;
|
|
1073
1089
|
return true;
|
|
1074
1090
|
}
|
|
1075
1091
|
|
|
1076
1092
|
/**
|
|
1077
1093
|
* 跨条复读守卫:同一频道 5 分钟内跟刚发过的内容(规整化后)一字不差或高相似换说法的段落,拦掉不发。
|
|
1078
1094
|
* 模型遇到相近输入或重推时偶尔把自己上一条消息原样再发一遍或换句近义词复读。
|
|
1079
|
-
*
|
|
1095
|
+
* 收到实质新消息时 shouldClearRecentSent 会把旧记录标成 stale(不再整份清空);
|
|
1096
|
+
* 一字不差始终拦(对方明确要求「再说一遍」时除外),近义换说法按话题新旧分档。
|
|
1080
1097
|
* 短句(规整化后 <12 字)允许重复。
|
|
1081
1098
|
*/
|
|
1082
1099
|
dropRepeats(row, paragraphs) {
|
|
1083
1100
|
const store = (this.recentSent ??= new Map());
|
|
1084
1101
|
const now = Date.now();
|
|
1085
1102
|
const hist = (store.get(row.channel_id) ?? []).filter((h) => now - h.at <= 300_000);
|
|
1086
|
-
|
|
1103
|
+
// 对方刚说的是「再说一遍 / 刚才说什么」这类复述请求:原样重发是对的,别当复读拦掉
|
|
1104
|
+
const restate = RESTATE_RE.test(String(this.lastInbound?.get(row.channel_id)?.text ?? ''));
|
|
1105
|
+
const dups = new Set(findRepeatedParagraphs(hist, paragraphs, { now, windowMs: 300_000, allowRestate: restate }));
|
|
1087
1106
|
if (dups.size > 0) {
|
|
1088
1107
|
this.note('filtered', { channelId: row.channel_id, title: row.title, text: paragraphs.filter((_, i) => dups.has(i)).join(' / ').slice(0, 120), reason: '跟刚发的消息重复或近义换说法,跨条复读没再发' });
|
|
1089
1108
|
}
|
|
1090
1109
|
return paragraphs.filter((_, i) => !dups.has(i));
|
|
1091
1110
|
}
|
|
1092
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* 队列重发成功后把这段记进「最近发过的」——**重发的也算说过了**。
|
|
1114
|
+
*
|
|
1115
|
+
* 以前 onSent 只调 rememberOwn / note,注释里写着「重发成功时 Outbox 的 onSent 回调再记」
|
|
1116
|
+
* 但实现一直缺这一行:重发的那段话不在守卫历史里,下一轮她再复读同一段就查不到。
|
|
1117
|
+
* 占位符(`[图片]` / `[语音]`)不用特殊处理:norm 之后剩下 2 字,低于 minLen 12 本来就不参与判定。
|
|
1118
|
+
*/
|
|
1119
|
+
noteOutboxSent(item) {
|
|
1120
|
+
const text = String(item?.text ?? '');
|
|
1121
|
+
if (text.trim() === '') return;
|
|
1122
|
+
this.noteSent({ channel_id: item.channel_id }, [text]);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1093
1125
|
/** 发送成功后把这轮发出去的段落记进「最近发过的」,给下一轮跨条复读比对用。 */
|
|
1094
1126
|
noteSent(row, paragraphs) {
|
|
1095
1127
|
const store = (this.recentSent ??= new Map());
|
|
@@ -1097,7 +1129,8 @@ export class ChatGateway extends gatewayMixins() {
|
|
|
1097
1129
|
const hist = (store.get(row.channel_id) ?? []).filter((h) => now - h.at <= 300_000);
|
|
1098
1130
|
for (const p of paragraphs) {
|
|
1099
1131
|
const n = normSentText(p);
|
|
1100
|
-
|
|
1132
|
+
// stale: false —— 这是刚发出去的话,属于当前这一段对话
|
|
1133
|
+
if (n !== '') hist.push({ at: now, norm: n, stale: false });
|
|
1101
1134
|
}
|
|
1102
1135
|
while (hist.length > 50) hist.shift();
|
|
1103
1136
|
store.set(row.channel_id, hist);
|
package/lib/outbox.js
CHANGED
|
@@ -60,7 +60,7 @@ export class Outbox {
|
|
|
60
60
|
/**
|
|
61
61
|
* @param {object} deps
|
|
62
62
|
* @param {import('node:sqlite').DatabaseSync} deps.db
|
|
63
|
-
* @param {{ connected?: boolean, send: (channelId: string, segs: object[]) => Promise<string> }} deps.channel
|
|
63
|
+
* @param {{ connected?: boolean, send: (channelId: string, segs: object[], convId?: string) => Promise<string> }} deps.channel
|
|
64
64
|
* @param {() => number} deps.windowMs 超过多久就不再重发(取回复时限)
|
|
65
65
|
* @param {(id: string, item: object) => void} [deps.onSent]
|
|
66
66
|
* @param {(item: object, reason: string) => void} [deps.onGiveUp]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-fish-soul",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.10",
|
|
4
4
|
"description": "鱼 · 人格、按人记忆(可纠正、有印象、能导入旧聊天记录)、日程自走与主动开口,直连 SnowLuma 收发 QQ(群里会自己插话),B站 / 抖音小号私信与自己刷视频;按功能选模型并统计用量花费,能听会说 QQ 语音、收藏表情包、学群里的梗,可选上网查;心情影响说话、去 AI 味、每个群的设定、按聊天选模型、每晚写日记、每周记忆存档与可选周记(DSH 插件,单角色 feiyu ,v0.18.23)",
|
|
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-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/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/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/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/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-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/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-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/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/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",
|
|
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-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/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/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/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-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/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-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/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",
|
|
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"
|