@sparkelf/dsh-knowledge-base 0.6.13 → 0.6.14
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/lib/client.js +644 -644
- package/lib/index.js +5 -2
- package/package.json +1 -1
- package/skills/memory/references/guardian.md +1 -1
package/lib/index.js
CHANGED
|
@@ -28534,12 +28534,14 @@ function apply(ctx, deploymentConfig) {
|
|
|
28534
28534
|
return;
|
|
28535
28535
|
}
|
|
28536
28536
|
const cwd = registry.list()[0]?.path ?? process.cwd();
|
|
28537
|
-
const existing = (await schedule.list({ limit: 200 })).items.find((item) => item.title === "记忆守护会话" && item.target.
|
|
28537
|
+
const existing = (await schedule.list({ limit: 200 })).items.find((item) => item.title === "记忆守护会话" && item.target.sessionId !== void 0);
|
|
28538
28538
|
let taskId;
|
|
28539
28539
|
let sessionId;
|
|
28540
|
+
let sessionExists;
|
|
28540
28541
|
if (existing !== void 0 && existing.target.sessionId !== void 0) {
|
|
28541
28542
|
taskId = existing.id;
|
|
28542
28543
|
sessionId = existing.target.sessionId;
|
|
28544
|
+
sessionExists = existing.target.kind === "session";
|
|
28543
28545
|
} else {
|
|
28544
28546
|
const entry = await schedule.create({
|
|
28545
28547
|
title: GUARDIAN_SESSION_TITLE,
|
|
@@ -28559,6 +28561,7 @@ function apply(ctx, deploymentConfig) {
|
|
|
28559
28561
|
taskId = entry.id;
|
|
28560
28562
|
if (entry.target.sessionId === void 0) throw new Error("schedule new_once did not reserve a session id");
|
|
28561
28563
|
sessionId = entry.target.sessionId;
|
|
28564
|
+
sessionExists = false;
|
|
28562
28565
|
}
|
|
28563
28566
|
const store = new GuardianSessionStore(memoryUsersRoot);
|
|
28564
28567
|
const prior = await store.read(LOCAL_USER_ID).catch(() => void 0);
|
|
@@ -28573,7 +28576,7 @@ function apply(ctx, deploymentConfig) {
|
|
|
28573
28576
|
updatedAt: now
|
|
28574
28577
|
});
|
|
28575
28578
|
}
|
|
28576
|
-
await schedule.run({ id: taskId });
|
|
28579
|
+
if (!sessionExists) await schedule.run({ id: taskId });
|
|
28577
28580
|
const pinGuardian = async (tries) => {
|
|
28578
28581
|
try {
|
|
28579
28582
|
await registry.pinSession(sessionId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sparkelf/dsh-knowledge-base",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.14",
|
|
4
4
|
"description": "DataOps-backed knowledge base for DeepSeek Harness: a left-sidebar destination, Settings configuration, and index tooling over a mounted NAS view.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
- **空闲**:某个会话静默了一段时间,可能积累了值得记住的内容。
|
|
8
8
|
- **压缩**:某个会话开始压缩。原始消息仍然存在,压缩摘要会标出被遮蔽的范围;判断依据以原始轨迹为准。
|
|
9
|
-
- **dream
|
|
9
|
+
- **dream**:每日一次的整理与评估。守护会话本身就是承载 dream 的 schedule 任务(new_once,新建并复用),**不要另建 dream 任务**;执行时间以该自动化任务的设置为准。若发现重复的同名任务,按标题去重只保留一份。
|
|
10
10
|
- **存储报错**:记忆增删改查遇到存储访问错误(如未挂载盘、目录缺失、权限拒绝)。消息里带错误信息,按「存储报错自愈」处理。
|
|
11
11
|
|
|
12
12
|
四类消息按到达顺序串行处理。上一轮没有收尾时,不要开始下一轮;宁可晚一点整理,也不要把同一天的记忆写乱。存储报错优先处理——存储不可用时整理也写不进去。
|