修复Action组件可用性和实现消息驱动思考循环

Action组件修复:
- 在core_actions插件中正确注册reply动作
ps:这个优先还是使用之前系统原有的reply,新增这个仅作为回退使用

- 更新_manifest.json、config.toml和plugin.py

- 解决no_reply和reply动作不可用问题(关于这个我觉得是之前的那个在focus模式下设置了提及/@ 必回然后移除动作的先后顺序这一块有问题)

大C发力了,今天有一点感冒所以停止思考这一块()
This commit is contained in:
Furina-1013-create
2025-08-22 13:42:05 +08:00
committed by Windpicker-owo
parent bca9747691
commit 6af2716e0e
8 changed files with 709 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ class NoReplyAction(BaseAction):
focus_activation_type = ActionActivationType.ALWAYS # 修复在focus模式下应该始终可用
normal_activation_type = ActionActivationType.ALWAYS # 修复在normal模式下应该始终可用
mode_enable = ChatMode.FOCUS | ChatMode.NORMAL # 修复:在所有模式下都可用
mode_enable = ChatMode.FOCUS
parallel_action = False
# 动作基本信息

View File

@@ -24,6 +24,16 @@
"is_built_in": true,
"plugin_type": "action_provider",
"components": [
{
"type": "action",
"name": "no_reply",
"description": "暂时不回复消息,等待新消息或超时"
},
{
"type": "action",
"name": "reply",
"description": "执行基本回复动作"
},
{
"type": "action",
"name": "emoji",

View File

@@ -17,6 +17,7 @@ from src.common.logger import get_logger
# 导入API模块 - 标准Python包方式
from src.plugins.built_in.core_actions.no_reply import NoReplyAction
from src.plugins.built_in.core_actions.reply import ReplyAction
from src.plugins.built_in.core_actions.emoji import EmojiAction
from src.plugins.built_in.core_actions.anti_injector_manager import AntiInjectorStatusCommand, AntiInjectorSkipListCommand
@@ -55,6 +56,8 @@ class CoreActionsPlugin(BasePlugin):
"config_version": ConfigField(type=str, default="0.6.0", description="配置文件版本"),
},
"components": {
"enable_no_reply": ConfigField(type=bool, default=True, description="是否启用不回复动作"),
"enable_reply": ConfigField(type=bool, default=True, description="是否启用基本回复动作"),
"enable_emoji": ConfigField(type=bool, default=True, description="是否启用发送表情/图片动作"),
"enable_anti_injector_manager": ConfigField(type=bool, default=True, description="是否启用反注入系统管理命令"),
},
@@ -65,6 +68,10 @@ class CoreActionsPlugin(BasePlugin):
# --- 根据配置注册组件 ---
components = []
if self.get_config("components.enable_no_reply", True):
components.append((NoReplyAction.get_action_info(), NoReplyAction))
if self.get_config("components.enable_reply", True):
components.append((ReplyAction.get_action_info(), ReplyAction))
if self.get_config("components.enable_emoji", True):
components.append((EmojiAction.get_action_info(), EmojiAction))
if self.get_config("components.enable_anti_injector_manager", True):