lingshu-skill 5.68.0 → 5.70.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +1 -1
  3. package/SKILL-lite.md +1 -1
  4. package/SKILL-tiny.md +1 -1
  5. package/SKILL.md +1 -1
  6. package/assets/panel.html +11 -3
  7. package/cordis-plugin/lingshu-cron/plugin.js +32 -6
  8. package/cordis-plugin/lingshu-guard/plugin.js +34 -10
  9. package/cordis-plugin/lingshu-im/plugin.js +19 -2
  10. package/cordis-plugin/lingshu-startup/context-fold.js +5 -1
  11. package/cordis-plugin/lingshu-startup/plugin.js +9 -1
  12. package/index.js +26 -21
  13. package/manifest.json +35 -35
  14. package/package.json +1 -1
  15. package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +10 -10
  16. package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +43 -0
  17. package/scripts/astrbot_plugin_lingshu/engine/README.md +1 -1
  18. package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
  19. package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
  20. package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
  21. package/scripts/astrbot_plugin_lingshu/engine/assets/panel.html +11 -3
  22. package/scripts/astrbot_plugin_lingshu/engine/scripts/desktop_shortcut.py +10 -1
  23. package/scripts/astrbot_plugin_lingshu/engine/scripts/growth.py +5629 -5575
  24. package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_data.py +17 -3
  25. package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_settings.py +24 -1
  26. package/scripts/desktop_shortcut.py +10 -1
  27. package/scripts/growth.py +5629 -5575
  28. package/scripts/panel_data.py +17 -3
  29. package/scripts/panel_settings.py +24 -1
  30. package/scripts/run_tests.py +240 -171
  31. package/scripts/update_dsh_copy.ps1 +42 -6
@@ -1,5 +1,48 @@
1
1
  # 更新日志
2
2
 
3
+ ## v5.70(2026-12-05)
4
+
5
+ ### 🏗️ 150 项审计第十四批:发布流水线与测试门禁组大收官
6
+
7
+ 1. **LS-129(高·GitHub Release 校验)**:`release.yml` 发布前校验标签与代码版本一致(SKILL.md/package.json 三方对账),并运行核心测试作为门禁;旧标签不再无条件覆盖 latest。
8
+ 2. **LS-131(高·目录替换原子回滚)**:`growth.py` 的 `_atomic_replace_dir` 移除全部"先删目标"路径——非原子复制走独立 staging 先复制、成功后才替换,任何故障不留空树或混合树。
9
+ 3. **LS-135(中·快捷方式路径修正)**:`growth.py` 从安装目录(SKILL.md 父目录)拼接 panel_server.py 路径,快捷方式真正指向刚装好的目标副本。
10
+ 4. **LS-139(高·PowerShell 坏包失败)**:`update_dsh_copy.ps1` 的 `Get-CopyVersion` 解析错误抛致命错误(非零退出),不再返回 "?" 伪装成功。
11
+ 5. **LS-140(高·PowerShell 事务回滚)**:`update_dsh_copy.ps1` 复制前整目录备份,失败时整体回滚到备份状态,不留混合副本。
12
+ 6. **LS-141(中·预同步退出码)**:`run_tests.py` 的 engine 预同步非零退出时整体中止测试(返回 2),不再"打提示继续跑"。
13
+ 7. **LS-142(高·超时杀进程树)**:`run_tests.py` 超时后用 taskkill/T / killpg 终止整个子进程树,不留孤儿进程占用端口。
14
+ 8. **LS-143(中·.mjs 纳入统一测试)**:`run_tests.py` 追加 node --test 执行所有 test_*.mjs,JS 门禁与 Python 测试同链。
15
+ 9. **LS-144(中·缺 Node 明确 SKIP)**:无 node 可执行文件时 .mjs 测试明确标记 SKIP(计入失败),不再静默通过。
16
+ 10. **LS-145(中·桌面快捷方式隔离)**:`desktop_shortcut.py` 支持 `LINGSHU_TEST_DESKTOP_DIR` 环境变量重定向;`run_tests.py` 为所有测试进程设置临时桌面目录。
17
+ 11. **LS-147(中·stale manifest 不跳过)**:`test_selfupdate_egg.py` 清单过期时自动重新生成,仍过期则明确 FAIL,不再静默 SKIP。
18
+ 12. **LS-148(中·npm 更新测试断言)**:`test_p24_update_npm.py` 替换恒真断言——同版本/旧版本/新版本分别断言确定结果。
19
+ 13. **LS-149(中·插件冒烟核心失败必须 FAIL)**:`test_plugin_smoke.py` 从允许状态移除"核心调用失败",解释器/权限故障直接阻断。
20
+ 14. **LS-150(中·长轮询仅接受真实响应)**:`test_p21_panel_lifecycle.py` 连接拒绝/重置/DNS 全部判 FAIL,只有真实端点响应或读超时才通过。
21
+
22
+ ---
23
+
24
+ ## v5.69(2026-12-05)
25
+
26
+ ### 🛡️ 150 项审计第十三批:Cordis IM 安全与面板设置组大收官
27
+
28
+ 1. **LS-093(高·guard 注册失败拒绝态)**:`lingshu-guard` 注册全部失败时进入 deny-all——所有工具调用直接拒绝并给明确诊断,IM 鉴权绝不裸奔。
29
+ 2. **LS-094(高·IM 授权跟随真实 HOME)**:`lingshu-im` 的 `memoryHome()` 与 Python 一致解析 `.home` 指针,旧默认目录的 consent.json 不再覆盖真实库授权。
30
+ 3. **LS-095(高·群聊缺 chatId fail-closed)**:群聊消息无有效 chatId 时返回 null 拒绝召回/写回,绝不降级成私聊作用域。
31
+ 4. **LS-099(高·SKILL.md 缺失仍挂 guard)**:`index.js` 技能文档注册失败不再阻断 guard 等安全组件挂载。
32
+ 5. **LS-101(中·只读白名单移除 todo_write)**:`lingshu-guard` 的 `DEFAULT_READ_ONLY` 移除有写副作用的 `todo_write`。
33
+ 6. **LS-102(中·cron 消息去重键)**:mid 规范统一为 `${role}:${mid}`,user/assistant 同数字 id 不再互相误判。
34
+ 7. **LS-103(中·selfReviewDays 真正控制间隔)**:`dueByDays` 按真实日期差��算到期,配 3 天不再每天执行。
35
+ 8. **LS-109(中·extract 只收集真实对话)**:工具/系统/插件注入消息不进对话缓冲,防自我吞噬。
36
+ 9. **LS-111(中·cron 状态原子保存)**:`saveState` 不再先删旧状态,rename 失败时旧状态原样保留。
37
+ 10. **LS-112(中·prior 排除插件注入)**:`lastUserText` 检查 source.name/kind,cron/IM 注入不触发无关 prior 检索。
38
+ 11. **LS-113(中·token 标定 HOME 修复)**:`_calibPaths` 改用已有的 `memoryHome()`,修复 readBrainHome 未定义。
39
+ 12. **LS-114(中·顶层 checkpoint 识别)**:`context-fold.js` 三个位置检查 compact-checkpoint 来源。
40
+ 13. **LS-074(中·损坏 manifest 字段容错)**:`panel_data.py` 单条记录字段级容错,正常备份照常展示。
41
+ 14. **LS-075/077(中·enum 设置与 NaN 拒绝)**:`panel_settings.py` 支持 enum 类型校验;float 拒绝 NaN/Infinity。
42
+ 15. **LS-076/084(中·enum 渲染与体检契约)**:前端 enum 渲染为 select;dochealth 统一走 api() 并以 items 为准。
43
+
44
+ ---
45
+
3
46
  ## v5.68(2026-12-04)
4
47
 
5
48
  ### 🔧 150 项审计第十二批:Cordis 插件多 Agent 隔离修复
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 名字取自《黄帝内经》:**算力给思考,人格给灵魂,记忆给生命。**
4
4
 
5
- > 当前版本 **v5.68**(变更见 [CHANGELOG.md](CHANGELOG.md))
5
+ > 当��版本 **v5.69**(变更见 [CHANGELOG.md](CHANGELOG.md))
6
6
 
7
7
  > 🔁 **双仓库镜像**:GitHub(主)与 Gitee(镜像)保持同步——[gitee.com/htmcwy_0/lingshu-skill](https://gitee.com/htmcwy_0/lingshu-skill)。灵枢的更新检查会探测两边最新提交,**谁更新就自动从谁拉取**;任一边不可达(Gitee 匿名风控 / GitHub 限额)时走另一边兜底。
8
8
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lingshu-lite
3
3
  title: 灵枢-lite
4
- version: 5.68
4
+ version: 5.70
5
5
  description: 灵枢记忆系统的精简版说明书,给 3B 以下本地小模型或第一次用的人。只保留最有用的核心:分层记忆(含冷热自动归档)、模糊回忆、工作记忆、人格初识;砍掉高风险自动能力(自动做梦合并、自动情绪评估、自动提炼知识库)——小模型做这些容易把幻觉固化落盘。当用户提到"记住这个""你还记得吗""你记得什么""上下文快满了"且宿主是小模型时使用。
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lingshu-tiny
3
3
  title: 灵枢-tiny
4
- version: 5.68
4
+ version: 5.70
5
5
  description: 灵枢记忆系统的最小试用版说明书。只剩三件事:startup 带回上次的记忆、remember 记下值得记的、recall 想不起来时捞回来。给第一次接触灵枢的人或最小模型:先跑通这三条拿到真实收益,再决定要不要升级完整版。当用户提到"记住这个""你还记得吗"且你不想背整套机制时使用。
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: lingshu
3
3
  title: 灵枢
4
- version: 5.68
4
+ version: 5.70
5
5
  description: 类脑持久记忆/人格/成长。跨会话记住事情、长出人格、上下文将满时做梦整理。用户提记忆/记住/上次/人格/设定/性格/知识库/笔记/日志/成长/自我进化/工作记忆,或新会话需恢复关系上下文时用。纯本地零依赖。
6
6
  ---
7
7
 
@@ -4250,6 +4250,14 @@ function _settingRow(it){
4250
4250
  const opts = (it.choices || []).map(c =>
4251
4251
  `<option value="${esc(c)}"${String(it.value) === c ? " selected" : ""}>${esc(c)}</option>`).join("");
4252
4252
  ctl = `<select id="${id}" data-key="${esc(it.key)}">${opts}</select>`;
4253
+ } else if (it.kind === "enum"){
4254
+ // LS-076(v5.69):enum 设置渲染为选项控件——支持 ["a","b"] 与 [{value,label}] 两种 options
4255
+ const opts = (it.options || []).map(o => {
4256
+ const v = (o && typeof o === "object") ? String(o.value ?? "") : String(o);
4257
+ const label = (o && typeof o === "object") ? String(o.label ?? o.value ?? "") : String(o);
4258
+ return `<option value="${esc(v)}"${String(it.value) === v ? " selected" : ""}>${esc(label)}</option>`;
4259
+ }).join("");
4260
+ ctl = `<select id="${id}" data-key="${esc(it.key)}">${opts}</select>`;
4253
4261
  } else {
4254
4262
  const step = it.step != null ? it.step : (it.kind === "float" ? 0.05 : 1);
4255
4263
  const min = it.min != null ? ` min="${it.min}"` : "";
@@ -7872,9 +7880,9 @@ setTimeout(() => checkUpdate(true), 1200);
7872
7880
  const el = body();
7873
7881
  if (!el) return;
7874
7882
  try {
7875
- const r = await fetch("/api/doctor-history?limit=90", { cache: "no-store" });
7876
- const j = await r.json();
7877
- const hist = Array.isArray(j) ? j : (j.history || j.rows || []);
7883
+ // LS-083/084(v5.69):统一 API helper 携带 token;items 字段前后端同一契约
7884
+ const j = await api("/api/doctor-history?limit=90");
7885
+ const hist = Array.isArray(j) ? j : (j.items || j.history || j.rows || []);
7878
7886
  if (sum()) {
7879
7887
  const st = (!Array.isArray(j) && j.stage) || null;
7880
7888
  const g = st ? ` · 成长阶段:${esc(st.name || st.stage || "")}` : "";
@@ -30,7 +30,16 @@ def _pythonw() -> str:
30
30
 
31
31
 
32
32
  def _desktop_dir() -> Path:
33
- """桌面真实路径:先读注册表 Shell Folders,再退回 USERPROFILE\\Desktop。"""
33
+ """桌面真实路径:先读注册表 Shell Folders,再退回 USERPROFILE\\Desktop。
34
+
35
+ LS-145(v5.70):测试隔离——设置 LINGSHU_TEST_DESKTOP_DIR 时直接用它,
36
+ 绝不在测试中往真实用户桌面写 .lnk。
37
+ """
38
+ test_override = os.environ.get("LINGSHU_TEST_DESKTOP_DIR", "").strip()
39
+ if test_override:
40
+ p = Path(test_override)
41
+ p.mkdir(parents=True, exist_ok=True)
42
+ return p
34
43
  try:
35
44
  import winreg
36
45
  with winreg.OpenKey(