存档
This commit is contained in:
@@ -246,6 +246,36 @@ class PostgresDatabase:
|
||||
await self.ready_event.wait()
|
||||
return await self._individual_database.get_all_worker_individual()
|
||||
|
||||
# plugin_owned slot 专用门面方法
|
||||
async def find_plugin_slot(self, plugin_name: str, slot_name: str):
|
||||
"""按 (plugin, slot) 查找已登记的插件 agent slot。"""
|
||||
await self.ready_event.wait()
|
||||
return await self._individual_database.find_plugin_slot(plugin_name, slot_name)
|
||||
|
||||
async def upsert_plugin_slot(
|
||||
self,
|
||||
plugin_name: str,
|
||||
slot_name: str,
|
||||
description: str,
|
||||
owner_id: str = "system",
|
||||
node_affinity: str = "cpu",
|
||||
):
|
||||
"""插件安装期登记 agent slot;用户自配 provider/model 不被覆盖。"""
|
||||
await self.ready_event.wait()
|
||||
return await self._individual_database.upsert_plugin_slot(
|
||||
plugin_name, slot_name, description, owner_id, node_affinity
|
||||
)
|
||||
|
||||
async def list_plugin_owned_names(self):
|
||||
"""枚举当前数据库中所有 plugin_owned 值(去重)。"""
|
||||
await self.ready_event.wait()
|
||||
return await self._individual_database.list_plugin_owned_names()
|
||||
|
||||
async def delete_plugin_slots(self, plugin_name: str) -> int:
|
||||
"""删掉某插件登记的全部 slot,返回被删条数。"""
|
||||
await self.ready_event.wait()
|
||||
return await self._individual_database.delete_plugin_slots(plugin_name)
|
||||
|
||||
# Workflow Database Methods
|
||||
async def create_workflow(
|
||||
self, trace_id: str, user_id: str, title: str, command: str
|
||||
|
||||
Reference in New Issue
Block a user