perf: optimize app startup and background lifecycles
This commit is contained in:
@@ -11,6 +11,7 @@ type AgentBrowserBody = {
|
||||
url?: unknown;
|
||||
action?: unknown;
|
||||
visible?: unknown;
|
||||
enabled?: unknown;
|
||||
bounds?: unknown;
|
||||
method?: unknown;
|
||||
params?: unknown;
|
||||
@@ -237,6 +238,20 @@ export async function handleAgentBrowserRoutes(
|
||||
bounds: parseBounds(body.bounds),
|
||||
});
|
||||
await ensureProjectStillActive(ctx, project);
|
||||
emitState(ctx, 'agent-browser:state', browser);
|
||||
sendJson(res, 200, { success: true, browser });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (url.pathname === '/api/agent-browser/diagnostics' && req.method === 'POST') {
|
||||
requireRendererPresentation(req);
|
||||
const body = await readBody(req);
|
||||
const project = await resolveActiveProject(ctx, body.project_path);
|
||||
const browser = await service.setDiagnostics({
|
||||
projectPath: project.path,
|
||||
enabled: body.enabled === true,
|
||||
});
|
||||
await ensureProjectStillActive(ctx, project);
|
||||
sendJson(res, 200, { success: true, browser });
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user