dsh-memory-archivist 0.1.1 → 0.1.2
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 +48 -31
- package/lib/index.js +148 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# dsh-memory-archivist
|
|
2
2
|
|
|
3
|
-
QQ
|
|
3
|
+
QQ 群会话「被解散 / 被踢 / 自己退群」时的自动归档,以及第三方插件补丁的启动自愈。
|
|
4
|
+
|
|
5
|
+
被踢只是「先离开」,会话保留 15 天:期间拉回去就原地复活,到期还没回群才落盘归档并删除。
|
|
4
6
|
|
|
5
7
|
> **针对 `@tencent-connect/dsh-qqbot` 与 `dsh-plugin-memory` 优化**
|
|
6
8
|
>
|
|
@@ -13,16 +15,26 @@ QQ 群会话「被解散/被踢」时的自动归档 + 删除,以及第三方
|
|
|
13
15
|
## 它解决什么
|
|
14
16
|
|
|
15
17
|
QQ 解散群**不会**下发事件(只有被踢才推 `GROUP_DEL_ROBOT`),所以靠事件监听必然漏。
|
|
16
|
-
本插件每 N 分钟用 `GET /v2/groups/{openid}/info`
|
|
18
|
+
本插件每 N 分钟用 `GET /v2/groups/{openid}/info` 探测所有已绑定群,按结果分三条路:
|
|
19
|
+
|
|
20
|
+
**① 群还在(200)** → 不动。如果它之前被标过「待定」,说明又被拉回去了:清掉标记,**原会话继续用**。
|
|
21
|
+
|
|
22
|
+
**② 被踢 / 自己退群(11293「鉴权失败,机器人非群成员」)** → **会话不删**:
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
4. 清掉 `model-prefs.json` 里的对应键
|
|
24
|
+
1. 读会话全文落 T0(`<记忆库>/raw/sessions/<日期>-<群8位>-<会话8位>.md`)
|
|
25
|
+
2. 在 `group-pending.json` 记下 `since`,进入「待定」
|
|
26
|
+
3. 宽限期(默认 **15 天**)内每隔几小时才复探一次,不反复打扰 API、不删会话
|
|
27
|
+
4. 过期仍未回群 → 转 ③ 的归档流程
|
|
28
|
+
5. 期间又被拉回群 → 看到 200 就取消待定,原会话继续用,上下文、映射都不丢
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
**③ 群解散 / 注销(11255「用户/群已注销」)** → 群已经没了,立刻收尾:
|
|
31
|
+
|
|
32
|
+
1. T0 原文落盘
|
|
33
|
+
2. 群页「历史」追加 T1 明细(群页按 frontmatter 的 `group_openid` 找,不靠文件名)
|
|
34
|
+
3. 调 `sessionCleaner` 删掉会话
|
|
35
|
+
4. 清掉 `model-prefs.json` 里的对应键
|
|
36
|
+
|
|
37
|
+
任一步失败 → 保留会话,只记日志。**宁可留会话,也不静默丢记录。**
|
|
26
38
|
|
|
27
39
|
## 路径怎么来的(可移植,不写死)
|
|
28
40
|
|
|
@@ -36,6 +48,7 @@ QQ 解散群**不会**下发事件(只有被踢才推 `GROUP_DEL_ROBOT`),
|
|
|
36
48
|
| QQ 数据目录 | `MEMORY_ARCHIVIST_QQ_DATA` → `~/.dsh-qqbot` |
|
|
37
49
|
| `model-prefs.json` | `MEMORY_ARCHIVIST_PREFS` → `<QQ 数据目录>/model-prefs.json` |
|
|
38
50
|
| 日志 | `MEMORY_ARCHIVIST_LOG` → `<QQ 数据目录>/memory-archivist.log` |
|
|
51
|
+
| 待定表 | `MEMORY_ARCHIVIST_PENDING` → `<QQ 数据目录>/group-pending.json` |
|
|
39
52
|
| 宿主 profile 目录 | `DSH_PROFILE_DIR` → `<DSH_HOME>/profiles` 下第一个含 `cordis.patch.yml` 的目录 → `<DSH_HOME>/profiles/desktop` |
|
|
40
53
|
|
|
41
54
|
- `DSH_HOME` 取环境变量,默认 `~/.dsh`。
|
|
@@ -69,12 +82,35 @@ QQ 解散群**不会**下发事件(只有被踢才推 `GROUP_DEL_ROBOT`),
|
|
|
69
82
|
"firstSweepDelaySec": 60,
|
|
70
83
|
"probeGroups": true,
|
|
71
84
|
"maxPerSweep": 5,
|
|
72
|
-
"rawRetentionDays": 30
|
|
85
|
+
"rawRetentionDays": 30,
|
|
86
|
+
"groupPendingGraceDays": 15,
|
|
87
|
+
"pendingProbeHours": 6
|
|
73
88
|
}
|
|
74
89
|
```
|
|
75
90
|
|
|
76
91
|
`dryRun: true` 时只探测、只写日志,不归档不删会话、也不过期删除原文。
|
|
77
92
|
|
|
93
|
+
- `groupPendingGraceDays`(默认 15):被踢/自退后保留会话的天数,到期仍未回群才归档删除。
|
|
94
|
+
- `pendingProbeHours`(默认 6):待定期间每隔多少小时复探一次(否则 15 天里每轮都打 API)。
|
|
95
|
+
|
|
96
|
+
## 待定表
|
|
97
|
+
|
|
98
|
+
`<QQ 数据目录>/group-pending.json`(可用 `MEMORY_ARCHIVIST_PENDING` 改)记录被踢但还没到期的群:
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"816EDEB4E0A44F71076CBF5D3743C890": {
|
|
103
|
+
"sessionId": "session-…",
|
|
104
|
+
"key": "qqbot:<appId>:group:816EDEB4…",
|
|
105
|
+
"since": "2026-12-06T07:06:27.442Z",
|
|
106
|
+
"t0": "2026-12-06-816EDEB4-515cbe0c.md",
|
|
107
|
+
"nextProbeAt": "2026-12-06T13:06:27.442Z"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
想立刻结束等待(比如确认群已经不存在),把 `since` 改成 15 天前、`nextProbeAt` 改成过去,下一次巡检就会归档并删会话。
|
|
113
|
+
|
|
78
114
|
## T0 原文的 30 天过期
|
|
79
115
|
|
|
80
116
|
每次巡检开始时扫一遍 `<记忆库>/raw/sessions/`,按**文件名开头的日期**判断:
|
|
@@ -95,29 +131,10 @@ QQ 解散群**不会**下发事件(只有被踢才推 `GROUP_DEL_ROBOT`),
|
|
|
95
131
|
|
|
96
132
|
## 安装
|
|
97
133
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
```jsonc
|
|
101
|
-
// 1) 直接从 GitHub 装(推荐先试这个,不用等 npm)
|
|
102
|
-
"dsh-memory-archivist": "github:haidao128/dsh-plugin-"
|
|
134
|
+
profile `package.json` 里以 `link:` 引入,并加进 `dsh.profile.bundles`:
|
|
103
135
|
|
|
104
|
-
|
|
105
|
-
"dsh-memory-archivist": "^0.1.0"
|
|
106
|
-
|
|
107
|
-
// 3) 本地开发用 link
|
|
136
|
+
```json
|
|
108
137
|
"dsh-memory-archivist": "link:../../plugins/dsh-memory-archivist"
|
|
109
138
|
```
|
|
110
139
|
|
|
111
|
-
仓库根目录就是包根,所以 `github:` 这种写法不用带 `#path`。
|
|
112
|
-
|
|
113
140
|
源码改动后要**重启应用**才生效(ESM 模块缓存);只改 `cordis.patch.yml` 会热重载 fiber,但不会重载模块代码。
|
|
114
|
-
|
|
115
|
-
## 发布
|
|
116
|
-
|
|
117
|
-
仓库带了 `.github/workflows/publish.yml`:在 GitHub Settings → Secrets 里配一个 `NPM_TOKEN`(npm 的 Automation token),然后打 tag 就会自动 `npm publish`:
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
git tag v0.1.0 && git push origin v0.1.0
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
也可以在能连 npm 的机器上手动发:`npm publish --access public`。
|
package/lib/index.js
CHANGED
|
@@ -52,6 +52,8 @@ const GROUPS_DIR = envPath('MEMORY_ARCHIVIST_GROUPS', path.join(MEMORY_ROOT, 'gr
|
|
|
52
52
|
const QQ_DATA_DIR = envPath('MEMORY_ARCHIVIST_QQ_DATA', path.join(os.homedir(), '.dsh-qqbot'))
|
|
53
53
|
const PREFS_FILE = envPath('MEMORY_ARCHIVIST_PREFS', path.join(QQ_DATA_DIR, 'model-prefs.json'))
|
|
54
54
|
const LOG_FILE = envPath('MEMORY_ARCHIVIST_LOG', path.join(QQ_DATA_DIR, 'memory-archivist.log'))
|
|
55
|
+
/** 待定表:被踢/自退的群先保留会话,宽限期过了才归档删除 */
|
|
56
|
+
const PENDING_FILE = envPath('MEMORY_ARCHIVIST_PENDING', path.join(QQ_DATA_DIR, 'group-pending.json'))
|
|
55
57
|
|
|
56
58
|
const DEFAULTS = Object.freeze({
|
|
57
59
|
enabled: true,
|
|
@@ -61,6 +63,10 @@ const DEFAULTS = Object.freeze({
|
|
|
61
63
|
probeGroups: true,
|
|
62
64
|
maxPerSweep: 5,
|
|
63
65
|
rawRetentionDays: 30,
|
|
66
|
+
/** 被踢/自退后保留会话的宽限期(天),到期仍未回群才归档删除 */
|
|
67
|
+
groupPendingGraceDays: 15,
|
|
68
|
+
/** 待定期间每隔多少小时才探测一次,避免 15 天里每 5 分钟打一次 API */
|
|
69
|
+
pendingProbeHours: 6,
|
|
64
70
|
})
|
|
65
71
|
|
|
66
72
|
function nowIso() { return new Date().toISOString() }
|
|
@@ -217,16 +223,23 @@ async function getAccessToken(creds) {
|
|
|
217
223
|
return { ok: true, token, expiresIn: (body && body.expires_in) || 0 }
|
|
218
224
|
}
|
|
219
225
|
|
|
220
|
-
|
|
226
|
+
/** 被移出群:QQ 返回 11293「鉴权失败,机器人非群成员」 */
|
|
227
|
+
const KICKED_CODES = new Set([11293, 304003, 304014])
|
|
228
|
+
/** 群被解散/注销:11255「请求的资源不存在(用户/群已注销)」 */
|
|
229
|
+
const DISSOLVED_CODES = new Set([11255])
|
|
221
230
|
|
|
222
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* 200=群还在;kicked=被踢/自己退群(会话要先保留);dissolved=群已解散(可立即归档);
|
|
233
|
+
* unknown=探测失败,不动手(宁可留着也不误删)。
|
|
234
|
+
*/
|
|
223
235
|
async function probeGroup(token, groupOpenid) {
|
|
224
236
|
const url = 'https://api.sgroup.qq.com/v2/groups/' + groupOpenid + '/info'
|
|
225
237
|
const { status, body } = await fetchJson(url, { headers: { Authorization: 'QQBot ' + token } })
|
|
226
238
|
if (status === 200) return { state: 'alive' }
|
|
227
239
|
const code = body && body.code
|
|
228
240
|
const message = String((body && body.message) || '')
|
|
229
|
-
if (
|
|
241
|
+
if (DISSOLVED_CODES.has(code) || /已注销|注销|不存在|not exist/i.test(message)) return { state: 'gone', kind: 'dissolved', code, message }
|
|
242
|
+
if (KICKED_CODES.has(code) || /非群成员|not in (the )?group|kicked/i.test(message)) return { state: 'gone', kind: 'kicked', code, message }
|
|
230
243
|
return { state: 'unknown', code, message: message || ('HTTP ' + status) }
|
|
231
244
|
}
|
|
232
245
|
|
|
@@ -243,6 +256,29 @@ function findGroupPage(groupOpenid) {
|
|
|
243
256
|
return null
|
|
244
257
|
}
|
|
245
258
|
|
|
259
|
+
/** 读待定表:{ <group_openid>: { sessionId, key, since, t0, nextProbeAt } } */
|
|
260
|
+
function readPending() {
|
|
261
|
+
try {
|
|
262
|
+
const raw = JSON.parse(readFileSync(PENDING_FILE, 'utf8'))
|
|
263
|
+
return raw && typeof raw === 'object' && Array.isArray(raw) === false ? raw : {}
|
|
264
|
+
} catch { return {} }
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function writePending(map) {
|
|
268
|
+
try {
|
|
269
|
+
mkdirSync(path.dirname(PENDING_FILE), { recursive: true })
|
|
270
|
+
writeFileSync(PENDING_FILE, JSON.stringify(map, null, 2))
|
|
271
|
+
return true
|
|
272
|
+
} catch (error) {
|
|
273
|
+
log('写待定表失败:' + (error instanceof Error ? error.message : String(error)))
|
|
274
|
+
return false
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function hoursLater(hours) {
|
|
279
|
+
return new Date(Date.now() + hours * 3600 * 1000).toISOString()
|
|
280
|
+
}
|
|
281
|
+
|
|
246
282
|
function createState() {
|
|
247
283
|
return { startedAt: nowIso(), lastSweepAt: null, lastSweepResult: null, sweeps: 0, lastError: null }
|
|
248
284
|
}
|
|
@@ -275,7 +311,7 @@ export function apply(ctx) {
|
|
|
275
311
|
|
|
276
312
|
async function sweepOnce(reason) {
|
|
277
313
|
const started = Date.now()
|
|
278
|
-
const result = { reason, at: nowIso(), raw: { scanned: 0, removed: [], dryRun: config.dryRun === true }, groups: [], archived: 0, skipped: 0, errors: [] }
|
|
314
|
+
const result = { reason, at: nowIso(), raw: { scanned: 0, removed: [], dryRun: config.dryRun === true }, groups: [], archived: 0, pending: 0, recovered: 0, skipped: 0, errors: [] }
|
|
279
315
|
try { result.raw = pruneRawSessions(config, report) } catch (error) {
|
|
280
316
|
result.errors.push('raw: ' + (error instanceof Error ? error.message : String(error)))
|
|
281
317
|
}
|
|
@@ -297,6 +333,10 @@ export function apply(ctx) {
|
|
|
297
333
|
}
|
|
298
334
|
|
|
299
335
|
const batch = groups.slice(0, Math.max(1, Number(config.maxPerSweep) || 5))
|
|
336
|
+
const pendingMap = readPending()
|
|
337
|
+
const graceDays = Math.max(1, Number(config.groupPendingGraceDays) || 15)
|
|
338
|
+
const graceMs = graceDays * 86400000
|
|
339
|
+
const probeHours = Math.max(1, Number(config.pendingProbeHours) || 6)
|
|
300
340
|
for (const item of batch) {
|
|
301
341
|
const row = { groupOpenid: item.groupOpenid, sessionId: item.sessionId, state: 'unknown', action: 'none', page: findGroupPage(item.groupOpenid) }
|
|
302
342
|
if (tokenInfo.ok !== true) {
|
|
@@ -304,17 +344,96 @@ export function apply(ctx) {
|
|
|
304
344
|
}
|
|
305
345
|
try {
|
|
306
346
|
const probe = await probeGroup(tokenInfo.token, item.groupOpenid)
|
|
307
|
-
row.state = probe.state
|
|
347
|
+
row.state = probe.state + (probe.kind ? '/' + probe.kind : '')
|
|
348
|
+
const pend = pendingMap[item.groupOpenid]
|
|
349
|
+
|
|
350
|
+
// ① 群还在:之前标过待定就说明又被拉回去了,取消标记、原会话继续用
|
|
351
|
+
if (probe.state === 'alive') {
|
|
352
|
+
if (pend) {
|
|
353
|
+
delete pendingMap[item.groupOpenid]
|
|
354
|
+
writePending(pendingMap)
|
|
355
|
+
row.action = 'recovered'
|
|
356
|
+
result.recovered += 1
|
|
357
|
+
report('群 ' + item.groupOpenid + ' 已恢复(重新进群),取消待定标记,会话 ' + item.sessionId + ' 继续用')
|
|
358
|
+
} else {
|
|
359
|
+
result.skipped += 1
|
|
360
|
+
}
|
|
361
|
+
result.groups.push(row)
|
|
362
|
+
continue
|
|
363
|
+
}
|
|
308
364
|
if (probe.state !== 'gone') { result.skipped += 1; result.groups.push(row); continue }
|
|
309
|
-
|
|
365
|
+
|
|
366
|
+
// ② 群解散:群已经没了,立刻归档 + 删会话
|
|
367
|
+
if (probe.kind === 'dissolved') {
|
|
368
|
+
row.action = config.dryRun ? 'would-archive' : 'archiving'
|
|
369
|
+
result.groups.push(row)
|
|
370
|
+
if (config.dryRun) {
|
|
371
|
+
report('[dryRun] 群 ' + item.groupOpenid + ' 已注销(' + (probe.code || '') + '),会归档并删会话 ' + item.sessionId)
|
|
372
|
+
continue
|
|
373
|
+
}
|
|
374
|
+
const done = await archiveAndDelete(item, probe, cleaner())
|
|
375
|
+
row.action = done.ok ? 'archived+deleted' : 'failed'
|
|
376
|
+
if (done.ok) {
|
|
377
|
+
result.archived += 1
|
|
378
|
+
if (pend) { delete pendingMap[item.groupOpenid]; writePending(pendingMap) }
|
|
379
|
+
} else result.errors.push(item.groupOpenid + ': ' + done.reason)
|
|
380
|
+
continue
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ③ 被踢 / 自己退群:先落 T0、标待定,会话保留;宽限期过了还没回群才归档删除
|
|
310
384
|
result.groups.push(row)
|
|
385
|
+
if (!pend) {
|
|
386
|
+
if (config.dryRun) {
|
|
387
|
+
row.action = 'would-stage-t0'
|
|
388
|
+
report('[dryRun] 群 ' + item.groupOpenid + ' 已不在(' + (probe.code || '') + '),会先存 T0 并保留会话')
|
|
389
|
+
continue
|
|
390
|
+
}
|
|
391
|
+
const staged = await stageT0(item)
|
|
392
|
+
pendingMap[item.groupOpenid] = {
|
|
393
|
+
sessionId: item.sessionId,
|
|
394
|
+
key: item.key,
|
|
395
|
+
since: nowIso(),
|
|
396
|
+
t0: staged.path === null ? null : path.basename(staged.path),
|
|
397
|
+
nextProbeAt: hoursLater(probeHours),
|
|
398
|
+
}
|
|
399
|
+
writePending(pendingMap)
|
|
400
|
+
row.action = 'staged-t0(会话保留)'
|
|
401
|
+
result.pending += 1
|
|
402
|
+
report('群 ' + item.groupOpenid + ' 已不在(' + (probe.code || 'kicked') + '):T0 ' + (staged.path === null ? '写盘失败' : '已存') + ',会话保留,' + graceDays + ' 天后复查')
|
|
403
|
+
continue
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const sinceMs = Date.parse(pend.since) || 0
|
|
407
|
+
const nowMs = Date.now()
|
|
408
|
+
if (nowMs < sinceMs + graceMs) {
|
|
409
|
+
const nextProbe = Date.parse(pend.nextProbeAt || '')
|
|
410
|
+
if (Number.isFinite(nextProbe) && nextProbe > nowMs) {
|
|
411
|
+
row.action = 'pending-wait'
|
|
412
|
+
result.skipped += 1
|
|
413
|
+
continue
|
|
414
|
+
}
|
|
415
|
+
pend.nextProbeAt = hoursLater(probeHours)
|
|
416
|
+
writePending(pendingMap)
|
|
417
|
+
row.action = 'pending-wait'
|
|
418
|
+
result.skipped += 1
|
|
419
|
+
const leftDays = Math.max(1, Math.ceil((sinceMs + graceMs - nowMs) / 86400000))
|
|
420
|
+
report('群 ' + item.groupOpenid + ' 仍在待定(还剩 ' + leftDays + ' 天),' + probeHours + ' 小时后再看')
|
|
421
|
+
continue
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// ④ 宽限期已满,仍未回群:按 T0→T1→删会话收尾
|
|
425
|
+
row.action = config.dryRun ? 'would-archive' : 'archiving'
|
|
311
426
|
if (config.dryRun) {
|
|
312
|
-
report('[dryRun] 群 ' + item.groupOpenid + '
|
|
427
|
+
report('[dryRun] 群 ' + item.groupOpenid + ' 待定已满 ' + graceDays + ' 天,会归档并删会话 ' + item.sessionId)
|
|
313
428
|
continue
|
|
314
429
|
}
|
|
315
430
|
const done = await archiveAndDelete(item, probe, cleaner())
|
|
316
431
|
row.action = done.ok ? 'archived+deleted' : 'failed'
|
|
317
|
-
if (done.ok)
|
|
432
|
+
if (done.ok) {
|
|
433
|
+
result.archived += 1
|
|
434
|
+
delete pendingMap[item.groupOpenid]
|
|
435
|
+
writePending(pendingMap)
|
|
436
|
+
} else result.errors.push(item.groupOpenid + ': ' + done.reason)
|
|
318
437
|
} catch (error) {
|
|
319
438
|
result.errors.push(item.groupOpenid + ': ' + (error instanceof Error ? error.message : String(error)))
|
|
320
439
|
}
|
|
@@ -326,6 +445,23 @@ export function apply(ctx) {
|
|
|
326
445
|
return result
|
|
327
446
|
}
|
|
328
447
|
|
|
448
|
+
/** 被踢/自退时只做 T0:读原文落 raw/sessions,不写群页、不删会话 */
|
|
449
|
+
async function stageT0(item) {
|
|
450
|
+
const service = cleaner()
|
|
451
|
+
if (service === undefined || service === null) return { path: null, reason: 'sessionCleaner 不可用' }
|
|
452
|
+
let transcript
|
|
453
|
+
try {
|
|
454
|
+
transcript = await service.read(item.sessionId)
|
|
455
|
+
} catch (error) {
|
|
456
|
+
return { path: null, reason: (error instanceof Error ? error.message : String(error)) }
|
|
457
|
+
}
|
|
458
|
+
if (!transcript || transcript.ok !== true) {
|
|
459
|
+
return { path: null, reason: String((transcript && transcript.error) || '会话不可读') }
|
|
460
|
+
}
|
|
461
|
+
const file = writeRawSession(item, transcript)
|
|
462
|
+
return { path: file, reason: file === null ? 'T0 写盘失败' : '' }
|
|
463
|
+
}
|
|
464
|
+
|
|
329
465
|
async function archiveAndDelete(item, probe) {
|
|
330
466
|
const service = cleaner()
|
|
331
467
|
if (service === undefined || service === null) {
|
|
@@ -370,6 +506,7 @@ export function apply(ctx) {
|
|
|
370
506
|
mkdirSync(RAW_DIR, { recursive: true })
|
|
371
507
|
const day = nowIso().slice(0, 10)
|
|
372
508
|
const file = path.join(RAW_DIR, rawFileName(item, day))
|
|
509
|
+
if (existsSync(file)) return file
|
|
373
510
|
const lines = []
|
|
374
511
|
lines.push('---')
|
|
375
512
|
lines.push('title: 群会话原文 ' + item.groupOpenid.slice(0, 8))
|
|
@@ -522,7 +659,8 @@ export function apply(ctx) {
|
|
|
522
659
|
}))
|
|
523
660
|
return sendJson(res, 200, {
|
|
524
661
|
ok: true,
|
|
525
|
-
version: '0.1.
|
|
662
|
+
version: '0.1.2',
|
|
663
|
+
pending: readPending(),
|
|
526
664
|
config,
|
|
527
665
|
patches: patchResults,
|
|
528
666
|
state,
|
|
@@ -553,5 +691,5 @@ export function apply(ctx) {
|
|
|
553
691
|
for (const item of patchResults) {
|
|
554
692
|
if (item.status !== 'already') report('补丁 ' + item.id + ' → ' + item.status + (item.error ? '(' + item.error + ')' : ''))
|
|
555
693
|
}
|
|
556
|
-
report('已加载 v0.1.
|
|
694
|
+
report('已加载 v0.1.2:dryRun=' + config.dryRun + ',每 ' + config.sweepMinutes + ' 分钟巡检,待定宽限 ' + config.groupPendingGraceDays + ' 天')
|
|
557
695
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-memory-archivist",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "QQ 群会话归档(针对 dsh-qqbot 与 dsh-plugin-memory
|
|
5
|
+
"description": "QQ 群会话归档(针对 dsh-qqbot 与 dsh-plugin-memory 优化):被踢/自退先保留会话 15 天并落 T0 原文,群解散才立即归档删会话;同时负责 node_modules 补丁的启动自愈。",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"deepseek",
|
|
8
8
|
"deepseek-harness",
|