🔧 修复P0级问题:40+文件语法错误 + import路径 + 清理废弃代码
✨ 跟项目能跑起来就差这一步!这次狠狠修了一波: 🩺 修复40+损坏Python文件 - 补全所有缺少的class定义头(plugin-loader-pro、code-reviewer、 http-api/ws-api/http-tcp、webui/dashboard/log-terminal 等) - 修复中文括号、字符串未闭合、缩进错乱等语法问题 🔗 创建符号链接 plugin_bridge -> plugin-bridge - 解决Python模块路径不支持连字符的问题 - 关联修复 plugin-bridge 中错误的 import 路径 🧹 清理废弃代码 - 删除 oss/tui/ 目录(已废弃) - 清理所有 __pycache__ 和 .pyc 缓存文件 ✅ 全量语法检查通过,零错误! 📋 ai.md 新增代码审计报告和分阶段修复计划 🗺️ 所有插件 use() 调用现在走统一路径
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
def scan_capabilities(plugin_dir):
|
||||
capabilities: set[str] = set()
|
||||
main_file = plugin_dir / "main.py"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""插件加载器 - 专门用于加载核心插件
|
||||
|
||||
遵循「最小化核心框架」设计哲学:
|
||||
- 只负责加载可信的核心插件(来自 store/@{NebulaShell}/)
|
||||
- 只负责加载可信的核心插件(来自 store/NebulaShell/)
|
||||
- 所有插件都使用统一的加载机制
|
||||
- 不再区分沙箱模式和非沙箱模式
|
||||
"""
|
||||
@@ -17,7 +17,7 @@ class PluginLoader:
|
||||
"""插件加载器 - 专门用于加载核心插件
|
||||
|
||||
遵循「最小化核心框架」设计哲学:
|
||||
- 只负责加载可信的核心插件(来自 store/@{NebulaShell}/)
|
||||
- 只负责加载可信的核心插件(来自 store/NebulaShell/)
|
||||
- 所有插件都使用统一的加载机制
|
||||
- 不再区分沙箱模式和非沙箱模式
|
||||
"""
|
||||
@@ -27,7 +27,7 @@ class PluginLoader:
|
||||
self._config = get_config()
|
||||
|
||||
def load_core_plugin(self, plugin_name: str, store_dir: Optional[str] = None) -> Optional[dict[str, Any]]:
|
||||
"""加载核心插件(来自 store/@{NebulaShell}/)
|
||||
"""加载核心插件(来自 store/NebulaShell/)
|
||||
|
||||
Args:
|
||||
plugin_name: 插件名称(如 "plugin-loader")
|
||||
@@ -38,7 +38,7 @@ class PluginLoader:
|
||||
"""
|
||||
if store_dir is None:
|
||||
store_dir = str(self._config.store_dir)
|
||||
plugin_dir = Path(store_dir) / "@{NebulaShell}" / plugin_name
|
||||
plugin_dir = Path(store_dir) / "NebulaShell" / plugin_name
|
||||
return self._load_plugin(plugin_name, plugin_dir)
|
||||
|
||||
def _load_plugin(self, plugin_name: str, plugin_dir: Path) -> Optional[dict[str, Any]]:
|
||||
|
||||
@@ -17,7 +17,7 @@ class PluginManager:
|
||||
遵循「最小化核心框架」设计哲学:
|
||||
- 核心框架只负责加载 plugin-loader 插件
|
||||
- 所有其他插件(HTTP、WebSocket、Dashboard 等)都由 plugin-loader 插件扫描和加载
|
||||
- store/@{NebulaShell}/ 是唯一的插件来源
|
||||
- store/NebulaShell/ 是唯一的插件来源
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -28,7 +28,7 @@ class PluginManager:
|
||||
"""仅加载 plugin-loader 核心插件
|
||||
|
||||
plugin-loader 插件会负责:
|
||||
1. 扫描 store/@{NebulaShell}/ 目录
|
||||
1. 扫描 store/NebulaShell/ 目录
|
||||
2. 加载所有启用的插件
|
||||
3. 处理依赖关系
|
||||
4. 执行 PL 注入机制
|
||||
|
||||
Reference in New Issue
Block a user