feat: displaying plugin debug info (#1828)

This commit is contained in:
Junyan Qin (Chin)
2025-12-01 17:59:49 +08:00
committed by GitHub
parent 0ddc3d60e7
commit e49a161d0a
10 changed files with 188 additions and 1 deletions

View File

@@ -385,6 +385,12 @@ class PluginRuntimeConnector:
async def get_plugin_assets(self, plugin_author: str, plugin_name: str, filepath: str) -> dict[str, Any]:
return await self.handler.get_plugin_assets(plugin_author, plugin_name, filepath)
async def get_debug_info(self) -> dict[str, Any]:
"""Get debug information including debug key and WS URL"""
if not self.is_enable_plugin:
return {}
return await self.handler.get_debug_info()
async def emit_event(
self,
event: events.BaseEventModel,

View File

@@ -758,3 +758,12 @@ class RuntimeConnectionHandler(handler.Handler):
timeout=30,
)
return result
async def get_debug_info(self) -> dict[str, Any]:
"""Get debug information including debug key and WS URL"""
result = await self.call_action(
LangBotToRuntimeAction.GET_DEBUG_INFO,
{},
timeout=10,
)
return result