Commit Graph

185 Commits

Author SHA1 Message Date
DrSmoothl
1f02171a63 Refactor plugin loader and runner to support enhanced manifest structure
- Updated the PluginMeta class to utilize a strongly typed PluginManifest, improving type safety and clarity.
- Refactored dependency extraction logic to streamline the handling of plugin dependencies.
- Modified the PluginLoader to accommodate new manifest versioning and validation processes.
- Enhanced the PluginRunner to work with a dictionary for external available plugins, allowing for version mapping.
- Updated built-in plugins' manifest files to version 2, adding URLs and SDK versioning for better integration and documentation.
- Improved error handling and logging for plugin loading and dependency resolution processes.
2026-03-24 12:14:59 +08:00
DrSmoothl
0c508995dd feat: enhance session ID calculation and plugin management
- Updated `calculate_session_id` method in `SessionUtils` to include optional `account_id` and `scope` parameters for more granular session ID generation.
- Added new environment variables in `plugin_runtime` for external plugin dependencies and global configuration snapshots.
- Introduced methods in `RuntimeComponentManagerProtocol` for loading and reloading plugins globally, accommodating external dependencies.
- Enhanced `PluginRunnerSupervisor` to manage external available plugin IDs during plugin reloads.
- Implemented dependency extraction and management in `PluginRuntimeManager` to handle cross-supervisor dependencies.
- Added tests for session ID calculation and message registration in `ChatManager` to ensure correct behavior with new parameters.
2026-03-24 12:14:58 +08:00
DrSmoothl
7a304ba549 feat: Enhance API and Outbound Tracking Functionality
- Add test for fallback to bot account in platform IO route metadata when context message is absent.
- Improve PlatformIOManager to avoid duplicate driver entries and streamline fallback driver handling.
- Refactor OutboundTracker to support tracking by both internal message ID and driver ID, enhancing the uniqueness of pending records.
- Introduce dynamic API capabilities in RuntimeComponent, allowing plugins to replace their dynamic API lists.
- Update APIRegistry to manage dynamic APIs more effectively, including registration and toggling of API statuses.
- Implement authorization checks for dynamic API capabilities to ensure proper permissions.
- Restrict direct calls to certain host RPC methods from plugins for enhanced security.
- Refactor send_service to ensure fallback to current platform account when no context message is available.
2026-03-24 12:14:58 +08:00
DrSmoothl
d13767ee21 feat: Enhance plugin configuration management and SDK integration
- Add support for configuration reload scopes in the plugin runtime.
- Implement validation for SDK plugins to ensure required lifecycle methods are overridden.
- Update the configuration update handling to include scope information.
- Introduce tests for expression auto-check task and NapCat adapter SDK integration.
- Refactor configuration management to support callbacks with variable arguments.
- Improve plugin loading and error handling for configuration updates.
- Ensure that plugins can manage their own configuration updates effectively.
2026-03-24 12:14:58 +08:00
DrSmoothl
9dea6b0e6f feat: implement dedicated API registry and enhance API handling capabilities
- Added APIEntry and APIRegistry classes for managing plugin APIs.
- Updated PluginRunnerSupervisor to include API registry and methods for invoking APIs.
- Enhanced PluginRuntimeManager to support API registration and invocation.
- Created tests for API registration, invocation, and visibility between plugins.
- Refactored component handling to distinguish between runtime components and APIs.
2026-03-24 12:14:41 +08:00
DrSmoothl
18a0e7664a Refactor plugin runtime components and enhance message handling
- Removed unused core action mirror functionality from PluginRunnerSupervisor.
- Simplified action and command execution logic in send_service.py.
- Introduced ComponentQueryService for unified component querying in plugin runtime.
- Enhanced message component handling with new binary component support.
- Improved message sequence construction and detection of outbound message flags.
- Updated methods for sending messages to streamline the process and improve readability.
2026-03-24 12:14:41 +08:00
DrSmoothl
d07915eea0 Refactor message sending architecture and implement legacy driver support
- Removed UniversalMessageSender from group_generator.py and private_generator.py.
- Updated PlatformIOManager to manage legacy send drivers and ensure send pipeline readiness.
- Enhanced LegacyPlatformDriver to utilize prepared messages for sending.
- Refactored send_service to unify message sending logic and integrate with Platform IO.
- Added regression tests for Platform IO legacy driver and send service functionality.
2026-03-24 12:14:41 +08:00
DrSmoothl
e26b27c287 refactor: update message gateway handling and remove adapter references
- Changed the message sending method to return DeliveryBatch instead of DeliveryReceipt in integration.py.
- Removed AdapterDeclarationPayload and related references from envelope.py, replacing them with MessageGatewayStateUpdatePayload and MessageGatewayStateUpdateResultPayload.
- Updated runner_main.py to remove adapter-related logic and methods, focusing on message gateway functionality.
- Added tests for message gateway runtime state synchronization and action bridge functionality in test files.
2026-03-24 12:14:41 +08:00
UnCLAS-Prommer
d07e8f90ef fix: remove nc ada pytest 2026-03-24 12:14:41 +08:00
DrSmoothl
89df7ccf6b feat: 添加 NapCat 适配器的入站消息编解码功能,增强插件配置更新逻辑和数据库交互测试 2026-03-24 12:14:28 +08:00
DrSmoothl
56a6d2fd8c refactor: 优化数据库操作和模型定义,增强表达方式和黑话表的插入逻辑 2026-03-24 12:14:28 +08:00
DrSmoothl
baabe4463e feat: add NapCat built-in adapter with configuration, filters, and transport layer
- Implemented configuration parsing for NapCat adapter including server, chat, and filter settings.
- Added message filtering logic to handle inbound chat messages based on user and group lists.
- Developed a transport layer for WebSocket communication with the NapCat server.
- Created a query service for fetching user and group information from the QQ platform.
- Implemented runtime state management to report connection status to the host.
- Added notice handling for various QQ platform events.
2026-03-24 12:14:28 +08:00
DrSmoothl
4e2e7a279e feat: Implement adapter runtime state management and update handling
- Added support for adapter runtime state updates in the PluginRunnerSupervisor.
- Introduced new payload classes: AdapterStateUpdatePayload and AdapterStateUpdateResultPayload for handling state updates.
- Implemented methods to bind and unbind routes based on adapter connection status.
- Enhanced the NapCat adapter to report connection state and manage runtime state.
- Added tests for adapter runtime state synchronization and database session behavior in the statistic module.
- Updated existing methods to ensure proper handling of adapter state and route bindings.
2026-03-24 12:14:28 +08:00
Dawn ARC
df872187d8 Merge branch 'r-dev' into r-dev 2026-03-24 10:00:58 +08:00
DrSmoothl
e66b2eb662 feat: 添加安全静态文件路径解析测试,增强路径遍历保护 2026-03-19 18:05:10 +08:00
Dawn ARC
eb257345dd Merge branch 'r-dev' into r-dev 2026-03-18 21:57:41 +08:00
DawnARC
bd84e500e1 feat:新增记忆测试、检索工具与服务
新增完整的长期记忆支持及测试:引入中文记忆检索提示词、query_long_term_memory 检索工具、记忆服务与记忆流程服务,以及 WebUI 的记忆路由。新增大规模测试套件(包括单元测试与基准/在线测试),覆盖聊天历史摘要、知识获取器、事件(episode)生成、写回机制以及用户画像检索等功能。

更新多个模块以集成记忆检索能力(包括 knowledge fetcher、chat summarizer、memory_retrieval、person_info、config/legacy 迁移以及 WebUI 路由),并移除遗留的 lpmm 知识模块。这些变更完成了记忆运行时的接入,同时为基准测试提供嵌入适配器的 mock,并支持新测试与工具所需的导入与 episode 处理流程。
2026-03-18 21:35:17 +08:00
DrSmoothl
a40d28a409 feat: 添加 EmojiManager 的配置热重载功能及其注销机制 2026-03-16 22:58:53 +08:00
DrSmoothl
a5a6d2cb26 fix: 修复错误的插件重载机制,改为插件级区分
test: 补充新版本插件系统重载机制的测试
2026-03-16 13:27:10 +08:00
DrSmoothl
ef9b0d6d08 feat(plugin_loader): 添加临时 sys.path 入口管理器以支持插件加载 2026-03-15 22:04:33 +08:00
DrSmoothl
e1b3cf6e9f fix: 修复 Windows 平台下信号处理器注册问题,避免不必要的注册尝试 2026-03-15 16:27:50 +08:00
DrSmoothl
49b9401709 feat: 添加 Windows Named Pipe 传输实现,支持异步连接和数据传输,修复 Windows 平台插件系统导入隔离误把 DLLs 加进去的 bug 2026-03-15 15:44:14 +08:00
晴猫
34a8de56c3 feat: 添加静态路径准备和自动构建功能的单元测试 2026-03-15 10:06:59 +09:00
晴猫
d3420bd1b3 fix: address second-round review feedback on bot identity PR 2026-03-15 08:05:36 +09:00
晴猫
4f8ab0abb1 fix: address bot identity review regressions 2026-03-15 07:51:31 +09:00
晴猫
267b42001e fix: make bot identity platform-aware 2026-03-15 07:22:08 +09:00
晴猫
e1a055b959 fix: 优化测试用例中的文件写入和读取错误处理逻辑 2026-03-15 04:02:28 +09:00
春河晴
5da82c4e24 feat: 更新 Crowdin 工作流以支持 dashboard WebUI 的本地化文件,添加相关验证逻辑 2026-03-13 20:09:22 +09:00
DrSmoothl
8da1b6d93f feat: 实现插件能力令牌的多版本支持,优化插件热重载逻辑 2026-03-13 16:54:01 +08:00
DrSmoothl
324432ff92 feat: 添加对 key_field/key_value 参数的兼容处理,自动转换为 filters 2026-03-13 16:37:46 +08:00
DrSmoothl
262efa2302 feat: 优化表情包插件和 TTS 插件的异步调用,简化错误处理逻辑 2026-03-13 16:31:59 +08:00
UnCLAS-Prommer
26ba33ff74 Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-03-13 16:20:11 +08:00
UnCLAS-Prommer
1592ee82a6 fix: pytest更新;session_message相关test更新 2026-03-13 16:19:49 +08:00
DrSmoothl
29f4d05a87 feat: 添加组件启停目标解析功能,支持全局唯一短名,避免跨 Supervisor 误操作 2026-03-13 16:15:20 +08:00
DrSmoothl
7e2b509bf0 feat: 实现 RPC 服务器的发送队列和背压控制机制 2026-03-13 16:05:51 +08:00
DrSmoothl
d92aa800a3 feat: 实现插件配置更新通知机制,支持热重载与文件变化监听 2026-03-13 15:47:49 +08:00
DrSmoothl
f1e10b4054 feat: 添加插件身份绑定机制,防止伪造插件身份的 RPC 调用 2026-03-13 15:40:14 +08:00
DrSmoothl
44a9e9ecd7 feat: 实现插件注册的分阶段接入与切换机制,优化 RPC 连接管理 2026-03-13 15:21:40 +08:00
DrSmoothl
a576313b22 Ruff Format 2026-03-13 11:45:26 +08:00
DrSmoothl
bcb7963d37 feat: 增强命令调用逻辑,支持通过 plugin.invoke_command 返回原始结构,并优化消息统计功能 2026-03-13 10:49:20 +08:00
春河晴
67b559200d move zh-CN prompt source 2026-03-13 02:36:08 +09:00
春河晴
d418a8451b feat: 增强国际化验证功能,添加对共享翻译字符串的支持,优化提示模板加载逻辑 2026-03-13 01:59:20 +09:00
DrSmoothl
f3270d4d41 feat: 添加插件运行时配置类,增强会话令牌管理和插件目录支持 2026-03-13 00:11:00 +08:00
春河晴
4b7ee3923c ci: tighten crowdin and i18n PR checks 2026-03-13 00:35:30 +09:00
春河晴
c9bfedddd2 i18n: localize prompt templates with crowdin 2026-03-13 00:09:08 +09:00
DrSmoothl
b17948a495 feat: 添加 Runner 日志桥,支持将 Runner 进程日志通过 IPC 批量发送到主进程 2026-03-12 21:45:58 +08:00
DrSmoothl
d0b56abdab feat: 增强插件能力检查,支持 generation 校验并添加清理功能 2026-03-12 21:22:23 +08:00
春河晴
c470fdfd1e i18n: crowdin integration 2026-03-12 17:23:17 +09:00
UnCLAS-Prommer
9fbb733e0a MessageUtils更新 2026-03-11 20:18:30 +08:00
UnCLAS-Prommer
aaf1c9ed40 更严厉测试 2026-03-10 13:48:24 +08:00