lingshu-skill 3.99.0 → 4.2.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 (29) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +697 -697
  3. package/SKILL.md +380 -380
  4. package/assets/panel.html +1 -1
  5. package/cordis-plugin/lingshu-cron/plugin.js +1074 -1040
  6. package/docs//350/277/233/345/261/225/344/270/216/345/276/205/345/212/236.md +38 -0
  7. package/package.json +52 -52
  8. package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +12 -10
  9. package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +44 -0
  10. package/scripts/astrbot_plugin_lingshu/engine/README.md +697 -697
  11. package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +380 -380
  12. package/scripts/astrbot_plugin_lingshu/engine/assets/panel.html +1 -1
  13. package/scripts/astrbot_plugin_lingshu/engine/scripts/checkpoint.py +47 -8
  14. package/scripts/astrbot_plugin_lingshu/engine/scripts/cli.py +131 -8
  15. package/scripts/astrbot_plugin_lingshu/engine/scripts/core.py +16 -0
  16. package/scripts/astrbot_plugin_lingshu/engine/scripts/desktop_shortcut.py +136 -0
  17. package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_data.py +75 -4
  18. package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_settings.py +23 -0
  19. package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_update.py +81 -0
  20. package/scripts/astrbot_plugin_lingshu/engine/scripts/release.py +10 -0
  21. package/scripts/checkpoint.py +47 -8
  22. package/scripts/cli.py +131 -8
  23. package/scripts/core.py +16 -0
  24. package/scripts/desktop_shortcut.py +136 -0
  25. package/scripts/panel_data.py +75 -4
  26. package/scripts/panel_settings.py +23 -0
  27. package/scripts/panel_update.py +81 -0
  28. package/scripts/release.py +10 -0
  29. package/scripts/run_tests.py +36 -0
@@ -93,6 +93,16 @@ def do_bump(new_ver: str, title: str) -> int:
93
93
  if not re.fullmatch(r"\d+\.\d+", new_ver):
94
94
  print(f"[release] 版本格式应为 X.Y,收到 {new_ver!r}", file=sys.stderr)
95
95
  return 1
96
+ # semver 不允许前导零:npm 会把 4.01.0 规范化成 4.1.0 发布出去,
97
+ # 而本地 package.json 仍写 4.01.0,publish 轮询 registry 就永远等不到
98
+ # 4.01.0(v4.01 就这么卡死过一次)。在这里挡掉。
99
+ _bad = [seg for seg in new_ver.split(".")
100
+ if len(seg) > 1 and seg.startswith("0") and seg.isdigit()]
101
+ if _bad:
102
+ fixed = ".".join(str(int(s)) if s.isdigit() else s for s in new_ver.split("."))
103
+ print(f"[release] 版本号 {new_ver} 含前导零段 {_bad}(semver 不允许),"
104
+ f"请改用 {fixed}", file=sys.stderr)
105
+ return 1
96
106
  old = cur_version()
97
107
  if _ver_tuple(new_ver) <= _ver_tuple(old):
98
108
  print(f"[release] 新版本 {new_ver} 必须大于当前 {old}", file=sys.stderr)
@@ -74,6 +74,42 @@ def main(argv: list[str]) -> int:
74
74
  print(f"FAIL {f.name}(exit {r.returncode})")
75
75
  shutil.rmtree(tmp, ignore_errors=True)
76
76
 
77
+ # —— 失败重试一次(可见,不掩盖)——
78
+ # 本机 360/索引器在 66 个测试文件连跑时会造成瞬时占用,个别测试(如
79
+ # checkpoint 的 git 取证、behavior baseline 的读写)会偶发失败、单跑必过。
80
+ # 这里对**失败的文件整体重跑一次**:过了就标 "PASS(重试后)",仍不过才算失败。
81
+ # 不做静默重试——重试过的事实必须打出来,否则等于用重试掩盖真回归。
82
+ if failed:
83
+ print()
84
+ print("[重试] 对 %d 个失败文件各重跑一次..." % len(failed))
85
+ still = []
86
+ for name, detail in failed:
87
+ f = next((x for x in files if x.name == name), None)
88
+ if f is None:
89
+ still.append((name, detail))
90
+ continue
91
+ tmp2 = Path(tempfile.mkdtemp(prefix="ls-retry-"))
92
+ env2 = dict(os.environ)
93
+ env2["BRAIN_MEMORY_HOME"] = str(tmp2 / "home")
94
+ env2["LINGSHU_GLOBAL_SKILLS"] = str(tmp2 / "skills")
95
+ env2["PYTHONIOENCODING"] = "utf-8"
96
+ (tmp2 / "home").mkdir(parents=True, exist_ok=True)
97
+ (tmp2 / "skills").mkdir(parents=True, exist_ok=True)
98
+ try:
99
+ r2 = subprocess.run([sys.executable, str(f)], capture_output=True, text=True,
100
+ encoding="utf-8", errors="replace", timeout=1800, env=env2)
101
+ except subprocess.TimeoutExpired:
102
+ still.append((name, detail))
103
+ shutil.rmtree(tmp2, ignore_errors=True)
104
+ continue
105
+ shutil.rmtree(tmp2, ignore_errors=True)
106
+ if r2.returncode == 0:
107
+ print(f" PASS(重试后) {name}")
108
+ else:
109
+ out2 = (r2.stdout or "") + (r2.stderr or "")
110
+ still.append((name, "\n".join(out2.strip().splitlines()[-40:])))
111
+ failed = still
112
+
77
113
  print()
78
114
  if failed:
79
115
  for name, detail in failed: