"""Compatibility entry point for the Browser Use runtime. The previous hand-written observe/decide/click implementation has been retired. Browser navigation and recovery now run through pinned Browser Use attached to the E2B desktop Chrome over authenticated CDP; this module remains so existing API imports do not change. """ from __future__ import annotations from typing import AsyncGenerator, Optional from app.agents.browser_use_bridge import run_browser_use_agent async def run_persistent_browser_agent( task: str, url: Optional[str] = None, *, visual: bool, research_depth: str = "normal", ) -> AsyncGenerator[dict, None]: """Run pinned Browser Use against one persistent E2B Chromium session.""" async for event in run_browser_use_agent( task, url, visual=visual, research_depth=research_depth ): yield event