Commit Graph

74 Commits

Author SHA1 Message Date
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
DrSmoothl
89df7ccf6b feat: 添加 NapCat 适配器的入站消息编解码功能,增强插件配置更新逻辑和数据库交互测试 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
DrSmoothl
dd20cd4992 refactor: 增强文档注释 2026-03-24 12:14:28 +08:00
DrSmoothl
780cd4f767 refactor: 更新插件和 RPC 服务器逻辑,增强握手状态管理与配置校验 2026-03-24 12:14:28 +08:00
DrSmoothl
85f060621d feat: Add NapCat adapter plugin and enhance message handling
- Introduced a built-in NapCat adapter plugin for MVP message forwarding.
- Implemented core functionalities for connecting to NapCat/OneBot v11 WebSocket service.
- Added message serialization capabilities for WebUI chat routes.
- Enhanced the RegisterPluginPayload to include optional adapter declarations.
- Implemented methods for handling external messages and adapter declarations in the PluginRunner.
- Improved the send_service to inherit platform IO route metadata for outgoing messages.
2026-03-24 12:13:17 +08:00
DrSmoothl
75cd50ee0f refactor: 更新能力实现注册和请求处理,增强类型一致性 2026-03-24 12:13:17 +08:00
DrSmoothl
e4850c469f feat: Enhance plugin loading and management
- Added module_name parameter to PluginMeta for better module tracking.
- Improved documentation for PluginMeta and PluginLoader methods.
- Introduced methods for managing loaded plugins: set_loaded_plugin, remove_loaded_plugin, and purge_plugin_modules.
- Enhanced dependency resolution in PluginLoader with resolve_dependencies method.
- Implemented candidate discovery and loading in PluginLoader.
- Added support for plugin reloading with _reload_plugin_by_id in PluginRunner.
- Improved error handling and logging throughout the RPCClient and PluginRunner.
- Added support for handling hook invocations in PluginRunner.
- Refactored plugin registration and unregistration processes for clarity and efficiency.
2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
3d22657707 refactor: supervisor部分方法重写 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
6cc7e37b1e refactor: 提取部分共同方法,预备supervisor 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
310d7798ba refactor: hook_dispatcher相关的修改 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
17248a4cbc 添加message gateway组件类型 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
32519c688b refactor: event_dispatcher 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
14a0c21cbf refactor: component_registry更易理解 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
ca6fd96d4c refactor: 确认ErrorCode可以继承str,恢复原来设计 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
84a6524bd9 refactor: 移除generation;添加新的ErrorCode;修改ErrorCode的一个名称 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
49b620219d refcator: 重命名policy为authorization;移除envelope的generation(runner不再重载); 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
e1b2ecb5b1 fix: (AI) 更robust的传输 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
3419075599 feat: 添加注释;添加日志颜色自定义 2026-03-24 12:13:17 +08:00
DrSmoothl
a5a6d2cb26 fix: 修复错误的插件重载机制,改为插件级区分
test: 补充新版本插件系统重载机制的测试
2026-03-16 13:27:10 +08:00
DrSmoothl
df088205dd refactor(plugin_loader): 优化插件发现与加载逻辑,使用 Path 类型增强可读性 2026-03-16 08:22:42 +08:00
DrSmoothl
7136deac93 补充 uds 的类型注解 2026-03-16 08:16:01 +08:00
DrSmoothl
7420f84fd0 补充 named pipe 文件的类型注解 2026-03-16 08:03:51 +08:00
DrSmoothl
00c2158f76 feat: 更新 handle_config_reload 方法文档,明确配置热重载的行为和通知机制 2026-03-16 07:49:25 +08:00
UnCLAS-Prommer
6e97bead53 Merge branch 'r-dev' of github.com:Mai-with-u/MaiBot into r-dev 2026-03-15 23:53:59 +08:00
UnCLAS-Prommer
cab502e727 修复拼写;将str换为路径使其更清晰 2026-03-15 23:48:15 +08:00
DrSmoothl
ef9b0d6d08 feat(plugin_loader): 添加临时 sys.path 入口管理器以支持插件加载 2026-03-15 22:04:33 +08:00
anderwer
e8244ed49e fix: 为 Runtime 和 Loader 补充包式插件导入支持 2026-03-15 16:58:53 +08:00
DrSmoothl
e1b3cf6e9f fix: 修复 Windows 平台下信号处理器注册问题,避免不必要的注册尝试 2026-03-15 16:27:50 +08:00
anderwer
314bbcd587 fix(plugin_runtime): handle unsupported signal handlers on Windows 2026-03-15 16:04:38 +08:00
DrSmoothl
49b9401709 feat: 添加 Windows Named Pipe 传输实现,支持异步连接和数据传输,修复 Windows 平台插件系统导入隔离误把 DLLs 加进去的 bug 2026-03-15 15:44:14 +08:00
DrSmoothl
6c6e441fbe pylance fix x3 2026-03-14 02:14:32 +08:00
DrSmoothl
2e080e437a pylance fix x2 2026-03-14 02:08:50 +08:00
DrSmoothl
10ff7a01c2 pylance fix 2026-03-14 01:50:00 +08:00
DrSmoothl
2c330e3902 重构事件总线和插件运行时,优化消息处理逻辑,新增 IPC 传输字典转换功能,改进组件管理协议 2026-03-14 01:39:59 +08:00
DrSmoothl
c4a0cc19f8 重构服务模块,优化消息处理逻辑,移除冗余功能,更新数据模型适配 2026-03-14 00:52:10 +08:00
DrSmoothl
4bc9c5bf7e 炸 service 层 x 2,把能归类为现有重构好的模块的都归类过去 2026-03-14 00:33:08 +08:00
DrSmoothl
43c5b34623 炸 service 层 2026-03-14 00:13:35 +08:00
DrSmoothl
2f3519411a feat: 添加 Host 应用版本号支持,优化插件加载和热重载逻辑,检测重复插件 ID 2026-03-13 17:35:35 +08: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
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