3cd0524: Enhanced Docker Environment and Browser Automation
Overview
This release focuses on significantly improving the Docker environment for the browser agent and enhancing its automation capabilities, particularly when running within a container. The primary goal was to establish a more robust and compatible base image for Docker deployments and to enable reliable headless browser execution in this environment. This is crucial for automated testing, scraping, and other tasks that require browser interaction without a graphical interface. Users can expect improved stability when running the agent in Docker and the ability to leverage headless browser features seamlessly within containerized workflows.
Release Details
- Release Date: 2025-05-10 18:28:56 UTC
- Commit: 3cd0524
- Author: Iván Luna
- Branch(es): main
Changes
This release introduces key improvements to the Docker build process and the browser execution logic, alongside the addition of new testing infrastructure.
Improvements
- Enhanced Docker Base Image: The Dockerfile has been updated to use the standard Node.js LTS image instead of the Alpine variant. This change provides better compatibility with various dependencies and system libraries required by browser automation tools like Playwright, reducing potential runtime issues.
- Integrated Browser Dependencies: The Dockerfile now includes the necessary system dependencies and installs the default Playwright browsers (Chromium, Firefox, WebKit) directly within the image. This ensures that the browser agent is self-contained and ready to execute browser tasks immediately upon container startup, eliminating the need for manual browser installation steps post-deployment.
- Headless Execution in Docker: The browser initialization logic in
src/executor.tshas been modified to automatically run browsers in headless mode when detected within a Docker environment. This is the standard and most efficient way to run browser automation in containers, as it does not require a graphical display server, making it suitable for server-side or CI/CD workflows.
Modified Files
-
Dockerfile(modified)- Changes: 61 total
- Added: 41 lines
- Removed: 20 lines
-
SECURITY.md(modified)- Changes: 4 total
- Added: 2 lines
- Removed: 2 lines
-
docker-compose.yml(added)- Changes: 13 total
- Added: 13 lines
- Removed: 0 lines
-
package.json(modified)- Changes: 2 total
- Added: 1 lines
- Removed: 1 lines
-
smithery.yaml(modified)- Changes: 14 total
- Added: 9 lines
- Removed: 5 lines
-
src/executor.ts(modified)- Changes: 7 total
- Added: 5 lines
- Removed: 2 lines
-
src/tests/basic.test.ts(added)- Changes: 40 total
- Added: 40 lines
- Removed: 0 lines
-
src/tests/browser-error.test.ts(added)- Changes: 52 total
- Added: 52 lines
- Removed: 0 lines
-
src/tests/docker-test.js(added)- Changes: 32 total
- Added: 32 lines
- Removed: 0 lines
-
tsconfig.json(modified)- Changes: 3 total
- Added: 2 lines
- Removed: 1 lines
Testing
Automated tests have been implemented and executed to validate the core functionality, browser error handling, and specifically the correct operation of the browser agent within the new Docker environment. The new test suites (basic.test.ts, browser-error.test.ts, docker-test.js) provide coverage for these critical areas.
Instructions for Update
To update to this version and utilize the enhanced Docker environment, users should:
- Pull the latest code from the
mainbranch. - If using Docker, rebuild the Docker image using the updated
Dockerfileor use the provideddocker-compose.ymlfile to build and run the service.docker-compose build docker-compose up
- Ensure any local dependencies are updated by running
npm installif not using Docker.
Additional Notes
- The change in the base Node.js image and the inclusion of browser dependencies will result in a larger Docker image size compared to previous versions using Alpine.
- The browser agent will now default to running browsers in headless mode when executed inside a Docker container. If non-headless execution is required in a container (which is generally not recommended), specific configuration might be necessary.
Full Changelog: 0.7.0...0.8.0