fix(agent-browser): restore bounded presentation lifecycle

This commit is contained in:
2026-09-06 12:50:18 +08:00
parent 5c61110f46
commit 9fed0cc7c4
20 changed files with 1714 additions and 49 deletions

View File

@@ -546,6 +546,18 @@ async function initialize(): Promise<void> {
storage: codingProjectStorage,
projectStore: codingProjectStore,
browser: agentBrowser,
requestAgentBrowserPresentation: (snapshot) => {
hostEventBus.emit('agent-browser:show', snapshot);
if (!window.isDestroyed() && !window.webContents.isDestroyed()) {
window.webContents.send('agent-browser:show', snapshot);
}
},
publishAgentBrowserState: (snapshot) => {
hostEventBus.emit('agent-browser:state', snapshot);
if (!window.isDestroyed() && !window.webContents.isDestroyed()) {
window.webContents.send('agent-browser:state', snapshot);
}
},
getLocalProxyCredential: () => getHostApiToken() || undefined,
acquireBackgroundLease: (lease) => backgroundLifecycle!.acquireLease(lease),
paths: {