lingshu-skill 5.50.0 → 5.52.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.
- package/CHANGELOG.md +48 -0
- package/README.md +1 -1
- package/SKILL-lite.md +1 -1
- package/SKILL-tiny.md +1 -1
- package/SKILL.md +1 -1
- package/assets/panel.html +105 -38
- package/package.json +1 -1
- package/scripts/astrbot_plugin_lingshu/CHECKSUMS.json +8 -8
- package/scripts/astrbot_plugin_lingshu/engine/CHANGELOG.md +48 -0
- package/scripts/astrbot_plugin_lingshu/engine/README.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-lite.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL-tiny.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/SKILL.md +1 -1
- package/scripts/astrbot_plugin_lingshu/engine/assets/panel.html +105 -38
- package/scripts/astrbot_plugin_lingshu/engine/scripts/panel_server.py +3419 -3372
- package/scripts/astrbot_plugin_lingshu/engine/scripts/persona.py +37 -0
- package/scripts/panel_server.py +3419 -3372
- package/scripts/persona.py +37 -0
package/scripts/persona.py
CHANGED
|
@@ -1469,6 +1469,43 @@ def daily_drift(days: int = 1) -> dict:
|
|
|
1469
1469
|
applied = True
|
|
1470
1470
|
audit_log("ai", "daily_drift", "state.mood_score",
|
|
1471
1471
|
f"{int(cur)}→{new}(近{days}天 net={net})")
|
|
1472
|
+
# —— 内驱演化(DRIVE-EVOLVE v5.52)——
|
|
1473
|
+
# 历史问题:mind_tune 只有 CLI 手动路径,从初识后好奇/理智永远不变。
|
|
1474
|
+
# 这里用【真实信号】驱动(都可追溯到记忆库),每天最多 ±2,带 history 留痕:
|
|
1475
|
+
# 好奇↑:近期用户大量要求调研/探索/深挖(说明他喜欢多问一层)
|
|
1476
|
+
# 理智↑:近期被纠正(correction)或要求证据/权衡(说明他要求严谨)
|
|
1477
|
+
try:
|
|
1478
|
+
import re as _re
|
|
1479
|
+
dr = p.setdefault("drives", {})
|
|
1480
|
+
_explore_words = ("调研", "查查", "搜一下", "深挖", "还有啥", "还有什么",
|
|
1481
|
+
"研究", "探索", "再看看", "改进", "完善", "优化", "想法")
|
|
1482
|
+
_rigor_words = ("证据", "权衡", "取舍", "利弊", "风险", "严谨",
|
|
1483
|
+
"不要猜", "查清楚", "根因")
|
|
1484
|
+
_explore_n = sum(1 for t0 in texts if any(w in t0 for w in _explore_words))
|
|
1485
|
+
_rigor_n = sum(1 for t0 in texts if any(w in t0 for w in _rigor_words))
|
|
1486
|
+
_corr_n = sum(1 for m0 in recent if m0.get("correction"))
|
|
1487
|
+
_dcur = 2 if _explore_n >= 3 else (1 if _explore_n >= 1 else 0)
|
|
1488
|
+
_drea = 2 if (_corr_n >= 1 or _rigor_n >= 3) else (1 if _rigor_n >= 1 else 0)
|
|
1489
|
+
for _k, _dv, _why0 in (("curiosity", _dcur, f"近{days}天探索类请求 {_explore_n} 条"),
|
|
1490
|
+
("reason", _drea, f"近{days}天纠正 {_corr_n} 条 / 严谨类 {_rigor_n} 条")):
|
|
1491
|
+
if not _dv:
|
|
1492
|
+
continue
|
|
1493
|
+
_old = dr.get(_k)
|
|
1494
|
+
if not isinstance(_old, (int, float)) or isinstance(_old, bool):
|
|
1495
|
+
continue
|
|
1496
|
+
_new = max(0, min(100, int(_old) + _dv))
|
|
1497
|
+
if _new != int(_old):
|
|
1498
|
+
dr[_k] = _new
|
|
1499
|
+
p.setdefault("history", []).append({
|
|
1500
|
+
"ts": now, "field": f"drives.{_k}", "from": int(_old), "to": _new,
|
|
1501
|
+
"why": f"内驱自然演化:{_why0}", "source": "drift"})
|
|
1502
|
+
audit_log("ai", "drive_evolve", f"drives.{_k}",
|
|
1503
|
+
f"{int(_old)}→{_new}({_why0})")
|
|
1504
|
+
applied = True
|
|
1505
|
+
if applied:
|
|
1506
|
+
save_persona(p)
|
|
1507
|
+
except Exception as _e:
|
|
1508
|
+
log_event("persona", f"内驱演化失败(不影响其他):{_e}", level="warn")
|
|
1472
1509
|
return {
|
|
1473
1510
|
"days": days, "memories": len(recent),
|
|
1474
1511
|
"emotion_hits": hits, "positive": positive, "negative": negative,
|