- Applied automated linting suggestions from pre-commit hooks, primarily updating type hints (e.g., Dict -> dict) and organizing imports.
- Refactored Playwright script execution in examples/features/playwright_script_generation.py to use asyncio.create_subprocess_exec for asynchronous handling and real-time log streaming, resolving ASYNC221 lint error and improving output visibility.
Implement the ability to generate executable Playwright scripts from an Agent's run history (`AgentHistoryList`).
This introduces the `PlaywrightScriptGenerator` class which translates recorded agent actions (clicks, inputs, navigation, etc.) into a Python script using Playwright's async API.
Key features:
- Uses XPath selectors derived from the agent's interaction history.
- Includes a robust helper function (`_try_locate_and_act`) with XPath prefix trimming for improved resilience on dynamic pages.
- Handles sensitive data placeholders by mapping them to environment variables in the generated script.
- Supports configuring the browser launch and context based on the original agent's `BrowserConfig` and `BrowserContextConfig`.
- Activated by setting the `save_playwright_script_path` option in `AgentSettings`.
Includes modifications to `Agent` service to trigger generation and `AgentHistoryList` view to add the saving method. Also adds a new example (`examples/features/playwright_script_generation.py`).
This feature enables reliable replay of agent runs, automated testing, and scripting of repetitive tasks discovered by the agent.