feat: get plugin info

This commit is contained in:
Junyan Qin
2025-07-13 22:14:22 +08:00
parent 4380041c7f
commit e0abd19636
3 changed files with 19 additions and 4 deletions

View File

@@ -98,6 +98,9 @@ class PluginRuntimeConnector:
async def list_plugins(self) -> list[dict[str, Any]]:
return await self.handler.list_plugins()
async def get_plugin_info(self, author: str, plugin_name: str) -> dict[str, Any]:
return await self.handler.get_plugin_info(author, plugin_name)
async def emit_event(
self,
event: events.BaseEventModel,

View File

@@ -372,6 +372,18 @@ class RuntimeConnectionHandler(handler.Handler):
return result['plugins']
async def get_plugin_info(self, author: str, plugin_name: str) -> dict[str, Any]:
"""Get plugin"""
result = await self.call_action(
LangBotToRuntimeAction.GET_PLUGIN_INFO,
{
'author': author,
'plugin_name': plugin_name,
},
timeout=10,
)
return result['plugin']
async def emit_event(
self,
event_context: dict[str, Any],