Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .adl-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ skills/wait_for_condition.go
skills/write_to_csv.go
internal/playwright/playwright.go

go.mod
.gitattributes

# Add your own files to ignore here:
Expand Down
42 changes: 5 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,12 @@ A production-ready [Agent-to-Agent (A2A)](https://github.com/inference-gateway/a
## Quick Start

```bash
# Run the agent locally
# Run the agent
go run .

# Or with Docker (Chromium only - smallest image)
# Or with Docker
docker build -t browser-agent .
docker run -p 8080:8080 browser-agent

# Build with specific browser engine
docker build --build-arg BROWSER_ENGINE=firefox -t browser-agent:firefox .

# Run with Xvfb enabled (for extensions or specific rendering features)
docker run -p 8080:8080 -e BROWSER_XVFB_ENABLED=true browser-agent
```

## Features
Expand Down Expand Up @@ -76,6 +70,7 @@ The following custom configuration variables are available:
| **Browser** | `BROWSER_HEADER_DNT` | Header_dnt configuration | `1` |
| **Browser** | `BROWSER_HEADER_UPGRADE_INSECURE_REQUESTS` | Header_upgrade_insecure_requests configuration | `1` |
| **Browser** | `BROWSER_HEADLESS` | Headless configuration | `true` |
| **Browser** | `BROWSER_SESSION_TIMEOUT` | Session_timeout configuration | `2m` |
| **Browser** | `BROWSER_STEALTH_MODE` | Stealth_mode configuration | `false` |
| **Browser** | `BROWSER_USER_AGENT` | User_agent configuration | `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36` |
| **Browser** | `BROWSER_VIEWPORT_HEIGHT` | Viewport_height configuration | `1080` |
Expand Down Expand Up @@ -169,10 +164,10 @@ docker run --rm -it --network host ghcr.io/inference-gateway/a2a-debugger:latest

### Docker

The Docker image can be built with custom version information and browser selection using build arguments:
The Docker image can be built with custom version information using build arguments:

```bash
# Build with default values from ADL (Chromium only)
# Build with default values from ADL
docker build -t browser-agent .

# Build with custom version information
Expand All @@ -181,42 +176,15 @@ docker build \
--build-arg AGENT_NAME="My Custom Agent" \
--build-arg AGENT_DESCRIPTION="Custom agent description" \
-t browser-agent:1.2.3 .

# Build with specific browser engine
docker build --build-arg BROWSER_ENGINE=firefox -t browser-agent:firefox .

# Build with all browsers (larger image)
docker build --build-arg BROWSER_ENGINE=all -t browser-agent:all .
```

**Available Build Arguments:**
- `VERSION` - Agent version (default: `0.4.1`)
- `AGENT_NAME` - Agent name (default: `browser-agent`)
- `AGENT_DESCRIPTION` - Agent description (default: `AI agent for browser automation and web testing using Playwright`)
- `BROWSER_ENGINE` - Browser to install (`chromium`, `firefox`, `webkit`, or `all`) (default: `chromium`)

These values are embedded into the binary at build time using linker flags, making them accessible at runtime without requiring environment variables.

#### Xvfb Configuration

By default, the browser runs in native headless mode. For cases requiring a virtual display (e.g., extensions, specific rendering features), you can enable Xvfb:

```bash
# Run with Xvfb enabled
docker run -p 8080:8080 \
-e BROWSER_XVFB_ENABLED=true \
browser-agent

# Customize Xvfb display settings
docker run -p 8080:8080 \
-e BROWSER_XVFB_ENABLED=true \
-e BROWSER_XVFB_DISPLAY=:99 \
-e BROWSER_XVFB_SCREEN_RESOLUTION=1920x1080x24 \
browser-agent
```

**Security Note:** Xvfb is configured without the `-ac` flag (access control disabled) for security. The X server uses `-nolisten tcp` to prevent network access.

## License

MIT License - see LICENSE file for details
1 change: 1 addition & 0 deletions agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
headless: true
engine: "chromium"
stealth_mode: false
session_timeout: "2m"
user_agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
viewport_width: 1920
viewport_height: 1080
Expand Down
1 change: 1 addition & 0 deletions config/config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions example/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Inference Gateway
ENVIRONMENT=development
DEEPSEEK_API_KEY=
GOOGLE_API_KEY=

Expand Down
2 changes: 1 addition & 1 deletion example/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ services:
environment:
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
GOOGLE_API_KEY: ${GOOGLE_API_KEY}
ENVIRONMENT: development
ENVIRONMENT: ${ENVIRONMENT:-production}
SERVER_READ_TIMEOUT: 530s
SERVER_WRITE_TIMEOUT: 530s
CLIENT_TIMEOUT: 530s
Expand Down
6 changes: 6 additions & 0 deletions go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions internal/playwright/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All tests use mocks for fast execution (~0.18s). No browser downloads required.
go test -v ./internal/playwright

# Generate mocks (after interface changes)
# Note: counterfeiter is declared as a tool in go.mod
go run github.com/maxbrunsfeld/counterfeiter/v6 -o internal/playwright/mocks/browser_automation.go internal/playwright BrowserAutomation
```

Expand Down
Loading