update branch

This commit is contained in:
qwen.ai[bot]
2026-04-25 13:11:26 +00:00
committed by Falck
parent 83c3ccb86b
commit 64c8713945
26 changed files with 1417 additions and 82 deletions

View File

@@ -9,14 +9,16 @@ from datetime import datetime
from oss.logger.logger import Log
from oss.plugin.types import Plugin, register_plugin_type, Response
from oss.config import get_config
class PluginStorage:
"""插件隔离存储 - 每个插件拥有独立的 data/<plugin_name>/ 目录"""
def __init__(self, plugin_name: str, data_dir: str = "./data"):
def __init__(self, plugin_name: str, data_dir: str = None):
config = get_config()
self.plugin_name = plugin_name
self.data_dir = Path(data_dir) / plugin_name
self.data_dir = Path(data_dir or str(config.data_dir)) / plugin_name
self.data_dir.mkdir(parents=True, exist_ok=True)
self._data: dict[str, Any] = {}
self._lock = threading.Lock()