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.
This commit is contained in:
@@ -238,14 +238,14 @@ class RuntimeCoreCapabilityMixin:
|
||||
return {"success": False, "value": None, "error": str(e)}
|
||||
|
||||
async def _cap_config_get_plugin(self, plugin_id: str, capability: str, args: Dict[str, Any]) -> Any:
|
||||
from src.core.component_registry import component_registry as core_registry
|
||||
from src.plugin_runtime.component_query import component_query_service
|
||||
|
||||
plugin_name: str = args.get("plugin_name", plugin_id)
|
||||
key: str = args.get("key", "")
|
||||
default = args.get("default")
|
||||
|
||||
try:
|
||||
config = core_registry.get_plugin_config(plugin_name)
|
||||
config = component_query_service.get_plugin_config(plugin_name)
|
||||
if config is None:
|
||||
return {"success": False, "value": default, "error": f"未找到插件 {plugin_name} 的配置"}
|
||||
|
||||
@@ -258,11 +258,11 @@ class RuntimeCoreCapabilityMixin:
|
||||
return {"success": False, "value": default, "error": str(e)}
|
||||
|
||||
async def _cap_config_get_all(self, plugin_id: str, capability: str, args: Dict[str, Any]) -> Any:
|
||||
from src.core.component_registry import component_registry as core_registry
|
||||
from src.plugin_runtime.component_query import component_query_service
|
||||
|
||||
plugin_name: str = args.get("plugin_name", plugin_id)
|
||||
try:
|
||||
config = core_registry.get_plugin_config(plugin_name)
|
||||
config = component_query_service.get_plugin_config(plugin_name)
|
||||
if config is None:
|
||||
return {"success": True, "value": {}}
|
||||
return {"success": True, "value": config}
|
||||
|
||||
@@ -648,10 +648,10 @@ class RuntimeDataCapabilityMixin:
|
||||
return {"success": False, "error": str(e)}
|
||||
|
||||
async def _cap_tool_get_definitions(self, plugin_id: str, capability: str, args: Dict[str, Any]) -> Any:
|
||||
from src.core.component_registry import component_registry as core_registry
|
||||
from src.plugin_runtime.component_query import component_query_service
|
||||
|
||||
try:
|
||||
tools = core_registry.get_llm_available_tools()
|
||||
tools = component_query_service.get_llm_available_tools()
|
||||
return {
|
||||
"success": True,
|
||||
"tools": [{"name": name, "definition": info.get_llm_definition()} for name, info in tools.items()],
|
||||
|
||||
Reference in New Issue
Block a user