Commit Graph

5556 Commits

Author SHA1 Message Date
SengokuCola
233114b22d feat:分离主循环和消息接收流程,移除文件操作 2026-03-28 15:54:28 +08:00
SengokuCola
c545b24966 feat:优化maisak循环逻辑,分离接受和处理,移除冗余config.py 2026-03-28 15:23:38 +08:00
DrSmoothl
8b85c483b8 feat: 添加 API 匹配收集方法以增强 API 解析能力 2026-03-28 14:21:52 +08:00
DrSmoothl
7a460a474d feat: 更新多个文件以使用 SessionMessage 替代 MaiMessage,并调整相关逻辑 2026-03-28 13:39:48 +08:00
SengokuCola
a3bc145051 feat:让Maisaka使用message_cache 2026-03-27 15:08:11 +08:00
SengokuCola
0959193808 remove:两个弃用模块 2026-03-27 13:11:51 +08:00
DrSmoothl
414f7ad9a0 feat: 更新日志信息为中文以增强可读性 2026-03-26 23:08:52 +08:00
DrSmoothl
0a08973c41 feat: Enhance emoji and image management with asynchronous background processing
- Added support for scheduling background tasks to build emoji and image descriptions when not found in cache.
- Improved error handling and logging for emoji and image processing.
- Updated `SessionMessage` processing to allow for optional heavy media analysis and voice transcription.
- Refactored logging messages for better clarity and consistency across various modules.
- Introduced a new function to build outbound log previews for messages, enhancing logging capabilities.
2026-03-26 23:03:47 +08:00
DrSmoothl
777d4cb0d2 feat: Enhance OpenAI compatibility and introduce unified LLM service data models
- Refactored model fetching logic to support various authentication methods for OpenAI-compatible APIs.
- Introduced new data models for LLM service requests and responses to standardize interactions across layers.
- Added an adapter base class for unified request execution across different providers.
- Implemented utility functions for building OpenAI-compatible client configurations and request overrides.
2026-03-26 16:15:42 +08:00
SengokuCola
6e7daae55d Merge branch 'r-dev' of https://github.com/Mai-with-u/MaiBot into r-dev 2026-03-24 20:58:16 +08:00
SengokuCola
a5fc4d172d feat:提供原生vlm支持 2026-03-24 20:57:57 +08:00
DrSmoothl
0b0f47a444 feat: Enhance Hook System with HookHandler and Dispatcher
- Introduced HookHandlerEntry to manage hook processing with attributes like hook name, mode, order, timeout, and error policy.
- Implemented normalization methods for hook attributes to ensure valid configurations.
- Updated ComponentRegistry to support retrieval of hook handlers based on hook names, with sorting by mode and order.
- Refactored HookDispatcher to handle invocation of hooks, separating blocking and non-blocking handlers, and managing execution results.
- Added support for registering hook specifications and invoking hooks across supervisors in PluginRuntimeManager.
- Removed deprecated workflow step handling from PluginRunner, streamlining hook invocation responses.
2026-03-24 19:04:05 +08:00
SengokuCola
6cfc92e66f feat:添加maisaka接管回复逻辑 2026-03-24 18:11:15 +08:00
DrSmoothl
865e4916e3 refactor: 简化 display_name 属性的实现逻辑 2026-03-24 16:20:06 +08:00
DrSmoothl
7f490914d5 feat: 重构数据模型,添加聊天目标信息和回复生成结果模型 2026-03-24 16:17:01 +08:00
DrSmoothl
dcdb84acb1 feat: 添加规划动作相关数据模型,重构相关逻辑 2026-03-24 16:04:23 +08:00
SengokuCola
418a05effd Merge branch 'r-dev' of https://github.com/Mai-with-u/MaiBot into r-dev 2026-03-24 15:42:03 +08:00
SengokuCola
37f45d48c5 feat:maisaka使用主程序的message格式,优化逻辑,移除冗余模块 2026-03-24 15:41:58 +08:00
DrSmoothl
2c279f703c Revert "feat:尝试建立hfc逻辑"
This reverts commit bfc9781c4f.
2026-03-24 15:32:09 +08:00
DrSmoothl
b8224bdb3c refactor: 优化插件处理逻辑,改进导入保护机制 2026-03-24 12:14:59 +08:00
DrSmoothl
d5581a1a97 feat: 增强插件导入管理,添加导入请求验证和模块访问控制 2026-03-24 12:14:59 +08:00
DrSmoothl
f4a9afc452 feat: 增强 RPC 服务器连接处理,添加连接锁以防止并发连接问题 2026-03-24 12:14:59 +08:00
DrSmoothl
1b61e51554 feat: 添加批量插件重载功能及相关测试 2026-03-24 12:14:59 +08:00
DrSmoothl
78858f7004 fix: 更新插件适配器名称以反映新的命名约定 2026-03-24 12:14:59 +08:00
DrSmoothl
17b7306188 fix: 使用 f-string 改进日志记录格式 2026-03-24 12:14:59 +08:00
DrSmoothl
a61b124c93 feat: enhance global config handling and component resolution in plugin runtime 2026-03-24 12:14:59 +08:00
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
UnCLAS-Prommer
0066224251 fix: remove nc ada 2026-03-24 12:14:41 +08:00
DrSmoothl
a0c653de45 docs: 更新注释规范和语言规范,强调使用 Google DocStr 格式和简体中文 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
DrSmoothl
dd20cd4992 refactor: 增强文档注释 2026-03-24 12:14:28 +08:00
DrSmoothl
a1859027ef 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
DrSmoothl
07256182fb refactor(manager): 使用 List 类型替代 list,增强类型一致性 2026-03-24 12:13:17 +08:00
DrSmoothl
04f260e570 实现完整的消息中间层地基,暂未接入实际的消息流 2026-03-24 12:13:17 +08:00
UnCLAS-Prommer
3d22657707 refactor: supervisor部分方法重写 2026-03-24 12:13:17 +08:00