feat(agent-browser): add opt-in preview data injection

This commit is contained in:
2026-08-26 22:36:54 +08:00
parent 14fec70108
commit 38d63a9b7b
11 changed files with 1024 additions and 3 deletions

View File

@@ -11,6 +11,7 @@ type AgentBrowserBody = {
url?: unknown;
action?: unknown;
visible?: unknown;
inject_project_data?: unknown;
enabled?: unknown;
bounds?: unknown;
method?: unknown;
@@ -221,6 +222,7 @@ export async function handleAgentBrowserRoutes(
url: targetUrl,
bounds: parseBounds(body.bounds),
visible: rendererPresentation && body.visible !== false,
...(body.inject_project_data === true ? { injectProjectData: true } : {}),
});
await ensureProjectStillActive(ctx, project);
emitState(ctx, 'agent-browser:show', browser);