feat(agents): 完善恢复费用与云资源交互

This commit is contained in:
2026-09-10 22:29:24 +08:00
parent f8f39f39de
commit 303f26294e
24 changed files with 1170 additions and 127 deletions

View File

@@ -35,16 +35,24 @@ export async function handleCloudAgentsRoutes(req: IncomingMessage, res: ServerR
res.end();
return true;
}
if (path === '/attachments/pick' && req.method === 'POST') {
if (path === '/recovery' && req.method === 'GET') {
data = await cloudAgents.recovery();
} else if (path === '/recovery/recent' && req.method === 'PUT') {
data = await cloudAgents.rememberRecent(await parseJsonBody(req));
} else if (path === '/recovery/pending' && req.method === 'POST') {
data = await cloudAgents.resolvePending(await parseJsonBody(req));
} else if (path === '/attachments/pick' && req.method === 'POST') {
data = await cloudAgents.upload();
} else if (path === '/knowledge/pick' && req.method === 'POST') {
data = await cloudAgents.uploadKnowledge(await parseJsonBody(req));
} else if (path === '/skills/pick' && req.method === 'POST') {
data = await cloudAgents.uploadSkill();
} else if (path === '/files/save' && req.method === 'POST') {
data = await cloudAgents.download(await parseJsonBody(req));
} else if (path === '/actions' && req.method === 'POST') {
data = await cloudAgents.execute(await parseJsonBody(req));
} else if ((path === '/bootstrap' || path === '/agents') && req.method === 'GET') {
data = await cloudAgents.list(url.searchParams.get('cursor'));
data = await cloudAgents.list(url.searchParams.get('cursor'), url.searchParams.get('archived') === 'true');
} else if (path === '/agents' && req.method === 'POST') {
data = await cloudAgents.create(await parseJsonBody(req));
} else {