merge: feature/page-data-dev-aider into main
Bring in Page Data Aider dev loop, adm code-run policy UI, and customer order demo. Keep system disclosure policy and agent code-run admin wiring side by side. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,6 +33,7 @@ function plazaRouteError(res, req, error) {
|
||||
* @param {object|null} deps.memoryV2ConfigService
|
||||
* @param {object|null} deps.skillRuntimeConfigService
|
||||
* @param {object|null} deps.systemDisclosurePolicyService
|
||||
* @param {object|null} deps.agentCodeRunPolicyService
|
||||
* @param {object|null} deps.adminSystemTestService
|
||||
* @param {object|null} deps.plazaPosts
|
||||
* @param {object|null} deps.plazaOps
|
||||
@@ -50,6 +51,7 @@ export function createAdminApi({
|
||||
mindSearchConfigService,
|
||||
skillRuntimeConfigService,
|
||||
systemDisclosurePolicyService,
|
||||
agentCodeRunPolicyService,
|
||||
adminSystemTestService,
|
||||
plazaPosts,
|
||||
plazaOps,
|
||||
@@ -286,6 +288,48 @@ export function createAdminApi({
|
||||
return res.json(await skillRuntimeConfigService.getPublicRuntimeConfig());
|
||||
});
|
||||
|
||||
adminApi.get('/agent-code-run/config', requireAdmin, async (_req, res) => {
|
||||
if (!agentCodeRunPolicyService?.getAdminConfig) {
|
||||
return res.status(503).json({ message: 'Agent Code Run 配置服务未启用' });
|
||||
}
|
||||
return res.json(await agentCodeRunPolicyService.getAdminConfig());
|
||||
});
|
||||
|
||||
const updateAgentCodeRunConfig = async (req, res) => {
|
||||
if (!agentCodeRunPolicyService?.updateAdminConfig) {
|
||||
return res.status(503).json({ message: 'Agent Code Run 配置服务未启用' });
|
||||
}
|
||||
try {
|
||||
const result = await agentCodeRunPolicyService.updateAdminConfig(req.body?.config ?? req.body ?? {}, {
|
||||
updatedBy: req.currentUser.id,
|
||||
});
|
||||
return res.json(result);
|
||||
} catch (err) {
|
||||
if (err?.code === 'CODE_RUN_POLICY_ENV_LOCKED') {
|
||||
return res.status(409).json({ message: err.message });
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
adminApi.put('/agent-code-run/config', requireAdmin, updateAgentCodeRunConfig);
|
||||
adminApi.patch('/agent-code-run/config', requireAdmin, updateAgentCodeRunConfig);
|
||||
|
||||
adminApi.get('/agent-code-run/runtime', requireAdmin, async (_req, res) => {
|
||||
if (!agentCodeRunPolicyService?.getRuntimeState) {
|
||||
return res.status(503).json({ message: 'Agent Code Run 配置服务未启用' });
|
||||
}
|
||||
return res.json(await agentCodeRunPolicyService.getRuntimeState());
|
||||
});
|
||||
|
||||
adminApi.get('/agent-code-run/runs', requireAdmin, async (req, res) => {
|
||||
if (!agentCodeRunPolicyService?.listRecentPageDataDevRuns) {
|
||||
return res.status(503).json({ message: 'Agent Code Run 配置服务未启用' });
|
||||
}
|
||||
const limit = Number(req.query?.limit ?? 50);
|
||||
return res.json(await agentCodeRunPolicyService.listRecentPageDataDevRuns({ limit }));
|
||||
});
|
||||
|
||||
adminApi.post('/system-tests/skill-validation', requireAdmin, async (req, res) => {
|
||||
if (!adminSystemTestService?.runSkillValidation) {
|
||||
return res.status(503).json({ message: '系统测试服务未启用' });
|
||||
|
||||
Reference in New Issue
Block a user