feat(sleep): 为睡眠系统添加随机时间偏移功能

- 新增每日睡眠和起床时间随机偏移量配置选项
- 实现缓存机制确保同一天内使用相同的偏移量
- 重构睡眠时间检查逻辑以支持动态时间偏移
- 更新相关配置类和插件清单格式
This commit is contained in:
雅诺狐
2025-09-07 08:20:39 +08:00
parent 653599b7e7
commit cb994a4e17
6 changed files with 55 additions and 13 deletions

View File

@@ -283,6 +283,7 @@ class DefaultReplyer:
return False, None, None
from src.plugin_system.core.event_manager import event_manager
# 触发 POST_LLM 事件(请求 LLM 之前)
if not from_plugin:
result = await event_manager.trigger_event(
EventType.POST_LLM, plugin_name="SYSTEM", prompt=prompt, stream_id=stream_id
@@ -304,6 +305,7 @@ class DefaultReplyer:
"model": model_name,
"tool_calls": tool_call,
}
# 触发 AFTER_LLM 事件
if not from_plugin:
result = await event_manager.trigger_event(