Commit Graph

72 Commits

Author SHA1 Message Date
Windpicker-owo
5d1390d546 event重构暂时完成,待测试 2025-11-19 22:46:26 +08:00
雅诺狐
34252ea4a0 refactor: 清理代码质量和移除未使用文件
- 移除未使用的导入语句和变量
- 修复代码风格问题(空格、格式化等)
- 删除备份文件和测试文件
- 改进异常处理链式调用
- 添加权限系统数据库模型和配置
- 更新版本号至6.4.4
- 优化SQL查询使用正确的布尔表达式
2025-11-19 22:46:18 +08:00
雅诺狐
3360b22dca Refactor anti-injection system and remove command skip list
Removed the command skip list feature and related code from the anti-injection system, including configuration options, plugin command collection, and management commands. Refactored anti-injector logic to operate directly on message dictionaries and simplified whitelist and message content extraction. Updated response handling to perform anti-injection checks before reply generation, and removed skip list refresh logic from the plugin manager.
2025-11-19 22:46:06 +08:00
雅诺狐
1b9c86abef Refactor web search plugin and clean up code
Refactored the web search plugin by removing the old Bing search implementation and reorganizing the plugin structure. Introduced modular search engine classes under 'web_search_tool/engines' and utility tools under 'web_search_tool/tools' and 'web_search_tool/utils'. Updated references and initialization logic to support multiple search engines and improved maintainability. Also performed minor code cleanups and replaced 'except ...: pass' with 'except ...: ...' for brevity.
2025-11-19 22:45:42 +08:00
雅诺狐
31e028ab25 Refactor anti-injection system into modular subpackages
Split the anti-prompt-injector module into core, processors, management, and decision submodules for better maintainability and separation of concerns. Moved and refactored detection, shielding, statistics, user ban, message processing, and counter-attack logic into dedicated files. Updated imports and initialization in __init__.py and anti_injector.py to use the new structure. No functional changes to detection logic, but code organization is significantly improved.
2025-11-19 22:45:01 +08:00
minecraft1024a
d20daaf3e2 新增反击模式支持,允许在检测到提示词注入攻击时生成反击响应并发送。更新相关配置和处理逻辑,增强系统的防护能力。 2025-11-19 22:44:03 +08:00
雅诺狐
2d91a7d55c 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-11-19 22:43:58 +08:00
雅诺狐
16da725272 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-11-19 22:43:57 +08:00
雅诺狐
875e02d42f 数据库重构 2025-11-19 22:40:23 +08:00
minecraft1024a
38fed9b4cc 添加聊天类型限制功能,支持根据聊天类型过滤命令和动作,新增私聊和群聊专用命令及动作,优化相关日志记录。 2025-11-19 22:40:01 +08:00
雅诺狐
b966a2f09c 小修复 2025-11-19 22:35:34 +08:00
雅诺狐
a588a2a695 添加了一个发送api 2025-11-19 22:35:26 +08:00
UnCLAS-Prommer
1461338c0c typing fix 2025-08-13 22:51:34 +08:00
SengokuCola
f0fff5a039 fix:person创建和调用区分 2025-08-12 15:15:50 +08:00
SengokuCola
d1f15a932a fix:缺少stream的报错 2025-08-08 21:20:28 +08:00
SengokuCola
a2c86f3605 feat:部分处理notify,自动同步数据库null约束变更
notify存储至message库
2025-08-08 12:34:21 +08:00
UnCLAS-Prommer
bbb112d803 动态控制命令后续处理 2025-07-25 11:01:14 +08:00
UnCLAS-Prommer
d6284b6b4c 插件管理API测试与修改通过 2025-07-24 00:31:53 +08:00
UnCLAS-Prommer
10bf424540 增加了组件的局部禁用方法 2025-07-23 00:41:31 +08:00
SengokuCola
95d6ee1213 修复合并错误 2025-07-22 21:15:02 +08:00
SengokuCola
2a8d29332e Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev 2025-07-22 20:42:36 +08:00
SengokuCola
75022b5d10 s4u的一些修改,包括动作适配 2025-07-22 20:36:53 +08:00
UnCLAS-Prommer
484fc20983 typing and plugins 2025-07-21 01:23:23 +08:00
SengokuCola
faeb76bdd2 fix:s4u由platform触发 2025-07-20 14:24:44 +08:00
SengokuCola
a150aa7b2b feat:noreply不考虑command 2025-07-15 21:37:32 +08:00
SengokuCola
5ec0d42cde feat:添加新的message类为s4u服务,添加s4u config,添加sc和gift的解析,修复关系构建的一些问题 2025-07-15 17:04:30 +08:00
UnCLASPrommer
eae399fb95 typing change, use enum instead of string, fix typo 2025-07-14 23:40:09 +08:00
SengokuCola
e987b6331f Update bot.py 2025-07-13 15:50:08 +08:00
SengokuCola
6226de10ea remove:移除pfc遗留代码 2025-07-13 15:19:56 +08:00
UnCLAS-Prommer
f890722c3d Merge branch 'dev' into plugin 2025-07-13 01:28:48 +08:00
SengokuCola
6f1add930b feat:统一化模式动作,移除模式配置 2025-07-12 23:24:02 +08:00
UnCLAS-Prommer
b303a95f61 部分类型注解修复,优化import顺序,删除无用API文件 2025-07-12 00:34:49 +08:00
SengokuCola
50f0ddf2ce feat;新的情绪系统 2025-07-09 01:50:26 +08:00
UnCLAS-Prommer
1ea5d28d73 防止新版的notify炸消息 2025-07-07 16:57:44 +08:00
SengokuCola
1de15bcc31 ref:调整文件位置和命名,结构更清晰 2025-07-06 18:47:08 +08:00
github-actions[bot]
0e485f4680 🤖 自动格式化代码 [skip ci] 2025-07-06 03:47:36 +00:00
SengokuCola
b69be93e8e fix:修复过滤次序问题 2025-07-06 11:47:03 +08:00
github-actions[bot]
fbe8f08862 🤖 自动格式化代码 [skip ci] 2025-07-03 04:26:17 +00:00
SengokuCola
c3588a707c Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev 2025-07-03 12:26:01 +08:00
SengokuCola
0b2bf81f75 remove & fix:移除人格表达,修复过滤词失效,私聊强制focus 2025-07-03 12:24:38 +08:00
github-actions[bot]
b369d12c90 🤖 自动格式化代码 [skip ci] 2025-07-01 16:22:13 +00:00
SengokuCola
bb2a95e388 feat:为s4u添加了优先队列和普通队列 2025-07-02 00:21:47 +08:00
github-actions[bot]
324b294b5f 🤖 自动格式化代码 [skip ci] 2025-07-01 11:33:16 +00:00
SengokuCola
e04bf94e16 feat:一对多的新模式 2025-07-01 15:22:03 +08:00
github-actions[bot]
baac5e44cf 🤖 自动格式化代码 [skip ci] 2025-06-30 09:44:38 +00:00
A0000Xz
749deb09b8 增加错误检测,移除完全不必要的部分 2025-06-29 00:37:30 +08:00
A0000Xz
48060c601d 配合ada的dev改动,更简洁地实现消息回报更新message_id 2025-06-28 20:37:12 +08:00
A0000Xz
5573ec28ff 注意到ada改动后有的不爱填addtional_config,特意适配 2025-06-28 17:21:34 +08:00
A0000Xz
63eb678433 添加了mmc对于上报消息更新数据库内message_id的支持
目前只能支持text,image,emoji和reply的message_id更新
2025-06-26 23:16:13 +08:00
A0000Xz
1ba1b85f7d 现在被指令截断的消息会被保存并正常加入prompt 2025-06-25 13:17:29 +08:00