dsh-qqbot-muu 0.1.20 → 0.1.21
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/CHANGELOG.md +168 -154
- package/client/qqbot-settings.js +13401 -13380
- package/dist/config.js +573 -581
- package/dist/features/contextless-store.js +247 -247
- package/dist/features/four-source.js +338 -336
- package/dist/features/group-join-request.js +289 -287
- package/dist/features/local-models.js +1494 -1467
- package/dist/features/style-layer.js +501 -498
- package/dist/features/thinking-log.js +71 -69
- package/dist/gateway/bootstrap.js +1704 -1652
- package/dist/model/settings-reader.js +193 -102
- package/dist/shared/paths.js +128 -0
- package/dist/shared/settings-io.js +79 -83
- package/dshqqbot/.qqbot-extensions/inbound/00-vision.mjs +111 -0
- package/dshqqbot/.qqbot-extensions/inbound/aa-memory-recall.mjs +802 -794
- package/dshqqbot/.qqbot-extensions/inbound/az-feedback.mjs +113 -115
- package/dshqqbot/.qqbot-extensions/inbound/local-answer.mjs +689 -568
- package/dshqqbot/.qqbot-extensions/lib/local-llm.mjs +455 -444
- package/dshqqbot/.qqbot-extensions/lib/memory-agent.mjs +930 -928
- package/dshqqbot/.qqbot-extensions/lib/memory-core.mjs +537 -537
- package/dshqqbot/.qqbot-extensions/lib/memory-db.mjs +2476 -2245
- package/dshqqbot/.qqbot-extensions/lib/memory-hippo.mjs +18 -0
- package/dshqqbot/.qqbot-extensions/lib/memory.mjs +191 -186
- package/dshqqbot/.qqbot-extensions/lib/scope-util.mjs +84 -0
- package/dshqqbot/.qqbot-extensions/outbound/aa-sanitize.mjs +158 -154
- package/dshqqbot/.qqbot-extensions/outbound/memory-agent.mjs +121 -130
- package/dshqqbot/.qqbot-extensions/outbound/turn-memory.mjs +92 -101
- package/dshqqbot/.qqbot-extensions/tools/memory.mjs +178 -120
- package/dshqqbot/.qqbot-extensions/vendor/abogus/test-abogus.mjs +128 -126
- package/package.json +119 -118
- package/scripts/__pycache__/fan-mode.cpython-311.pyc +0 -0
- package/scripts/__pycache__/memory-audit.cpython-311.pyc +0 -0
- package/scripts/__pycache__/qq-ip-sync.cpython-311.pyc +0 -0
- package/scripts/__pycache__/qq-whitelist.cpython-311.pyc +0 -0
- package/scripts/ai-toolkit.py +607 -478
- package/scripts/chat-archive/__pycache__/build-sft-v4.cpython-311.pyc +0 -0
- package/scripts/chat-archive/__pycache__/build-sft.cpython-311.pyc +0 -0
- package/scripts/chat-archive/build-sft-v4.py +566 -0
- package/scripts/chat-archive/build-sft.py +390 -0
- package/scripts/chat-archive/eval-sft.py +155 -0
- package/scripts/chat-archive/extract-memory.py +143 -0
- package/scripts/chat-archive/inventory.py +182 -0
- package/scripts/chat-archive/merge-sft.py +114 -0
- package/scripts/chat-archive/qce-pull.py +217 -0
- package/scripts/chat-archive/qqheader.py +110 -0
- package/scripts/chat-archive/qqkey2.py +113 -0
- package/scripts/chat-archive/qqprobe.py +153 -0
- package/scripts/chat-archive/screen-collect.py +163 -0
- package/scripts/chat-archive/sqlcipher_probe.py +444 -0
- package/scripts/episode.py +529 -0
- package/scripts/fan-curve.py +218 -0
- package/scripts/fan-guard.cmd +8 -0
- package/scripts/fan-mode.py +380 -263
- package/scripts/gen-image.py +420 -413
- package/scripts/gen-video.py +186 -178
- package/scripts/hw-profile.py +175 -0
- package/scripts/media-enhance.py +402 -0
- package/scripts/memory-audit.py +581 -0
- package/scripts/migrate-scope.mjs +140 -139
- package/scripts/qq-connect-login.py +133 -0
- package/scripts/qq-ip-sync-hidden.vbs +5 -0
- package/scripts/qq-ip-sync.py +300 -0
- package/scripts/qq-whitelist.py +71 -0
- package/scripts/release-all.mjs +636 -509
- package/scripts/release-check.mjs +244 -226
- package/scripts/secure-room/index.html +334 -0
- package/scripts/secure-room/server.py +582 -0
- package/scripts/stickers/auto-tag.mjs +161 -0
- package/scripts/train/__pycache__/train-lora.cpython-311.pyc +0 -0
- package/scripts/train/gguf-quantize.py +92 -0
- package/scripts/train/gguf-to-hf.py +112 -0
- package/scripts/train/merge-lora.py +51 -0
- package/scripts/train/probe-mirrors.sh +12 -0
- package/scripts/train/probe-mirrors2.sh +20 -0
- package/scripts/train/setup-wsl.sh +23 -0
- package/scripts/train/setup-wsl2.sh +25 -0
- package/scripts/train/setup-wsl3.sh +22 -0
- package/scripts/train/setup-wsl4.sh +22 -0
- package/scripts/train/train-lora.py +319 -0
- package/dist/_backup_ctx_20261125_183653/dist/config.d.ts +0 -473
- package/dist/_backup_ctx_20261125_183653/dist/config.js +0 -450
- package/dist/_backup_ctx_20261125_183653/dist/features/contextless-trim.js +0 -304
- package/dist/_backup_ctx_20261125_183653/dist/session/session-manager.js +0 -1588
- package/dist/_backup_ctx_20261125_183653/dist/transport/inbound.js +0 -1567
- package/dist/_backup_ctx_20261125_183653/dist/transport/outbound.js +0 -647
- package/scripts/__pycache__/ai-mode.cpython-311.pyc +0 -0
- package/scripts/__pycache__/ai-toolkit.cpython-311.pyc +0 -0
- package/scripts/__pycache__/comfy_gen.cpython-311.pyc +0 -0
- package/scripts/__pycache__/gen-image.cpython-311.pyc +0 -0
- package/scripts/__pycache__/gen-video.cpython-311.pyc +0 -0
- package/scripts/__pycache__/model-registry.cpython-311.pyc +0 -0
- package/scripts/__pycache__/purge-standby.cpython-311.pyc +0 -0
|
@@ -1,70 +1,72 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* thinking-log.ts — 思考留档(观察期, 2026-09-13)
|
|
3
|
-
*
|
|
4
|
-
* 背景: 《好感度系统设计》§11 要走「四源对比」, 其中一源是大模型的思考(reasoning)。
|
|
5
|
-
* 主人定的第一件事是**先把思考读进来并留档**, 供人工标注 50 条, 再定这条支路的生死。
|
|
6
|
-
*
|
|
7
|
-
* 取值来源(2026-09-13 实测): dsh 会话事件 `assistant/message` 的 data.message.content[]
|
|
8
|
-
* 里 `{ type:'reasoning', text:'思考全文' }` —— 与宿主 @deepseek-ai/dsh-llm 的
|
|
9
|
-
* StreamChunk `reasoning-delta` 同源(插件侧走块级全文, 免累积、免误当正文发出去)。
|
|
10
|
-
* ⚠️ 还有空壳块 `{type:'reasoning', thinkingSignature:'reasoning_content'}` 无 text → 一律判空跳过。
|
|
11
|
-
*
|
|
12
|
-
* 红线(设计稿 §9 / §11):
|
|
13
|
-
* · 思考是她**隐私内部状态** —— 只写本地文件, **不进面板、不进 QQ、不参与任何行为判定**;
|
|
14
|
-
* · 与 value-scores.jsonl 分开存, 便于单独删除/停用;
|
|
15
|
-
* · 条数有上限, 超出滚动保留最新, 不无限膨胀。
|
|
16
|
-
*
|
|
17
|
-
* 数据位置: {dataRoot}/.qqbot/thinking-log.jsonl(一行一条 JSON)
|
|
18
|
-
*/
|
|
19
|
-
import { appendFileSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
20
|
-
import { join } from 'node:path';
|
|
21
|
-
/** 留档上限(行): 超出后滚动保留最新 —— 观察期足够人工取样, 又不让文件无界增长 */
|
|
22
|
-
const MAX_LINES = 400;
|
|
23
|
-
/** 单条思考落盘的字数上限(截断; 标注 50 条够用, 避免文件膨胀) */
|
|
24
|
-
const MAX_TEXT_CHARS = 1500;
|
|
25
|
-
/** 每写这么多条整理一次(不必每条都读全文件) */
|
|
26
|
-
const COMPACT_EVERY = 25;
|
|
27
|
-
let sinceCompact = 0;
|
|
28
|
-
/** 滚动整理: 行数超上限时重写成"最后 MAX_LINES 条" */
|
|
29
|
-
function compact(path) {
|
|
30
|
-
try {
|
|
31
|
-
const lines = readFileSync(path, 'utf8').split('\n').filter((l) => l.trim() !== '');
|
|
32
|
-
if (lines.length <= MAX_LINES)
|
|
33
|
-
return;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* thinking-log.ts — 思考留档(观察期, 2026-09-13)
|
|
3
|
+
*
|
|
4
|
+
* 背景: 《好感度系统设计》§11 要走「四源对比」, 其中一源是大模型的思考(reasoning)。
|
|
5
|
+
* 主人定的第一件事是**先把思考读进来并留档**, 供人工标注 50 条, 再定这条支路的生死。
|
|
6
|
+
*
|
|
7
|
+
* 取值来源(2026-09-13 实测): dsh 会话事件 `assistant/message` 的 data.message.content[]
|
|
8
|
+
* 里 `{ type:'reasoning', text:'思考全文' }` —— 与宿主 @deepseek-ai/dsh-llm 的
|
|
9
|
+
* StreamChunk `reasoning-delta` 同源(插件侧走块级全文, 免累积、免误当正文发出去)。
|
|
10
|
+
* ⚠️ 还有空壳块 `{type:'reasoning', thinkingSignature:'reasoning_content'}` 无 text → 一律判空跳过。
|
|
11
|
+
*
|
|
12
|
+
* 红线(设计稿 §9 / §11):
|
|
13
|
+
* · 思考是她**隐私内部状态** —— 只写本地文件, **不进面板、不进 QQ、不参与任何行为判定**;
|
|
14
|
+
* · 与 value-scores.jsonl 分开存, 便于单独删除/停用;
|
|
15
|
+
* · 条数有上限, 超出滚动保留最新, 不无限膨胀。
|
|
16
|
+
*
|
|
17
|
+
* 数据位置: {dataRoot}/.qqbot/thinking-log.jsonl(一行一条 JSON)
|
|
18
|
+
*/
|
|
19
|
+
import { appendFileSync, mkdirSync, readFileSync, writeFileSync, renameSync } from 'node:fs';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
/** 留档上限(行): 超出后滚动保留最新 —— 观察期足够人工取样, 又不让文件无界增长 */
|
|
22
|
+
const MAX_LINES = 400;
|
|
23
|
+
/** 单条思考落盘的字数上限(截断; 标注 50 条够用, 避免文件膨胀) */
|
|
24
|
+
const MAX_TEXT_CHARS = 1500;
|
|
25
|
+
/** 每写这么多条整理一次(不必每条都读全文件) */
|
|
26
|
+
const COMPACT_EVERY = 25;
|
|
27
|
+
let sinceCompact = 0;
|
|
28
|
+
/** 滚动整理: 行数超上限时重写成"最后 MAX_LINES 条" */
|
|
29
|
+
function compact(path) {
|
|
30
|
+
try {
|
|
31
|
+
const lines = readFileSync(path, 'utf8').split('\n').filter((l) => l.trim() !== '');
|
|
32
|
+
if (lines.length <= MAX_LINES)
|
|
33
|
+
return;
|
|
34
|
+
const tmp = `${path}.${process.pid}.tmp`;
|
|
35
|
+
writeFileSync(tmp, `${lines.slice(-MAX_LINES).join('\n')}\n`, 'utf8');
|
|
36
|
+
renameSync(tmp, path);
|
|
37
|
+
}
|
|
38
|
+
catch { /* 整理失败不影响主流程 */ }
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 留一条思考。
|
|
42
|
+
*
|
|
43
|
+
* 只写文件, 不做任何判定 —— 调用方(出站路由)在**任何模式**下都该照记(包括 silent 潜水),
|
|
44
|
+
* 因为"照常思考"本来就是 silent 的定义。
|
|
45
|
+
*/
|
|
46
|
+
export function noteThinking(dataRoot, entry) {
|
|
47
|
+
try {
|
|
48
|
+
const raw = String(entry.text ?? '');
|
|
49
|
+
if (raw.trim() === '')
|
|
50
|
+
return;
|
|
51
|
+
const dir = join(dataRoot, '.qqbot');
|
|
52
|
+
mkdirSync(dir, { recursive: true });
|
|
53
|
+
const path = join(dir, 'thinking-log.jsonl');
|
|
54
|
+
const rec = {
|
|
55
|
+
ts: Date.now(),
|
|
56
|
+
scope: entry.scope,
|
|
57
|
+
peer: entry.peerId,
|
|
58
|
+
turn: entry.turn,
|
|
59
|
+
step: entry.step,
|
|
60
|
+
chars: raw.length,
|
|
61
|
+
tokens: entry.tokens,
|
|
62
|
+
text: raw.replace(/\r/g, '').slice(0, MAX_TEXT_CHARS),
|
|
63
|
+
};
|
|
64
|
+
appendFileSync(path, `${JSON.stringify(rec)}\n`, 'utf8');
|
|
65
|
+
if (++sinceCompact >= COMPACT_EVERY) {
|
|
66
|
+
sinceCompact = 0;
|
|
67
|
+
compact(path);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch { /* 留档失败绝不影响回复主流程 */ }
|
|
71
|
+
}
|
|
70
72
|
//# sourceMappingURL=thinking-log.js.map
|