v0.2.2: headless mode, debug server auto-start, WS fix, watchdog hot-reload, example plugin
- --headless flag (skip TUI for SSH/systemd) - InitService auto-starts cyrene_debug_server.py - Fixed log WS URL (home.html/api/logs/ws -> api/logs/ws) - PluginService watchdog hot-reload (plugins/ dir) - example_plugin: 2 commands (echo, plugin_status) - Tests: 15/15 passing
This commit is contained in:
@@ -100,23 +100,6 @@ class PluginService:
|
||||
logger.error(f"加载所有插件时出错: {str(e)}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
def _load_plugin_config(self, plugin_name: str) -> dict:
|
||||
"""加载并验证插件配置文件"""
|
||||
import yaml
|
||||
config_path = os.path.join(os.path.dirname(__file__), "..", "plugins", plugin_name, "config.yaml")
|
||||
# Also check workspace plugins dir
|
||||
workspace_config = os.path.join(os.getcwd(), "plugins", plugin_name, "config.yaml")
|
||||
for path in [config_path, workspace_config]:
|
||||
if os.path.exists(path):
|
||||
try:
|
||||
with open(path) as f:
|
||||
return yaml.safe_load(f) or {}
|
||||
except Exception as e:
|
||||
logger.error(f"解析插件配置失败 {path}: {e}")
|
||||
return {}
|
||||
return {}
|
||||
|
||||
async def load_plugin(self, plugin_name: str) -> bool:
|
||||
"""加载单个插件 - 支持异步权限处理"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user