Commit Graph

213 Commits

Author SHA1 Message Date
minecraft1024a
ec61a9ccf0 新增反击模式支持,允许在检测到提示词注入攻击时生成反击响应并发送。更新相关配置和处理逻辑,增强系统的防护能力。 2025-08-18 22:13:23 +08:00
tt-P607
15ae0ea609 <Thinking>
我需要分析这个git diff,并生成一个与之前完全不同的commit message。

让我先分析变更内容:

1. **主要变更**:
   - 在 `anti_injector.py` 中添加了新的 `auto` 处理模式
   - 添加了命令跳过列表功能 (`command_skip_list`)
   - 重构了反注入管理命令,从独立插件移动到核心动作插件
   - 更新了配置文件以支持新功能
   - 在插件管理器中添加了跳过列表刷新逻辑

2. **之前的commit message重点**:
   - 强调了"advanced anti-injection capabilities"
   - 重点描述了"intelligent 'auto' mode"
   - 提到了"command skip list"
   - 强调了"dynamically assesses threats"
   - 提到了"refactored and integrated into core actions plugin"

3. **我需要完全不同的角度**:
   - 可以从架构重构的角度
   - 可以从用户体验改进的角度
   - 可以从系统集成的角度
   - 可以从性能优化的角度

让我从**系统架构优化和插件整合**的角度来写这个commit message,重点强调:
- 插件系统的重构和整合
- 管理命令的迁移和统一
- 跳过机制的实现
- 自动化决策系统的引入

这样就能避免使用之前message中的关键词和结构。
</Thinking>

refactor(plugins): 重构反注入插件架构并优化命令管理体系

将反注入管理功能从独立插件迁移至核心动作模块,实现更好的系统集成。新增智能跳过机制,允许已注册的插件命令绕过检测流程,有效减少误判。同时引入自适应处理策略,系统可根据威胁评估结果自主选择最适当的响应方式。

插件管理器现已集成自动刷新功能,确保跳过列表与插件状态保持同步。配置系统扩展支持多种跳过模式和自定义规则,提升了整体可维护性和用户体验。
ps:谢谢雅诺狐姐姐投喂的提交喵^ω^
2025-08-18 21:49:17 +08:00
雅诺狐
7856c6a8e9 Expand dangerous keyword list in message shielding
Extended the list of dangerous keywords in the _partially_shield_content method to cover more attack vectors, including system commands, privilege escalation, information leakage, and social engineering. This enhances the robustness of the message shielding mechanism against prompt injection and related attacks.
2025-08-18 18:08:10 +08:00
雅诺狐
ceb8150914 Expand and update prompt injection detection patterns
Enhanced the default_patterns list in PromptInjectionDetector with more comprehensive and specific regular expressions to improve detection of prompt injection attempts, including new patterns for admin commands, system prompts, privilege escalation, and sensitive information leakage. This update aims to strengthen the robustness of the anti-prompt-injection mechanism.
2025-08-18 18:04:44 +08:00
雅诺狐
f61710b0ce Refactor anti-injector process result handling
Introduced a ProcessResult enum to standardize anti-injector message processing outcomes. Updated anti_injector.py to return ProcessResult values instead of booleans, and refactored bot.py to handle these results with improved logging and clearer control flow. This change improves code clarity and maintainability for anti-prompt injection logic.
2025-08-18 17:51:44 +08:00
雅诺狐
689aface9d Add LLM anti-prompt injection system
Introduces a comprehensive anti-prompt injection system for LLMs, including rule-based and LLM-based detection, user ban/whitelist management, message shielding, and statistics tracking. Adds new modules under src/chat/antipromptinjector, integrates anti-injection checks into the message receive flow, updates configuration and database models, and provides test scripts. Also updates templates and logger aliases to support the new system.
2025-08-18 17:27:59 +08:00
雅诺狐
cb65d91c7a Refactor antiprompt flowchart and fix indentation
Updated the antipromptinjector flowchart for improved clarity and logic. Fixed indentation in expression_selector.py to correct code structure. Removed obsolete db_migration_plan.md documentation.
2025-08-17 20:51:52 +08:00
minecraft1024a
ba5563abc5 feat(chat): 私聊专注模式下强制回复
在私聊的专注模式下,即使用户的发言没有触发任何功能,机器人也会进行回复,而不是选择“no_reply”。
此举旨在提升私聊场景下的用户体验,避免机器人因未匹配到关键词而沉默,让对话感觉更自然。
2025-08-17 16:48:42 +08:00
雅诺狐
37684fea51 Update emoji_manager.py 2025-08-17 13:59:09 +08:00
雅诺狐
a9d5cd8958 fix:数据库修复 2025-08-17 13:56:15 +08:00
雅诺狐
5e2485dde0 Create 流程图.md
Co-Authored-By: tt-P607 <68868379+tt-P607@users.noreply.github.com>
2025-08-17 02:52:21 +08:00
雅诺狐
93901f4851 Merge branch 'master' of https://github.com/MaiBot-Plus/MaiMbot-Pro-Max 2025-08-16 23:48:07 +08:00
雅诺狐
d46d689c43 数据库重构 2025-08-16 23:43:45 +08:00
minecraft1024a
8588a21c75 feat(config): 为表情包识别添加独立的VLM模型配置
为表情包识别功能(emoji_vlm)引入了专门的模型任务配置,使其与通用的视觉语言模型(VLM)配置分离。这提高了配置的灵活性和模块化程度。

- 在 `api_ada_configs.py` 中新增 `emoji_vlm` 任务配置。
- 更新 `emoji_manager.py` 以使用新的 `emoji_vlm` 配置。
- 在 `model_config_template.toml` 中添加了相应的配置模板。
2025-08-16 22:15:08 +08:00
minecraft1024a
26689061d6 fix(statistic): 修复统计任务中因数据库记录格式问题导致的异常
在处理来自数据库的记录时,增加对记录类型的检查和时间戳格式的转换。确保即使记录不是预期的字典格式,或者时间戳字段为None或字符串格式,程序也能够安全处理,避免因`TypeError`或`AttributeError`导致整个统计任务中断(说真的这都一天了为什么还没人修)
2025-08-16 21:33:40 +08:00
雅诺狐
7dfaf54c9c llm统计记录模型反应时间 2025-08-16 14:26:18 +08:00
minecraft1024a
e19106b5b0 添加聊天类型限制功能,支持根据聊天类型过滤命令和动作,新增私聊和群聊专用命令及动作,优化相关日志记录。 2025-08-16 13:21:13 +08:00
Furina-1013-create
f4968c5751 炸飞Breaking形式并顺手修了一个数据库的小bug 2025-08-14 22:34:44 +08:00
minecraft1024a
b82bb30095 优化ActionPlanner类中的时间戳更新逻辑,确保在成功执行计划后再更新last_obs_time_mark,以提高消息判断的准确性。 2025-08-14 17:57:01 +08:00
minecraft1024a
9b49c20614 将聊天消息构建器中的日志级别从info调整为debug,以减少日志输出的冗余,优化调试信息的记录。 2025-08-14 15:33:42 +08:00
minecraft1024a
ec63259886 在聊天消息构建器中添加日志记录功能,记录函数调用参数和处理过程,优化动作记录的返回格式,确保返回的动作记录包含必要字段。 2025-08-14 14:07:42 +08:00
minecraft1024a
ee66fbe827 优化插件热重载管理,支持多个监听目录 2025-08-14 13:43:22 +08:00
minecraft1024a
5f7f68f640 重构日程管理模块,将原有的schedule_manager模块迁移至manager目录,并更新相关引用。同时优化了定时任务管理逻辑,确保基于日程的发送功能正常运作,改进了日志记录和活动处理机制(OK兄弟们全体目光向我看齐,看我看我,我是个sb) 2025-08-14 12:40:58 +08:00
Furina-1013-create
9d29228784 我靠我我视频识别怎么又给我炸了
--已重新修复......
2025-08-14 00:45:19 +08:00
Furina-1013-create
b0846b5d05 光速修复主动思考的bug -AI选择沉默的时候会把这个消息泄漏到群聊里面 2025-08-13 23:52:24 +08:00
Furina-1013-create
e0fa579a83 增加关于主动思考的配置,现在你可以在配置文件里面设置Bot的一个主动思考回复的行为
请务必不要修改proactive_thinking_prompt_template里面的{time}占位符以及请回复沉默!!!( )
 对了还有,你们知道吗,狐狐已经同意女装了(不是
2025-08-13 23:18:50 +08:00
minecraft1024a
a8dc0937dd 整理了一下配置文件 2025-08-13 21:39:23 +08:00
minecraft1024a
e95d105f8f 添加表情包情感分析功能,允许通过配置启用二次识别以生成情感关键词,并更新相关文档和配置模板。 2025-08-13 21:32:19 +08:00
minecraft1024a
36e937a57a 更新时间戳显示模式,在消息回复和规划器规划时:消息将显示完整日期 (如: 2024-01-15 14:30:22) 2025-08-13 21:19:30 +08:00
minecraft1024a
8a538cd0c0 更新聊天响应逻辑,优化消息针对性判断,避免无意义参与;同时在提示中增加针对性分析规则以提升对话质量。 2025-08-13 20:55:51 +08:00
minecraft1024a
2d498544a6 Merge branch 'master' of https://github.com/MaiBot-Plus/MaiMbot-Pro-Max 2025-08-13 19:11:40 +08:00
minecraft1024a
871ece9965 添加决策器自定义提示词功能,允许用户启用并设置自定义提示词内容 2025-08-13 19:11:30 +08:00
ikun-11451
a105ce6d26 Merge branch 'master' of https://github.com/MaiBot-Plus/MaiMbot-Pro-Max 2025-08-13 19:09:39 +08:00
ikun-11451
6f54da9e2d 给这个文件的请求session加上一个with上下文管理喵~ 2025-08-13 19:09:24 +08:00
minecraft1024a
f071345bbc 优化决策后时间戳更新逻辑,确保新消息判断的准确性 2025-08-13 18:49:45 +08:00
雅诺狐
0e7ebffb8f Update storage.py 2025-08-13 18:38:12 +08:00
雅诺狐
a42be7b5ae 格式化了一下代码 2025-08-13 18:38:06 +08:00
minecraft1024a
370176bffa 优化表情包删除逻辑,确保成功删除记录后返回正确的结果。同时,更新聊天提示模板,新增日程和心情信息,以提升聊天互动的自然性和趣味性(希望能更好的回复) 2025-08-13 16:10:45 +08:00
minecraft1024a
6030b9e7c2 修复interest_value为None的情况,确保在计算兴趣值时不会出现错误。将interest_value的默认值设置为0.0,以提高代码的健壮性。 2025-08-13 13:44:12 +08:00
Furina-1013-create
7ee9b8f39f Merge branch 'master' of https://github.com/MaiBot-Plus/MaiMbot-Pro-Max 2025-08-13 13:36:31 +08:00
Furina-1013-create
8e2137a4a8 在能量值上面动了点手脚,现在你可以在config里面重新配置群聊里面的聊天模式了 2025-08-13 13:34:21 +08:00
minecraft1024a
c0720a72cb 优化图片格式处理,统一将'jpg'格式转换为'jpeg',新增标准化和MIME类型转换功能,以确保API兼容性和提高代码可读性(最主要的还是为了gemini) 2025-08-13 13:20:15 +08:00
minecraft1024a
9c11dd9b0f 修复emoji_manager.py中的数据库持久化逻辑;更新Maizone插件的作者信息和项目链接。 2025-08-13 11:30:44 +08:00
minecraft1024a
4c8daa3c7f 新增强制私聊专注模式配置,优化专注模式切换逻辑,确保在私聊时能正确管理能量值和专注状态。 2025-08-13 11:00:27 +08:00
minecraft1024a
15562db2d6 将日志级别从info更改为debug,以减少日志输出的冗余,优化调试信息的记录。 2025-08-13 10:43:42 +08:00
minecraft1024a
bc50bb35b5 新增0.9之前的Prompt模板,支持选择Prompt模式(s4u或normal),并更新相关配置文件以适应新功能。 2025-08-13 10:40:08 +08:00
雅诺狐
fe97d897ef 优化项目结构,格式化代码 2025-08-13 09:49:39 +08:00
Furina-1013-create
32feae137e 增加视频识别板块
采用抽帧的方式识别视频,可以自己配置详细参数 -详细请看bot_config最底下
更改了template模板
多bb一句:我真的是被这个炸服了,改完这里那里就又炸了,但是总之现在没问题了
2025-08-13 01:58:43 +08:00
雅诺狐
4da66f39c9 小修复 2025-08-12 22:38:26 +08:00
雅诺狐
7c0efafd50 更新插件示例,及信息类型问题 2025-08-12 18:43:29 +08:00