feat: add pluggable workflow orchestrator controls
This commit is contained in:
@@ -31,6 +31,7 @@ function plazaRouteError(res, req, error) {
|
||||
* @param {object} deps.userAuth
|
||||
* @param {object|null} deps.llmProviderService
|
||||
* @param {object|null} deps.memoryV2ConfigService
|
||||
* @param {object|null} deps.orchestratorConfigService
|
||||
* @param {object|null} deps.skillRuntimeConfigService
|
||||
* @param {object|null} deps.systemDisclosurePolicyService
|
||||
* @param {object|null} deps.adminSystemTestService
|
||||
@@ -47,6 +48,7 @@ export function createAdminApi({
|
||||
assetGatewayConfigService,
|
||||
imageMakeAdminConfigService,
|
||||
memoryV2ConfigService,
|
||||
orchestratorConfigService,
|
||||
mindSearchConfigService,
|
||||
skillRuntimeConfigService,
|
||||
systemDisclosurePolicyService,
|
||||
@@ -225,6 +227,34 @@ export function createAdminApi({
|
||||
return res.json(result);
|
||||
});
|
||||
|
||||
adminApi.get('/orchestrator/config', requireAdmin, async (_req, res) => {
|
||||
if (!orchestratorConfigService?.getAdminConfig) {
|
||||
return res.status(503).json({ message: 'Orchestrator 配置服务未启用' });
|
||||
}
|
||||
return res.json(await orchestratorConfigService.getAdminConfig());
|
||||
});
|
||||
|
||||
const updateOrchestratorConfig = async (req, res) => {
|
||||
if (!orchestratorConfigService?.updateAdminConfig) {
|
||||
return res.status(503).json({ message: 'Orchestrator 配置服务未启用' });
|
||||
}
|
||||
const result = await orchestratorConfigService.updateAdminConfig(
|
||||
req.body?.config ?? req.body ?? {},
|
||||
{ updatedBy: req.currentUser.id },
|
||||
);
|
||||
return res.json(result);
|
||||
};
|
||||
|
||||
adminApi.put('/orchestrator/config', requireAdmin, updateOrchestratorConfig);
|
||||
adminApi.patch('/orchestrator/config', requireAdmin, updateOrchestratorConfig);
|
||||
|
||||
adminApi.get('/orchestrator/runtime', requireAdmin, async (_req, res) => {
|
||||
if (!orchestratorConfigService?.getRuntimeState) {
|
||||
return res.status(503).json({ message: 'Orchestrator 配置服务未启用' });
|
||||
}
|
||||
return res.json(await orchestratorConfigService.getRuntimeState());
|
||||
});
|
||||
|
||||
adminApi.get('/skill-runtime/config', requireAdmin, async (_req, res) => {
|
||||
if (!skillRuntimeConfigService?.getAdminConfig) {
|
||||
return res.status(503).json({ message: 'Skill Runtime 配置服务未启用' });
|
||||
|
||||
Reference in New Issue
Block a user